/* ============================================================================
   RIGS · eigenständige Ansichten für alle Halls
   Ruhige AIHall-v3-Office-Optik: hell, dicht, wie eine Akte im Fenster.
   Die Bausteine lesen ausschließlich --rig-* aus tokens.css. Workspace-Themes
   ändern daran nichts; nur die Daten und der Agentenname kommen aus der Hall.
   ============================================================================ */

/* Fenster tragen dieselbe helle Aktenoptik. */
.win[data-kind='rig'] {
  background: var(--rig-surface);
  border-color: var(--rig-line-2);
}
.win[data-kind='rig'] .win-head {
  background: var(--rig-surface-2);
  border-bottom: 1px solid var(--rig-line);
  color: var(--rig-ink);
}
.win[data-kind='rig']:not(.vorn) .win-head { background: var(--rig-surface-3); }
.win[data-kind='rig'] .win-title b { color: var(--rig-ink); font-weight: 600; }
.win[data-kind='rig'] .win-sub,
.win[data-kind='rig'] .win-state,
.win[data-kind='rig'] .win-tools button,
.win[data-kind='rig'] .win-ctrls button { color: var(--rig-muted); }
.win[data-kind='rig'] .win-ico {
  background: var(--rig-accent-soft);
  color: var(--rig-accent-2);
  border-radius: 6px;
}
.win[data-kind='rig'] .win-tools button:hover,
.win[data-kind='rig'] .win-ctrls button:hover {
  background: var(--rig-surface-3);
  color: var(--rig-ink);
}
.win[data-kind='rig'] .win-ctrls button.zu:hover { background: var(--rig-risk); color: var(--rig-on-accent); }
.win[data-kind='rig'] .win-state .dot { border-color: var(--rig-surface); }
.win[data-kind='rig'] .win-loading { background: var(--rig-surface); color: var(--rig-ink); }
.win-body.rig-body { background: var(--rig-surface); }

/* Dashboard: die Akte liegt als helles Fenster auf ruhigem, gepunktetem Papier.
   Der schwebende Agentenknopf würde den Aktenfuß verdecken; die Akte selbst
   hat dafür „Mit … besprechen“. */
body:has(.classic-rig-host) #agent-pill { display: none; }
.classic-native.classic-rig-host {
  background-color: var(--rig-bg);
  background-image: radial-gradient(var(--rig-dot) 1px, transparent 1.2px);
  background-size: 17px 17px;
  padding: clamp(10px, 2.6vh, 26px);
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: auto;
}
.classic-rig-host > .rig-customer {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1160px;
  max-height: 860px;
  min-height: 0;
  border: 1px solid var(--rig-line-2);
  border-radius: 12px;
  box-shadow: var(--rig-shadow);
  overflow: auto;
  background: var(--rig-surface);
}

/* ---------------------------------------------------------------------------- */
.rig-customer {
  --rig-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  container-type: inline-size;
  height: 100%;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--rig-surface);
  color: var(--rig-ink);
  font-family: var(--rig-font);
  font-size: 13px;
  line-height: 1.45;
}
.rig-customer *,
.rig-customer *::before,
.rig-customer *::after { box-sizing: border-box; }
.rig-customer button,
.rig-customer input { font: inherit; }
.rig-customer button { color: inherit; }
.rig-customer :focus-visible { outline: 2px solid var(--rig-accent); outline-offset: 2px; }
.rig-customer .ico { flex: none; }
.rig-customer,
.rig-table-wrap,
.rig-side { scrollbar-color: var(--rig-line-2) transparent; }
.rig-customer::-webkit-scrollbar,
.rig-table-wrap::-webkit-scrollbar,
.rig-side::-webkit-scrollbar { width: 8px; height: 8px; }
.rig-customer::-webkit-scrollbar-thumb,
.rig-table-wrap::-webkit-scrollbar-thumb,
.rig-side::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--rig-line-2);
  background-clip: padding-box;
}

/* Aktenkopf: nur im Dashboard sichtbar; im Studio übernimmt ihn der Fensterkopf. */
.rig-file-head {
  display: none;
  flex: none;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--rig-line);
  background: var(--rig-surface-2);
}
.classic-rig-host .rig-file-head { display: flex; }
.rig-file-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--rig-accent);
  color: var(--rig-on-accent);
}
.rig-file-title { min-width: 0; }
.rig-file-title h1 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.rig-file-title p { margin: 1px 0 0; color: var(--rig-muted); font-size: 11.5px; }
.rig-file-source {
  margin-left: auto;
  max-width: 42%;
  overflow: hidden;
  color: var(--rig-muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Werkzeugleiste: Filter und Suche, sonst nichts. */
.rig-toolbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--rig-line);
  background: var(--rig-surface);
}
.rig-filters {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.rig-chip {
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--rig-muted);
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}
.rig-chip small { color: inherit; font-size: 10.5px; opacity: 0.7; font-variant-numeric: tabular-nums; }
.rig-chip:hover { background: var(--rig-surface-3); color: var(--rig-ink); }
.rig-chip[aria-pressed='true'] {
  border-color: var(--rig-line-2);
  background: var(--rig-surface-3);
  color: var(--rig-ink);
  font-weight: 600;
}
.rig-chip[aria-pressed='true'] small { opacity: 0.65; }
.rig-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 240px;
  height: 32px;
  margin-left: auto;
  padding: 0 9px;
  border: 1px solid var(--rig-line-2);
  border-radius: 6px;
  background: var(--rig-surface);
  color: var(--rig-muted);
}
.rig-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--rig-ink);
  font-size: 12.5px;
}
.rig-search input::placeholder { color: var(--rig-muted); }
.rig-search:focus-within { border-color: var(--rig-accent); box-shadow: 0 0 0 3px var(--rig-accent-soft); }

/* Liste + Akte */
.rig-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(310px, 1fr);
}
.rig-index {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--rig-line);
  background: var(--rig-surface);
}
.rig-table-wrap { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; }
.rig-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12.5px;
}
.rig-table .col-name { width: 33%; }
.rig-table .col-place { width: 17%; }
.rig-table .col-kind { width: 14%; }
.rig-table .col-money { width: 15%; }
.rig-table .col-last { width: 21%; }
.rig-table thead { position: sticky; top: 0; z-index: 2; }
.rig-table th {
  padding: 7px 10px;
  border-bottom: 1px solid var(--rig-line-2);
  background: var(--rig-surface-2);
  color: var(--rig-ink-2);
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.rig-table th.num { text-align: right; }
.rig-table td {
  height: 32px;
  padding: 7px 10px;
  overflow: hidden;
  border-bottom: 1px solid var(--rig-line);
  color: var(--rig-ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rig-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rig-table tbody tr { cursor: pointer; }
.rig-table tbody tr:hover td { background: var(--rig-surface-2); }
.rig-table tbody tr.is-selected td { background: var(--rig-accent-soft); color: var(--rig-ink); }
.rig-table tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--rig-accent); }
.rig-table tbody tr:focus-visible { outline: 2px solid var(--rig-accent); outline-offset: -2px; }
.rig-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.rig-name b { overflow: hidden; color: var(--rig-ink); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.rig-status-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rig-muted);
}
.rig-status-dot.is-ok { background: var(--rig-ok); }
.rig-status-dot.is-warn { background: var(--rig-warn); }
.rig-status-dot.is-muted { background: var(--rig-line-2); }
.rig-table .rig-empty-row td {
  height: 140px;
  padding: 30px;
  color: var(--rig-muted);
  text-align: center;
}
.rig-empty-row td .ico { display: block; margin: 0 auto 5px; }
.rig-empty-row b { display: block; color: var(--rig-ink); font-weight: 600; }
.rig-empty-row span { display: block; font-size: 11.5px; }
.rig-count {
  flex: none;
  margin: 0;
  padding: 6px 10px;
  border-top: 1px solid var(--rig-line);
  background: var(--rig-surface);
  color: var(--rig-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* Kundenakte */
.rig-side {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px 18px;
  background: var(--rig-surface);
  scrollbar-width: thin;
}
.rig-detail-head { display: flex; align-items: center; gap: 11px; }
.rig-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--rig-accent-soft);
  color: var(--rig-accent-2);
  font-size: 14px;
  font-weight: 600;
}
.rig-detail-title { min-width: 0; }
.rig-detail-title h2 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--rig-ink);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.rig-detail-title p {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 7px;
  margin: 3px 0 0;
  color: var(--rig-muted);
  font-size: 11.5px;
}
.rig-detail-title p > span + span::before { content: '·'; margin-right: 7px; opacity: 0.7; }
.rig-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--rig-ink-2);
  font-size: 10.5px;
  font-weight: 500;
}
.rig-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--rig-muted); }
.rig-status.is-ok { color: var(--rig-ok); }
.rig-status.is-ok i { background: var(--rig-ok); }
.rig-status.is-warn { color: var(--rig-warn); }
.rig-status.is-warn i { background: var(--rig-warn); }
.rig-status.is-muted i { background: var(--rig-line-2); }
.rig-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.rig-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--rig-line-2);
  border-radius: 6px;
  background: var(--rig-surface);
  color: var(--rig-ink-2);
  font-size: 12.5px;
  text-decoration: none;
}
.rig-action:hover { background: var(--rig-surface-3); color: var(--rig-ink); text-decoration: none; }
.rig-action .ico { color: var(--rig-accent); }
.rig-tabs {
  display: flex;
  gap: 14px;
  margin: 7px 0 12px;
  border-bottom: 1px solid var(--rig-line-2);
}
.rig-tabs button {
  margin-bottom: -1px;
  padding: 6px 0 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--rig-muted);
  font-size: 12.5px;
  font-weight: 500;
}
.rig-tabs button:hover { color: var(--rig-ink); }
.rig-tabs button[aria-selected='true'] { border-bottom-color: var(--rig-accent); color: var(--rig-ink); }
.rig-tabs button span { margin-left: 3px; color: var(--rig-muted); font-size: 11px; }
.rig-overview { animation: rig-in 0.12s var(--rig-ease); }
@keyframes rig-in { from { opacity: 0; transform: translateY(2px); } }
.rig-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
  margin: 0;
}
.rig-fields > div { min-width: 0; padding: 2px 0; }
.rig-fields dt { color: var(--rig-muted); font-size: 11px; }
.rig-fields dd { margin: 1px 0 0; overflow-wrap: anywhere; color: var(--rig-ink); font-size: 12.5px; line-height: 1.4; }
.rig-side-title {
  margin: 13px 0 5px;
  color: var(--rig-muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.rig-note { margin-top: 11px; padding: 8px 10px; border-left: 2px solid var(--rig-accent); background: var(--rig-surface-2); }
.rig-note-label { display: block; margin-bottom: 2px; color: var(--rig-muted); font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.rig-note p { margin: 0; color: var(--rig-ink-2); font-size: 12px; line-height: 1.5; }
.rig-hint { margin: 10px 0 0; color: var(--rig-muted); font-size: 10.5px; line-height: 1.45; }
.rig-source { margin: 14px 0 0; padding-top: 8px; border-top: 1px solid var(--rig-line); color: var(--rig-muted); font-size: 10.5px; }
.rig-history { margin: 0; padding: 0; list-style: none; }
.rig-history li { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--rig-line); }
.rig-history time { color: var(--rig-muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.rig-history span { color: var(--rig-ink-2); font-size: 12px; line-height: 1.45; }
.rig-order-card { display: grid; gap: 1px; padding: 10px 11px; border: 1px solid var(--rig-line); border-radius: 8px; background: var(--rig-surface-2); }
.rig-order-card b { color: var(--rig-ink); font-size: 20px; font-weight: 600; line-height: 1; }
.rig-order-card span { color: var(--rig-ink-2); font-size: 12px; }
.rig-order-card small { color: var(--rig-muted); font-size: 10.5px; }
.rig-detail-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 100%; min-height: 160px; color: var(--rig-muted); text-align: center; }
.rig-detail-empty b { color: var(--rig-ink); font-weight: 600; }
.rig-detail-empty span { font-size: 11.5px; }

/* Assistenz: grüne Hinweiszeile und ruhiger Gesprächsblock. */
.rig-assist { flex: none; border-top: 1px solid var(--rig-accent-line); background: var(--rig-accent-soft); }
.rig-assist-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 9px;
  padding: 7px 12px;
}
.rig-agent-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--rig-accent);
  color: var(--rig-on-accent);
  font-size: 8px;
  font-weight: 600;
}
.rig-assist-note p { flex: 1 1 250px; min-width: 0; margin: 0; color: var(--rig-ink-2); font-size: 12px; line-height: 1.4; }
.rig-assist-note b { color: var(--rig-ink); font-weight: 600; }
.rig-assist-button {
  flex: none;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--rig-accent-line);
  border-radius: 6px;
  background: var(--rig-surface);
  color: var(--rig-accent-2);
  font-size: 12px;
  white-space: nowrap;
}
.rig-assist-button:hover { border-color: var(--rig-accent); background: var(--rig-surface); }
.rig-discuss {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 14px 11px;
  border-top: 1px solid var(--rig-line);
  background: var(--rig-surface);
}
.rig-discuss-head { display: flex; align-items: center; gap: 7px; color: var(--rig-ink); font-size: 12px; }
.rig-discuss-head b { font-weight: 600; }
.rig-tag { padding: 1px 5px; border-radius: 4px; background: var(--rig-surface-3); color: var(--rig-muted); font-size: 10px; font-weight: 500; }
.rig-greeting { margin: 0; color: var(--rig-ink-2); font-size: 12.5px; line-height: 1.45; }
.rig-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--rig-line);
  border-radius: 8px;
  background: var(--rig-line);
}
.rig-stat { display: grid; gap: 1px; padding: 6px 9px; background: var(--rig-surface-2); }
.rig-stat.is-good { background: var(--rig-ok-soft); }
.rig-stat.is-warn { background: var(--rig-warn-soft); }
.rig-stat b { color: var(--rig-ink); font-size: 15px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.rig-stat span { color: var(--rig-muted); font-size: 10.5px; }
.rig-thread {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 150px;
  padding: 1px 2px 1px 0;
  overflow-y: auto;
  scrollbar-color: var(--rig-line-2) transparent;
}
.rig-thread[hidden] { display: none; }
.rig-turn { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; }
.rig-turn.is-user { justify-content: flex-end; }
.rig-bubble {
  max-width: 92%;
  padding: 5px 8px;
  border: 1px solid var(--rig-line);
  border-radius: 8px;
  background: var(--rig-surface-2);
  color: var(--rig-ink-2);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.rig-turn.is-user .rig-bubble { border-color: var(--rig-accent-line); background: var(--rig-accent-soft); color: var(--rig-ink); }
.rig-turn.is-step { color: var(--rig-muted); font-size: 11px; }
.rig-step-mark { flex: none; width: 5px; height: 5px; margin-top: 5px; border-radius: 50%; background: var(--rig-accent); }
.rig-ask button:disabled { opacity: 0.55; cursor: default; }
.rig-questions { display: flex; flex-wrap: wrap; gap: 5px; }
.rig-questions button {
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--rig-line-2);
  border-radius: 999px;
  background: var(--rig-surface);
  color: var(--rig-ink-2);
  font-size: 11.5px;
  white-space: nowrap;
}
.rig-questions button:hover { border-color: var(--rig-accent-line); background: var(--rig-accent-soft); }
.rig-ask {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 2px 2px 9px;
  border: 1px solid var(--rig-line-2);
  border-radius: 7px;
  background: var(--rig-surface);
}
.rig-ask:focus-within { border-color: var(--rig-accent); box-shadow: 0 0 0 3px var(--rig-accent-soft); }
.rig-ask input {
  flex: 1;
  min-width: 0;
  height: 28px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--rig-ink);
  font-size: 12px;
}
.rig-ask input::placeholder { color: var(--rig-muted); }
.rig-ask button {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 5px;
  background: var(--rig-accent);
  color: var(--rig-on-accent);
}
.rig-ask button:hover { background: var(--rig-accent-2); }

.rig-error { margin: auto; max-width: 520px; padding: 30px; color: var(--rig-ink-2); }
.rig-error h1 { margin: 4px 0 6px; color: var(--rig-ink); font-size: 18px; font-weight: 600; }
.rig-error code { padding: 1px 4px; border-radius: 4px; background: var(--rig-surface-3); font-size: 11.5px; }
.rig-kicker { color: var(--rig-muted); font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

/* Schmalere Fenster: dieselbe Akte, nur gestapelt. */
@container (max-width: 780px) {
  .rig-main { grid-template-columns: 1fr; grid-template-rows: minmax(190px, 1.1fr) minmax(180px, 0.9fr); }
  .rig-index { border-right: 0; border-bottom: 1px solid var(--rig-line); }
  .rig-side { padding: 12px 14px 16px; }
  .rig-discuss { display: none; }
}
@container (max-width: 620px) {
  .rig-customer { display: block; overflow-y: auto; }
  .rig-main { display: block; flex: none; }
  .rig-index { border-bottom: 1px solid var(--rig-line); }
  .rig-table-wrap { max-height: 320px; }
  .rig-side { overflow: visible; border-top: 1px solid var(--rig-line); }
  .rig-toolbar { flex-wrap: wrap; gap: 6px 0; padding-top: 6px; padding-bottom: 6px; }
  .rig-filters { flex: 1 1 100%; }
  .rig-search { flex: 1 1 100%; max-width: none; }
  .rig-file-source { display: none; }
  .rig-assist-note { gap: 6px 8px; padding: 8px 10px; }
  .rig-assist-note p { flex-basis: 100%; font-size: 11.5px; }
  .rig-assist-button { height: 27px; }
  .rig-table { min-width: 0; }
  .rig-table th:nth-child(2), .rig-table td:nth-child(2),
  .rig-table th:nth-child(3), .rig-table td:nth-child(3),
  .rig-table th:nth-child(5), .rig-table td:nth-child(5) { display: none; }
  .rig-table .col-name { width: 68%; }
  .rig-table .col-money { width: 32%; }
  .rig-fields { grid-template-columns: 1fr 1fr; }
}
/* Kurze Ansichten: Akte bleibt lesbar; Nebenflächen treten zurück. Die
   Höhe hängt am Fenster, nicht am Container; deshalb Media Queries statt
   einer zweiten Container-Achse (die bei verschachtelten Akten oszillieren
   kann). */
@media (max-height: 820px) {
  .rig-discuss { padding: 7px 12px 9px; gap: 6px; }
  .rig-discuss-head, .rig-greeting, .rig-stats, .rig-questions { display: none; }
  .rig-thread { max-height: 96px; }
  .rig-assist-note p { font-size: 11.5px; }
}
@media (max-height: 660px) {
  .rig-assist { display: none; }
  .rig-toolbar { min-height: 42px; padding-top: 5px; padding-bottom: 5px; }
  .rig-file-head { min-height: 38px; padding-top: 4px; padding-bottom: 4px; }
  .rig-table td { height: 29px; padding-top: 5px; padding-bottom: 5px; }
  .rig-count { padding-top: 4px; padding-bottom: 4px; }
}
@media (max-height: 560px) {
  .rig-file-head { display: none; }
  .rig-main { display: block; overflow: auto; }
  .rig-side { display: block; overflow: visible; border-top: 1px solid var(--rig-line); }
  .rig-index { border-right: 0; border-bottom: 0; }
  .rig-toolbar { border-bottom: 0; }
}

/* Sehr schmale Ansichten: die Akte wird zum scrollbaren Blatt. */
@media (max-width: 720px) {
  .classic-native.classic-rig-host { padding: 0; }
  .classic-rig-host > .rig-customer { max-width: none; max-height: none; border-width: 0; border-radius: 0; box-shadow: none; }
  .rig-customer { font-size: 12.5px; }
}
@media (max-height: 520px) {
  .classic-native.classic-rig-host { padding: 0; }
  .classic-rig-host > .rig-customer { max-height: none; border-radius: 0; }
}

/* ============================================================================
   OFFICE-RIG · alle Werkstattfunktionen in einer Akte
   Die Bausteine sitzen in platform/lib/rigs/office.mjs. Hier steht nur die
   ruhige Office-Optik; Farben kommen ausschließlich aus --rig-*.
   ============================================================================ */

.rig-office {
  position: relative;
  container-type: inline-size;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--rig-surface);
  color: var(--rig-ink);
  font-family: var(--rig-font);
  font-size: 13px;
  line-height: 1.45;
}
.rig-office *,
.rig-office *::before,
.rig-office *::after { box-sizing: border-box; }
.rig-office button,
.rig-office input { font: inherit; }
.rig-office button { color: inherit; }
.rig-office :focus-visible { outline: 2px solid var(--rig-accent); outline-offset: 2px; }
.rig-office .ico { flex: none; }

.office-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 16px 13px;
  border-bottom: 1px solid var(--rig-line);
  background: linear-gradient(180deg, var(--rig-surface-2), var(--rig-surface));
}
.office-head-id { min-width: 0; }
.office-kicker {
  display: block;
  color: var(--rig-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.office-head h1 {
  margin: 4px 0 0;
  color: var(--rig-ink);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.office-head p {
  max-width: 66ch;
  margin: 4px 0 0;
  color: var(--rig-ink-2);
  font-size: 11.5px;
  line-height: 1.5;
}
.office-stats {
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, 1fr));
  gap: 1px;
  max-width: 58%;
  overflow: hidden;
  border: 1px solid var(--rig-line-2);
  border-radius: 9px;
  background: var(--rig-line);
}
.office-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding: 8px 10px;
  background: var(--rig-surface-2);
}
.office-stat b {
  overflow: hidden;
  color: var(--rig-ink);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.office-stat span {
  overflow: hidden;
  color: var(--rig-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.office-stat small {
  overflow: hidden;
  color: var(--rig-muted);
  font-size: 9.5px;
  opacity: 0.85;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.office-stat.is-ok b { color: var(--rig-ok); }
.office-stat.is-warn b { color: var(--rig-warn); }
.office-stat.is-neutral b { color: var(--rig-ink); }

.office-index { position: relative; }
.office-table th:first-child { width: 17%; }
.office-table th:nth-child(2) { width: 20%; }
.office-table th:nth-child(3) { width: 23%; }
.office-table th:nth-child(4) { width: 16%; }
.office-table th:nth-child(5) { width: 12%; }
.office-table th:nth-child(6) { width: 12%; }

/* Übersicht: Hinweise vor der Tabelle. */
.office-hints {
  flex: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  margin: 10px 12px 2px;
  overflow: hidden;
  border: 1px solid var(--rig-line);
  border-radius: 8px;
  background: var(--rig-line);
}
.office-hint { padding: 8px 10px; background: var(--rig-surface-2); min-width: 0; }
.office-hint b { display: block; color: var(--rig-ink); font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.office-hint span { display: block; margin-top: 2px; color: var(--rig-ink-2); font-size: 11.5px; line-height: 1.45; }

/* Tafel: Planung als Spalten. */
.office-board {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 9px;
  padding: 12px;
  overflow: auto;
  background: var(--rig-bg);
  scrollbar-width: thin;
}
.office-column {
  flex: 1 0 188px;
  min-width: 188px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--rig-line);
  border-radius: 10px;
  background: var(--rig-surface-2);
}
.office-column > header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rig-line);
  color: var(--rig-ink-2);
  font-size: 11px;
  font-weight: 600;
}
.office-column > header span {
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--rig-surface-3);
  color: var(--rig-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.office-column-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.office-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--rig-line);
  border-radius: 8px;
  background: var(--rig-surface);
  text-align: left;
  box-shadow: 0 1px 0 rgb(0 0 0 / 3%);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.office-card:hover { border-color: var(--rig-line-2); }
.office-card[aria-pressed='true'] {
  border-color: var(--rig-accent-line);
  box-shadow: 0 0 0 2px var(--rig-accent-soft);
}
.office-card-top { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.office-card-top small { color: var(--rig-muted); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.office-card > b { color: var(--rig-ink); font-size: 12px; font-weight: 600; line-height: 1.3; }
.office-card-sub { color: var(--rig-muted); font-size: 10.5px; line-height: 1.4; }
.office-empty { margin: 0; padding: 10px 4px; color: var(--rig-muted); font-size: 10.5px; text-align: center; }

/* Kalender: Termine nach Tag. */
.office-agenda {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 12px;
  overflow: auto;
  scrollbar-width: thin;
}
.office-day { flex: none; }
.office-day > h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 5px;
  color: var(--rig-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.office-day > h3 span {
  padding: 0 5px;
  border-radius: 999px;
  background: var(--rig-surface-3);
  color: var(--rig-ink-2);
  font-size: 9.5px;
  letter-spacing: 0;
}
.office-slot {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 3px;
  padding: 7px 10px;
  border: 1px solid var(--rig-line);
  border-radius: 8px;
  background: var(--rig-surface);
  text-align: left;
}
.office-slot:hover { border-color: var(--rig-line-2); }
.office-slot[aria-pressed='true'] { border-color: var(--rig-accent-line); background: var(--rig-accent-soft); }
.office-slot time {
  color: var(--rig-ink);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.office-slot-main { min-width: 0; display: flex; flex-direction: column; }
.office-slot-main b { overflow: hidden; color: var(--rig-ink); font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.office-slot-main small { overflow: hidden; color: var(--rig-muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }

/* Auswertung: Balken plus Tabelle. */
.office-report { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.office-bars {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rig-line);
  background: var(--rig-surface);
}
.office-bar {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 78px;
  align-items: center;
  gap: 9px;
}
.office-bar > span { color: var(--rig-muted); font-size: 10.5px; }
.office-bar > b { color: var(--rig-ink-2); font-size: 10.5px; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.office-bar > small { display: none; }
.office-bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--rig-surface-3);
}
.office-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--rig-accent);
}
.office-bar.is-warn .office-bar-track i { background: var(--rig-warn); }
.office-bar.is-muted .office-bar-track i { background: var(--rig-line-2); }

/* Einstellungen: Schalter, Werte und Gruppen. */
.rig-office[data-art='settings'] .rig-main { display: block; overflow: auto; }
.rig-office[data-art='settings'] .office-index { border-right: 0; }
.rig-office[data-art='settings'] .office-side { display: none; }
.office-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px 16px 18px;
}
.office-setting-group > h3 {
  margin: 0 0 3px;
  color: var(--rig-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.office-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rig-line);
}
.office-setting:last-child { border-bottom: 0; }
.office-setting-text { min-width: 0; }
.office-setting-text b { display: block; color: var(--rig-ink); font-size: 12px; font-weight: 500; }
.office-setting-text p { margin: 1px 0 0; color: var(--rig-muted); font-size: 10.5px; line-height: 1.45; }
.office-setting-value,
.office-setting-input {
  flex: none;
  padding: 3px 8px;
  border: 1px solid var(--rig-line);
  border-radius: 6px;
  background: var(--rig-surface-2);
  color: var(--rig-ink-2);
  font-size: 11px;
}
.office-setting-input {
  width: clamp(120px, 38%, 230px);
  min-width: 0;
  border-color: transparent;
  background: transparent;
  font-family: inherit;
  text-align: right;
  transition: border-color 0.15s, background 0.15s;
}
.office-setting-input:hover { border-color: var(--rig-line); background: var(--rig-surface-2); }
.office-setting-input:focus {
  outline: 2px solid var(--rig-accent);
  outline-offset: 1px;
  border-color: transparent;
  background: var(--rig-surface);
}
.office-switch {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--rig-line-2);
  border-radius: 999px;
  background: var(--rig-surface-3);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.office-switch span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--rig-surface);
  box-shadow: 0 1px 2px rgb(0 0 0 / 18%);
  transition: transform 0.15s;
}
.office-switch[aria-pressed='true'] { border-color: var(--rig-accent); background: var(--rig-accent); }
.office-switch[aria-pressed='true'] span { transform: translateX(16px); background: var(--rig-on-accent); }
.office-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0 2px; }
.office-tags span {
  padding: 2px 7px;
  border: 1px solid var(--rig-line);
  border-radius: 999px;
  background: var(--rig-surface-2);
  color: var(--rig-muted);
  font-size: 10px;
}
.office-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.office-flash {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 4;
  max-width: calc(100% - 28px);
  margin: 0;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--rig-ink);
  color: var(--rig-surface);
  font-size: 10.5px;
  box-shadow: var(--rig-shadow);
}
.office-flash[hidden] { display: none; }

/* Office in geteilten Fenstern. */
@container (max-width: 860px) {
  .office-head { flex-direction: column; gap: 10px; }
  .office-stats { width: 100%; max-width: none; }
}
@container (max-width: 520px) {
  .office-head { padding: 11px 12px 10px; }
  .office-head h1 { font-size: 16px; }
  .office-stats { grid-template-columns: 1fr 1fr; }
  .office-stat { padding: 6px 8px; }
  .office-stat b { font-size: 14px; }
  .office-slot { grid-template-columns: 42px minmax(0, 1fr); }
  .office-slot .rig-status { display: none; }
  .office-setting { gap: 10px; }
}
.office-toolbar-note { margin: 0; color: var(--rig-muted); font-size: 11px; }
/* Schmale Rigs: Kopf und Liste bleiben beieinander, die Akte scrollt als Blatt. */
@container (max-width: 620px) {
  .rig-office { overflow-y: auto; }
  .rig-office .office-head { gap: 8px; }
  .rig-office .office-head p { display: none; }
  .rig-office .office-stats { grid-template-columns: 1fr 1fr; }
  .rig-office .office-stat { padding: 6px 8px; }
  .rig-office .office-stat b { font-size: 14px; }
  .rig-office .office-stat small { display: none; }
}

/* Annahme-Assistent: vier Schritte im Rig, ohne die Akte zu verlassen. */
.office-intake { margin: 0 0 12px; }
.office-intake-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 13px;
  border: 1px solid var(--rig-line);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--rig-surface-2), var(--rig-surface));
}
.office-intake-bar b { display: block; margin-top: 2px; color: var(--rig-ink); font-size: 13px; }
.office-intake-bar p { margin: 2px 0 0; color: var(--rig-muted); font-size: 11px; line-height: 1.45; }
.office-intake-start {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--rig-accent);
  border-radius: 7px;
  background: var(--rig-accent);
  color: var(--rig-on-accent);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.office-intake-start:hover { filter: brightness(1.05); }
.office-intake-start:focus-visible,
.office-intake-next:focus-visible,
.office-intake-back:focus-visible,
.office-intake-cancel:focus-visible,
.office-steps button:focus-visible { outline: 2px solid var(--rig-accent); outline-offset: 2px; }
.office-intake-card {
  padding: 13px;
  border: 1px solid var(--rig-line);
  border-radius: 10px;
  background: var(--rig-surface);
  box-shadow: 0 8px 22px rgb(28 33 40 / 7%);
}
.office-intake-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.office-intake-head h2 { margin: 1px 0 2px; color: var(--rig-ink); font-size: 15px; letter-spacing: -0.01em; }
.office-intake-head p { margin: 0; color: var(--rig-muted); font-size: 11px; line-height: 1.45; max-width: 58ch; }
.office-intake-cancel {
  flex: none;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--rig-muted);
  font: inherit;
  font-size: 10.5px;
  cursor: pointer;
}
.office-intake-cancel:hover { border-color: var(--rig-line); color: var(--rig-ink); }
.office-steps {
  display: flex;
  gap: 5px;
  margin: 11px 0;
  padding: 0;
  list-style: none;
}
.office-steps li { flex: 1; min-width: 0; }
.office-steps button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 6px;
  border: 1px solid var(--rig-line);
  border-radius: 6px;
  background: var(--rig-surface-2);
  color: var(--rig-muted);
  font: inherit;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}
.office-steps button span {
  display: grid;
  place-items: center;
  flex: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--rig-surface);
  color: var(--rig-ink-2);
  font-size: 9px;
  font-weight: 600;
}
.office-steps button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.office-steps button[aria-current='step'] {
  border-color: var(--rig-accent);
  background: var(--rig-accent-soft, var(--rig-surface-2));
  color: var(--rig-ink);
}
.office-steps button[aria-current='step'] span { background: var(--rig-accent); color: var(--rig-on-accent); }
.office-intake-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px;
}
.office-intake-stephead { grid-column: 1 / -1; }
.office-intake-stephead > span {
  color: var(--rig-muted);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.office-intake-stephead h3 { margin: 1px 0 2px; color: var(--rig-ink); font-size: 13px; }
.office-intake-stephead p { margin: 0 0 2px; color: var(--rig-muted); font-size: 11px; }
.office-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.office-field.is-breit { grid-column: 1 / -1; }
.office-field > span { color: var(--rig-ink-2); font-size: 10.5px; font-weight: 500; }
.office-field input[type='text'],
.office-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid var(--rig-line-2);
  border-radius: 6px;
  background: var(--rig-surface);
  color: var(--rig-ink);
  font: inherit;
  font-size: 11px;
}
.office-field textarea { resize: vertical; min-height: 58px; }
.office-field input[type='text']:focus,
.office-field textarea:focus { outline: 2px solid var(--rig-accent); outline-offset: 1px; border-color: transparent; }
.office-field.is-check {
  flex-direction: row;
  align-items: flex-start;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid var(--rig-line);
  border-radius: 6px;
  background: var(--rig-surface-2);
}
.office-field.is-check input { margin: 2px 0 0; accent-color: var(--rig-accent); }
.office-field.is-check b { display: block; color: var(--rig-ink); font-size: 11px; font-weight: 500; }
.office-field.is-check small { display: block; margin-top: 1px; color: var(--rig-muted); font-size: 10px; }
.office-intake-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid var(--rig-line);
}
.office-intake-back,
.office-intake-next {
  padding: 6px 10px;
  border: 1px solid var(--rig-line-2);
  border-radius: 6px;
  background: var(--rig-surface);
  color: var(--rig-ink);
  font: inherit;
  font-size: 10.5px;
  cursor: pointer;
}
.office-intake-next {
  margin-left: auto;
  border-color: var(--rig-accent);
  background: var(--rig-accent);
  color: var(--rig-on-accent);
}
.office-intake-back:hover { border-color: var(--rig-accent); }
.office-intake-next:hover { filter: brightness(1.05); }
.office-intake-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 14px;
  margin: 0;
}
.office-intake-summary div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--rig-line);
}
.office-intake-summary dt { color: var(--rig-muted); font-size: 10.5px; }
.office-intake-summary dd { margin: 0; color: var(--rig-ink); font-size: 11px; text-align: right; }

@container (max-width: 620px) {
  .office-intake-bar { align-items: flex-start; flex-direction: column; gap: 9px; }
  .office-intake-body,
  .office-intake-summary { grid-template-columns: 1fr; }
  .office-steps { flex-wrap: wrap; }
  .office-steps li { flex: 1 1 44%; }
}

/* ============================================================================
   DATAUNITS-RIG · Katalog und Modell der DataUnits
   Der Katalog führt name, reference, art, form, owner, zugriff, GUs und Teile;
   das Modell zeigt Slots, Felder mit Crafts, Übergänge, Contracts, Lifecycle.
   Farben ausschließlich aus --rig-*.
   ============================================================================ */

.rig-du {
  position: relative;
  container-type: inline-size;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--rig-surface);
  color: var(--rig-ink);
  font-family: var(--rig-font);
  font-size: 13px;
  line-height: 1.45;
}
.rig-du *,
.rig-du *::before,
.rig-du *::after { box-sizing: border-box; }
.rig-du button,
.rig-du input { font: inherit; }
.rig-du button { color: inherit; }
.rig-du :focus-visible { outline: 2px solid var(--rig-accent); outline-offset: 2px; }

.du-head {
  flex: none;
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--rig-line);
  background: linear-gradient(180deg, var(--rig-surface-2), var(--rig-surface));
}
.du-kicker {
  display: block;
  color: var(--rig-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.du-head h1 {
  margin: 3px 0 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.du-lead {
  max-width: 88ch;
  margin: 4px 0 0;
  color: var(--rig-ink-2);
  font-size: 11.5px;
  line-height: 1.5;
}
.du-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 9px;
  overflow: hidden;
  border: 1px solid var(--rig-line-2);
  border-radius: 9px;
  background: var(--rig-line);
}
.du-stat { padding: 5px 9px; background: var(--rig-surface-2); }
.du-stat b { display: block; font-size: 16px; font-weight: 600; line-height: 1.15; }
.du-stat span {
  display: block;
  color: var(--rig-muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.du-stat small { display: block; color: var(--rig-muted); font-size: 9.5px; }
.du-legende { margin: 7px 0 0; color: var(--rig-muted); font-size: 10.5px; }
.du-legende b { color: var(--rig-ink-2); }

.du-toolbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--rig-line);
}
.du-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.du-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--rig-line-2);
  border-radius: 999px;
  background: var(--rig-surface);
  font-size: 11px;
  cursor: pointer;
}
.du-chip:hover { border-color: var(--rig-dot); }
.du-chip[aria-pressed="true"] {
  border-color: var(--rig-accent-line);
  background: var(--rig-accent-soft);
  color: var(--rig-accent-2);
  font-weight: 600;
}
.du-chip small { color: var(--rig-muted); font-size: 9.5px; }
.du-search {
  display: flex;
  flex: none;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--rig-line-2);
  border-radius: 7px;
  background: var(--rig-surface);
  color: var(--rig-muted);
}
.du-search input {
  width: 220px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--rig-ink);
  font-size: 11.5px;
}

.du-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 262px minmax(0, 1fr);
}
.du-index {
  min-height: 0;
  overflow: auto;
  padding: 5px;
  border-right: 1px solid var(--rig-line);
  background: var(--rig-surface-2);
}
.du-eintrag {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.du-eintrag:hover { background: var(--rig-surface); }
.du-eintrag.ist-gewaehlt {
  border-color: var(--rig-accent-line);
  background: var(--rig-surface);
  box-shadow: inset 2px 0 0 var(--rig-accent);
}
.du-eintrag-kopf { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.du-eintrag-kopf b { font-size: 12px; font-weight: 600; }
.du-eintrag-ref { display: block; margin-top: 1px; color: var(--rig-muted); font-size: 9.5px; }
.du-eintrag-kurz {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 2px;
  color: var(--rig-ink-2);
  font-size: 10.5px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.du-leer { margin: 10px 8px; color: var(--rig-muted); font-size: 11px; }

.du-detail { min-height: 0; overflow: auto; padding: 13px 16px 22px; }
.du-titel { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.du-titel h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.du-titel code { color: var(--rig-muted); font-size: 11px; }
.du-version {
  padding: 0 5px;
  border: 1px solid var(--rig-line-2);
  border-radius: 4px;
  color: var(--rig-muted);
  font-size: 9.5px;
}
.du-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.du-badge {
  padding: 0 6px;
  border: 1px solid var(--rig-line-2);
  border-radius: 999px;
  background: var(--rig-surface-2);
  color: var(--rig-ink-2);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.du-badge-du-S { border-color: var(--rig-accent-line); background: var(--rig-accent-soft); color: var(--rig-accent-2); }
.du-badge-du-HC { border-color: var(--rig-line-2); background: var(--rig-surface-3); }
.du-badge-du-AAI { border-color: var(--rig-accent-line); background: var(--rig-surface-3); color: var(--rig-accent-2); }
.du-badge-secret { border-color: var(--rig-warn); background: var(--rig-warn-soft); color: var(--rig-warn); }
.du-kurz { max-width: 92ch; margin: 6px 0 0; color: var(--rig-ink-2); font-size: 11.5px; }

.du-fakten {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1px;
  margin-top: 9px;
  overflow: hidden;
  border: 1px solid var(--rig-line-2);
  border-radius: 8px;
  background: var(--rig-line);
}
.du-fakten > div { padding: 5px 8px; background: var(--rig-surface-2); }
.du-fakten span {
  display: block;
  color: var(--rig-muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.du-fakten b { font-size: 11px; font-weight: 600; }

.du-abschnitt { margin-top: 15px; }
.du-abschnitt h3 { margin: 0 0 5px; font-size: 12.5px; font-weight: 600; }
.du-abschnitt h3 small { margin-left: 5px; color: var(--rig-muted); font-size: 10px; font-weight: 400; }
.du-plan-klein { color: var(--rig-muted); font-size: 10.5px; }
.du-ende { margin: 5px 0 0; }
.du-zwei { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; }

.du-tabelle { width: 100%; border-collapse: collapse; font-size: 11px; }
.du-tabelle th {
  padding: 2px 5px;
  border-bottom: 1px solid var(--rig-line-2);
  color: var(--rig-muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}
.du-tabelle td { padding: 3px 5px; border-bottom: 1px solid var(--rig-line); vertical-align: top; }
.du-tabelle tbody tr:hover td { background: var(--rig-surface-2); }
.du-felder td:nth-child(n + 4) { width: 26px; text-align: center; }

.du-slot-art {
  display: inline-block;
  padding: 0 5px;
  border: 1px solid var(--rig-line-2);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}
.du-slot-part { border-color: var(--rig-accent-line); background: var(--rig-accent-soft); color: var(--rig-accent-2); }
.du-slot-relation { background: var(--rig-surface-3); }

.du-marke {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  border: 1px solid var(--rig-line);
  border-radius: 5px;
  color: var(--rig-muted);
  font-size: 9px;
  font-weight: 700;
  opacity: 0.4;
}
.du-marke small { margin-left: 1px; font-size: 8px; }
.du-marke.an { opacity: 1; border-color: var(--rig-line-2); background: var(--rig-surface-3); color: var(--rig-ink); }
.du-marke[data-marke="V"].an { border-color: var(--rig-accent-line); background: var(--rig-accent-soft); color: var(--rig-accent-2); }
.du-marke[data-marke="C"].an { border-color: var(--rig-warn); background: var(--rig-warn-soft); color: var(--rig-warn); }
.du-marke[data-marke="O"].an { border-color: var(--rig-dot); }

.du-uebergaenge { display: grid; gap: 4px; }
.du-uebergang { padding: 5px 8px; border: 1px solid var(--rig-line); border-radius: 8px; background: var(--rig-surface-2); }
.du-uebergang-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 11.5px; }
.du-pfeil { color: var(--rig-muted); font-size: 10px; }
.du-recht {
  margin-left: auto;
  padding: 0 6px;
  border: 1px solid var(--rig-line-2);
  border-radius: 999px;
  color: var(--rig-ink-2);
  font-size: 9px;
}
.du-recht[data-recht="mensch"] { border-color: var(--rig-accent-line); background: var(--rig-accent-soft); color: var(--rig-accent-2); }
.du-recht[data-recht="fragt-vorher"] { border-color: var(--rig-warn); background: var(--rig-warn-soft); color: var(--rig-warn); }

.du-liste { margin: 0; padding: 0; list-style: none; }
.du-liste li { display: flex; flex-wrap: wrap; gap: 6px; padding: 3px 0; border-bottom: 1px solid var(--rig-line); font-size: 10.5px; }
.du-liste code { color: var(--rig-ink); }
.du-liste span { color: var(--rig-muted); }

.du-zustaende { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.du-zustand {
  padding: 1px 7px;
  border: 1px solid var(--rig-line-2);
  border-radius: 999px;
  background: var(--rig-surface-2);
  font-size: 10px;
}
.du-zustand-pfeil { color: var(--rig-muted); font-size: 10px; }

.du-fuss { margin-top: 16px; padding-top: 8px; border-top: 1px solid var(--rig-line); }
.du-fuss div { color: var(--rig-muted); font-size: 10px; }
.du-fuss span {
  display: inline-block;
  min-width: 84px;
  color: var(--rig-ink-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 9px;
}

@container (max-width: 900px) {
  .du-main { grid-template-columns: 210px minmax(0, 1fr); }
  .du-zwei { grid-template-columns: 1fr; }
  .du-search input { width: 150px; }
}
/* Katalog-Details: GUs, Teile, Quellen */
.du-katalog { margin-top: 7px; font-size: 10.5px; color: var(--rig-muted); }
.du-katalog summary { cursor: pointer; color: var(--rig-ink-2); }
.du-katalog p { max-width: 110ch; margin: 4px 0 0; line-height: 1.5; }

.du-zugriff { margin: 6px 0 0; color: var(--rig-ink-2); font-size: 11px; }
.du-zugriff span {
  margin-right: 6px;
  color: var(--rig-muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.du-gu-liste { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.du-gu-liste li {
  padding: 3px 7px;
  border: 1px solid var(--rig-line);
  border-radius: 7px;
  background: var(--rig-surface-2);
  font-size: 10.5px;
}
.du-gu-liste code { font-size: 11px; }
.du-gu-liste span { margin-left: 6px; color: var(--rig-muted); font-size: 9.5px; }
.du-gu-liste small { display: block; color: var(--rig-muted); font-size: 9.5px; }

.du-teile { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.du-teil {
  padding: 0 7px;
  border: 1px solid var(--rig-line-2);
  border-radius: 999px;
  background: var(--rig-surface-2);
  font-size: 10px;
}

.du-quelle { max-width: 110ch; margin: 5px 0 0; color: var(--rig-muted); font-size: 10.5px; line-height: 1.5; }
.du-quelle b {
  display: block;
  color: var(--rig-ink-2);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.du-quellen { border-top: 1px solid var(--rig-line); }
.du-quellen h3 { margin: 8px 0 4px; }

.du-quellen h3 { font-size: 12.5px; font-weight: 600; }
/* DU-HC-Rig: Frames, Aufbau, Relationen */
.du-pfad { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 0 0 4px; color: var(--rig-muted); font-size: 9.5px; letter-spacing: 0.03em; text-transform: uppercase; }
.du-pfad span + span::before { content: "›"; margin: 0 4px; opacity: 0.6; }

.du-eintrag-pfad { display: block; color: var(--rig-muted); font-size: 9px; letter-spacing: 0.03em; text-transform: uppercase; }

.du-fakten .du-tag { font-weight: 500; }

.du-boxen { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.du-box { padding: 6px 8px; border: 1px solid var(--rig-line); border-radius: 8px; background: var(--rig-surface-2); }
.du-box-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.du-box-kopf b { font-size: 11.5px; }
.du-box-kopf span { color: var(--rig-ink-2); font-size: 9.5px; }
.du-box-kopf em { margin-left: auto; color: var(--rig-muted); font-size: 9px; font-style: normal; }
.du-box p { margin: 3px 0 0; color: var(--rig-muted); font-size: 10px; line-height: 1.45; }
.du-box-link { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--rig-ink-2); font: inherit; font-size: 9.5px; text-decoration: underline; cursor: pointer; }

.du-kanten { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.du-kanten li { padding: 3px 7px; border: 1px solid var(--rig-line); border-radius: 6px; background: var(--rig-surface-2); font-size: 10px; }
.du-kanten b { font-size: 10.5px; font-weight: 600; }
.du-kanten span { color: var(--rig-muted); }

.du-beispiel { margin: 6px 0 0; padding: 6px 9px; border-left: 2px solid var(--rig-line-2); color: var(--rig-ink-2); font-size: 10.5px; line-height: 1.5; }

.du-tabelle { max-height: 240px; margin-top: 4px; overflow: auto; border: 1px solid var(--rig-line); border-radius: 7px; }
.du-tabelle table { width: 100%; border-collapse: collapse; font-size: 10px; }
.du-tabelle th { position: sticky; top: 0; padding: 4px 7px; border-bottom: 1px solid var(--rig-line); background: var(--rig-surface-2); color: var(--rig-muted); font-size: 9px; font-weight: 600; text-align: left; text-transform: uppercase; }
.du-tabelle td { padding: 3px 7px; border-bottom: 1px solid var(--rig-line); vertical-align: top; }
.du-tabelle tr:last-child td { border-bottom: 0; }
/* Ebenen im DU-HC-Rig */
.du-gruppe { display: flex; align-items: baseline; gap: 6px; margin: 8px 0 2px; padding: 0 2px; }
.du-gruppe span { color: var(--rig-muted); font-size: 9px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.du-gruppe small { color: var(--rig-muted); font-size: 9px; }

.du-badge-duhc { border-color: var(--rig-accent-line); background: var(--rig-accent-soft); color: var(--rig-accent-2); }
.du-badge-dus { border-color: var(--rig-line-2); background: var(--rig-surface-3); }
.du-badge-duaai,
.du-badge-aai { border-color: var(--rig-line); background: var(--rig-surface-2); color: var(--rig-muted); }
.du-badge-frame { border-color: var(--rig-line-2); background: var(--rig-surface-3); font-weight: 600; }
.du-badge-frames { border-color: var(--rig-line); background: var(--rig-surface-2); color: var(--rig-muted); }

.du-box-note { display: inline-block; margin-top: 4px; color: var(--rig-muted); font-size: 9.5px; font-style: italic; }
/* App Builder: Packages öffnen, Units lesen, aktivieren */
.du-bauer { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 12px; padding: 10px 12px 12px; }
.du-frames { min-height: 0; overflow: auto; padding-right: 2px; }
.du-frame { border: 1px solid var(--rig-line); border-radius: 9px; background: var(--rig-surface); margin-bottom: 4px; }
.du-frame.ist-gewaehlt { border-color: var(--rig-accent-line); box-shadow: inset 2px 0 0 var(--rig-accent); }
.du-frame-kopf { display: flex; align-items: center; gap: 2px; padding: 0 6px 0 3px; }
.du-caret { display: grid; place-items: center; flex: none; width: 20px; height: 30px; padding: 0; border: 0; background: none; color: var(--rig-muted); cursor: pointer; }
.du-caret::before { content: ""; width: 0; height: 0; border-left: 4px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .12s ease; }
.du-caret[aria-expanded="true"]::before { transform: rotate(90deg); }
.du-frame-name { flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 8px; min-width: 0; padding: 7px 4px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.du-frame-name b { font-size: 12.5px; font-weight: 600; }
.du-frame-name small { color: var(--rig-muted); font-size: 10px; }
.du-unit { display: flex; align-items: baseline; gap: 7px; width: 100%; padding: 4px 6px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.du-units { display: grid; gap: 1px; padding: 0 6px 6px 25px; }
.du-unit:hover { background: var(--rig-surface-2); }
.du-unit.ist-gewaehlt { background: var(--rig-accent-soft); }
.du-unit-punkt { flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--rig-line-2); }
.du-unit.ist-gewaehlt .du-unit-punkt { background: var(--rig-accent); }
.du-unit b { font-size: 11.5px; font-weight: 500; color: var(--rig-ink); }
.du-unit em { margin-left: auto; color: var(--rig-muted); font-size: 9.5px; font-style: normal; white-space: nowrap; }
.du-frame-leer { margin: 0; padding: 0 10px 8px 25px; color: var(--rig-muted); font-size: 10px; }

.du-detail { min-height: 0; overflow: auto; padding: 11px 13px 14px; border: 1px solid var(--rig-line); border-radius: 9px; background: var(--rig-surface-2); }
.du-pfad { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin: 0; color: var(--rig-muted); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; }
.du-pfad button { padding: 0; border: 0; background: none; color: var(--rig-muted); font: inherit; font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.du-pfad button:hover { color: var(--rig-ink); text-decoration: underline; }
.du-pfad b { color: var(--rig-ink-2); font-size: 9px; font-weight: 600; }
.du-detail-kopf { display: flex; align-items: baseline; gap: 7px; margin-top: 6px; }
.du-detail-kopf h2 { margin: 0; overflow-wrap: anywhere; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.du-art { flex: none; padding: 0 6px; border: 1px solid var(--rig-line-2); border-radius: 999px; background: var(--rig-surface); color: var(--rig-muted); font-size: 9px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.du-beschreibung { margin: 5px 0 0; color: var(--rig-ink-2); font-size: 11px; line-height: 1.5; }
.du-stand-hinweis { margin: 6px 0 0; color: var(--rig-muted); font-size: 10px; line-height: 1.45; }
.du-abschnitt-titel { display: flex; align-items: baseline; gap: 6px; margin: 13px 0 5px; color: var(--rig-ink); font-size: 11px; font-weight: 600; }
.du-abschnitt-titel small { color: var(--rig-muted); font-size: 9.5px; font-weight: 400; }
.du-liste-units { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.du-liste-units button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; width: 100%; padding: 5px 7px; border: 1px solid var(--rig-line); border-radius: 7px; background: var(--rig-surface); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.du-liste-units button:hover { border-color: var(--rig-line-2); background: var(--rig-surface-3); }
.du-liste-units b { font-size: 11px; font-weight: 600; }
.du-liste-units em { color: var(--rig-muted); font-size: 9px; font-style: normal; white-space: nowrap; }
.du-liste-units span { grid-column: 1 / -1; color: var(--rig-muted); font-size: 9.5px; line-height: 1.4; }
.du-liste-units .du-unit-felder { color: var(--rig-muted); font-size: 9px; }
.du-angaben { display: grid; gap: 0; margin: 0; }
.du-angaben > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--rig-line); }
.du-angaben dt { color: var(--rig-muted); font-size: 9.5px; }
.du-angaben dd { margin: 0; overflow-wrap: anywhere; color: var(--rig-ink-2); font-size: 10.5px; line-height: 1.45; }
.du-felder-gruppe { display: flex; align-items: baseline; gap: 6px; margin: 8px 0 3px; color: var(--rig-ink-2); font-size: 9.5px; font-weight: 600; letter-spacing: 0.02em; }
.du-felder-gruppe small { color: var(--rig-muted); font-size: 9px; font-weight: 400; }
.du-aufbau { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; }
.du-aufbau-zeile { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; padding: 3px 6px 3px calc(6px + var(--tiefe, 0) * 11px); border-left: 1px solid var(--rig-line); background: var(--rig-surface); font-size: 10px; }
.du-aufbau-zeile b { font-weight: 600; }
.du-aufbau-art { padding: 0 5px; border: 1px solid var(--rig-line-2); border-radius: 999px; color: var(--rig-muted); font-size: 8.5px; font-weight: 600; text-transform: uppercase; }
.du-aufbau-bezug { color: var(--rig-ink-2); font-size: 9px; font-style: normal; }
.du-aufbau-zeile small { color: var(--rig-muted); font-size: 9px; }
.du-aufbau-anzahl { margin-left: auto; color: var(--rig-muted); font-size: 9px; }
.du-aufbau-offen { font-style: italic; }
.du-feldliste { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.du-feldliste li { padding: 4px 7px; border: 1px solid var(--rig-line); border-radius: 6px; background: var(--rig-surface); }
.du-feld-kopf { display: flex; align-items: baseline; gap: 6px; }
.du-feld-kopf b { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 10.5px; font-weight: 600; }
.du-feld-meta { flex: none; color: var(--rig-muted); font-size: 9px; white-space: nowrap; }
.du-feldliste small { display: block; margin-top: 1px; color: var(--rig-muted); font-size: 9.5px; line-height: 1.4; }
.du-beziehungen, .du-bewegungen { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.du-beziehungen li { padding: 4px 7px; border: 1px solid var(--rig-line); border-radius: 6px; background: var(--rig-surface); }
.du-beziehungen small { display: block; margin-top: 1px; color: var(--rig-muted); font-size: 9.5px; line-height: 1.4; }
.du-bewegung { padding: 4px 7px; border: 1px solid var(--rig-line); border-radius: 6px; background: var(--rig-surface); }
.du-bewegung summary { display: flex; align-items: baseline; gap: 6px; cursor: pointer; }
.du-bewegung summary b { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 10.5px; font-weight: 600; }
.du-bewegung[open] summary { margin-bottom: 3px; }
.du-bewegung .du-feldliste { margin-top: 4px; }
.du-bewegung .du-beschreibung { margin: 2px 0 4px; }
.du-aktion { margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--rig-line-2); }
.du-aktivieren { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 7px; border: 1px solid var(--rig-accent-line); border-radius: 7px; background: var(--rig-accent-soft); color: var(--rig-accent-2); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.du-aktivieren:hover { border-color: var(--rig-accent); }
.du-aktivieren:disabled { opacity: .45; cursor: default; }
.du-aktion-hinweis { margin: 5px 0 0; color: var(--rig-muted); font-size: 9.5px; line-height: 1.45; }
.du-neben { margin-top: 6px; padding: 0; border: 0; background: none; color: var(--rig-muted); font: inherit; font-size: 9.5px; text-decoration: underline; cursor: pointer; }
.du-neben:hover { color: var(--rig-ink); }
.du-status { margin: 6px 0 0; padding: 5px 7px; border-radius: 6px; background: var(--rig-ok-soft, var(--rig-surface-3)); color: var(--rig-ink); font-size: 10px; line-height: 1.4; }
/* Unit aktivieren steht ganz oben in der Detailspalte und bleibt beim Scrollen da. */
.du-kopf-aktion { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; margin: -11px -13px 9px; padding: 8px 13px; border-bottom: 1px solid var(--rig-line-2); background: var(--rig-surface-2); }
.du-kopf-aktion .du-aktivieren { width: auto; padding: 6px 11px; }
.du-kopf-aktion .du-aktion-hinweis { flex: 1 1 120px; margin: 0; }
.du-kopf-aktion .du-status { flex: 1 1 100%; margin: 0; }
.du-feld-roh { color: var(--rig-muted); font-size: 9px; }
.du-feld-versteckt { margin: 6px 0 0; color: var(--rig-muted); font-size: 9px; font-style: italic; }
@container (max-width: 700px) {
  .du-bauer { grid-template-columns: 1fr; overflow: auto; padding-bottom: 14px; }
  .du-frames { overflow: visible; }
  .du-detail { overflow: visible; }
}

/* Modul-Fenster: Modelle als Datenmodell */
.rig-mo { display: flex; flex-direction: column; gap: 9px; height: 100%; padding: 10px 12px 12px; overflow: auto; }
.mo-kicker { color: var(--rig-muted); font-size: 9px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.mo-name { display: grid; gap: 2px; margin-top: 4px; }
.mo-name span { color: var(--rig-muted); font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; }
.mo-name input { padding: 5px 8px; border: 1px solid var(--rig-line-2); border-radius: 7px; background: var(--rig-surface-2); color: var(--rig-ink); font: inherit; font-size: 16px; font-weight: 600; }
.mo-lead { margin: 0; color: var(--rig-muted); font-size: 10px; line-height: 1.5; }
.mo-modelle { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.mo-modell { display: grid; gap: 5px; padding: 7px 8px 6px; border: 1px solid var(--rig-line); border-radius: 9px; background: var(--rig-surface-2); }
.mo-modell-kopf { display: flex; align-items: center; gap: 6px; }
.mo-ico { flex: none; color: var(--rig-accent-2); }
.mo-feld { flex: 1; display: grid; gap: 1px; min-width: 0; }
.mo-feld > span { color: var(--rig-muted); font-size: 8.5px; letter-spacing: 0.05em; text-transform: uppercase; }
.mo-feld input { padding: 3px 6px; border: 1px solid var(--rig-line); border-radius: 6px; background: var(--rig-surface); color: var(--rig-ink); font: inherit; font-size: 12.5px; font-weight: 600; }
.mo-weg { flex: none; padding: 2px; border: 0; background: none; color: var(--rig-muted); cursor: pointer; }
.mo-modell-fuss { display: flex; align-items: baseline; gap: 8px; color: var(--rig-muted); font-size: 9px; line-height: 1.4; }
.mo-modell-fuss span { flex: 1; min-width: 0; }
.mo-modell-fuss b { flex: none; font-size: 9px; font-weight: 600; }
.mo-aufbau { color: var(--rig-muted); font-size: 9px; line-height: 1.45; }
.mo-gruppe { display: flex; align-items: baseline; gap: 6px; margin: 6px 0 2px; color: var(--rig-ink-2); font-size: 9.5px; font-weight: 600; }
.mo-gruppe small { color: var(--rig-muted); font-size: 9px; font-weight: 400; }
.mo-felder { display: grid; gap: 2px; margin: 1px 0 0; padding: 0; list-style: none; }
.mo-feldzeile { overflow: hidden; border: 1px solid var(--rig-line); border-radius: 6px; background: var(--rig-surface); }
.mo-feldzeile.ist-offen { border-color: var(--rig-accent-line); }
.mo-feldknopf { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; width: 100%; padding: 4px 7px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.mo-feldknopf:hover { background: var(--rig-surface-2); }
.mo-feldknopf b { font-size: 10.5px; font-weight: 600; }
.mo-feldart { color: var(--rig-muted); font-size: 9px; white-space: nowrap; }
.mo-werte { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 3px; }
.mo-werte em { padding: 0 5px; border: 1px solid var(--rig-line-2); border-radius: 999px; background: var(--rig-surface-2); color: var(--rig-ink-2); font-size: 9px; font-style: normal; }
.mo-werte-frei { grid-column: 1 / -1; color: var(--rig-muted); font-size: 9.5px; }
.mo-feld-mehr { display: grid; gap: 0; margin: 0; padding: 4px 7px 5px; border-top: 1px solid var(--rig-line); }
.mo-feld-mehr > div { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 6px; padding: 1px 0; }
.mo-feld-mehr dt { color: var(--rig-muted); font-size: 9px; }
.mo-feld-mehr dd { margin: 0; color: var(--rig-ink-2); font-size: 10px; line-height: 1.4; }
.mo-felder-leer { margin: 0; color: var(--rig-muted); font-size: 9.5px; }
.mo-roh { font-family: ui-monospace, "Cascadia Code", monospace; color: var(--rig-muted); font-size: 9.5px; }
.mo-technik { align-self: flex-start; margin: 5px 0 0; padding: 1px 0; border: 0; background: none; color: var(--rig-muted); font: inherit; font-size: 9px; text-decoration: underline; cursor: pointer; }
.mo-technik:hover { color: var(--rig-ink); }
.mo-technik[aria-pressed="true"] { color: var(--rig-ink-2); }
.mo-fuss { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; border-top: 1px solid var(--rig-line); color: var(--rig-muted); font-size: 9px; }
.mo-loeschen { padding: 0; border: 0; background: none; color: var(--rig-warn, #a4532f); font: inherit; font-size: 9.5px; text-decoration: underline; cursor: pointer; }
