/* ══════════════════════════════════════════════════════════════════════════
   ComponentBox — Referenzumsetzung der Bausteine
   ══════════════════════════════════════════════════════════════════════════
   Setzt 04_components.md in CSS-Klassen um. Benutzt AUSSCHLIESSLICH Tokens
   aus tokens.css. Geladen von den Vorschauen, der Website, den Geräte-Apps
   und unverändert vom Next.js-Frontend (06_reference_code.md) — dessen
   Komponenten setzen nur diese Klassen.

   Widersprechen sich diese Datei und 04_components.md, gilt 04 — und diese
   Datei wird im selben Arbeitsgang nachgezogen.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Schale ──────────────────────────────────────────────────────────────── */
.shell { display: flex; height: 100vh; overflow: hidden; }
.shell-main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.content { flex: 1; overflow: auto; padding: 20px; }

.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w); background: var(--sidebar-bg);
  display: flex; flex-direction: column; color: var(--sidebar-text);
  transition: width var(--duration-base) var(--ease-standard);
}
.sidebar.is-collapsed { width: var(--sidebar-w-collapsed); min-width: var(--sidebar-w-collapsed); }
.sidebar-logo {
  display: flex; align-items: center; gap: 6px; padding: 12px 10px;
  border-bottom: 1px solid var(--sidebar-border); min-height: 64px;
}
.sidebar-logo img { height: 40px; width: auto; display: block; }   /* schmales Logo, dunkel — assets/logo/ */
.sidebar.is-collapsed .sidebar-logo img { content: url('logo/componentbox-icon.svg'); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 0 4px; }
.nav-group-title {
  padding: 12px 18px 4px; font-size: 10px; font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255, 255, 255, 0.28);
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 18px 8px 15px;
  border-left: 3px solid transparent; font-size: 13px; font-weight: var(--fw-medium);
  color: var(--sidebar-text); transition: background var(--duration-fast), color var(--duration-fast);
}
.nav-item svg { width: 16px; height: 16px; opacity: 0.65; flex: none; }
.nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-text-hover); }
.nav-item.is-active {
  background: var(--sidebar-active); color: var(--sidebar-text-active);
  border-left-color: var(--sidebar-marker); font-weight: var(--fw-semibold);
}
.nav-item.is-active svg { opacity: 1; }
/* Untermenü: Obereintrag klappt auf und zu (Pfeil rechts), Unterpunkte an einer senkrechten
   Führungslinie unter dem Icon; zugeklappt, solange keine Seite darin offen ist */
.nav-parent { width: 100%; border-top: 0; border-right: 0; border-bottom: 0; background: none; font-family: inherit; text-align: left; cursor: pointer; }
.nav-parent .nav-caret { width: 12px; height: 12px; margin-left: auto; opacity: 0.6; transition: transform var(--duration-fast) var(--ease-standard); }
.nav-parent[aria-expanded="false"] .nav-caret { transform: rotate(-90deg); }
.nav-parent.has-active { color: var(--sidebar-text-active); }
.nav-parent.has-active[aria-expanded="false"] { background: var(--sidebar-active); border-left-color: var(--sidebar-marker); font-weight: var(--fw-semibold); }
.nav-parent.has-active svg { opacity: 1; }
.nav-sub { margin: 2px 0 4px 25px; border-left: 1px solid rgba(255, 255, 255, 0.14); }
.nav-sub[hidden] { display: none; }
.nav-sub .nav-item { margin-left: -2px; padding: 6px 18px 6px 14px; font-size: 12px; font-weight: var(--fw-regular); }
.nav-sub .nav-item.is-active { font-weight: var(--fw-semibold); }
.nav-count {
  margin-left: auto; font-size: 11px; padding: 1px 8px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08); color: var(--sidebar-count-fg);
}
.nav-divider { height: 1px; background: var(--sidebar-border); margin: 6px 16px; }
.sidebar-footer { padding: 12px 16px 14px; border-top: 1px solid var(--sidebar-border); }
/* Fuß wie im Altstand (app.css → .version-*): Name mit Info-Knopf, Version, Zeitpunkt, Copyright */
.version-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.version-name { font-size: 12.5px; font-weight: var(--fw-semibold); color: var(--sidebar-foot-strong); }
/* Info-Knopf — Ausnahme von der 32-px-Regel (04 → „Die eine Regel vorweg"); „i" als Schriftzeichen wie im Altstand */
.version-info-btn {
  width: 18px; height: 18px; flex: none; padding: 0; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--version-info-bg); color: var(--version-info-fg);
  font-family: Georgia, serif; font-size: 10px; font-weight: var(--fw-semibold); font-style: italic;
  transition: background 0.15s;
}
.version-info-btn:hover { background: var(--version-info-bg-hover); }
.version-info-btn:focus-visible { outline: 2px solid var(--sidebar-marker); outline-offset: 1px; }
.version-ver { margin-bottom: 1px; font-size: var(--text-2xs); font-weight: var(--fw-semibold); color: var(--sidebar-foot-strong); }
.version-date { margin-bottom: 8px; font-size: var(--text-2xs); font-weight: var(--fw-semibold); color: var(--sidebar-foot-dim); }
.version-copy { font-size: 10.5px; line-height: 1.5; color: var(--sidebar-foot-dim); }

.header {
  height: var(--header-h); flex: none; display: flex; align-items: center; gap: 6px;
  padding: 0 20px; background: var(--surface-card); border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm); position: relative; z-index: var(--z-header);
}
.header-spacer { flex: 1; }
.subheader {
  height: var(--subheader-h); flex: none; display: flex; align-items: center; gap: 12px;
  padding: 0 20px; background: var(--surface-card); border-bottom: 1px solid var(--border-subtle);
}
.page-title { font-family: var(--font-display); font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); line-height: 1.2; }
.page-subtitle { font-size: 10px; color: var(--text-muted); }
.subheader-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; min-width: 0; }
/* Kontext-Pill ganz rechts in der Pfadzeile (z. B. „Einlagern in …“, 19.11.2026): abgehoben in Markenfarbe, ✕ bricht ab */
.context-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; min-width: 0; max-width: 420px; padding: 0 3px 0 10px;
  border: 1px solid var(--border-brand); border-radius: var(--radius-pill); background: var(--surface-brand-soft);
  color: var(--text-brand); font-size: var(--text-xs); font-weight: var(--fw-semibold); white-space: nowrap;
}
.context-pill > svg { width: 14px; height: 14px; flex: none; }
.context-pill .text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.context-pill .pill-x {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
}
.context-pill .pill-x:hover { background: var(--surface-card); }
.context-pill .pill-x svg { width: 13px; height: 13px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--text-muted); }
.breadcrumb a { color: inherit; }
.breadcrumb a:hover { color: var(--text-brand); text-decoration: underline; text-underline-offset: 2px; }
.breadcrumb .sep { color: var(--border-default); }

.user-pill {
  display: inline-flex; align-items: center; gap: 8px; height: var(--control-h);
  padding: 0 8px 0 2px; border-radius: var(--radius-pill); font-size: var(--text-xs);
  font-weight: var(--fw-semibold); color: var(--text-strong); background: transparent; border: 0;
  text-align: left; cursor: pointer;
}
.user-pill:hover, .user-pill[aria-expanded="true"] { background: var(--surface-sunken); }
.user-pill .user-info { display: flex; flex-direction: column; min-width: 0; max-width: 180px; line-height: 1.2; }
.user-pill .user-name,
.user-pill .user-org { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-pill .user-name { font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-strong); }
.user-pill .user-org { font-size: var(--text-2xs); font-weight: var(--fw-regular); color: var(--text-muted); }
.user-pill > svg {
  width: 13px; height: 13px; flex: none; color: var(--text-subtle);
  transition: transform var(--duration-fast);
}
.user-pill[aria-expanded="true"] > svg { transform: rotate(180deg); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--action-bg); color: var(--action-fg);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: var(--fw-bold);
}

/* ── Karte ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-header {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.card-title { font-family: var(--font-display); font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
/* Kopf als Band: wenn der Inhalt selbst fette Zeilenanfänge hat (Wertetabelle), setzt die Fläche den Titel ab */
.card-header.is-band { background: var(--surface-sunken); }
.card-meta { font-size: var(--text-2xs); color: var(--text-muted); }
.card-body { padding: 16px; font-size: var(--text-xs); }
.card-footer {
  display: flex; justify-content: flex-end; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--border-subtle);
}
/* in einer Flex-Spalte schrumpft nur die Listenkarte (sie scrollt innen); alle anderen behalten ihre Höhe */
.card { flex-shrink: 0; }
.card.is-list { display: flex; flex-direction: column; min-height: 0; flex-shrink: 1; }
/* Wo gerollt wird (01 → „Wo gerollt wird", WEB-R14) */
.content.is-fit, .content.is-grow { display: flex; flex-direction: column; gap: 12px; }
.content.is-fit > .card.is-list { flex: 1 1 auto; }
.content.is-fit > .edit-cols { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
.content.is-fit > .edit-cols > .col { min-height: 0; overflow: auto; }
.content.is-fit > .edit-cols > .col > .card.is-list { flex: 1 1 auto; }
@media (max-width: 700px) {
  .content.is-fit > .edit-cols { flex: none; grid-template-rows: none; }
  .content.is-fit > .edit-cols > .col { overflow: visible; }
}
.content.is-grow > .card.is-list { flex: 1 0 auto; min-height: auto; overflow: visible; }
.content.is-grow > .card.is-list .table-wrap { flex: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.content.is-grow > .card.is-list .table-wrap::-webkit-scrollbar { display: none; }
/* Kopf bleibt stehen: verschoben werden die Zellen, nicht <thead> — Safari wendet transform auf
   Tabellenzeilen und -gruppen nicht zuverlässig an */
.table thead.is-floating th { transform: translateY(var(--head-y, 0px)); z-index: 4; }
.table thead.is-floating th.is-frozen { z-index: 5; }
/* steht der Kopf, wirft er einen Schatten nach unten — Gegenstück zur Kante der eingefrorenen Spalten.
   Ein einziger Schatten an der ersten (eingefrorenen) Kopfzelle über die sichtbare Breite (--head-w, vom
   Skript): je Zelle ein eigener würde sich unter den eingefrorenen Spalten überlagern */
.table thead.is-floating th:first-child::before {
  /* top + 1px: 100 % endet an der Innenkante, also auf der unteren Rahmenlinie — der Schatten beginnt darunter */
  content: ''; position: absolute; left: 0; width: var(--head-w, 100%); top: calc(100% + 1px); height: 10px; pointer-events: none;
  background: linear-gradient(to bottom, var(--shadow-frozen), transparent);
  opacity: 0; transition: opacity var(--duration-fast);
}
.table thead.is-floating.is-stuck th:first-child::before { opacity: 1; }
/* Fußleiste klebt am unteren Rand des Inhalts — der liegt um die Polsterung von .content (20) über dem
   Fensterrand. Sie sieht aus wie das Kartenende: ::after zieht die untere Kante und deckt den Rand darunter
   in Seitenfarbe ab (dort liefen sonst Zeilen durch), ::before rundet die Ecken samt Rahmen. */
.list-foot { position: sticky; bottom: 0; z-index: 5; margin-top: auto; background: var(--surface-card); box-shadow: 0 1px 0 var(--border-subtle); }
/* 12 breiter als die Karte: deckt auch deren Schatten ab, sonst zeichnet er die Abdeckung nach */
.list-foot::after { content: ''; position: absolute; left: -12px; right: -12px; top: calc(100% + 1px); height: 20px; background: var(--surface-page); pointer-events: none; }
.list-foot::before {
  content: ''; position: absolute; z-index: 1; left: -1px; right: -1px; bottom: -1px; height: var(--radius-lg); pointer-events: none;
  --corner: transparent calc(var(--radius-lg) - 1px), var(--border-subtle) calc(var(--radius-lg) - 1px), var(--border-subtle) var(--radius-lg), var(--surface-page) var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0, var(--corner)) left bottom / var(--radius-lg) var(--radius-lg) no-repeat,
    radial-gradient(circle at 0 0, var(--corner)) right bottom / var(--radius-lg) var(--radius-lg) no-repeat;
}
/* Rollschiene: eigener, immer sichtbarer Rollbalken — Safari blendet seinen sonst aus und zeigt in der
   flachen Schiene nichts */
.hscroll-rail { overflow-x: scroll; overflow-y: hidden; height: 13px; border-top: 1px solid var(--border-subtle); background: var(--surface-sunken); }
.hscroll-rail > div { height: 1px; }
.hscroll-rail::-webkit-scrollbar { height: 10px; }
.hscroll-rail::-webkit-scrollbar-track { background: var(--surface-sunken); }
.hscroll-rail::-webkit-scrollbar-thumb { background: var(--border-strong); border: 2px solid var(--surface-sunken); border-radius: var(--radius-pill); }
.hscroll-rail::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }
.filter-row { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); }

/* ── Schaltfläche ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--control-h); padding: 0 16px; border-radius: var(--radius-sm);
  font-size: var(--text-sm); /* 14.11.2026 Nutzer: eine Stufe über der Arbeitsgröße */ font-weight: var(--fw-semibold); white-space: nowrap;
  border: 1px solid transparent; transition: filter var(--duration-fast), background var(--duration-fast);
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { filter: brightness(0.94); }
.btn:disabled, .btn.is-disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.btn.is-busy { cursor: progress; }
.btn.is-busy svg { animation: cb-spin 900ms linear infinite; }
.btn-primary   { background: var(--action-bg); color: var(--action-fg); }
.btn-primary:hover { background: var(--action-bg-hover); filter: none; }
.btn-secondary {
  background: var(--surface-card); color: var(--text-body); border-color: var(--border-subtle);
  padding: 0 14px; font-weight: var(--fw-medium);
}
.btn-secondary:hover { background: var(--surface-sunken); color: var(--text-strong); filter: none; }
.btn-soft      { background: var(--surface-brand-soft); color: var(--text-brand); }
.btn-quiet     { background: transparent; color: var(--text-muted); padding: 0 10px; font-weight: var(--fw-medium); }
.btn-quiet:hover { background: var(--surface-sunken); color: var(--text-body); filter: none; }
.btn-danger    { background: var(--danger); color: var(--on-status); }
.btn-success   { background: var(--success); color: var(--on-status); }
.btn-warning   { background: var(--warning); color: var(--on-status); }
/* Flächenfüllende Schaltfläche — Ausnahme von --control-h, siehe 04 → „Schaltfläche" */
.btn-fill { height: auto; padding: 12px; font-size: var(--text-sm); font-weight: var(--fw-bold); flex-direction: column; gap: 8px; }
.btn-fill svg { width: 20px; height: 20px; }

.btn-split { display: inline-flex; }
.btn-split > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-split > .btn-split-toggle {
  width: var(--control-h); padding: 0; border-top-left-radius: 0; border-bottom-left-radius: 0;
  border-left: 1px solid color-mix(in srgb, currentColor 30%, transparent);
}
.btn-split-toggle svg { width: 18px; height: 18px; transition: transform var(--duration-fast) var(--ease-standard); }
.btn-split-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--control-h); height: var(--control-h); padding: 0; border: 0;
  border-radius: var(--radius-sm); background: transparent; color: var(--text-subtle);
  transition: background var(--duration-fast), filter var(--duration-fast);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--surface-sunken); color: var(--text-body); }
.icon-btn.is-outlined { border: 1px solid var(--border-subtle); }
/* Knopf in Listenzeilen: weiß mit dunklerem Rahmen — hebt sich von der eingefärbten Zeile (Hover, gewählt) ab, wie im Altstand */
.icon-btn.is-card { background: var(--surface-card); border: 1px solid var(--border-default); color: var(--text-muted); }
.icon-btn.is-card:hover { background: var(--surface-card); border-color: var(--border-strong); color: var(--text-strong); }
.icon-btn.is-filled  { background: var(--surface-sunken); color: var(--text-muted); }
.icon-btn.is-brand   { background: var(--surface-brand-soft); color: var(--text-brand); }
.icon-btn.is-success { background: var(--success-soft); color: var(--success); }
.icon-btn.is-warning { background: var(--warning-soft); color: var(--warning); }
.icon-btn.is-danger  { background: var(--danger-soft);  color: var(--danger); }
.icon-btn.is-filled:hover, .icon-btn.is-brand:hover, .icon-btn.is-success:hover,
.icon-btn.is-warning:hover, .icon-btn.is-danger:hover { filter: brightness(0.9); }
.icon-btn:disabled { opacity: 0.25; cursor: not-allowed; filter: none; }
.row-actions { display: inline-flex; gap: 4px; justify-content: flex-end; }
/* Geteilter Zeilenknopf (04): häufigste Handlung + schmaler Pfeil mit Menü, Altstand .split-btn-group */
.row-split { display: inline-flex; vertical-align: middle; }
.row-split > .icon-btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.row-split > .icon-btn svg { width: 18px; height: 18px; }
.row-split-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: var(--control-h);
  padding: 0; border: 1px solid var(--border-default); border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-card); color: var(--text-muted);
  transition: border-color var(--duration-fast), color var(--duration-fast);
}
/* Trennlinie zwischen den Teilen: der Rahmen des vorderen Knopfs */
.row-split-toggle:hover, .row-split-toggle[aria-expanded="true"] { border-color: var(--border-strong); color: var(--text-strong); }
.row-split-toggle svg { width: 12px; height: 12px; transition: transform var(--duration-fast); }
.row-split-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.row-split-menu { min-width: 170px; }
.menu-item.is-success svg { color: var(--success); }
.row-actions .icon-btn svg { width: 18px; height: 18px; }
.default-mark { /* Standard einer Liste: sieht aus wie eine Zeilenaktion, ist aber kein Knopf */
  display: inline-flex; align-items: center; justify-content: center; width: var(--control-h); height: var(--control-h);
  border-radius: var(--radius-sm); background: var(--surface-brand-soft); color: var(--text-brand);
}

/* ── Formular ────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-strong); }
.field-label .req { color: var(--danger); margin-left: 2px; }
.field-label .opt { font-weight: var(--fw-regular); color: var(--text-subtle); margin-left: 4px; }
.hint { font-size: var(--text-2xs); color: var(--text-muted); line-height: 1.4; }
.hint.is-bad { color: var(--danger); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-stack { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }

.input, .textarea {
  width: 100%; height: var(--control-h); padding: 0 10px; font-size: var(--text-xs);
  color: var(--text-strong); background: var(--surface-field);
  border-width: 1px; border-style: solid; border-color: var(--border-subtle); border-radius: var(--radius-sm);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast), background var(--duration-fast);
}
.textarea { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input:hover, .textarea:hover { border-color: var(--border-default); }
.input:focus, .textarea:focus {
  outline: none; border-color: var(--border-brand); box-shadow: var(--shadow-focus); background: var(--surface-card);
}
.input.is-error, .textarea.is-error { border-color: var(--danger); }
.input.is-error:focus { box-shadow: 0 0 0 3px var(--danger-soft); }
.input:disabled, .textarea:disabled { opacity: 0.5; cursor: not-allowed; }
.input[readonly], .textarea[readonly] { background: var(--surface-sunken); border-style: dashed; }
.input.is-num { text-align: right; font-variant-numeric: tabular-nums; }

/* Eingabe mit Anbau (Einheit, Präfix): die Gruppe trägt Rahmen, Fokus und Fehler */
.input-group {
  display: flex; align-items: stretch; height: var(--control-h); width: 100%;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--surface-field); overflow: hidden;
}
.input-group:focus-within { border-color: var(--border-brand); box-shadow: var(--shadow-focus); background: var(--surface-card); }
.input-group.is-error { border-color: var(--danger); }
.input-group .input { border: 0; border-radius: 0; height: 100%; background: transparent; box-shadow: none; }
.input-addon {
  display: inline-flex; align-items: center; padding: 0 10px; font-size: var(--text-xs);
  font-weight: var(--fw-semibold); color: var(--text-muted); background: var(--surface-sunken);
  border-left: 1px solid var(--border-subtle); white-space: nowrap;
}
.input-addon.is-start { border-left: 0; border-right: 1px solid var(--border-subtle); }
/* Trenner zwischen zwei Feldern einer Gruppe (Bereich Min … Max) */
.input-addon.is-sep { border-right: 1px solid var(--border-subtle); font-weight: var(--fw-regular); }
/* Einheitenwahl am Feld: die Auswahl sitzt als Zusatz rechts in der Gruppe */
.input-group .select { width: auto; min-width: 72px; flex: none; height: 100%; border: 0; border-left: 1px solid var(--border-subtle); border-radius: 0; background: var(--surface-sunken); font-weight: var(--fw-semibold); }
.input-group .icon-btn { height: 100%; border-radius: 0; border-left: 1px solid var(--border-subtle); }

/* Suchfeld */
.search { position: relative; flex: 1; min-width: 180px; }
.search > svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-subtle); pointer-events: none; }
.search .input { padding-left: 29px; padding-right: 30px; }
.search-clear {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent;
  border-radius: var(--radius-xs); color: var(--text-subtle);
}
.search-clear:hover { background: var(--surface-sunken); color: var(--text-body); }
.search-clear svg { width: 14px; height: 14px; }
/* Suchkopf: Kreuz direkt hinter dem übernommenen Begriff; die Lage setzt die Komponente in --clear-x */
.search-clear.is-inline { right: auto; left: var(--clear-x, auto); }

/* Auswahl (eigene, kein natives <select>) */
.select {
  display: flex; align-items: center; gap: 8px; width: 100%; height: var(--control-h); padding: 0 8px 0 10px;
  font-size: var(--text-xs); color: var(--text-strong); background: var(--surface-field); text-align: left;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
}
.select .value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select .placeholder { flex: 1; color: var(--text-subtle); }
/* Auswahl mit Bildern (Kategorien): Bild 20 × 20 vor dem Namen, im Feld und im Menü; ohne Bild Ordner-Zeichen */
.opt-thumb { width: 20px; height: 20px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-xs); border: 1px solid var(--border-subtle); background: var(--surface-field); object-fit: contain; color: var(--text-subtle); }
.select .opt-thumb svg, .menu-item .opt-thumb svg { width: 12px; height: 12px; color: var(--text-subtle); }
.select .value:has(> .opt-thumb) { display: flex; align-items: center; gap: 8px; }
.menu-item .opt-hint { font-size: var(--text-2xs); font-weight: var(--fw-regular); color: var(--text-subtle); margin-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select > svg:last-child { width: 18px; height: 18px; color: var(--text-subtle); flex: none; transition: transform var(--duration-fast) var(--ease-standard); }
.select[aria-expanded="true"] { border-color: var(--border-brand); box-shadow: var(--shadow-focus); background: var(--surface-card); }
.select[aria-expanded="true"] > svg:last-child { transform: rotate(180deg); }
.select.is-error { border-color: var(--danger); }
.select:disabled { opacity: 0.5; cursor: not-allowed; }

.menu {
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); overflow: hidden; z-index: var(--z-popover); min-width: 180px;
  padding: 0; /* KEIN Innenabstand: Einträge laufen von Kante zu Kante */
}
.menu-search { padding: 6px; border-bottom: 1px solid var(--border-subtle); }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0;
  border-bottom: 1px solid var(--border-subtle); background: transparent; font-size: var(--text-xs);
  color: var(--text-body); text-align: left; border-radius: 0; /* KEINE Rundung am Eintrag */
}
.menu-item:last-child { border-bottom: 0; }
.menu-item svg { width: 16px; height: 16px; color: var(--text-subtle); flex: none; }
.menu-item:hover { background: var(--surface-sunken); color: var(--text-strong); }
.menu-item.is-selected { background: var(--surface-brand-soft); color: var(--text-brand); font-weight: var(--fw-semibold); }
.menu-item.is-selected .check { margin-left: auto; width: 13px; height: 13px; color: var(--text-brand); }
.menu-item.is-danger { color: var(--danger); }
.menu-item.is-danger svg { color: var(--danger); }
.menu-item:disabled { opacity: 0.45; cursor: not-allowed; }
.menu-group { padding: 8px 10px 4px; font-size: 10px; font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-subtle); border-bottom: 1px solid var(--border-subtle); }

/* Kontrollkästchen und Optionsfeld — eigener Kasten, nativer Input darunter */
.check, .radio { display: inline-flex; align-items: flex-start; gap: 8px; font-size: var(--text-xs); color: var(--text-body); cursor: pointer; line-height: 16px; }
.check input, .radio input {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none; width: 16px; height: 16px;
  border: 1px solid var(--border-default); background: var(--surface-field); cursor: pointer;
  display: inline-grid; place-content: center; transition: background var(--duration-fast), border-color var(--duration-fast);
}
.check input { border-radius: var(--radius-xs); }
.radio input { border-radius: 50%; }
.check input:hover, .radio input:hover { border-color: var(--border-strong); }
/* Kontrollkästchen im blauen Akzent (02 → Ausnahme „blauer Akzent“, 14.11.2026 Nutzer) */
.check input:checked, .check input:indeterminate { background: var(--accent-blue); border-color: var(--accent-blue); }
.check input:checked::after {
  content: ''; width: 9px; height: 5px; border-left: 2px solid var(--action-fg); border-bottom: 2px solid var(--action-fg);
  transform: translateY(-1px) rotate(-45deg);
}
.check input:indeterminate::after { content: ''; width: 8px; height: 2px; background: var(--action-fg); border-radius: 1px; }
.radio input:checked { border-color: var(--action-bg); border-width: 5px; background: var(--white); }
.check input:focus-visible, .radio input:focus-visible { box-shadow: var(--shadow-focus); }
.check input:focus-visible { box-shadow: 0 0 0 3px var(--accent-blue-ring); }
.check input:disabled, .radio input:disabled { opacity: 0.45; cursor: not-allowed; }
.check.is-error input { border-color: var(--danger); }
.choice-list { display: flex; flex-direction: column; gap: 8px; }

/* Auswahlkarte (Einzelwahl mit Erklärung) */
.choice-card {
  display: grid; grid-template-columns: 16px 1fr; gap: 10px; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-card);
}
.choice-card:hover { border-color: var(--border-default); }
.choice-card.is-selected { border-color: var(--border-brand); background: var(--surface-brand-soft); }
.choice-card .title { font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-strong); }
.choice-card .desc { font-size: var(--text-2xs); color: var(--text-muted); }

/* Auswahlkarte mit Bild (Typwahl im Assistenten) */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.pick-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; padding: 0; text-align: left; cursor: pointer;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--surface-card); font: inherit; color: var(--text-body);
  transition: border-color .15s, box-shadow .15s;
}
.pick-card:hover { border-color: var(--border-default); box-shadow: var(--shadow-sm); }
.pick-card.is-selected { border-color: var(--border-brand); box-shadow: 0 0 0 3px var(--surface-brand-soft); }
.pick-card .media { display: flex; align-items: center; justify-content: center; height: 110px; background: var(--surface-sunken); }
.pick-card .media img { width: 100%; height: 100%; object-fit: cover; }
.pick-card .media > svg { width: 36px; height: 36px; color: var(--text-subtle); }
.pick-card .body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; }
.pick-card .title { font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-strong); }
.pick-card .desc { font-size: var(--text-2xs); color: var(--text-muted); line-height: 1.4; }
.pick-card .body .badge-count { align-self: flex-start; margin-top: 2px; font-family: inherit; }
.pick-card .mark { position: absolute; top: 8px; right: 8px; display: none; width: 22px; height: 22px; border-radius: 50%; background: var(--action-bg); color: var(--action-fg); align-items: center; justify-content: center; }
.pick-card .mark svg { width: 13px; height: 13px; stroke-width: 3; }
.pick-card.is-selected .mark { display: inline-flex; }

/* Schalter */
.switch {
  position: relative; flex: none; width: 40px; height: 22px; padding: 0; border: 0;
  border-radius: var(--radius-pill); background: var(--border-default); cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--white); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: left var(--duration-fast) var(--ease-standard);
}
.switch[aria-checked="true"] { background: var(--action-bg); }
.switch[aria-checked="true"]::after { left: 21px; }
.switch.is-running { opacity: 0.5; cursor: progress; }
.switch.is-locked { cursor: not-allowed; background: var(--border-subtle); }
.switch.is-locked[aria-checked="true"] { background: var(--action-bg-muted); }
.switch.is-locked::after { box-shadow: none; }
.switch-label { display: inline-flex; align-items: center; gap: 8px; flex: none; white-space: nowrap; font-size: var(--text-xs); color: var(--text-body); }

/* Geheimnisfeld */
.secret {
  display: flex; align-items: center; gap: 8px; height: var(--control-h); padding: 0 4px 0 10px;
  border-width: 1px; border-style: solid; border-radius: var(--radius-sm); font-size: var(--text-xs);
}
.secret > svg { width: 15px; height: 15px; flex: none; }
.secret .text { flex: 1; }
.secret .dots { font-family: var(--font-mono); font-size: var(--text-sm); letter-spacing: 0.22em; color: var(--text-strong); }
.secret .secret-btn { height: 24px; padding: 0 10px; border: 0; border-radius: var(--radius-xs); font-size: var(--text-2xs); font-weight: var(--fw-semibold); }
.secret.is-set     { border-color: var(--border-brand); background: var(--surface-brand-soft); color: var(--text-brand); }
.secret.is-set .secret-btn { background: var(--surface-card); color: var(--text-brand); box-shadow: var(--shadow-xs); }
.secret.is-unset   { border-color: var(--border-default); border-style: dashed; background: var(--surface-card); color: var(--text-subtle); }
.secret.is-unset .text { font-style: italic; }
.secret.is-unset .secret-btn { background: var(--surface-brand-soft); color: var(--text-brand); }
.secret.is-missing { border-color: var(--warning); background: var(--warning-soft); color: var(--warning); }
.secret.is-missing .text { font-weight: var(--fw-semibold); }
.secret.is-missing .secret-btn { background: var(--warning); color: var(--on-status); }
.secret.is-new     { border-color: var(--border-brand); box-shadow: inset 3px 0 0 var(--border-brand); background: var(--surface-card); color: var(--text-brand); }
.secret.is-new .text { font-weight: var(--fw-semibold); }
.secret.is-new .secret-btn { background: var(--surface-brand-soft); color: var(--text-brand); }

/* Datums- und Zeitfeld */
.date-field {
  display: inline-flex; align-items: center; gap: 7px; height: var(--control-h); padding: 0 6px 0 10px;
  background: var(--surface-field); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
}
.date-field > svg { width: 14px; height: 14px; color: var(--text-subtle); flex: none; }
.date-field input {
  border: 0; background: transparent; outline: none; padding: 0; height: 100%; width: 10ch;
  font-size: var(--text-xs); color: var(--text-strong); font-variant-numeric: tabular-nums;
}
.date-field input.is-time { width: 5ch; }
.date-field input::placeholder { color: var(--text-subtle); }
.date-field .dash { color: var(--text-subtle); }
.date-field .clear { width: 18px; height: 18px; border: 0; background: transparent; border-radius: var(--radius-xs); color: var(--text-subtle); display: inline-flex; align-items: center; justify-content: center; }
.date-field .clear:hover { background: var(--surface-sunken); }
.date-field .clear svg { width: 12px; height: 12px; }
.date-field:focus-within, .date-field.is-open { border-color: var(--border-brand); box-shadow: var(--shadow-focus); background: var(--surface-card); }
.date-field.is-error { border-color: var(--danger); }
.date-field.is-disabled { opacity: 0.5; cursor: not-allowed; }
.date-field .next-day { font-size: var(--text-2xs); color: var(--text-subtle); }

.sheet {
  display: inline-flex; gap: 10px; padding: 10px; background: var(--surface-card);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); box-shadow: var(--shadow-md); z-index: var(--z-popover);
}
.sheet-col { display: flex; flex-direction: column; }
.sheet-col + .sheet-col { border-left: 1px solid var(--border-subtle); padding-left: 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.sheet-head .nav { width: 26px; height: 26px; border: 0; background: transparent; border-radius: var(--radius-sm); color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; }
.sheet-head .nav:hover { background: var(--surface-sunken); }
.sheet-head .nav svg { width: 16px; height: 16px; }
.sheet-head .title { font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-strong); border: 0; background: transparent; }
.cal-grid { display: grid; grid-template-columns: 30px repeat(7, 32px); }
.cal-grid .wd, .col-head { height: 22px; display: flex; align-items: center; justify-content: center; font-size: var(--text-2xs); color: var(--text-subtle); text-transform: uppercase; letter-spacing: 0.06em; }
.col-head.is-next { color: var(--text-brand); }
.cal-grid .kw { display: flex; align-items: center; justify-content: flex-start; font-size: var(--text-2xs); color: var(--text-subtle); border-right: 1px solid var(--border-subtle); margin-right: 5px; }
.cell {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: var(--radius-sm); font-size: var(--text-xs);
  color: var(--text-body); font-variant-numeric: tabular-nums;
}
.cell:hover { background: var(--surface-sunken); }
.cell.is-today { box-shadow: inset 0 0 0 1px var(--border-brand); color: var(--text-brand); font-weight: var(--fw-semibold); }
.cell.is-selected { background: var(--surface-brand); color: var(--text-on-brand); font-weight: var(--fw-semibold); }
.cell.is-range { background: var(--surface-brand-soft); color: var(--text-brand); border-radius: 0; }
.cell.is-other { color: var(--text-subtle); opacity: 0.55; }
.cell.is-disabled { color: var(--text-subtle); opacity: 0.3; cursor: default; }
.time-grid { display: grid; gap: 0; }
.time-grid.hours { grid-template-columns: repeat(4, 32px); }
.time-grid.minutes { grid-template-columns: repeat(3, 32px); }
.sheet-foot { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--border-subtle); margin-top: 8px; padding-top: 8px; font-size: var(--text-2xs); }
.sheet-foot .now { color: var(--text-brand); font-weight: var(--fw-semibold); }
.sheet-foot .clr { color: var(--text-muted); }
.sheet-foot .tz { margin-left: auto; color: var(--text-subtle); }

/* ── Schaltflächengruppe ─────────────────────────────────────────────────── */
.segmented {
  display: inline-flex; align-self: flex-start; height: var(--control-h);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-card);
}
.segmented > button {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 0;
  border-right: 1px solid var(--border-subtle); background: transparent; font-size: var(--text-xs);
  color: var(--text-muted); font-weight: var(--fw-medium);
}
.segmented > button:last-child { border-right: 0; }
.segmented > button:hover { background: var(--surface-sunken); color: var(--text-body); }
.segmented > button.is-active { background: var(--surface-brand-soft); color: var(--text-brand); font-weight: var(--fw-semibold); }
.segmented > button:disabled { opacity: 0.4; cursor: not-allowed; }
.segmented svg { width: 16px; height: 16px; }

/* ── Auswahlfelder zum Antippen (Chips) ──────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  height: 28px; min-width: 34px; padding: 0 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle); background: var(--surface-card); color: var(--text-muted);
  font-size: var(--text-2xs); font-weight: var(--fw-medium); display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.chip:hover { border-color: var(--border-default); color: var(--text-body); }
.chip.is-on { background: var(--surface-brand-soft); border-color: var(--border-brand); color: var(--text-brand); font-weight: var(--fw-semibold); }
/* Standard unter den gewählten (Standard-Präfix eines Parameters) */
.chip.is-on.is-default { background: var(--accent-blue-soft); border-color: var(--accent-blue); color: var(--accent-blue-text); }
.chip > svg { width: 14px; height: 14px; flex: none; } /* Zeichen vor dem Text, z. B. Lagertyp (15.11.2026) */
.chip-links { display: flex; gap: 10px; margin-top: 6px; font-size: var(--text-2xs); }
.chip-links button { border: 0; background: transparent; padding: 0; font: inherit; color: var(--text-brand); }

/* Filter-Chip (aktiver Filter einer Liste, mit Entfernen) */
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 4px 0 10px;
  border-radius: var(--radius-pill); background: var(--surface-brand-soft); color: var(--text-brand);
  font-size: var(--text-2xs); font-weight: var(--fw-semibold);
}
.filter-chip .label { color: var(--text-muted); font-weight: var(--fw-regular); }
.filter-chip button { width: 18px; height: 18px; border: 0; border-radius: 50%; background: transparent; color: inherit; display: inline-flex; align-items: center; justify-content: center; }
.filter-chip button:hover { background: color-mix(in srgb, currentColor 15%, transparent); }
.filter-chip svg { width: 12px; height: 12px; }

/* ── Kennzeichen ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: var(--text-2xs); font-weight: var(--fw-semibold); line-height: 1.4; white-space: nowrap;
  background: var(--neutral-soft); color: var(--neutral);
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.is-success { background: var(--success-soft); color: var(--success); }
.badge.is-warning { background: var(--warning-soft); color: var(--warning); }
.badge.is-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge.is-info    { background: var(--info-soft);    color: var(--info); }
.badge.is-brand   { background: var(--surface-brand-soft); color: var(--text-brand); }
.badge.is-draft   { background: var(--color-draft-soft);  color: var(--color-draft); }
.badge.is-series  { background: var(--color-series-soft); color: var(--color-series); }
.badge.is-square  { border-radius: var(--radius-xs); }
.badge.is-neutral { background: var(--neutral-soft); color: var(--neutral); }
/* Kennung als Pill (Code einer Kategorie): Monospace */
.badge.is-code    { font-family: var(--font-mono); font-weight: var(--fw-regular); }
.badge-count {
  display: inline-flex; align-items: center; padding: 1px 7px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle); background: var(--surface-card); color: var(--text-body);
  font-family: var(--font-mono); font-size: var(--text-2xs); font-variant-numeric: tabular-nums;
}
button.badge-count { color: var(--text-link); cursor: pointer; }
button.badge-count:hover { border-color: var(--accent-blue); background: var(--accent-blue-soft); }
button.badge-count:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.badge > svg { width: 11px; height: 11px; }
/* Aufklappliste in einer Zelle (Auswahlwerte eines Parameters) */
details.cell-list > summary { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; list-style: none; color: var(--text-muted); user-select: none; }
details.cell-list > summary::-webkit-details-marker { display: none; }
details.cell-list > summary svg { width: 12px; height: 12px; transition: transform var(--duration-fast) var(--ease-standard); }
details.cell-list[open] > summary svg { transform: rotate(90deg); }
details.cell-list ul { margin: 4px 0 0; padding-left: 16px; font-size: var(--text-xs); line-height: 1.7; white-space: normal; }
/* Zwei Rollen tauschen (Parameter zusammenführen: MIN / MAX) */
.role-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.role-card { background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.role-card .role { font-size: var(--text-2xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.role-card.is-min .role { color: var(--success); }
.role-card.is-max .role { color: var(--text-link); }
.role-card .name { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-card .key { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-muted); }
/* Datei-Zeichen eines Datenblatts: Blatt mit Eselsohr und „PDF"; Farbe je Datenblatt (`--doc-color`, Daten) */
.doc-icon { position: relative; flex: none; display: inline-flex; align-items: flex-end; justify-content: center; width: 26px; height: 32px; padding-bottom: 5px; border-radius: var(--radius-xs); background: var(--doc-color, var(--danger)); color: var(--action-fg); font-size: 8px; font-weight: var(--fw-bold); letter-spacing: .02em; line-height: 1; }
.doc-icon::before { content: ''; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 7px 7px 0; border-color: transparent var(--surface-card) rgba(0, 0, 0, .18) transparent; }
.doc-icon.is-lg { width: 48px; height: 56px; padding-bottom: 9px; font-size: 11px; border-radius: var(--radius-sm); }
.doc-icon.is-lg::before { border-width: 0 11px 11px 0; }
/* Dokument-Kopf auf der Bearbeitungsseite: großes Zeichen, Name, Größe · Datum, Aktionen rechts */
.doc-preview { display: flex; align-items: center; gap: 14px; }
.doc-preview .doc-text { flex: 1; min-width: 0; }
.doc-preview .doc-name { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-preview .doc-meta { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.doc-preview .row-actions { flex: none; }
/* Farbwahl aus wenigen festen Farben (Icon-Farbe eines Datenblatts) */
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.swatch { width: 20px; height: 20px; border: 0; border-radius: 50%; padding: 0; cursor: pointer; background: var(--swatch); }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface-card), 0 0 0 4px var(--swatch); }
/* Zeichen wählen (04 → „Zeichen wählen“): Raster aus Icon-Knöpfen 36 × 36, gewählt in Markenfarbe */
.icon-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--surface-card); color: var(--text-muted); cursor: pointer; }
.icon-pick svg { width: 20px; height: 20px; }
.icon-pick:hover { background: var(--surface-sunken); color: var(--text-body); }
.icon-pick[aria-checked="true"] { border-color: var(--border-brand); background: var(--surface-brand-soft); color: var(--text-brand); }
.icon-pick:focus-visible { outline: 2px solid var(--border-brand); outline-offset: 1px; }
.doc-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.doc-cell .doc-text { min-width: 0; }
.doc-cell .doc-title { display: flex; align-items: center; gap: 6px; }
/* Zustand der KI-Analyse als Zeichen (robot): erledigt grün, offen/veraltet orange */
.ai-state { display: inline-flex; width: 18px; height: 18px; }
.ai-state.is-done { color: var(--success); }
.ai-state.is-open { color: var(--warning); }
.badge-fields {
  display: inline-flex; align-items: stretch; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill); background: var(--surface-card); font-size: var(--text-2xs); overflow: hidden;
}
.badge-fields > span { padding: 3px 10px; border-left: 1px solid var(--border-subtle); color: var(--text-body); font-weight: var(--fw-medium); white-space: nowrap; }
.badge-fields > span:first-child { border-left: 0; }
.badge-fields .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: var(--fw-regular); color: var(--text-strong); }

.facts { display: flex; flex-wrap: wrap; gap: 6px; }
.fact { min-width: 132px; padding: 6px 10px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); }
.fact .k { height: 16px; display: flex; align-items: center; justify-content: space-between; font-size: var(--text-2xs); color: var(--text-subtle); }
.fact .v { height: 22px; display: flex; align-items: center; font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--text-strong); white-space: nowrap; }
.fact .v.mono { font-family: var(--font-mono); }

/* ── Kategorie-Kachel ────────────────────────────────────────────────────── */
.tile-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); grid-auto-rows: max-content; /* Reihen nie stauchen — die Kachel schneidet sonst ab */ gap: 16px; align-content: start; padding: 16px; overflow: auto; }
.tile {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); background: var(--surface-card); box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tile::before { content: ""; position: absolute; z-index: 1; top: 0; left: 0; right: 0; height: 3px; background: var(--surface-brand); opacity: 0; transition: opacity .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-default); }
.tile:hover::before { opacity: 1; }
.tile-main { display: flex; flex-direction: column; width: 100%; padding: 0; border: 0; background: none; font: inherit; text-align: left; color: var(--text-strong); cursor: pointer; }
.tile-media { position: relative; display: flex; align-items: center; justify-content: center; height: 140px; overflow: hidden; background: var(--surface-sunken); }
.tile-media img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.tile-media > svg { width: 40px; height: 40px; color: var(--border-default); }
.tile-head { display: flex; align-items: center; gap: 6px; padding: 14px 16px 0; }
.tile-head .tile-title { flex: 1; min-width: 0; font-family: var(--font-display); font-size: var(--text-sm); font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-head > svg { flex: none; width: 16px; height: 16px; color: var(--text-subtle); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; }
.tile:hover .tile-head > svg { opacity: 1; transform: none; }
.tile-pills { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 16px 0; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.tile-pill {
  max-width: 100%; padding: 2px 7px; border: 1px solid var(--border-subtle); border-radius: var(--radius-xs); background: var(--surface-page);
  font: inherit; font-size: var(--text-2xs); color: var(--text-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
}
.tile-pill:hover { border-color: var(--border-brand); color: var(--text-brand); }
.tile-pill .num { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tile-pill .num .sep { margin: 0 2px; opacity: .5; }
.tile-pill .num .is-warning { color: var(--warning); font-weight: var(--fw-semibold); }
.tile-pill .num .is-danger { color: var(--danger); font-weight: var(--fw-semibold); }
.tile-head .badge, .tile-head .badge-count { flex: none; }
.tile-more { align-self: center; padding: 2px 4px; border: 0; background: none; font: inherit; font-size: var(--text-2xs); color: var(--text-subtle); cursor: pointer; }
.tile-more:hover { color: var(--text-brand); }

/* ── Suchkopf der Bauteilbibliothek (04 → „Suchkopf", 13.11.2026) ─────────── */
.search-head { display: flex; flex-direction: column; gap: 0; }
.search-head-bar { position: relative; padding: 14px 16px; }
/* wie im Altstand: dauerhaft im Akzent umrandet, mit weichem Ring (im Bestand blau → .tone-blue) */
.search-group {
  display: flex; align-items: stretch; height: 44px; background: var(--surface-card);
  border: 2px solid var(--border-brand); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 0 0 4px var(--surface-brand-soft);
  transition: box-shadow var(--duration-fast);
}
.search-group:focus-within { box-shadow: var(--shadow-focus); }
.search-group .search { min-width: 0; }
.search-group .search .input { height: 100%; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: var(--text-sm); padding-left: 34px; }
.search-group .search > svg { left: 12px; width: 16px; height: 16px; }
.search-group > .btn { height: auto; border-radius: 0; padding: 0 20px; font-size: var(--text-sm); }
.scope-btn {
  display: flex; align-items: center; gap: 7px; max-width: 240px; padding: 0 10px 0 8px; border: 0;
  border-right: 1px solid var(--border-subtle); background: var(--surface-brand-soft); color: var(--text-brand);
  font: inherit; font-size: var(--text-sm); font-weight: var(--fw-semibold); white-space: nowrap; cursor: pointer;
}
.scope-btn:hover { filter: brightness(0.97); }
.scope-btn .label { overflow: hidden; text-overflow: ellipsis; }
.scope-btn > svg { width: 16px; height: 16px; flex: none; }
.scope-btn > svg:last-child { width: 14px; height: 14px; opacity: 0.7; transition: transform var(--duration-fast); }
.scope-btn[aria-expanded="true"] > svg:last-child { transform: rotate(180deg); }
.scope-btn img { width: 22px; height: 22px; flex: none; border-radius: var(--radius-xs); object-fit: cover; }

/* Bereichsauswahl: Menü mit Ebenen, die seitlich einschieben */
.drill-menu { width: 380px; display: flex; flex-direction: column; }
.drill-viewport { position: relative; overflow: hidden; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.drill-panel { display: flex; flex-direction: column; min-height: 0; flex: 1; transition: transform var(--duration-base) var(--ease-standard), opacity var(--duration-base); }
.drill-panel.is-entering { transform: translateX(100%); opacity: 0; }
.drill-panel.is-entering-back { transform: translateX(-30%); opacity: 0; }
.drill-list { flex: 1; min-height: 0; overflow-y: auto; }
.drill-head { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-bottom: 1px solid var(--border-subtle); background: var(--surface-sunken); }
.drill-back { width: 24px; height: 24px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-xs); background: var(--surface-brand-soft); color: var(--text-brand); cursor: pointer; }
.drill-back svg { width: 14px; height: 14px; }
/* „/“ springt zur ersten Ebene — Text statt Zeichen, steht vor dem Zurück-Knopf */
.drill-back.is-root { font: inherit; font-size: var(--text-sm); font-weight: var(--fw-semibold); line-height: 1; }
.drill-back.is-root + .drill-back { margin-left: -5px; }
.drill-head .drill-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 2px 4px; margin: -2px -4px; border: 0; border-radius: var(--radius-xs); background: transparent; font: inherit; font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); text-align: left; cursor: pointer; }
.drill-head .drill-pick:hover { color: var(--text-brand); }
.drill-head .drill-pick .name, .drill-menu .menu-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drill-thumb { width: 30px; height: 30px; flex: none; border-radius: var(--radius-xs); border: 1px solid var(--border-subtle); background: var(--surface-field); object-fit: cover; display: inline-flex; align-items: center; justify-content: center; color: var(--text-subtle); }
.drill-thumb svg { width: 16px; height: 16px; }
.drill-thumb.is-all { background: var(--surface-brand); border-color: transparent; color: var(--text-on-brand); }
.drill-menu .menu-item .drill-thumb.is-all svg { color: var(--text-on-brand); } /* gegen .menu-item svg */
.drill-menu .menu-item { padding: 8px 12px; gap: 10px; font-size: var(--text-sm); }
.drill-menu .badge-count { font-size: var(--text-xs); }
.drill-menu .menu-item .badge-count { flex: none; }
.drill-menu .menu-item > svg:last-child { width: 14px; height: 14px; }

/* Suchverlauf unter dem Suchfeld */
.history-menu { width: 100%; }
.history-menu .menu-group { display: flex; align-items: center; gap: 6px; }
.history-menu .menu-group svg { width: 12px; height: 12px; }
.history-menu .menu-group button { margin-left: auto; border: 0; background: transparent; padding: 0; font: inherit; text-transform: none; letter-spacing: 0; font-size: var(--text-xs); color: var(--text-brand); cursor: pointer; }
.history-menu .menu-item { cursor: pointer; padding: 8px 12px; font-size: var(--text-sm); }
.history-menu .menu-item .term { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-menu .menu-item .icon-btn { width: 22px; height: 22px; margin: -3px -4px -3px 0; }
.history-menu .menu-item .icon-btn svg { width: 12px; height: 12px; }

/* Filterleiste unter dem Suchfeld (nur mit gewählter Kategorie) */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 16px 12px; border-top: 1px solid var(--border-subtle); }
.filter-bar > .lbl { font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-muted); margin-right: 2px; }
.filter-bar > .spacer { flex: 1; }
.filter-chip > button:first-child { width: auto; height: auto; border-radius: 0; padding: 0; font: inherit; color: inherit; }
.filter-chip > button:first-child:hover { background: transparent; text-decoration: underline; text-underline-offset: 2px; }
.filter-chip.is-pending { background: var(--surface-card); box-shadow: inset 0 0 0 1px var(--border-brand); color: var(--text-muted); }
.filter-add {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border: 1px dashed var(--border-default);
  border-radius: var(--radius-pill); background: transparent; font: inherit; font-size: var(--text-2xs); font-weight: var(--fw-medium);
  color: var(--text-muted); cursor: pointer;
}
.filter-add:hover, .filter-add[aria-expanded="true"] { border-color: var(--border-brand); color: var(--text-brand); }
.filter-add svg { width: 13px; height: 13px; }
.filter-toggle { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-pill); font-size: var(--text-2xs); color: var(--text-body); cursor: pointer; }
.filter-toggle:has(input:checked) { background: var(--surface-brand-soft); border-color: var(--border-brand); color: var(--text-brand); font-weight: var(--fw-semibold); }
.filter-toggle input { accent-color: var(--accent-blue); margin: 0; } /* Kontrollkästchen blau, 02 → Ausnahme */
.param-menu .menu-item .unit { margin-left: auto; font-size: var(--text-2xs); color: var(--text-subtle); }

/* Filterfenster am Chip */
.filter-pop { width: 290px; display: flex; flex-direction: column; }
.filter-pop-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--border-subtle); background: var(--surface-sunken); }
.filter-pop-head .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-strong); }
.filter-pop-head .segmented { flex: none; }
.filter-pop-head .segmented > button { height: 24px; padding: 0 7px; font-size: var(--text-2xs); }
.filter-pop-units { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 7px 12px; border-bottom: 1px solid var(--border-subtle); }
.filter-pop-units .lbl { font-size: var(--text-2xs); color: var(--text-muted); margin-right: 2px; }
.filter-pop-units .chip { height: 22px; min-width: 28px; padding: 0 6px; }
.filter-pop-body { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.filter-pop-row { display: flex; align-items: center; gap: 8px; }
.filter-pop-row .op { width: 26px; flex: none; text-align: right; font-size: var(--text-xs); font-weight: var(--fw-bold); color: var(--text-brand); }
.filter-pop-row .input { flex: 1; min-width: 0; font-family: var(--font-mono); }
.filter-pop-row .unit { min-width: 26px; flex: none; font-size: var(--text-2xs); font-weight: var(--fw-semibold); color: var(--text-muted); }
.filter-pop .menu-search { display: flex; }
.filter-pop .menu-search .search { min-width: 0; }
.value-list { flex: 1 1 auto; min-height: 0; max-height: 230px; overflow-y: auto; user-select: none; }
.value-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 12px 6px 9px; border: 0; border-left: 3px solid transparent;
  background: transparent; font: inherit; font-size: var(--text-xs); color: var(--text-body); text-align: left; cursor: pointer;
}
.value-item:hover { background: var(--surface-sunken); }
.value-item.is-selected { background: var(--surface-brand-soft); border-left-color: var(--border-brand); color: var(--text-brand); font-weight: var(--fw-semibold); }
.value-item .v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.value-item .v.is-num { font-family: var(--font-mono); }
.value-item .alias { margin-left: 4px; font-size: var(--text-2xs); font-weight: var(--fw-regular); color: var(--text-subtle); }
.value-item .n { flex: none; font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-muted); }
.value-item.is-selected .n { color: var(--text-brand); }
.value-item .logo { width: 34px; height: 20px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--text-subtle); }
.value-item .logo img { max-width: 34px; max-height: 20px; object-fit: contain; border-radius: var(--radius-xs); }
.value-item .logo svg { width: 14px; height: 14px; opacity: 0.5; }
.value-list .state-loading, .value-list .hint { display: block; padding: 14px; text-align: center; }
.filter-pop-foot { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border-subtle); background: var(--surface-sunken); }
.filter-pop-foot .hint { flex: 1; }
.filter-pop-foot .btn { height: 28px; padding: 0 12px; }

/* Treffer nach Kategorie (Suchtext ohne gewählte Kategorie) */
.cat-hits { flex: 1; min-height: 0; overflow: auto; }
.cat-hits-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 8px; font-size: var(--text-xs); color: var(--text-muted); }
.cat-hits-head b { font-size: var(--text-sm); color: var(--text-strong); }
.cat-hits-head .badge-count { margin-left: auto; }
.cat-hit { border-top: 1px solid var(--border-subtle); }
.cat-hit-main { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 16px; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.cat-hit-main:hover { background: var(--surface-sunken); }
.cat-hit-main .name { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.cat-hit-main:hover .name { color: var(--text-brand); }
.cat-hit-main > svg { margin-left: auto; width: 16px; height: 16px; color: var(--text-subtle); transition: transform var(--duration-fast); }
.cat-hit-main:hover > svg { transform: translateX(3px); color: var(--text-brand); }
.cat-hit-kids { display: flex; flex-wrap: wrap; gap: 2px 14px; padding: 0 16px 10px 54px; }
.cat-hit-kid { display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; border: 0; background: transparent; font: inherit; font-size: var(--text-xs); color: var(--text-link); cursor: pointer; }
.cat-hit-kid::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--text-subtle); }
.cat-hit-kid:hover { text-decoration: underline; text-underline-offset: 2px; }
.cat-hit-kid:hover::before { background: var(--text-link); }
.cat-hit-kid .n { color: var(--text-muted); }

/* Kopf der Ergebnisliste: Trefferzahl, Bereich, Suchtext; Reiter der Kategorien auf der Seite */
.results-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--border-subtle); font-size: var(--text-xs); color: var(--text-muted); }
.results-head b { font-size: var(--text-sm); color: var(--text-strong); }
.results-head .in { color: var(--text-brand); font-weight: var(--fw-semibold); }
.results-head .q { color: var(--text-body); font-style: italic; }
.cat-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 7px 16px; border-bottom: 1px solid var(--border-subtle); font-size: var(--text-2xs); color: var(--text-muted); }
.cat-tabs button { height: 22px; padding: 0 8px; border: 0; border-radius: var(--radius-xs); background: var(--surface-sunken); font: inherit; color: var(--text-body); cursor: pointer; }
.cat-tabs button:hover { color: var(--text-brand); }
.cat-tabs button.is-active { background: var(--surface-brand-soft); color: var(--text-brand); font-weight: var(--fw-semibold); }
.cat-tabs .hint { margin-left: 4px; }

/* Eingefrorene Spalten (Bauteil-Liste) — linker Versatz als Laufzeitwert --left am Element */
/* Eingefrorene Spalten (04 → „Eingefrorene Spalten“, Altstand .tbl-frozen-*): linker Versatz als
   Laufzeitwert --left am Element, gemessen an der Lage der Kopfzelle. Ebenen: Zelle 1 < Kopf 2 <
   eingefrorener Kopf 3 (die Ecke liegt über allem, was darunter durchrollt). */
.table th.is-frozen, .table td.is-frozen { position: sticky; left: var(--left, 0); }
.table td.is-frozen { z-index: 1; background: var(--surface-card); }
.table th.is-frozen { z-index: 3; }
.table tbody tr:hover td.is-frozen { background: var(--surface-sunken); }
.table tbody tr.is-selected td.is-frozen { background: var(--surface-brand-soft); }
/* Schatten an der letzten eingefrorenen Spalte erst, wenn waagrecht gerollt ist. Ein waagrechter
   Verlauf je Zelle statt box-shadow: er ändert sich nur von links nach rechts, die Stücke der Zeilen
   fügen sich so zu EINEM Streifen über die ganze Spalte (box-shadow läuft an jeder Zellkante aus).
   Die Zelle darf dafür nicht überlaufen abschneiden — gekürzt wird in einem inneren Element. */
.table .is-frozen-edge::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: -14px; width: 14px; pointer-events: none;
  background: linear-gradient(to right, var(--shadow-frozen), transparent);
  opacity: 0; transition: opacity var(--duration-fast);
}
.table-wrap.is-scrolled-x .table .is-frozen-edge::after { opacity: 1; }
.table .c-rowactions { width: 1%; white-space: nowrap; }
.table td.c-desc { max-width: 300px; min-width: 300px; }
.table td.c-desc > .clip { display: block; overflow: hidden; text-overflow: ellipsis; }
/* Bauteil-Liste: die Beschreibung bricht in der festen Breite um (wie im Altstand `.comp-desc`) */
.table td.c-desc.is-wrap { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
/* Name mit Unterzeile in einer schmalen Karte (z. B. Parameter einer Kategorie): bricht um, statt die Tabelle über die Karte zu schieben */
.table td.c-name.is-wrap { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.table td.c-namecol, .table th.c-namecol { min-width: 250px; max-width: 250px; }
.table td.c-namecol { overflow: hidden; text-overflow: ellipsis; }
/* Bildspalte der Bauteil-Liste wie im Altstand: 58 breit, ohne Innenabstand, Bild 50 × 50 mittig */
.table .c-img { width: 58px; min-width: 58px; max-width: 58px; padding: 0; text-align: center; }
.table td.c-img .thumb { display: flex; margin: 5px auto; }

/* Vorschaubild vergrößern beim Überfahren */
.thumb-zoom { position: fixed; z-index: var(--z-popover); padding: 8px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); pointer-events: none; }
.thumb-zoom img { display: block; width: 184px; height: 184px; object-fit: contain; }

/* Auswahl im Fuß der Liste (Altstand selection_dropdown): Sekundärknopf „Auswahl“ mit Pfeil nach oben,
   daneben „n/m markiert“; Menü öffnet nach oben, Gruppen „Aktuelle Seite“ / „Alle Seiten“ */
.sel-wrap { display: inline-flex; align-items: center; gap: 8px; }
.sel-btn .chev { width: 12px; height: 12px; opacity: 0.5; transition: transform var(--duration-fast); }
.sel-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.sel-count { font-size: var(--text-2xs); font-weight: var(--fw-semibold); color: var(--text-brand); white-space: nowrap; }
.sel-menu { min-width: 200px; }
.tile > :last-child { margin-bottom: 16px; }

/* ── Kennzahl ────────────────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 14px 16px;
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); color: inherit; text-decoration: none;
}
a.kpi:hover { border-color: var(--border-default); }
.kpi .k { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--text-muted); }
.kpi .k svg { width: 14px; height: 14px; flex: none; }
.kpi .v {
  font-size: var(--text-2xl); font-weight: var(--fw-bold); line-height: 1; color: var(--text-strong);
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi .hint { font-size: var(--text-2xs); color: var(--text-subtle); }
.kpi.is-warning .v, .kpi.is-warning .k svg { color: var(--warning); }
.kpi.is-danger .v, .kpi.is-danger .k svg { color: var(--danger); }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpis { grid-template-columns: minmax(0, 1fr); } }

/* ── Reiter ──────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; padding: 0 14px; background: var(--surface-card); border-bottom: 1px solid var(--border-subtle); overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border: 0; background: transparent;
  font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab svg { width: 16px; height: 16px; }
.tab .flag { font-size: var(--text-sm); line-height: 1; } /* Sprachreiter: Fahne vor dem Kürzel (Emoji wie im Altstand) */
/* Sprache in der Kopfzeile wie im Altstand: Fahne der aktuellen Sprache, Menü mit Fahne und Namen */
.lang-btn .flag { font-size: var(--text-lg); line-height: 1; }
.lang-menu { min-width: 150px; }
.lang-menu .flag { font-size: var(--text-base); line-height: 1; }
.tab:hover { color: var(--text-body); }
.tab.is-active { color: var(--text-brand); font-weight: var(--fw-semibold); border-bottom-color: var(--border-brand); }
.tab .count { height: 16px; padding: 0 6px; border-radius: var(--radius-pill); font-size: 10px; font-weight: var(--fw-semibold); display: inline-flex; align-items: center; background: var(--surface-sunken); color: var(--text-muted); }
.tab.is-active .count { background: var(--surface-brand-soft); color: var(--text-brand); }
.tab .dirty { width: 6px; height: 6px; border-radius: 50%; background: var(--text-brand); }
.tabs.is-level-2 { background: var(--surface-page); height: 36px; align-items: stretch; }
.tabs.is-level-2 .tab { padding: 0 16px; font-weight: var(--fw-regular); }
.tabs.is-level-2 .tab svg { width: 14px; height: 14px; }
.tabs.is-level-2 .tab.is-active { font-weight: var(--fw-medium); }

/* Bearbeitungsseite mit drei Spalten (Stammdaten, Altstand .cat-form-grid): je Spalte gestapelte Karten;
   unter 1100 zwei Spalten (die dritte darunter über die volle Breite), unter 700 eine */
.edit-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.edit-cols > .col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (max-width: 1100px) {
  .edit-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edit-cols > .col:nth-child(3) { grid-column: 1 / -1; }
}
/* zwei Spalten (Parameter, Altstand 1.15fr 1fr): Formular links etwas breiter */
.edit-cols.is-side { grid-template-columns: 360px minmax(0, 1fr); }
.edit-cols.is-2 { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
@media (max-width: 700px) { .edit-cols, .edit-cols.is-2, .edit-cols.is-side { grid-template-columns: minmax(0, 1fr); } }

/* ── Tabelle ─────────────────────────────────────────────────────────────── */
.table-wrap { flex: 1; overflow: auto; min-height: 0; }
/* Tabelle eine Stufe größer als die Arbeitsgröße (12.11.2026, Nutzer): Zellen 14, Kopf 11, Unterzeile 12 */
/* separate + Abstand 0 statt collapse: mit collapse malen Browser die Fläche klebender Zellen nicht
   über den ganzen Innenabstand — beim waagrechten Rollen scheint Inhalt durch (Altstand app.css).
   Kanten deshalb nur an Zellen, nie an Zeilen. */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--text-sm); }
.table th {
  position: sticky; top: 0; z-index: 1; padding: 8px 12px; text-align: left; white-space: nowrap;
  font-size: var(--text-2xs); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--table-header-fg); background: var(--table-header-bg); border-bottom: 1px solid var(--border-subtle);
}
.table td { padding: 9px 12px; color: var(--text-body); border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-sunken); }
.table tbody tr.is-selected td { background: var(--surface-brand-soft); }
.table .c-name { font-weight: var(--fw-medium); color: var(--text-strong); }
/* Parameter bearbeiten (Altstand `param-row`): Name auf eigener Fläche, Feld, Entfernen */
.param-list { display: flex; flex-direction: column; }
.param-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) 44px; min-height: 46px; border-bottom: 1px solid var(--border-subtle); }
.param-row > .label { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 9px 14px; background: var(--surface-sunken); border-right: 1px solid var(--border-subtle); min-width: 0; }
.param-row > .label .name { font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-strong); line-height: 1.35; overflow-wrap: anywhere; }
.param-row > .label .unit, .param-row > .label .from { font-size: var(--text-2xs); color: var(--text-muted); }
.param-row > .label .badge { width: fit-content; }
.param-row > .value { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 7px 12px; min-width: 0; }
.param-row > .remove { display: flex; align-items: center; justify-content: center; border-left: 1px solid var(--border-subtle); }
.param-group-head { padding: 8px 14px; font-size: var(--text-2xs); font-weight: var(--fw-semibold); color: var(--text-muted); background: var(--surface-sunken); border-bottom: 1px solid var(--border-subtle); }
.param-add { padding: 10px 14px; border-top: 1px solid var(--border-subtle); }
.param-list:empty + .param-add { border-top: 0; }
/* Wertetabelle (Name → Wert, ohne Kopfzeile): Name fett, beide Spalten brechen um */
.table.is-kv td { white-space: normal; }
.table.is-kv td.k { width: 40%; font-weight: var(--fw-semibold); color: var(--text-strong); }
.table .c-name a:hover { color: var(--text-brand); }
.table .c-id { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.table .c-mid { text-align: center; }
/* Spalte mit externem Link (Website von Hersteller/Lieferant): Adresse ohne Protokoll, gekürzt, Zeichen „extern" */
.table td.c-link { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.table td.c-link a { color: var(--text-link); }
.table td.c-link a:hover { text-decoration: underline; text-underline-offset: 2px; }
.table td.c-link a svg { width: 12px; height: 12px; margin-left: 4px; vertical-align: -1px; opacity: 0.6; }
/* nicht gesetztes Feld (Altstand): gedämpfter Halbgeviertstrich */
.table .c-empty { color: var(--text-subtle); }
.table .c-num { text-align: right; font-variant-numeric: tabular-nums; }
.table .c-sub { display: block; max-width: 360px; overflow: hidden; text-overflow: ellipsis; font-size: var(--text-xs); color: var(--text-muted); }
.table .c-actions { text-align: right; width: 1%; }
/* Optionen bleiben sichtbar, wenn die Tabelle waagrecht scrollt */
.table td.c-actions, .table th.c-actions { position: sticky; right: 0; }
.table td.c-actions { background: var(--surface-card); }
.table th.c-actions { z-index: 2; }
.table .c-check { width: 36px; }
.table th.is-sortable { cursor: pointer; user-select: none; }
.table th.is-sortable:hover { color: var(--text-body); }
.table th .sort-mark { width: 12px; height: 12px; vertical-align: -2px; margin-left: 4px; opacity: 0.35; transition: transform var(--duration-fast); }
/* Mehrzeiliger Kopf: der Text ist ein Block, das Sortierzeichen steht rechts daneben auf halber Höhe —
   nicht hinter der letzten Zeile */
.table th .th-label { display: inline-block; vertical-align: middle; }
.table th .th-label + .sort-mark { vertical-align: middle; }
.table th.is-sorted { color: var(--text-brand); }
.table th.is-sorted .sort-mark { opacity: 1; }
.table th.is-sorted[data-dir="down"] .sort-mark { transform: rotate(180deg); }
.yes { color: var(--success); } .no { color: var(--danger); }
.yes svg, .no svg { width: 16px; height: 16px; }
/* „Nein“ ohne Gefahr (19.11.2026, z. B. Mehrfachbelegung): gelb statt rot; geerbter Wert zurückgenommen */
.no.is-mild { color: var(--warning); }
.yes.is-inherited, .no.is-inherited { opacity: 0.5; }
.drag-handle { width: 24px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--text-subtle); cursor: grab; }
.drag-handle:hover { background: var(--surface-sunken); color: var(--text-muted); }
.drag-handle svg { width: 16px; height: 16px; }
button.drag-handle { border: 0; background: transparent; padding: 0; } /* als Knopf: per Tastatur bedienbar (↑/↓) */
.drag-handle:active { cursor: grabbing; }
.drag-handle:focus-visible { outline: 2px solid var(--border-brand); outline-offset: 1px; color: var(--text-brand); }
/* Reihenfolge ziehen (04 → „Reihenfolge ziehen“, nach BAERISsys): Griffspalte 36 breit in jeder Tabelle.
   Live-Umsortieren: die gezogene Zeile steht schon an ihrem neuen Platz, die übrigen rutschen per
   transform nach (180 ms, --ease-standard — gesetzt vom Baustein RowReorder). Gezogene Zeile blass auf
   Markenfläche. */
.table .c-grip { width: 36px; padding-left: 6px; padding-right: 0; }
.table tr.is-dragging { opacity: 0.45; }
.table tr.is-dragging > td { background: var(--surface-brand-soft); box-shadow: inset 0 1px 0 var(--border-brand), inset 0 -1px 0 var(--border-brand); }

/* Vorschaubild in Listen (04 → „Tabelle"): Logos, Bauformen, Kategorien */
.thumb { width: 28px; height: 28px; flex: none; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); background: var(--surface-field); object-fit: contain; display: inline-flex; align-items: center; justify-content: center; color: var(--text-subtle); vertical-align: middle; }
.thumb svg { width: 14px; height: 14px; }
.thumb-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.thumb.is-row { width: 50px; height: 50px; }
.thumb.is-row svg { width: 16px; height: 16px; }
.thumb.is-lg { width: 96px; height: 96px; border-radius: var(--radius-md); }
.thumb.is-lg svg { width: 32px; height: 32px; }

/* Baumtabelle (04 → „Baumtabelle"): Einrückung je Ebene über --level (am Element gesetzt) */
.table.is-tree .tree-cell { display: flex; align-items: center; gap: 6px; padding-left: calc(var(--level, 0) * 20px); }
.tree-toggle { width: 20px; height: 20px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; padding: 0; border-radius: var(--radius-xs); color: var(--text-muted); cursor: pointer; }
.tree-toggle:hover { background: var(--surface-sunken); color: var(--text-strong); }
.tree-toggle:focus-visible { outline: 2px solid var(--border-brand); outline-offset: 1px; }
.tree-toggle svg { width: 14px; height: 14px; transition: transform var(--duration-fast) var(--ease-standard); }
.tree-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.tree-leaf { width: 20px; flex: none; }
/* Zeichen vor dem Namen: Art des Eintrags (Lagerort-Typ), Farbe je Art über die Ton-Klassen */
.tree-icon { width: 16px; height: 16px; flex: none; color: var(--text-muted); }
.tree-icon.is-brand { color: var(--text-brand); }
.tree-icon.is-series { color: var(--color-series); }
.tree-icon.is-warning { color: var(--warning); }
.tree-icon.is-success { color: var(--success); }
.tree-icon.is-danger { color: var(--danger); }
.table.is-tree tr.is-slot .tree-icon { width: 14px; height: 14px; }
.table.is-tree .tree-cell .badge { flex: none; }
.table.is-tree tr.is-inactive td, .table.is-tree tr.is-inactive .c-name a { color: var(--text-muted); }
.table.is-tree tr.is-slot td { background: var(--surface-page); font-size: var(--text-xs); padding-top: 6px; padding-bottom: 6px; }
/* Plätze (Boden, Schublade, Fach, Reihe): keine eigene Fläche — Unterorte darunter stehen auf derselben Fläche (17.11.2026 Nutzer) */
.table.is-tree tr.is-slot.is-place td { background: none; }
.table.is-tree tr.is-slot .c-name { font-weight: var(--fw-regular); color: var(--text-body); }

/* ── Blätterleiste ───────────────────────────────────────────────────────── */
.pager { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-top: 1px solid var(--border-subtle); background: var(--surface-card); }
.pager .range { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }
.pager .spacer { flex: 1; }
.pager .segmented > button { min-width: 32px; justify-content: center; padding: 0 8px; font-variant-numeric: tabular-nums; }

/* ── Hinweisband ─────────────────────────────────────────────────────────── */
.banner {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle); font-size: var(--text-xs); color: var(--text-body); line-height: 1.5;
}
.banner > svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.banner b { color: var(--text-strong); margin-right: 4px; }
.banner .banner-body { flex: 1; }
.banner .icon-btn { margin: -6px -8px -6px 0; }
.banner.is-info    { background: var(--info-soft); }    .banner.is-info > svg    { color: var(--info); }
.banner.is-success { background: var(--success-soft); } .banner.is-success > svg { color: var(--success); }
.banner.is-warning { background: var(--warning-soft); } .banner.is-warning > svg { color: var(--warning); }
.banner.is-danger  { background: var(--danger-soft); }  .banner.is-danger > svg  { color: var(--danger); }

/* ── Laden, leer, Fehler ─────────────────────────────────────────────────── */
.state-loading { display: flex; align-items: center; gap: 8px; padding: 14px 16px; font-size: 13px; color: var(--text-muted); }
.state-loading svg { width: 14px; height: 14px; animation: cb-spin 900ms linear infinite; }
.state-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 16px; text-align: center; color: var(--text-muted); }
.state-empty > svg { width: 32px; height: 32px; color: var(--text-subtle); margin-bottom: 4px; }
.state-empty .what { font-size: 13px; color: var(--text-body); }
.state-empty.is-compact { padding: 20px 16px; }
.state-empty.is-compact > svg { width: 20px; height: 20px; }
.state-empty .how { font-size: var(--text-xs); }
.state-empty.is-success > svg { color: var(--success); width: 40px; height: 40px; }
.state-empty.is-success .what { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.state-empty .row-actions { margin-top: 10px; justify-content: center; }
.state-error { display: flex; gap: 10px; padding: 14px 16px; background: var(--danger-soft); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); font-size: var(--text-xs); color: var(--text-body); }
.state-error > svg { width: 18px; height: 18px; color: var(--danger); flex: none; }
.state-error b { display: block; color: var(--text-strong); }
.state-error .detail { opacity: 0.85; }
.state-error .retry { margin-top: 6px; border: 0; background: transparent; padding: 0; color: var(--text-brand); font-weight: var(--fw-semibold); font-size: var(--text-xs); }

/* ── Modal, Schublade, Rückfrage ─────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal {
  width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  background: var(--surface-card); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal.is-wide { width: min(720px, 100%); }
.modal.is-wide.is-xl { width: min(900px, 100%); } /* Auswahl mit vielen Spalten (Bauteile verknüpfen) */
/* Im Standardfenster (Innenbreite 488) füllt das Formular die Breite — sonst bliebe rechts ein Rand von 28 */
.modal:not(.is-wide) > .modal-body > .form-stack { max-width: none; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); }
.modal-head .title { flex: 1; font-family: var(--font-display); font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.modal-head .title .sub { display: block; font-family: var(--font-body); font-size: var(--text-2xs); font-weight: var(--fw-regular); color: var(--text-muted); }
.modal-body { padding: 14px 16px; font-size: var(--text-xs); line-height: 1.6; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border-subtle); background: var(--surface-page); }
.modal-foot .left { margin-right: auto; }

/* ── Versionshistorie (Fenster am Info-Knopf) — wie im Altstand (app.css → .cl-*) ── */
.cl-modal {
  width: 560px; max-width: 94vw; max-height: 84vh; display: flex; flex-direction: column;
  background: var(--surface-card); border-radius: 14px; box-shadow: var(--cl-shadow); overflow: hidden;
}
.cl-header { position: relative; overflow: hidden; flex: none; padding: 22px 22px 18px; background: var(--cl-head-bg); }
.cl-header::before, .cl-header::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
.cl-header::before { right: -30px; top: -30px; width: 120px; height: 120px; background: var(--cl-head-ring-1); }
.cl-header::after { right: 40px; bottom: -40px; width: 80px; height: 80px; background: var(--cl-head-ring-2); }
.cl-header-top { position: relative; display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.cl-wordmark { margin-bottom: 3px; font-size: 10.5px; font-weight: var(--fw-semibold); letter-spacing: 0.1em; text-transform: uppercase; color: var(--cl-wordmark); }
.cl-title { font-size: 19px; font-weight: var(--fw-bold); line-height: 1.1; letter-spacing: -0.02em; color: var(--cl-head-text); }
.cl-close {
  position: relative; width: 28px; height: 28px; flex: none; display: grid; place-items: center;
  border: 0; border-radius: 6px; background: var(--cl-head-close-bg); color: var(--cl-head-close-fg); cursor: pointer;
}
.cl-close svg { width: 14px; height: 14px; }
.cl-close:hover { background: var(--cl-head-close-bg-hover); color: var(--cl-head-text); }
.cl-close:focus-visible { outline: 2px solid var(--green-500); outline-offset: 1px; }
.cl-stats { position: relative; display: flex; align-items: center; gap: 18px; }
.cl-stat { display: flex; flex-direction: column; }
.cl-stat-value { font-size: 16px; font-weight: var(--fw-bold); line-height: 1; letter-spacing: -0.01em; color: var(--green-500); }
.cl-stat-value.is-small { font-size: 13px; letter-spacing: 0; }
.cl-stat-label { margin-top: 2px; font-size: 10px; color: var(--cl-head-muted); }
.cl-stat-divider { width: 1px; align-self: stretch; background: var(--cl-head-divider); }
.cl-body {
  flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px;
  scrollbar-width: thin; scrollbar-color: var(--cl-scrollbar) transparent;
}
.cl-body .state-empty, .cl-body .state-loading { padding: 32px 16px; }
.cl-card { flex: none; border: 1.5px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow 0.15s; }
.cl-card:hover { box-shadow: var(--cl-card-shadow); }
.cl-card.cl-latest { border-color: var(--green-500); }
.cl-card.cl-dev { border-color: var(--cl-dev); }
.cl-card-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 14px; border: 0; background: var(--cl-card-head-bg); font: inherit; text-align: left;
  cursor: pointer; user-select: none;
}
.cl-card-head:focus-visible { outline: 2px solid var(--border-brand); outline-offset: -2px; }
.cl-latest .cl-card-head { background: var(--cl-latest-head-bg); }
.cl-dev .cl-card-head { background: var(--cl-dev-head-bg); }
.cl-card-head-left { display: flex; align-items: center; gap: 9px; }
.cl-card-head-right { display: flex; align-items: center; gap: 8px; }
.cl-ver-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--cl-dot); }
.cl-latest .cl-ver-dot { background: var(--green-500); }
.cl-dev .cl-ver-dot { background: var(--cl-dev); }
.cl-ver-num { font-size: 12.5px; font-weight: var(--fw-semibold); color: var(--text-strong); }
.cl-latest-chip, .cl-dev-chip {
  padding: 2px 8px; border-radius: 20px; font-size: 9.5px; font-weight: var(--fw-semibold);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--white);
}
.cl-latest-chip { background: var(--green-500); }
.cl-dev-chip { background: var(--cl-dev); }
.cl-card-date { font-size: var(--text-2xs); color: var(--text-muted); }
.cl-type-pills { display: flex; align-items: center; gap: 4px; }
.cl-type-pill { width: 7px; height: 7px; flex: none; border-radius: 50%; }
.cl-tp-new { background: var(--cl-new-dot); }
.cl-tp-improve { background: var(--cl-improve-dot); }
.cl-tp-fix { background: var(--cl-fix-dot); }
.cl-tp-remove { background: var(--cl-remove-dot); }
.cl-chevron { width: 12px; height: 12px; color: var(--text-muted); transition: transform 0.2s; }
.cl-card-head[aria-expanded="true"] .cl-chevron { transform: rotate(180deg); }
/* aufgeklappt: zweispaltiges Raster Kennzeichen | Text */
.cl-card-body {
  display: grid; grid-template-columns: auto 1fr; align-items: start; row-gap: 5px; column-gap: 10px;
  padding: 12px 14px; border-top: 1px solid var(--border-subtle);
}
.cl-card-body[hidden] { display: none; }
.cl-entry { display: contents; }
.cl-entry > span:last-child { align-self: center; font-size: 12.5px; line-height: 1.45; color: var(--text-body); overflow-wrap: anywhere; }
.cl-badge {
  padding: 2px 7px; border-radius: var(--radius-xs); white-space: nowrap;
  font-size: 10px; font-weight: var(--fw-semibold); letter-spacing: 0.04em; text-transform: uppercase;
}
.cl-badge-new { background: var(--cl-new-bg); color: var(--cl-new-fg); }
.cl-badge-improve { background: var(--cl-improve-bg); color: var(--cl-improve-fg); }
.cl-badge-fix { background: var(--cl-fix-bg); color: var(--cl-fix-fg); }
.cl-badge-remove { background: var(--cl-remove-bg); color: var(--cl-remove-fg); }
.confirm-icon { width: 36px; height: 36px; border-radius: var(--radius-lg); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.confirm-icon svg { width: 18px; height: 18px; }
.confirm-icon.is-danger { background: var(--danger-soft); color: var(--danger); }
.confirm-icon.is-brand  { background: var(--surface-brand-soft); color: var(--text-brand); }
.keyword { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--fw-semibold); padding: 1px 6px; border-radius: var(--radius-xs); background: var(--danger-soft); color: var(--danger); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); z-index: var(--z-drawer);
  display: flex; flex-direction: column; background: var(--surface-card); box-shadow: var(--shadow-lg);
}

/* ── Fußleiste einer Bearbeiten-Seite ────────────────────────────────────── */
.edit-footer { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 14px; background: var(--surface-card); border-top: 1px solid var(--border-subtle); }
.edit-footer .danger-zone { margin-right: auto; }
.edit-footer .msg-error { margin-right: auto; color: var(--danger); font-size: var(--text-xs); }

/* ── Ablagefeld und Dateizeile ───────────────────────────────────────────── */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 20px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--border-default); border-radius: var(--radius-lg); background: var(--surface-sunken); color: var(--text-muted); font-size: var(--text-xs);
}
.dropzone > svg { width: 32px; height: 32px; color: var(--text-brand); }
.dropzone .em { color: var(--text-brand); font-weight: var(--fw-semibold); }
.dropzone .sub { font-size: var(--text-2xs); color: var(--text-subtle); }
.dropzone:hover, .dropzone.is-over { border-color: var(--border-brand); background: var(--surface-card); }
.dropzone.is-error { border-color: var(--danger); }
.file-row { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); font-size: var(--text-xs); }
.file-row > svg { width: 16px; height: 16px; color: var(--text-brand); flex: none; }
.file-row .name { flex: 1; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .size { font-family: var(--font-mono); color: var(--text-subtle); font-size: var(--text-2xs); }
/* Datei an einem Eintrag (Formular): Name als Link, Vorschau bei Bildern, Ziehen auch auf die gesetzte Datei */
.file-row a.name:hover { color: var(--text-brand); text-decoration: underline; text-underline-offset: 2px; }
.file-row .icon-btn { width: 26px; height: 26px; }
.file-row .icon-btn svg { width: 14px; height: 14px; }
.file-preview { display: block; width: 100%; max-height: 200px; object-fit: contain; padding: 8px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-field); }
.file-field.is-over .file-row, .file-field.is-over .file-preview { border-color: var(--border-brand); background: var(--surface-card); }
/* vorgemerkt (Bearbeitungsseite): gestrichelt im Akzent, bis „Speichern" übernimmt */
.file-row.is-pending { border-style: dashed; border-color: var(--border-brand); background: var(--surface-brand-soft); }
/* Textknopf in einem Hinweis („Rückgängig") */
.link-btn { display: inline-flex; align-items: center; gap: 3px; padding: 0; border: 0; background: none; font: inherit; color: var(--text-link); cursor: pointer; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 2px; }
.link-btn svg { width: 12px; height: 12px; }

/* ── Schritte (Assistent auf heller Fläche) ──────────────────────────────── */
.steps { display: flex; align-items: flex-start; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; font-size: var(--text-2xs); font-weight: var(--fw-medium); color: var(--text-muted); }
.step::before { content: ''; position: absolute; top: 13px; left: calc(-50% + 17px); right: calc(50% + 17px); height: 2px; background: var(--border-default); }
.step:first-child::before { display: none; }
.step .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border-default); background: var(--surface-card); display: inline-flex; align-items: center; justify-content: center; font-weight: var(--fw-bold); color: var(--text-muted); z-index: 1; }
.step.is-done .dot { background: var(--action-bg); border-color: var(--action-bg); color: var(--action-fg); cursor: pointer; }
.step.is-done::before, .step.is-current::before { background: var(--action-bg); }
.step.is-current .dot { background: var(--action-bg); border-color: var(--action-bg); color: var(--action-fg); box-shadow: 0 0 0 5px var(--surface-brand-soft); }
.step.is-current { color: var(--text-strong); }
.step .dot svg { width: 14px; height: 14px; stroke-width: 3; }

/* ── Tooltip und Hinweis-Popup ───────────────────────────────────────────── */
.tooltip { position: fixed; z-index: var(--z-popover); max-width: 280px; padding: 5px 8px; border-radius: var(--radius-xs); background: var(--surface-inverse); color: var(--text-inverse); font-size: var(--text-2xs); line-height: 1.4; box-shadow: var(--shadow-md); }
.info-btn { width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--text-link); display: inline-flex; align-items: center; justify-content: center; }
.info-btn:hover, .info-btn[aria-expanded="true"] { background: var(--surface-brand-soft); color: var(--text-brand); }
.info-btn svg { width: 16px; height: 16px; }
.popover { max-width: 380px; padding: 12px 14px; background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); font-size: var(--text-xs); line-height: 1.5; z-index: var(--z-popover); }
.popover-head { display: flex; align-items: center; gap: 6px; font-weight: var(--fw-semibold); color: var(--text-strong); margin-bottom: 4px; }
.popover-head svg { width: 16px; height: 16px; color: var(--info); }
/* Inhalt eines Hinweis-Popups zu einem Eintrag: Unterzeile, Liste „Bezeichnung: Wert", Fußzeile */
.popover-sub { color: var(--text-muted); font-size: var(--text-2xs); margin-bottom: 6px; }
.popover-list { display: flex; flex-direction: column; gap: 2px; margin: 0; color: var(--text-muted); }
.popover-list b { font-weight: var(--fw-regular); color: var(--text-body); }
.popover-foot { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border-subtle); color: var(--text-body); }
.popover-foot b { color: var(--text-strong); }
/* Text mit Hinweis-Knopf dahinter (Bauteilname im Slot) */
.inline-info { display: inline-flex; align-items: center; gap: 4px; }

/* ── Meldung (Toast) ─────────────────────────────────────────────────────── */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: flex-start; gap: 10px; min-width: 260px; max-width: 380px; padding: 10px 8px 10px 12px;
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-left-width: 3px; border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); font-size: var(--text-xs); color: var(--text-body);
}
.toast > svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.toast .toast-body { flex: 1; }
.toast b { display: block; color: var(--text-strong); }
.toast .icon-btn { width: 24px; height: 24px; }
.toast.is-success { border-left-color: var(--success); } .toast.is-success > svg { color: var(--success); }
.toast.is-danger  { border-left-color: var(--danger); }  .toast.is-danger > svg  { color: var(--danger); }
.toast.is-info    { border-left-color: var(--info); }    .toast.is-info > svg    { color: var(--info); }

/* ── Fortschritt ─────────────────────────────────────────────────────────── */
.progress { height: 6px; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--action-bg); border-radius: inherit; }

/* ── Hilfen ──────────────────────────────────────────────────────────────── */
.mono { font-family: var(--font-mono); }
.only-dark { display: none; }
[data-theme="dark"] .only-dark { display: revert; }
[data-theme="dark"] .only-light { display: none; }
.muted { color: var(--text-muted); }
.link { color: var(--text-link); text-decoration: underline; text-underline-offset: 2px; }
.spin { animation: cb-spin 900ms linear infinite; }
@keyframes cb-spin { to { transform: rotate(360deg); } }

/* ── Änderungshistorie (Karte, Altstand audit_history_card) ─────────────── */
.audit-list { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; }
.audit-row { display: flex; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--border-subtle); }
.audit-row:first-child { border-top: 0; }
.audit-avatar { width: 26px; height: 26px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-sunken); color: var(--text-muted); font-size: 10px; font-weight: var(--fw-semibold); }
.audit-avatar svg { width: 12px; height: 12px; }
.audit-body { flex: 1; min-width: 0; }
.audit-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--text-xs); }
.audit-meta .who { color: var(--text-strong); font-weight: var(--fw-medium); }
.audit-meta .when { margin-left: auto; font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-subtle); }
.audit-diff { margin-top: 4px; font-size: var(--text-2xs); }
.audit-diff summary { cursor: pointer; color: var(--text-link); }
.audit-diff-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; padding: 3px 0 0 12px; }
.audit-diff-row .field { color: var(--text-muted); font-weight: var(--fw-semibold); }
.audit-diff-row .old { color: var(--text-subtle); text-decoration: line-through; overflow-wrap: anywhere; }
.audit-diff-row .arrow { color: var(--text-subtle); }
.audit-diff-row .new { color: var(--text-strong); overflow-wrap: anywhere; }

/* ── Mehrfachauswahl im Fenster (Parameter einer Kategorie hinzufügen) ──── */
.pick-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pick-head .search { flex: 1; }
.pick-list { max-height: 420px; overflow-y: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--border-subtle); font-size: var(--text-xs); cursor: pointer; }
.pick-item:last-child { border-bottom: 0; }
.pick-item:hover { background: var(--surface-sunken); }
.pick-item.is-selected { background: var(--accent-blue-soft); }
.pick-item .name { flex: 1; min-width: 0; color: var(--text-strong); font-weight: var(--fw-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-item .meta { flex: none; color: var(--text-muted); font-size: var(--text-2xs); }

/* ── Synonyme als Pills (Gehäuse-Liste, Altstand) ────────────────────────── */
.table td.c-aliases { white-space: normal; max-width: 220px; }
.alias-pill { display: inline-block; margin: 1px 4px 1px 0; padding: 1px 7px; border-radius: var(--radius-xs); border: 1px solid var(--border-subtle); background: var(--surface-sunken); font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-body); white-space: nowrap; }

/* ── 3D-Viewer (Fenster, Altstand stl3dViewer): dunkle Bühne, Bedienhinweis unten ─ */
.model-stage { position: relative; height: min(460px, 60vh); border-radius: var(--radius-md); overflow: hidden; background: var(--viewer-stage); }
.model-stage canvas { display: block; width: 100%; height: 100%; }
.model-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--viewer-fg); font-size: var(--text-xs); text-align: center; padding: 20px; }
.model-overlay svg { width: 28px; height: 28px; }
.model-overlay.is-error { color: var(--danger); }
.model-help { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); font-size: var(--text-2xs); color: var(--viewer-fg-muted); white-space: nowrap; pointer-events: none; }
.model-ext { margin-left: 4px; font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--fw-regular); color: var(--text-subtle); }

/* ── Vorschlag an Stammdaten (Bild/3D-Modell einer Bauform): übernehmen oder verwerfen ── */
.proposal-card { margin-bottom: 12px; border-color: var(--border-brand); box-shadow: 0 0 0 3px var(--surface-brand-soft); }
.proposal-card .card-header { gap: 8px; }
.proposal-card .proposal-icon { width: 18px; height: 18px; color: var(--text-brand); }
.proposal-card .card-header .when { margin-left: auto; font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-subtle); }
.proposal-body { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.proposal-image { width: 160px; height: 160px; flex: none; object-fit: contain; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-card); }
.proposal-image.is-empty { display: inline-flex; align-items: center; justify-content: center; font-size: var(--text-xs); color: var(--text-subtle); }
.proposal-info { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.proposal-info dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: var(--text-xs); }
.proposal-info dt { color: var(--text-muted); font-weight: var(--fw-semibold); }
.proposal-info dd { margin: 0; color: var(--text-body); overflow-wrap: anywhere; }
.proposal-info dd a { color: var(--text-link); }
.proposal-info dd a svg { width: 12px; height: 12px; margin-left: 4px; vertical-align: -1px; opacity: 0.6; }
.proposal-foot { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border-subtle); background: var(--surface-sunken); }
.proposal-foot .hint { flex: 1; }
/* Namensnennung (CC-BY-SA u. ä.): unter Bild/Modell und im 3D-Viewer */
.asset-credit { display: block; margin-top: 6px; }
.asset-credit a { color: var(--text-link); }
.model-credit { margin-right: auto; font-size: var(--text-2xs); color: var(--text-muted); }

/* ── Lizenzen und Quellen (Seite /licenses) ─────────────────────────────── */
.content.licenses { display: flex; flex-direction: column; gap: 12px; }
.licenses .lead { margin: 0; max-width: 760px; font-size: var(--text-sm); color: var(--text-body); }
.credit-block { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--border-subtle); font-size: var(--text-xs); color: var(--text-body); }
.credit-block:last-child { padding-bottom: 0; border-bottom: 0; }
.credit-block p { margin: 0; }
.credit-head { font-size: var(--text-sm); color: var(--text-strong); }
.credit-head a, .licenses td a { color: var(--text-link); }
.credit-head a svg, .licenses td a svg { width: 12px; height: 12px; margin-left: 4px; vertical-align: -1px; opacity: 0.6; }
.credit-block summary { cursor: pointer; color: var(--text-link); }
.credit-list { margin-top: 4px; font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-muted); }
.bom-card { max-height: 520px; }
.bom-card .card-header .badge-count { margin-left: 8px; }
/* Link im Fuß der Seitenleiste */
.sidebar-footer .version-licenses { display: inline-block; margin-top: 6px; font-size: var(--text-2xs); color: var(--sidebar-text); text-decoration: underline; text-underline-offset: 2px; }
.sidebar-footer .version-licenses:hover { color: var(--sidebar-text-hover); }

/* ── Lagervorlagen (15.11.2026, APP-042, Mockup app/mockups/settings_storage_templates.html) ───────── */
/* Platzvorschau: Fächer im Raster (Spaltenzahl als Laufzeitwert am Element) bzw. als Liste */
.place-preview { display: grid; gap: 4px; width: 100%; }
.place-preview .cell { height: 28px; display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-xs); background: var(--surface-page);
  font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-muted); white-space: nowrap; }
.place-preview.is-list { grid-template-columns: 1fr; }
.place-preview.is-list .cell { padding: 0 10px; font-family: var(--font-body); } /* volle Breite, Text mittig (17.11.2026 Nutzer) */
.place-preview + .hint { display: block; margin-top: 6px; }
/* Inhalt einer Vorlage: Anzahl · Vorlage · Entfernen */
.content-list { display: flex; flex-direction: column; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; }
.content-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 32px; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--border-subtle); }
.content-row:last-child { border-bottom: 0; }
.content-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--text-xs); color: var(--text-strong); }

/* ── Einteilung (16.11.2026, APP-044, Mockup app/mockups/storage_nesting_layout.html) ───────────── */
.layout-editor { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .layout-editor { grid-template-columns: 1fr; } }
.layout-side.form-stack, .layout-main.form-stack { max-width: none; }
.layout-head { display: flex; align-items: center; gap: 8px; }
/* Raster: linke Randspalte 20 (Zeilenbuchstabe, Schiene), Feldgröße 30; Spalten/Zeilen als Laufzeitwert */
.layout-canvas { --cell: 30px; display: grid; gap: 3px; padding: 10px; background: var(--surface-sunken); border-radius: var(--radius-md); width: 100%; overflow: auto; }
/* Spalten wachsen auf die volle Breite (mindestens --cell), Text im Platz mittig (17.11.2026 Nutzer) */
.layout-canvas .field-cell { width: auto; min-width: var(--cell); }
.layout-canvas .field-cell { width: var(--cell); height: var(--cell); border: 1px dashed var(--border-default); border-radius: var(--radius-xs); background: var(--surface-page); cursor: pointer; padding: 0; }
.layout-canvas .field-cell:hover:not(:disabled) { border-style: solid; border-color: var(--border-brand); background: var(--surface-brand-soft); }
.layout-canvas .field-cell.is-blocked { cursor: not-allowed; }
.layout-canvas .field-cell.is-blocked:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-soft); }
.layout-canvas .field-cell:disabled { cursor: default; }
.layout-canvas .insert { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; min-width: 0; padding: 0; overflow: hidden;
  border: 1px solid var(--border-strong); border-radius: var(--radius-xs); background: var(--surface-card); box-shadow: var(--shadow-sm);
  font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-strong); cursor: pointer; }
.layout-canvas .insert.is-used { background: var(--surface-brand-soft); border-color: var(--border-brand); color: var(--text-brand); }
.layout-canvas .insert.is-selected { outline: 2px solid var(--accent-blue); outline-offset: 1px; }
.layout-canvas .insert:focus-visible, .layout-canvas .field-cell:focus-visible { box-shadow: var(--shadow-focus); outline: none; }
.layout-canvas .rail { grid-column: 2 / -1; height: 0; border-top: 2px solid var(--border-strong); align-self: end; margin-bottom: -3px; z-index: 2; pointer-events: none; }
.layout-canvas .rail-toggle { grid-column: 1; align-self: end; justify-self: center; width: 18px; height: 12px; margin-bottom: -8px; z-index: 3; padding: 0;
  border: 1px dashed var(--border-default); border-radius: var(--radius-pill); background: var(--surface-card); cursor: pointer; }
.layout-canvas .rail-toggle[aria-pressed="true"] { border: 0; background: var(--border-strong); }
.layout-canvas .rail-toggle:hover:not(:disabled) { border-color: var(--border-brand); background: var(--surface-brand-soft); }
.layout-canvas .rail-toggle:focus-visible { box-shadow: var(--shadow-focus); outline: none; }
.layout-canvas .row-label { grid-column: 1; align-self: center; justify-self: center; font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-subtle); }
/* Größen zum Setzen: Chip mit Form der Größe */
.insert-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.insert-pick .chip { height: auto; min-height: 28px; padding: 4px 8px; gap: 8px; }
.insert-pick .chip:disabled { opacity: .45; cursor: not-allowed; }
.insert-pick .shape { display: inline-grid; gap: 1px; }
.insert-pick .shape i { width: 6px; height: 6px; background: currentColor; border-radius: 1px; opacity: .7; }
/* Lagerort bearbeiten (17.11.2026 Nutzer): links „Änderbar“, rechts „Angaben“ ohne Eingabefelder */
.edit-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 760px) { .edit-split { grid-template-columns: 1fr; } }
/* Begriff/Wert-Liste (dl) — eigener Name; `.facts` sind die Kennfelder (04 → „Kennfelder“) */
.fact-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: var(--text-sm); }
.fact-list dt { color: var(--text-muted); }
.fact-list dd { margin: 0; color: var(--text-strong); min-width: 0; overflow-wrap: anywhere; }
.facts-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.facts-head .pic { width: 64px; height: 64px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius-md); background: var(--surface-sunken); color: var(--text-muted); }
.facts-head .pic img { width: 100%; height: 100%; object-fit: cover; }
.facts-head .pic svg { width: 28px; height: 28px; }
.facts-head b { display: block; color: var(--text-strong); }
.facts-head span span { font-size: var(--text-xs); color: var(--text-muted); }
.card-title > svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; color: var(--text-muted); }
/* Einteilung umbauen: Kasten links, Ablage und neue Einsätze rechts */
.rebuild { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .rebuild { grid-template-columns: 1fr; } }
.rebuild .card + .card { margin-top: 12px; }
.target-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.layout-canvas .field-cell:disabled:hover { border-style: dashed; border-color: var(--border-default); background: var(--surface-page); }
.layout-canvas .insert { flex-direction: column; gap: 1px; padding: 2px; }
.layout-canvas .insert svg { width: 10px; height: 10px; margin-left: 2px; vertical-align: -1px; }
.layout-canvas .insert small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-sans); font-size: 9px; color: var(--text-muted); }
.layout-canvas .insert.is-moved { border-style: dashed; }
.sel-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 36px; margin-top: 10px; font-size: var(--text-xs); color: var(--text-muted); }
.sel-bar b { color: var(--text-strong); }
.tray { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.tray-item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; text-align: left; cursor: pointer;
  border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--surface-card); font: inherit; font-size: var(--text-xs); color: var(--text-body); }
.tray-item:hover { border-color: var(--border-brand); }
.tray-item.is-selected { outline: 2px solid var(--accent-blue); outline-offset: 1px; }
.tray-item .shape { display: inline-grid; gap: 1px; flex: none; }
.tray-item .shape i { width: 7px; height: 7px; border-radius: 1px; background: var(--border-strong); }
.tray-item.is-used .shape i { background: var(--border-brand); }
.tray-item b { display: block; color: var(--text-strong); font-weight: var(--fw-medium); }
.tray-item span span { color: var(--text-muted); }
.tray-empty { padding: 10px; text-align: center; font-size: var(--text-xs); color: var(--text-muted); border: 1px dashed var(--border-default); border-radius: var(--radius-md); }
.changes { margin: 0; padding-left: 18px; font-size: var(--text-xs); color: var(--text-body); }
.changes li { margin: 2px 0; }
.layout-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: var(--text-2xs); color: var(--text-muted); }
.layout-legend span { display: inline-flex; align-items: center; gap: 6px; }
.layout-legend i { width: 12px; height: 12px; border-radius: var(--radius-xs); border: 1px solid var(--border-strong); background: var(--surface-card); display: inline-block; }
.layout-legend i.is-used { background: var(--surface-brand-soft); border-color: var(--border-brand); }
.layout-legend i.is-free { border-style: dashed; border-color: var(--border-default); background: var(--surface-page); }

