/* PX Data operations overview. Platform X brand tokens first; see
   docs/UI_DESIGN.md. */
@font-face {
  font-family: "Roboto";
  src: url("assets/fonts/Roboto-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("assets/fonts/Roboto-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("assets/fonts/Roboto-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
:root {
  /* platform X design system (Material UI tokens; docs/UI_DESIGN.md). */
  --primary-main: #0068a5; --primary-dark: #004e82; --primary-light: #2e96ff;
  --secondary-main: #607d8b; --secondary-dark: #455a64; --secondary-light: #b0bec5;
  --error-main: #d32f2f; --error-dark: #c62828; --error-light: #ef5350;
  --warning-main: #ef6c00; --warning-dark: #e65100; --warning-light: #ff9800;
  --info-main: #0288d1; --info-dark: #01579b; --info-light: #03a9f4;
  --success-main: #2e7d32; --success-dark: #1b5e20; --success-light: #4caf50;
  --text-primary: rgb(0 0 0 / 87%); --text-secondary: rgb(0 0 0 / 60%); --text-disabled: rgb(0 0 0 / 38%);
  --text-inverted: #ffffff;
  --action-active: rgb(0 0 0 / 56%); --action-hover: rgb(0 0 0 / 4%); --action-selected: rgb(0 0 0 / 8%);
  --action-disabled: rgb(0 0 0 / 26%); --action-disabled-bg: rgb(0 0 0 / 12%);
  --divider: rgb(0 0 0 / 12%); --outlined-border: rgb(0 0 0 / 23%);
  --bg-paper: #ffffff; --bg-default: #fafafa; --bg-page: #f0f3f5; --grey-100: #f5f5f5;
  /* Standard alerts: tinted background, dark text of the role. */
  --alert-info-bg: #e5f6fd; --alert-info-text: #014361;
  --alert-success-bg: #edf7ed; --alert-success-text: #1e4620;
  --alert-warning-bg: #fff4e5; --alert-warning-text: #663c00;
  --alert-error-bg: #fdeded; --alert-error-text: #5f2120;
  --snackbar-bg: #323232;
  /* Material elevation ramp. */
  --el-1: 0 2px 1px -1px rgb(0 0 0 / 20%), 0 1px 1px rgb(0 0 0 / 14%), 0 1px 3px rgb(0 0 0 / 12%);
  --el-2: 0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px rgb(0 0 0 / 14%), 0 1px 5px rgb(0 0 0 / 12%);
  --el-4: 0 2px 4px -1px rgb(0 0 0 / 20%), 0 4px 5px rgb(0 0 0 / 14%), 0 1px 10px rgb(0 0 0 / 12%);
  --el-6: 0 3px 5px -1px rgb(0 0 0 / 20%), 0 6px 10px rgb(0 0 0 / 14%), 0 1px 18px rgb(0 0 0 / 12%);
  --el-8: 0 5px 5px -3px rgb(0 0 0 / 20%), 0 8px 10px 1px rgb(0 0 0 / 14%), 0 3px 14px 2px rgb(0 0 0 / 12%);
  --el-24: 0 11px 15px -7px rgb(0 0 0 / 20%), 0 24px 38px 3px rgb(0 0 0 / 14%), 0 9px 46px 8px rgb(0 0 0 / 12%);
  --font-text: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --font-logo: var(--font-text);

  /* Roles the rules below use. */
  --success: var(--success-main); --info: var(--info-main); --error: var(--error-main); --warning: var(--warning-main);
  --bg: var(--bg-page); --panel: var(--bg-paper); --panel-2: var(--grey-100);
  --text: var(--text-primary); --muted: var(--text-secondary); --faint: var(--text-disabled);
  --line: var(--divider);
  --accent: var(--primary-main); --accent-hover: var(--primary-dark);
  --accent-soft: rgb(0 104 165 / 8%); --accent-hover-bg: rgb(0 104 165 / 4%);
  --accent-border: rgb(0 104 165 / 50%);
  --figure: var(--primary-dark); /* key figures (metric cards) */
  /* Status dots use the light tint of the role, status text its main colour. */
  --ok: var(--success-main); --ok-indicator: var(--success-light);
  --warn: var(--warning-main); --warn-indicator: var(--warning-light);
  --bad: var(--error-main); --bad-indicator: var(--error-light);
  --idle: var(--secondary-main); --idle-bg: var(--action-selected);
  --radius: 4px; --shadow: var(--el-1);
  /* Deviation from the design system (owner 2026-11-25): its table rows are
     52 px high (16 px above and below the text); the operations lists keep
     MUI's small-table height. To follow the design exactly, set this to
     16px; nothing else depends on it (docs/UI_DESIGN.md, "Deviations"). */
  --table-cell-pad-y: 8px;
  --drawer-width: 280px;
}
/* Darstellung (owner 2026-11-12): the system's light or dark mode unless
   the profile menu chose Hell or Dunkel (data-theme on <html>). The design
   system ships no dark theme: the dark values are derived from the same
   roles, keep the brand header and redefine only the base tokens. */
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg-page: #121519; --bg-paper: #1c2127; --grey-100: #252b33; --bg-default: #181d22;
  --text-primary: rgb(255 255 255 / 87%); --text-secondary: rgb(255 255 255 / 60%); --text-disabled: rgb(255 255 255 / 38%);
  --action-active: rgb(255 255 255 / 56%); --action-hover: rgb(255 255 255 / 8%); --action-selected: rgb(255 255 255 / 16%);
  --action-disabled: rgb(255 255 255 / 30%); --action-disabled-bg: rgb(255 255 255 / 12%);
  --divider: rgb(255 255 255 / 12%); --outlined-border: rgb(255 255 255 / 23%);
  --accent: #3a8bd0; --accent-hover: #5aa2dd; --accent-soft: rgb(74 163 223 / 16%);
  --accent-hover-bg: rgb(74 163 223 / 8%); --accent-border: rgb(74 163 223 / 50%); --figure: #6cb6e8;
  --ok: #66bb6a; --warn: #ffa726; --bad: #ef6b6b; --idle: #90a4ae;
  --alert-info-bg: #071318; --alert-info-text: #b8e7fb;
  --alert-success-bg: #0c130d; --alert-success-text: #cce8cd;
  --alert-warning-bg: #191207; --alert-warning-text: #ffe2b7;
  --alert-error-bg: #160b0b; --alert-error-text: #f4c7c7;
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg-page: #121519; --bg-paper: #1c2127; --grey-100: #252b33; --bg-default: #181d22;
  --text-primary: rgb(255 255 255 / 87%); --text-secondary: rgb(255 255 255 / 60%); --text-disabled: rgb(255 255 255 / 38%);
  --action-active: rgb(255 255 255 / 56%); --action-hover: rgb(255 255 255 / 8%); --action-selected: rgb(255 255 255 / 16%);
  --action-disabled: rgb(255 255 255 / 30%); --action-disabled-bg: rgb(255 255 255 / 12%);
  --divider: rgb(255 255 255 / 12%); --outlined-border: rgb(255 255 255 / 23%);
  --accent: #3a8bd0; --accent-hover: #5aa2dd; --accent-soft: rgb(74 163 223 / 16%);
  --accent-hover-bg: rgb(74 163 223 / 8%); --accent-border: rgb(74 163 223 / 50%); --figure: #6cb6e8;
  --ok: #66bb6a; --warn: #ffa726; --bad: #ef6b6b; --idle: #90a4ae;
  --alert-info-bg: #071318; --alert-info-text: #b8e7fb;
  --alert-success-bg: #0c130d; --alert-success-text: #cce8cd;
  --alert-warning-bg: #191207; --alert-warning-text: #ffe2b7;
  --alert-error-bg: #160b0b; --alert-error-text: #f4c7c7;
  color-scheme: dark;
}
[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: 400 14px/1.43 var(--font-text);
  letter-spacing: 0.01071em;
  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(--panel) 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;
  min-height: 64px; padding: 8px 24px; background: var(--primary-main); color: var(--text-inverted);
  box-shadow: var(--el-4); position: relative; z-index: 1;
}
.title { display: flex; align-items: center; gap: 10px; }
.brand-logo { display: block; width: 116px; height: auto; }
/* h6: app bar title and card titles. subtitle2: titles inside a card. */
h1, h2 { font-size: 20px; font-weight: 500; line-height: 1.6; letter-spacing: 0.15px; margin: 0; }
h3, h4 { font-size: 14px; font-weight: 500; line-height: 1.57; letter-spacing: 0.1px; }
.meta { display: flex; align-items: center; gap: 10px; color: rgb(255 255 255 / 80%); font-size: 13px; }
.tag { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text-inverted); background: rgb(255 255 255 / 18%); border-radius: 999px; padding: 4px 10px; }
header button, header button.quiet { color: var(--text-inverted); border-color: rgb(255 255 255 / 50%); background: transparent; box-shadow: none; }
header button:hover, header button.quiet:hover { color: var(--text-inverted); background: rgb(255 255 255 / 8%); border-color: var(--text-inverted); box-shadow: none; }
/* Drawer (the design system's app shell): 280 px on the left below the app
   bar; every area is a group, its pages are the items. */
.tabs { position: fixed; top: var(--chrome-height, 64px); left: 0; bottom: 0; width: var(--drawer-width); z-index: 19;
  display: flex; flex-direction: column; padding: 8px 0; background: var(--panel);
  border-right: 1px solid var(--line); overflow-y: auto; }
.drawer-label { padding: 12px 16px 4px; font-size: 12px; font-weight: 500; color: var(--muted);
  letter-spacing: 0.04em; text-transform: uppercase; }
.drawer-item { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 16px; color: var(--text);
  text-decoration: none; font-size: 14px; border-left: 3px solid transparent; white-space: nowrap; }
.drawer-item:hover { background: var(--action-hover); }
.drawer-item.active { color: var(--accent); background: var(--accent-soft); border-left-color: var(--accent); }
.drawer-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Put away with the app bar's menu button (our addition, docs/UI_DESIGN.md):
   the page takes the whole width. */
body.drawer-closed .tabs { display: none; }
body.drawer-closed:has(#tabs:not([hidden])) main.tab { margin-left: 0; }
header .icon-button, header .icon-button:hover { color: var(--text-inverted); border-color: transparent; }
header .icon-button:hover { background: rgb(255 255 255 / 8%); }
#drawer-toggle { margin-left: -8px; }
/* The page beside the drawer; without one (welcome, reader view) centred as before. */
body:has(#tabs:not([hidden])) main.tab { margin-left: var(--drawer-width); max-width: none; }
/* A narrow screen has no room for a drawer: the items become one row that
   scrolls sideways, the group names are left out. */
@media (max-width: 900px) {
  .tabs { position: static; width: auto; flex-direction: row; align-items: center; padding: 0 8px;
    border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
  .areas, .drawer-group { display: flex; }
  .drawer-group + .drawer-group { border-left: 1px solid var(--line); }
  .drawer-label { display: none; }
  .drawer-item { height: 48px; border-left: 0; border-bottom: 2px solid transparent; }
  .drawer-item.active { background: none; border-bottom-color: var(--accent); }
  body:has(#tabs:not([hidden])) main.tab { margin-left: 0; }
  /* The row of items is always there. */
  #drawer-toggle { display: none; }
  body.drawer-closed .tabs { display: flex; }
}

/* --- 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-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 24px; 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(--panel); }
  #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 --------------------------------------------------------------- */
/* Contained button (medium): the primary action. */
button {
  font: inherit; font-size: 14px; font-weight: 500; letter-spacing: 0.4px; text-transform: uppercase;
  line-height: 1.2; min-height: 36px; padding: 0 16px; border-radius: 4px; cursor: pointer;
  border: 1px solid transparent; background: var(--accent); color: #fff; box-shadow: var(--el-2);
  transition: box-shadow .15s, background-color .15s;
}
button:hover { background: var(--accent-hover); box-shadow: var(--el-4); }
button:disabled { background: var(--action-disabled-bg); color: var(--text-disabled); border-color: transparent;
  box-shadow: none; cursor: not-allowed; }
/* Outlined button: every secondary action. */
button.quiet { background: transparent; color: var(--accent); border-color: var(--accent-border); box-shadow: none; }
button.quiet:hover { background: var(--accent-hover-bg); border-color: var(--accent); box-shadow: none; }
button.quiet:disabled { background: transparent; color: var(--action-disabled); border-color: var(--action-disabled-bg); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; }
/* Outlined text field (small, 40 px). */
input, select, textarea {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--outlined-border);
  border-radius: 4px; padding: 8px 14px; min-width: 0;
}
input:not([type=checkbox], [type=radio], [type=range]), select { min-height: 40px; }
input:hover, select:hover, textarea:hover { border-color: var(--text); }
input:not([type=checkbox], [type=radio], [type=range]):focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
/* Controls that are buttons in the markup but not in the design system:
   links, list items, tiles, chips. No button typography or elevation. */
.tile, .chip, .chip-toggle, .dataset-link, .count-link, .picker-item, .tree-toggle,
.action-menu-panel button, .segmented button {
  text-transform: none; letter-spacing: inherit; box-shadow: none; min-height: 0; }
.tile:hover, .chip:hover, .chip-toggle:hover, .dataset-link:hover, .count-link:hover, .picker-item:hover,
.tree-toggle:hover, .action-menu-panel button:hover, .segmented button:hover {
  box-shadow: none; }
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: var(--radius); }
.choices label.check { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: normal; }
/* Form inputs are full width; a checkbox stays its own size next to its label. */
.choices label.check input[type=checkbox] { width: auto; flex: 0 0 auto; margin: 0; }
.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: var(--radius);
  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 { background: var(--action-hover); }
.segmented button.active { color: var(--accent); background: var(--accent-soft); }
.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; min-height: 36px; }
/* An address is not a label: no capitals. */
#profile-button { text-transform: none; letter-spacing: inherit; }

/* --- summary chips ---------------------------------------------------------- */
.summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 24px; }
.summary .count { color: var(--muted); margin-right: 6px; }
/* Six cards in one row beside the open drawer on a 1440 px window. */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.metric-card { display: grid; gap: 6px; padding: 16px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--panel); }
.metric-card .label, .metric-card .hint { color: var(--muted); font-size: 12px; }
.metric-card strong { color: var(--figure); font-size: 24px; font-weight: 500; line-height: 1.334; }
/* Chip (medium, 32 px): filled when idle, primary when chosen. */
.chip { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 16px; height: 32px;
  padding: 0 12px; cursor: pointer; background: var(--action-selected); color: var(--text); font-size: 13px; font-weight: 400; }
.chip:hover { background: var(--action-disabled-bg); }
.chip b { font-weight: 500; }
.chip.active, .chip.active:hover { background: var(--accent); color: #fff; }
.access-filters { margin-bottom: 10px; }
.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 -24px; padding: 0 24px; }
/* Table: the design system's cell gutter (16 px) and type (14 px, head 500).
   The row height is --table-cell-pad-y (a documented deviation, see :root). */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: var(--table-cell-pad-y) 16px; color: var(--text); font-weight: 500; font-size: 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: var(--table-cell-pad-y) 16px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
td.num, th.num { font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--action-hover); }
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: 500; 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 16px 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: 500; }
.s-RECONCILE, .s-LAGGING { color: var(--warn); }
.s-PAUSED, .s-NOT_SCHEDULED { color: var(--muted); }
/* Small chips inside text and table rows. */
.pill { display: inline-block; font-size: 12px; font-weight: 400; line-height: 20px; color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 0 8px; margin-left: 6px; }
.window { display: inline-block; background: var(--idle-bg); border-radius: var(--radius); padding: 1px 7px; margin: 1px 4px 1px 0; font-size: 12px; }
.window.learned { background: transparent; border: 1px dashed var(--line); }
.outages summary { cursor: pointer; }
.outages ul { margin: 6px 0 0; padding-left: 18px; 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: 13px; min-height: 30px; padding: 0 10px; } /* small button */
td.row-actions { width: 1%; text-align: right; padding-left: 8px; padding-right: 8px; }
.connection-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
td.row-actions .actions { justify-content: flex-end; flex-wrap: 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(--action-active); border: 0; border-radius: 50%; cursor: pointer;
  list-style: none; background: transparent; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu > summary:hover, .action-menu[open] > summary { background: var(--action-hover); }
.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: 8px 0; background: var(--panel);
  border-radius: var(--radius); box-shadow: var(--el-8); }
.action-menu-panel button, td .action-menu-panel button { width: 100%; padding: 6px 16px; border: 0; border-radius: 0;
  background: transparent; color: var(--text); text-align: left; font-size: 14px; font-weight: 400; min-height: 36px; }
.action-menu-panel button:hover { background: var(--action-hover); }

/* --- dialog, toast, forms ----------------------------------------------------- */
dialog { border: 0; border-radius: var(--radius); background: var(--panel); color: var(--text);
  width: min(480px, calc(100vw - 32px)); padding: 16px 24px; box-shadow: var(--el-24); }
dialog::backdrop { background: rgb(0 0 0 / 50%); }
dialog:not(.overlay) label, .narrow label { display: block; margin: 12px 0 4px; color: var(--muted); font-size: 13px; }
dialog:not(.overlay) textarea, dialog:not(.overlay) input, dialog:not(.overlay) select, .narrow input,
.narrow select { width: 100%; }
/* Standard alerts. */
.action-warning { padding: 6px 16px; color: var(--alert-warning-text); background: var(--alert-warning-bg);
  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; }
/* Fields that belong together, e.g. a row filter's rule and its values. */
.field-group { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 16px; margin: 10px 0 6px; padding: 6px 14px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.field-group legend { padding: 0 6px; font-size: 13px; font-weight: 500; }
@media (max-width: 680px) { .field-group { grid-template-columns: 1fr; } }
@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: var(--radius); }
.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; }
}
/* Snackbar; a failure as a filled error alert. */
.toast { position: fixed; right: 16px; bottom: 16px; max-width: min(420px, calc(100vw - 32px)); background: var(--snackbar-bg);
  color: #fff; border: 0; border-radius: 4px; padding: 14px 16px; box-shadow: var(--el-6); z-index: 3; }
.toast.bad { background: var(--error-main); }
/* Shown as a popover (top layer): reset the UA popover box. */
.toast:popover-open { inset: auto 16px 16px auto; margin: 0; color: #fff; }
.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; }
/* Collapsible home sections: the title toggles, the counts stay visible. */
.section-toggle { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.section-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.section-toggle .chev { display: inline-block; width: 1em; color: var(--muted); transition: transform .15s; }
.section-toggle[aria-expanded="false"] .chev { transform: rotate(-90deg); }
section.collapsed .collapse-body { display: none; }
section.collapsed .section-head { margin-bottom: 0; }
section:not(.collapsed) .collapsed-only { display: none; }
#activity tbody tr { cursor: pointer; }
.tile { text-align: left; background: var(--panel); color: var(--text); border: 0;
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 24px; display: grid; gap: 4px; }
.tile:hover { background: var(--panel); box-shadow: var(--el-4); }
.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: 34px; font-weight: 400; letter-spacing: 0.25px; line-height: 1.235; }
.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 .status { white-space: nowrap; flex: none; }
.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: 500; line-height: 20px; border-radius: 999px; padding: 2px 10px; 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: var(--radius);
  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: 500; }
.stack h3.resolved { color: var(--muted); }
.run-timings { margin: 6px 0 12px; }
.run-timings h3 { font-size: 13px; margin: 0 0 6px; font-weight: 500; }
.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: 500; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin: 12px 0 16px; }
/* Controls on one line even when a label wraps: labels of a row are equally
   tall (grid stretch), the control sits at the bottom. */
.form-grid label { display: flex; flex-direction: column; justify-content: space-between; 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; }
#contract-note { white-space: pre-line; }
/* One draft layout (TARGET_MODEL.md §4a): the Prepared part first, the upstream details below. */
.prepared-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 16px; margin: 12px 0; }
.prepared-summary div { min-width: 0; }
.prepared-summary dt { font-size: 12px; color: var(--muted); }
.prepared-summary dd { margin: 0; overflow-wrap: anywhere; }
details.upstream { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 8px; }
details.upstream > summary { cursor: pointer; font-weight: 500; }
#draft-columns input:not([type=checkbox]), #draft-columns select { width: 100%; min-width: 120px; }
.form-grid.wide { grid-column: 1 / -1; margin: 0; }
/* Outlined error button. */
button.danger { background: transparent; color: var(--bad); border-color: rgb(211 47 47 / 50%); box-shadow: none; }
button.danger:hover { background: rgb(211 47 47 / 4%); border-color: var(--bad); box-shadow: none; }
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-radius: var(--radius); padding: 20px 24px; 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; }
.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: 500; 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. */
/* No line breaks where they can be avoided (owner 2026-11-25): a column is
   at least as wide as its longest word, so names, addresses and ids never
   break inside; text breaks between words only when the table would not fit
   its card otherwise. Such a table has no column widths of its own: the
   content sizes them. The two big lists (#source-grid, #catalog) and the
   draft tables keep fixed columns, so filtering and refreshing never move them. */
.table-wrap > table { table-layout: auto; min-width: 760px; }
.table-wrap > table td { white-space: normal; overflow-wrap: normal; }
#draft-columns, #contract-fields, #drafts, #discovery-schemas, #discovery-objects { table-layout: fixed; }
#draft-columns td, #contract-fields td, #drafts td, #discovery-schemas td, #discovery-objects td { overflow-wrap: anywhere; }
.table-wrap > table td.row-actions { width: auto; }
/* A table that shares a row with others (Läufe): as wide as its card, never
   the page tables' 760 px, its columns as wide as their content. */
.grid .table-wrap > table { table-layout: auto; min-width: 0; }
.grid .table-wrap > table th, .grid .table-wrap > table td { white-space: nowrap; overflow-wrap: normal; }
.grid .table-wrap > table th:first-child, .grid .table-wrap > table td:first-child { white-space: normal; }
/* Two tables side by side inside one card (Maskierung): each keeps to its
   half, with a gutter between them. */
.grid > .table-wrap { margin: 0; padding: 0; }
section > .grid { gap: 16px 48px; }
td.row-actions .actions { flex-wrap: wrap; }
#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%; }
#drafts th:nth-child(1) { width: 32px; }
#drafts th:nth-child(2) { width: 30%; } #drafts th:nth-child(3) { width: 12%; }
#drafts th:nth-child(4) { width: 10%; } #drafts th:nth-child(5) { width: 20%; } #drafts th:nth-child(6) { width: 12%; }
#draft-columns th:nth-child(1) { width: 15%; } #draft-columns th:nth-child(2) { width: 8%; }
#draft-columns th:nth-child(3) { width: 7%; } #draft-columns th:nth-child(4) { width: 6%; }
#draft-columns th:nth-child(5) { width: 27%; } #draft-columns th:nth-child(6) { width: 9%; }
#draft-columns th:nth-child(7) { width: 14%; }
#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: 40 px circle. */
.icon-button { min-width: 40px; width: 40px; height: 40px; padding: 8px; border-radius: 50%;
  color: var(--action-active); background: transparent; border-color: transparent; box-shadow: none; }
.icon-button:hover { background: var(--action-hover); box-shadow: none; }
.icon-button svg { display: block; width: 20px; height: 20px; fill: currentColor; }
.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; }
/* The datasets' bulk bar: one line, always there, so ticking a box never
   moves the list (owner, 2026-11-10); more buttons than fit scroll sideways. */
#tree-bulk.bulk-bar { flex: 1 1 0; min-width: 0; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; height: 40px;
  margin: 0; scrollbar-width: thin; }
#tree-bulk.bulk-bar > * { flex: 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; }
dialog.bulk .bulk-field > span { display: block; margin: 12px 0 4px; color: var(--muted); font-size: 13px; }
/* Export and import side by side on wide screens (the import preview needs
   the room), stacked below 1100 px. */
.transfer-grid { display: grid; grid-template-columns: minmax(320px, 2fr) minmax(480px, 3fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .transfer-grid { grid-template-columns: 1fr; } }
.transfer-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.transfer-card h3 { margin-top: 0; }
.transfer-card h4 { margin: 18px 0 4px; }
.transfer-card > label.check { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-weight: normal; }
.transfer-card textarea { width: 100%; }
.transfer-card .actions { margin: 10px 0; }
.pick-table { width: 100%; }
/* A pick table sits in a narrow card: not the page tables' fixed 760 px, which
   pushed its count column out of view (export, import preview). */
.table-wrap > table.pick-table { table-layout: auto; min-width: 0; }
.pick-table td, .pick-table th { padding-top: 4px; padding-bottom: 4px; }
.pick-table td.num, .pick-table th { white-space: nowrap; }
.pick-table td.num { width: 1%; text-align: right; }
.transfer-card .table-wrap { overflow-x: auto; max-width: 100%; }
.transfer-results:empty { display: none; }
@media (max-width: 520px) { .transfer-grid { grid-template-columns: 1fr; } }
.job-status { margin: 12px 0 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  border-left: 4px solid var(--accent); display: grid; gap: 6px; }
.job-status.finished { border-left-color: var(--ok-indicator); }
.job-status.failed { border-left-color: var(--bad-indicator); }
.job-status .job-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.job-status progress { width: 100%; height: 8px; accent-color: var(--accent); }
.job-lines { max-height: 45vh; overflow-y: auto; }
.glossary-pick { max-height: 40vh; overflow-y: auto; }
.picker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 36px; }
.picker-chips { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; color: var(--text); }
.picker-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.picker-panes h4 { margin: 0 0 6px; }
.picker-panes input[type=search] { width: 100%; margin-bottom: 6px; }
.picker-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--radius); min-height: 120px; }
.picker-list li { border-bottom: 1px solid var(--line); }
.picker-list li.muted { padding: 8px; border: 0; }
.picker-item { width: 100%; text-align: left; border: 0; background: transparent; color: var(--text);
  padding: 6px 8px; border-radius: 0; font-weight: normal; }
.picker-item:hover:not(:disabled) { background: var(--panel-2); }
.draft-columns-head { margin-top: 8px; }
.draft-columns-head input[type=search] { min-width: 280px; }
.column-help { margin: 4px 0 8px; font-size: 13px; }
.column-help dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0; }
.column-help dt { font-weight: 500; } .column-help dd { margin: 0; color: var(--muted); }
@media (max-width: 600px) { .picker-panes { grid-template-columns: 1fr; } }
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 8px 0 12px; counter-reset: step; flex-wrap: wrap; }
.steps li { counter-increment: step; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; }
.steps li::before { content: counter(step) ". "; }
.steps li.current { border-color: var(--accent); color: var(--accent); font-weight: 500; }
.steps li.done { color: var(--text); }
.steps li.done::before { content: "✓ "; }
.check-list { list-style: none; padding: 10px 12px; margin: 4px 0 12px; border: 1px solid var(--line);
  border-radius: var(--radius); display: grid; gap: 4px; }
.check-list li { display: flex; gap: 8px; align-items: baseline; }
.check-mark { width: 1em; font-weight: 700; text-align: center; }
.check-ok .check-mark { color: var(--ok-indicator); }
.check-warn .check-mark, .check-warn { color: var(--warn); }
.check-bad .check-mark, .check-bad { color: var(--bad); }
.transfer-card > label.check.everything { font-weight: 500; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover, th.sortable:focus-visible { color: var(--accent); }
th.sortable::after { content: " ↕"; opacity: 0.3; font-size: 0.85em; }
th.sortable[data-sorted="asc"]::after { content: " ▲"; opacity: 1; }
th.sortable[data-sorted="desc"]::after { content: " ▼"; opacity: 1; }
.openmetadata-note { margin: 8px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
/* Draft columns: the head stays while the list scrolls inside its frame;
   the column explanations are the heads' tooltips (marked with ⓘ). */
.draft-columns-wrap { max-height: 70vh; overflow: auto; }
.draft-columns-wrap thead th { position: sticky; top: 0; z-index: 2; background: var(--panel); box-shadow: inset 0 -1px 0 var(--line); }
#draft-columns th[title]::before, #contract-fields th[title]::before { content: "ⓘ "; color: var(--accent); font-size: 0.9em; }
/* Draft columns compact: one line per column where possible. */
#draft-columns td, #contract-fields td { padding-top: 4px; padding-bottom: 4px; vertical-align: middle; }
#draft-columns input:not([type=checkbox]), #draft-columns select,
#contract-fields input:not([type=checkbox]), #contract-fields select { padding: 4px 8px; min-height: 30px; font-size: 14px; }
#draft-columns .name-cell, #contract-fields .name-cell { gap: 2px; }
#draft-columns .name-line, #contract-fields .name-line { display: flex; align-items: center; gap: 6px; }
#draft-columns .name-line input, #contract-fields .name-line input { flex: 1; min-width: 140px; }
/* A name's hint stays on its line (long glossary lists pushed the table
   apart): cut with an ellipsis, the whole text on hover, a click opens it. */
#draft-columns .term-hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 0 1 auto; max-width: 50%; min-width: 0; cursor: help; }
#draft-columns .name-line input { flex: 1 1 50%; min-width: 120px; }
#draft-columns .term-hint.open { white-space: normal; overflow: visible; }
/* The name cell never grows past its column (an auto grid track took the
   hint's full width, 5000 px in Dev, and pushed the table apart). */
#draft-columns .name-cell { grid-template-columns: minmax(0, 1fr); min-width: 0; }
#draft-columns td { overflow-wrap: anywhere; }
#draft-columns .term-hint:empty { display: none; }
#draft-columns td > .pill { margin-left: 4px; }
.pill.proposed { background: transparent; box-shadow: inset 0 0 0 1px var(--accent); }
#d-key-reason.missing { border-color: var(--bad, #c0392b); box-shadow: 0 0 0 2px rgb(192 57 43 / 20%); }
.timing { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 4px 0 12px; align-items: start; }
.timing-row { display: flex; gap: 12px; flex-wrap: wrap; }
.chip-row { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 6px; }
.chip-toggle { height: 24px; padding: 0 10px; min-width: 2.6em; border-radius: 999px; border: 1px solid var(--outlined-border);
  background: transparent; color: var(--text); font-weight: normal; font-size: 12px; }
.chip-toggle.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.timing label.inline { flex-direction: row; align-items: center; gap: 6px; }
.timing-preview { grid-column: 1 / -1; }
/* A checkbox with a long label keeps its size (it was squeezed to a dot). */
.transfer-card label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: normal; margin: 8px 0; }
.transfer-card label.check input[type=checkbox] { flex: 0 0 auto; width: 16px; height: 16px; margin: 3px 0 0; }
/* "Name in Prepared": the source system's namespace in front of the editable table name. */
.prefixed { display: flex; align-items: stretch; }
.prefixed .prefix { display: flex; align-items: center; padding: 0 6px 0 14px; border: 1px solid var(--outlined-border);
  border-right: 0; border-radius: 4px 0 0 4px; color: var(--muted); background: var(--panel-2); font-size: 14px; }
.prefixed input { flex: 1; min-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.activation-banner { background: var(--alert-warning-bg); color: var(--alert-warning-text); padding: 6px 24px; font-size: 14px; }
/* Alarms and pauses: on top of the drawer. */
.operations-status { display: grid; gap: 8px; order: -1; margin: 8px 16px; flex: 0 0 auto; }
@media (max-width: 900px) { .operations-status { display: flex; order: 0; margin: 0 0 0 auto; padding-left: 12px; } }
.operations-status[hidden], .alarm-banner[hidden], .pause-status[hidden] { display: none; }
.tabs .alarm-banner, .tabs .pause-status { border-radius: 4px; padding: 6px 16px; min-height: 36px; text-align: left;
  font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: inherit; box-shadow: none; cursor: pointer; border: 1px solid; }
.tabs .alarm-banner, .tabs .alarm-banner:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.tabs .pause-status, .tabs .pause-status:hover { background: var(--alert-warning-bg); border-color: var(--warn); color: var(--alert-warning-text); }
.flow-links { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 13px; }

/* Contract fields use the same compact draft table as database columns. */
.contract-path { display: inline-block; }
.contract-path.depth-1 { padding-left: 16px; }
.contract-path.depth-2 { padding-left: 32px; }
.contract-type { display: grid; gap: 2px; min-width: 150px; }
.contract-type label { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; }
#contract-fields .name-cell input { width: 100%; }
#contract-fields .reason-cell { min-width: 170px; }

/* Processing record form (app.js openRecord). */
dialog.record fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0 0; padding: 4px 14px 12px; }
dialog.record legend { padding: 0 6px; font-weight: 500; }
dialog.record .record-field.wide { grid-column: 1 / -1; }
dialog.record .help { color: var(--muted); cursor: help; font-size: 12px; }
dialog.record .record-rows { display: grid; gap: 6px; }
dialog.record .record-row { display: grid; gap: 6px; align-items: center; }
dialog.record .record-row.ticket { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; }
dialog.record .record-row.link { grid-template-columns: 9em minmax(0, 1fr) minmax(0, 2fr) auto; }
dialog.record .record-row button.icon { width: auto; padding: 4px 10px; }
dialog.record .record-facts, dialog.record .record-history { margin-top: 10px; font-size: 13px; }
dialog.record .record-facts ul, dialog.record .record-history ul { margin: 6px 0 0; padding-left: 18px; }
dialog.record input:invalid:not(:placeholder-shown), dialog.record select:invalid { border-color: var(--bad, #c0392b); }
#processing-records .kind { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
@media (max-width: 680px) { dialog.record .record-row.link { grid-template-columns: 1fr; } }
#processing-records .clamp { max-width: 32em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#processing-records button.chevron { width: auto; padding: 2px 6px; }
#processing-records tr.record-details td { background: var(--panel-alt, transparent); border-top: 0; }
.record-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14em, 1fr)); gap: 10px 20px; padding: 4px 0 8px; }
.record-detail > span { display: block; font-size: 12px; margin-bottom: 2px; }

/* Subtabs of the sources tab: one view per kind (Datenbanken, API, ...). */
.subtabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 16px; }
.subtabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted);
  box-shadow: none; padding: 12px 16px; font-weight: 500; }
.subtabs button:hover { color: var(--accent); background: var(--accent-hover-bg); box-shadow: none; }
.subtabs button.active { color: var(--accent); border-bottom-color: var(--accent); background: none; }
.record-art30 { border-top: 1px solid var(--line); padding-top: 6px; font-size: 13px; }
.record-art30 p { margin: 4px 0; }

/* --- navigation by task (data_etl_config#70, prototype) ----------------------- */
.header-link { color: var(--text-inverted); text-decoration: none; padding: 4px 8px; }
.header-link:hover { text-decoration: underline; }
.profile { position: relative; }
.profile-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 260px;
  background: var(--panel); color: var(--text); border-radius: var(--radius);
  box-shadow: var(--el-8); padding: 16px; display: grid; gap: 8px; }
.profile-menu button { color: var(--text); border-color: var(--line); }
.profile-roles { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.profile-soon { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 2px;
  color: var(--muted); }
.profile-theme { border-top: 1px solid var(--line); padding-top: 8px; }
.profile-theme .chip-row { margin: 4px 0 0; }
.profile-menu .chip-toggle { background: transparent; color: var(--text); }
.profile-menu .chip-toggle.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Drafts: a word before each filter row (Art, Status). */
.filter-group { display: inline-flex; align-items: center; gap: 8px; margin: 4px 16px 4px 0; }
.filter-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

/* Übertragen: a source expands to its datasets (#81). */
.tree-toggle { background: none; border: 0; padding: 0 4px; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.tree-toggle:disabled { opacity: 0.3; cursor: default; }
tr.tree-child td { background: var(--panel-2); }

/* Quellen (owner 2026-11-25): the page scrolls, not the dataset list inside
   its card, so its title, filters and pager are never scrolled away. Only
   the systems above stay a short list of their own. */

/* Quellen (#70): a source's details, a dataset, a draft or a contract open
   in a large overlay over the lists (they stay behind it, greyed); it
   scrolls on its own. The sections inside look as on a page. */
dialog.overlay { width: min(1440px, calc(100vw - 48px)); max-width: none; height: calc(100dvh - 64px);
  max-height: none; padding: 0; overflow-y: auto; background: var(--bg); }
dialog.overlay::backdrop { background: rgb(10 14 20 / 35%); }
dialog.overlay > section { margin: 0; border: 0; border-radius: 0; box-shadow: none; min-height: 100%; }
dialog.overlay > section > .section-head:first-child { position: sticky; top: 0; z-index: 3;
  background: var(--panel); margin: -20px -24px 12px; padding: 16px 24px 12px; border-bottom: 1px solid var(--line); }
.grid-scroll { max-height: 340px; overflow-y: auto; }
/* The datasets: a page of 100 at its full height. */
.grid-scroll.grid-scroll-datasets { max-height: none; }
.grid-scroll thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
/* Fixed columns: a filter or a long name never moves them. */
#source-grid, #catalog { table-layout: fixed; width: 100%; }
/* Narrow screens (a phone): the columns keep their size, the list scrolls
   sideways instead of breaking names letter by letter. */
#source-grid { min-width: 900px; }
#catalog { min-width: 1040px; }
.grid-scroll { overflow-x: auto; }
#source-grid th:nth-child(2) { width: 162px; }
#source-grid th:nth-child(3) { width: 242px; }
#source-grid th:nth-child(4), #source-grid th:nth-child(5), #source-grid th:nth-child(6) { width: 86px; }
#source-grid th:nth-child(7) { width: 64px; }
#source-grid .repo-link { font-size: 12px; }
#catalog th:nth-child(1) { width: 52px; }
#catalog th:nth-child(2) { width: 140px; }
#catalog th:nth-child(4) { width: 112px; }
#catalog th:nth-child(5) { width: 170px; }
#catalog th:nth-child(6) { width: 70px; }
#catalog th:nth-child(7) { width: 124px; }
#catalog th:nth-child(8) { width: 156px; }
#catalog th:nth-child(9) { width: 64px; }
#catalog .direction { white-space: nowrap; font-size: 12px; }
.pill.requested .spinner, tr.action-note .spinner { width: 10px; height: 10px; margin-right: 6px;
  vertical-align: -1px; display: inline-block; }
#catalog .direction.d-out { color: var(--accent); font-weight: 500; }
.draft-load { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.draft-load h3, .draft-columns-title { margin: 0 0 8px; }
.draft-columns-title { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; }
.delivery-purpose { margin: 0 0 12px; }
.delivery-purpose label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.delivery-purpose textarea { width: 100%; }
.delivery-dataset { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.delivery-dataset h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; }
.delivery-columns input[data-f="reason"] { width: 100%; }
#delivery-add { margin-top: 12px; }
#source-grid td, #catalog td { overflow-wrap: anywhere; padding-top: 6px; padding-bottom: 6px; }
#catalog td.row-actions .action-menu summary { padding: 2px 6px; }
.drift-issues { margin: 8px 0 12px; padding: 6px 16px; border-radius: 4px; color: var(--alert-warning-text); background: var(--alert-warning-bg); font-size: 14px; }
.drift-issues p { margin: 0 0 6px; }
.drift-issues ul { margin: 0; padding-left: 18px; }
.drift-issues li { margin: 3px 0; }
.drift-issues a { color: var(--accent); }
.producer-hint { margin: 0 0 12px; padding: 6px 16px; color: var(--alert-info-text); background: var(--alert-info-bg);
  border-radius: 4px; font-size: 14px; }
.count-link { background: none; border: 0; padding: 0 2px; font: inherit; color: var(--accent); cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px; }
.count-link.open-count { font-weight: 500; }
.count-link.bad-text { color: var(--bad); }
.count-link:hover { color: var(--accent-hover); }
.count-link.active { color: #fff; background: var(--accent); border-radius: 999px; padding: 1px 8px;
  text-decoration: none; }
.count-link.active.bad-text { background: var(--bad); color: #fff; }
#source-grid tr.grid-row, #catalog tr.grid-row { cursor: pointer; }
#source-grid tr.expanded td, #catalog tr.expanded td { background: var(--accent-soft); }
#source-grid td.num, #source-grid th.num { white-space: nowrap; text-align: right; }
#source-grid td.open-count { font-weight: 500; }

#dataset-config { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
#dataset-config table { table-layout: auto; min-width: 720px; }
#dataset-config h3 .pill { margin-left: 8px; }
/* Who reads a dataset's table (data_etl_config#98). */
.access-view .section-head { align-items: center; }
.access-view h3 { margin: 0; }
.access-view h3 .pill { margin-left: 8px; }
.access-view table { table-layout: auto; min-width: 640px; }
.access-view code { font-size: 12px; }
.pill.warn { color: var(--alert-warning-text); background: var(--alert-warning-bg); }
.revision-history { margin: 4px 0 12px; }
.revision-history ul { margin: 6px 0 0; padding-left: 18px; }
#catalog .tree-name { overflow-wrap: anywhere; }
#catalog .pii[title] { cursor: help; }


#dataset-grid-source { margin-top: 4px; }
.count-pill { display: inline-block; margin: 1px 6px 1px 0; font-size: 12px; color: var(--muted); white-space: nowrap; }
.group-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.group-part { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.group-part > h3, .group-part .section-head h3 { margin: 0 0 4px; }
.dlq-note { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin: 4px 0 8px; background: var(--panel-2); }
.dlq-note h2 { font-size: 14px; margin: 0; }

/* Drafts: Art and Status as dropdowns with checkboxes. */
.filter-dropdowns { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
details.multi { position: relative; }
details.multi > summary { list-style: none; cursor: pointer; border: 1px solid var(--outlined-border); border-radius: 4px;
  min-height: 40px; padding: 8px 14px; font-size: 14px; background: var(--panel); white-space: nowrap; }
details.multi > summary::-webkit-details-marker { display: none; }
details.multi > summary::after { content: " \25BE"; color: var(--muted); }
details.multi.active > summary { border-color: var(--accent); color: var(--accent); }
details.multi > summary { display: flex; align-items: center; gap: 4px; box-sizing: border-box; max-width: 100%; }
.multi-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* The dataset list's filters: a row of their own, each of a fixed width. */
/* As high with a system's buttons as without: choosing one moves nothing. */
.grid-head { justify-content: flex-start; min-height: 40px; }
.grid-head h2 { margin: 0; }
.grid-filters { margin: 0 0 8px; flex-wrap: nowrap; }
@media (max-width: 900px) { .grid-filters { flex-wrap: wrap; } #tree-bulk.bulk-bar { flex-basis: 100%; } }
/* The filters in force (a tile or a count was clicked): chips with a cross. */
#connect-status { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 8px; }
#connect-status[hidden] { display: none; }
#connect-status button { height: 32px; min-height: 0; padding: 0 12px; border: 0; border-radius: 16px; box-shadow: none;
  background: var(--action-selected); color: var(--text); font-size: 13px; font-weight: 400;
  text-transform: none; letter-spacing: inherit; }
#connect-status button:hover { background: var(--action-disabled-bg); box-shadow: none; }
#tree-directions > summary { width: 13rem; }
#tree-stages > summary { width: 24rem; }
.multi-panel { position: absolute; z-index: 15; top: calc(100% + 4px); left: 0; min-width: 220px; background: var(--panel);
  border-radius: var(--radius); box-shadow: var(--el-8); padding: 8px 16px; display: grid; gap: 2px; }
.multi-panel label.check { display: flex; gap: 8px; align-items: center; margin: 4px 0; font-weight: normal; white-space: nowrap; }
.multi-panel button { justify-self: start; margin-top: 6px; font-size: 12px; padding: 3px 9px; }

/* Drafts: running source checks above the list (#89). */
.source-checks { display: grid; gap: 4px; margin: 4px 0 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.source-check { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }

/* A phone: the header wraps, the signed-in address shortens; nothing makes
   the page wider than the screen. */
@media (max-width: 680px) {
  header .meta { flex-wrap: wrap; row-gap: 8px; }
  #profile-button { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Vollexport in the draft: day chips, time, a warning inside the source's
   maintenance window. */
.full-choice { display: grid; gap: 6px; }
.full-choice .chip-row { display: flex; flex-wrap: wrap; gap: 4px; }

/* Nachtplan (Quellen, system details): ECharts sizes the canvas to the box. */
.night-plan { margin-top: 16px; }
.night-plan .filters { gap: 6px; margin: 6px 0; }
.night-chart { width: 100%; }

/* Vorschläge für die Datenbank: the SQL as the DBAs get it. */
.proposals pre.sql { margin: 0; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 560px; }

/* The dataset's Zeitplan tile: what runs when, and "Ändern" right there. */
.schedule-tile { display: grid; gap: 4px; justify-items: start; }
.schedule-tile button { margin-top: 4px; }
.run-timings .stage-row th { border-bottom: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.run-timings .stage-prepared { border-left: 1px solid var(--line); }
.run-timings td:last-child { border-left: 1px solid var(--line); min-width: 170px; }
