/*
 * mXP UI – gemeinsames Aussehen aller Apps (ohne UI5), angelehnt an SAP Fiori Horizon und das mXP Corporate Design.
 * Werte entsprechen den Horizon-Theming-Parametern (sapBackgroundColor, sapField_…, sapList_…, sapButton_…);
 * Markenfarbe mXP-Primär #3B5E78. Hell/Dunkel nach Systemeinstellung oder data-theme am <html>.
 */
@font-face { font-family: "72"; font-weight: 400; font-display: swap; src: url("https://ui5.sap.com/1.136.23/resources/sap/ui/core/themes/sap_horizon/fonts/72-Regular.woff2") format("woff2"); }
@font-face { font-family: "72"; font-weight: 600; font-display: swap; src: url("https://ui5.sap.com/1.136.23/resources/sap/ui/core/themes/sap_horizon/fonts/72-Semibold.woff2") format("woff2"); }
@font-face { font-family: "72"; font-weight: 700; font-display: swap; src: url("https://ui5.sap.com/1.136.23/resources/sap/ui/core/themes/sap_horizon/fonts/72-Bold.woff2") format("woff2"); }

:root {
  --bg: #f5f6f7; --surface: #ffffff; --shell: #ffffff; --raised: #ffffff;
  --line: #e5e5e5; --line-strong: #d9d9d9; --field-border: #556b82; --field-bg: #ffffff; --field-ro: #f5f6f7;
  --text: #1d2d3e; --muted: #556b82; --label: #556b82; --placeholder: #556b82;
  --brand: #3B5E78; --brand-hover: #2F4B60; --brand-active: #26404F; --accent: #3B5E78;
  --brand-10: #EAF0F4; --brand-20: #DCE6EC; --brand-40: #AAC0CF; --brand-60: #7993A7;
  --lime: #BDCE33; --sage: #A1B977; --violet: #A5679C; --berry: #8F2E56; --coral: #E96070; --grey: #7E777C;
  --ok: #256f3a; --ok-bg: #f5fae5; --ok-line: #30914c;
  --warn: #b44f00; --warn-c: #e76500; --warn-bg: #fff8d6; --warn-line: #e76500;
  /* „bedingt machbar“ in Graphen: deutlich Orange/Bernstein, vom Fehler-Rot unterscheidbar */ --cond: #f29b00; --cond-bg: #fff4dc; --cond-text: #8a5300;
  --err: #aa0808; --err-bg: #ffeaf4; --err-line: #e90b0b;
  --info: #0064d9; --info-bg: #e1f4ff; --info-line: #0070f2;
  --hover: #eaecee; --active: #dee2e5; --sel: #EAF0F4; --sel-hover: #DCE6EC;
  --shadow0: 0 0 0.125rem 0 rgba(34,53,72,.15), 0 0.125rem 0.25rem 0 rgba(34,53,72,.15);
  --shadow1: 0 0 0.125rem 0 rgba(34,53,72,.15), 0 0.5rem 1rem 0 rgba(34,53,72,.15);
  --shadow2: 0 0 0.125rem 0 rgba(34,53,72,.2), 0 0.625rem 1.875rem 0 rgba(34,53,72,.25);
  --radius-s: 0.25rem; --radius: 0.5rem; --radius-l: 0.75rem; --radius-xl: 1rem;
  --font: "72", "72full", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shell-h: 3.25rem;
  /* Dichte (Branding in der App System bzw. persönlich im Benutzermenü): Höhe der Felder und Knöpfe, Abstand in Tabellenzeilen */
  --ctl-h: 2.25rem; --cell-py: 0.5rem; --row-h: 2.25rem; --tab-h: 2.75rem; --grid-row-h: 2.75rem; --field-py: 0.375rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12171c; --surface: #1d232a; --shell: #1d232a; --raised: #232b33;
    --line: #2f3c48; --line-strong: #39475a; --field-border: #8396a8; --field-bg: #1d232a; --field-ro: #232b33;
    --text: #f5f6f7; --muted: #a9b4be; --label: #a9b4be; --placeholder: #8396a8;
    --brand: #6f9bbd; --brand-hover: #85aecd; --brand-active: #9dc0dc; --accent: #9dc0dc;
    --brand-10: #22313d; --brand-20: #2b3d4b; --brand-40: #3e5a70; --brand-60: #6f9bbd;
    --ok: #a3d993; --ok-bg: #213b1d; --ok-line: #5dc122; --warn: #ffab5a; --warn-c: #ffab5a; --warn-bg: #3b2e14; --warn-line: #ff8b00; --cond: #ffb020; --cond-bg: #3b2e14; --cond-text: #ffc861;
    --err: #ff8888; --err-bg: #3d1a1a; --err-line: #ff5c77; --info: #4db1ff; --info-bg: #163a52; --info-line: #4db1ff;
    --hover: #29313a; --active: #333d47; --sel: #22313d; --sel-hover: #2b3d4b;
    --shadow0: 0 0 0.125rem 0 rgba(0,0,0,.6), 0 0.125rem 0.25rem 0 rgba(0,0,0,.6);
    --shadow1: 0 0.5rem 1rem 0 rgba(0,0,0,.6); --shadow2: 0 0.625rem 1.875rem 0 rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12171c; --surface: #1d232a; --shell: #1d232a; --raised: #232b33;
  --line: #2f3c48; --line-strong: #39475a; --field-border: #8396a8; --field-bg: #1d232a; --field-ro: #232b33;
  --text: #f5f6f7; --muted: #a9b4be; --label: #a9b4be; --placeholder: #8396a8;
  --brand: #6f9bbd; --brand-hover: #85aecd; --brand-active: #9dc0dc; --accent: #9dc0dc;
  --brand-10: #22313d; --brand-20: #2b3d4b; --brand-40: #3e5a70; --brand-60: #6f9bbd;
  --ok: #a3d993; --ok-bg: #213b1d; --ok-line: #5dc122; --warn: #ffab5a; --warn-c: #ffab5a; --warn-bg: #3b2e14; --warn-line: #ff8b00; --cond: #ffb020; --cond-bg: #3b2e14; --cond-text: #ffc861;
  --err: #ff8888; --err-bg: #3d1a1a; --err-line: #ff5c77; --info: #4db1ff; --info-bg: #163a52; --info-line: #4db1ff;
  --hover: #29313a; --active: #333d47; --sel: #22313d; --sel-hover: #2b3d4b;
  --shadow0: 0 0 0.125rem 0 rgba(0,0,0,.6), 0 0.125rem 0.25rem 0 rgba(0,0,0,.6);
  --shadow1: 0 0.5rem 1rem 0 rgba(0,0,0,.6); --shadow2: 0 0.625rem 1.875rem 0 rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font: 0.875rem/1.42 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.mx { display: flex; flex-direction: column; min-height: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
h1 { font-size: 1.25rem; } h2 { font-size: 1rem; } h3 { font-size: 0.875rem; }
code, .mono { font-family: var(--mono); font-size: 0.8125rem; }
.muted { color: var(--muted); }
.small { font-size: 0.75rem; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.row-flex { display: flex; align-items: center; gap: 0.5rem; }
.ic { width: 1rem; height: 1rem; fill: currentColor; flex: none; vertical-align: -0.1875rem; }
.ic.l { width: 1.5rem; height: 1.5rem; }
.ic.xl { width: 2rem; height: 2rem; }

/* ---------------------------------------------------------------- Schaltflächen (sap.m.Button) */
.btn, button.btn { font: inherit; font-weight: 600; font-size: 0.875rem; color: var(--accent); background: var(--surface); border: 1px solid #bcc3ca; border-radius: var(--radius); height: var(--ctl-h); padding: 0 0.75rem; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 0.375rem; }
.btn:hover { background: var(--hover); }
.btn:active { background: var(--active); }
.btn.emph { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.emph:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.emph:active { background: var(--brand-active); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.neg { color: var(--err); }
.btn.pos { color: var(--ok); }
.btn.icon { width: 2.25rem; padding: 0; justify-content: center; }
.btn.sm { height: 1.625rem; padding: 0 0.5rem; font-size: 0.8125rem; border-radius: 0.375rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: default; pointer-events: none; }
.btn:focus-visible, a:focus-visible, .focusable:focus-visible { outline: 0.125rem solid var(--brand); outline-offset: 0.0625rem; }
.seg { display: inline-flex; border: 1px solid #bcc3ca; border-radius: var(--radius); overflow: hidden; }
.seg > button { font: inherit; font-weight: 600; color: var(--accent); background: var(--surface); border: 0; border-right: 1px solid #bcc3ca; height: calc(var(--ctl-h) - 0.125rem); padding: 0 0.75rem; cursor: pointer; }
.seg > button:last-child { border-right: 0; }
.seg > button.on { background: var(--sel); box-shadow: inset 0 -0.125rem 0 var(--brand); }

/* ---------------------------------------------------------------- Eingabefelder (sap.m.Input/Select/TextArea) */
.inp, select.inp, textarea.inp { font: inherit; color: var(--text); background: var(--field-bg); border: 1px solid var(--field-border); border-radius: var(--radius-s); height: var(--ctl-h); padding: 0 0.625rem; min-width: 0; width: 100%; box-shadow: inset 0 -1px 0 transparent; }
textarea.inp { height: auto; min-height: 4.5rem; padding: 0.5rem 0.625rem; resize: vertical; line-height: 1.4; }
.inp:hover { background: #f5f6f7; border-color: var(--brand); }
:root[data-theme="dark"] .inp:hover { background: var(--raised); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .inp:hover { background: var(--raised); } }
.inp:focus { outline: 0.125rem solid var(--brand); outline-offset: -0.0625rem; border-color: var(--brand); }
.inp::placeholder { color: var(--placeholder); font-style: italic; }
.inp[readonly], .inp:disabled { background: var(--field-ro); border-color: transparent; border-bottom: 1px dashed var(--line-strong); border-radius: 0; color: var(--text); }
/* Auswahl nur über die Wertehilfe (UUID-Schlüssel mit Text): wie ein Eingabefeld darstellen */
.vh-wrap .inp.vh-only[readonly] { background: var(--field-bg); border: 1px solid var(--field-border); border-radius: var(--radius-s); cursor: pointer; }
.inp.state-error { border-color: var(--err-line); background: var(--err-bg); box-shadow: inset 0 -1px 0 var(--err-line); }
.inp.state-warning { border-color: var(--warn-line); background: var(--warn-bg); }
.inp.mono { font-family: var(--mono); }
.chk { width: 1.125rem; height: 1.125rem; accent-color: var(--brand); margin: 0; }
.switch { position: relative; display: inline-block; width: 2.5rem; height: 1.375rem; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #788fa6; border-radius: 1rem; transition: .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; height: 1rem; width: 1rem; left: 0.1875rem; top: 0.1875rem; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(1.125rem); }
.vh-wrap { position: relative; display: flex; }
.vh-wrap .inp { padding-right: 2.25rem; }
.vh-wrap .vh-btn { position: absolute; right: 1px; top: 1px; height: calc(100% - 2px); width: 2rem; border: 0; background: transparent; color: var(--accent); cursor: pointer; border-radius: 0 var(--radius-s) var(--radius-s) 0; display: flex; align-items: center; justify-content: center; }
.vh-wrap .vh-btn:hover { background: var(--hover); }
.field-text { color: var(--muted); font-size: 0.8125rem; margin-top: 0.125rem; }

/* ---------------------------------------------------------------- Shell-Leiste (sap.f.ShellBar) */
.shellbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 0.5rem; height: var(--shell-h); padding: 0 1rem 0 0.75rem; background: var(--shell); box-shadow: var(--shadow0); border-top: 0.1875rem solid var(--brand); }
.shellbar .logo { display: inline-flex; align-items: center; height: 2.5rem; padding: 0 0.5rem; border-radius: var(--radius); }
.shellbar .logo:hover { background: var(--brand-10); text-decoration: none; }
.shellbar .logo img { height: 1.625rem; display: block; }
.shellbar .title { font-size: 1rem; font-weight: 700; color: var(--text); padding: 0 0.25rem 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shellbar .title small { font-weight: 400; color: var(--muted); margin-left: 0.5rem; font-size: 0.875rem; }
.shellbar .search { flex: 1; max-width: 30rem; margin-left: auto; position: relative; }
.shellbar .search input { width: 100%; height: var(--ctl-h); border-radius: 1.125rem; border: 1px solid transparent; background: var(--bg); padding: 0 1rem 0 2.25rem; font: inherit; color: var(--text); }
.shellbar .search input:hover { border-color: var(--brand); }
.shellbar .search input:focus { outline: 0.125rem solid var(--brand); }
.shellbar .search .ic { position: absolute; left: 0.75rem; top: 0.625rem; color: var(--muted); }
.shellbar .actions { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; }
.shellbar .search + .actions { margin-left: 0.5rem; }
.bell { position: relative; }
.bell .bell-n { position: absolute; top: .125rem; right: .125rem; min-width: 1rem; height: 1rem; padding: 0 .25rem; border-radius: .5rem; background: var(--critical, #c0392b); color: #fff; font-size: .625rem; font-weight: 700; line-height: 1rem; text-align: center; }
.bell-list { max-height: 60vh; overflow: auto; min-width: 22rem; max-width: 28rem; }
.bell-item { display: flex !important; gap: .5rem; align-items: flex-start; white-space: normal !important; }
.bell-item .bi { flex: none; margin-top: .125rem; color: var(--muted); }
.bell-item .bt { display: flex; flex-direction: column; gap: .125rem; min-width: 0; }
.bell-item.unread { background: var(--bg); }
.bell-item.unread b::before { content: '●'; color: var(--brand); margin-right: .25rem; font-size: .625rem; vertical-align: middle; }
.avatar { width: 2rem; height: 2rem; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 0.8125rem; display: inline-flex; align-items: center; justify-content: center; border: 0; cursor: pointer; }
.avatar:hover { box-shadow: 0 0 0 0.1875rem var(--brand-20); }
.avatar.tech { background: var(--violet); }

/* ---------------------------------------------------------------- Menü / Popover / Dialog */
.popover { position: fixed; z-index: 60; background: var(--raised); border-radius: var(--radius-l); box-shadow: var(--shadow2); min-width: 14rem; max-width: 26rem; padding: 0.5rem 0; max-height: 70vh; overflow: auto; }
.popover .item { display: flex; gap: 0.625rem; align-items: center; padding: 0.5rem 1rem; cursor: pointer; color: var(--text); }
.popover .item:hover { background: var(--hover); text-decoration: none; }
.popover .sep { height: 1px; background: var(--line); margin: 0.375rem 0; }
.popover .head { padding: 0.5rem 1rem 0.75rem; border-bottom: 1px solid var(--line); margin-bottom: 0.375rem; }
.popover .look { padding: 0.25rem 1rem; display: grid; gap: 0.375rem; }
.popover .look-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.popover .look-ctl { display: inline-flex; align-items: center; gap: 0.375rem; }
.popover .look-ctl b { min-width: 3.5rem; text-align: center; font-weight: 600; }
.popover .look .btn, .popover .look .seg > button { height: 1.75rem; padding: 0 0.5rem; font-size: 0.8125rem; }
dialog.dlg { border: 0; padding: 0; border-radius: var(--radius-l); box-shadow: var(--shadow2); background: var(--raised); color: var(--text); width: min(40rem, 94vw); max-height: 88vh; display: flex; flex-direction: column; }
dialog.dlg:not([open]) { display: none; }
dialog.dlg.wide { width: min(64rem, 96vw); }
dialog.dlg::backdrop { background: rgba(29,45,62,.5); }
dialog.dlg > header { padding: 1rem 1.25rem 0.75rem; font-weight: 700; font-size: 1rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 0.5rem; }
dialog.dlg > .body { padding: 1rem 1.25rem; overflow: auto; flex: 1; }
dialog.dlg > footer { padding: 0.625rem 1.25rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 0.5rem; background: var(--surface); border-radius: 0 0 var(--radius-l) var(--radius-l); }

/* ---------------------------------------------------------------- Meldungen (MessageStrip, MessageToast, MessagePopover) */
.strip { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.5rem 0.75rem; border-radius: var(--radius); border: 1px solid; font-size: 0.875rem; }
.strip.info { background: var(--info-bg); border-color: var(--info-line); }
.strip.ok { background: var(--ok-bg); border-color: var(--ok-line); }
.strip.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.strip.err { background: var(--err-bg); border-color: var(--err-line); }
.strip .ic { margin-top: 0.125rem; }
.strip.info .ic { color: var(--info); } .strip.ok .ic { color: var(--ok); } .strip.warn .ic { color: var(--warn-c); } .strip.err .ic { color: var(--err); }
.toasts { position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 0.5rem; align-items: center; pointer-events: none; }
.toast { background: rgba(29,45,62,.92); color: #fff; padding: 0.75rem 1.25rem; border-radius: var(--radius); box-shadow: var(--shadow1); max-width: 36rem; pointer-events: auto; }
.toast.err { background: #aa0808; }
.msgbtn { position: relative; }
.msgbtn .count { position: absolute; top: 0.125rem; right: 0.125rem; min-width: 1rem; height: 1rem; border-radius: 0.5rem; background: var(--err-line); color: #fff; font-size: 0.6875rem; display: flex; align-items: center; justify-content: center; padding: 0 0.25rem; }
.msglist .msg { display: flex; gap: 0.625rem; padding: 0.625rem 1rem; border-bottom: 1px solid var(--line); }
.msglist .msg:last-child { border-bottom: 0; }
.sev-error { color: var(--err); } .sev-warning { color: var(--warn-c); } .sev-info { color: var(--info); } .sev-success { color: var(--ok); }

/* ---------------------------------------------------------------- Status, Badges, Chips (ObjectStatus, Token) */
.status { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 600; font-size: 0.8125rem; white-space: nowrap; }
.status.s1 { color: var(--err); } .status.s2 { color: var(--warn-c); } .status.s3 { color: var(--ok); } .status.s5 { color: var(--info); } .status.s0 { color: var(--muted); }
.badge { display: inline-flex; align-items: center; height: 1.375rem; padding: 0 0.5rem; border-radius: 0.6875rem; font-size: 0.75rem; font-weight: 600; background: var(--hover); color: var(--text); white-space: nowrap; }
.badge.s1 { background: var(--err-bg); color: var(--err); } .badge.s2 { background: var(--warn-bg); color: var(--warn); } .badge.s3 { background: var(--ok-bg); color: var(--ok); } .badge.s5 { background: var(--info-bg); color: var(--info); }
.badge.brand { background: var(--brand-10); color: var(--brand); }
.token { display: inline-flex; align-items: center; gap: 0.25rem; height: 1.5rem; padding: 0 0.5rem; border: 1px solid var(--line-strong); border-radius: 0.375rem; background: var(--surface); font-size: 0.8125rem; }
.kind { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; height: 1.5rem; border-radius: 0.375rem; font-size: 0.6875rem; font-weight: 700; color: #fff; padding: 0 0.25rem; background: var(--grey); }
.kind.format { background: var(--grey); } .kind.codelist { background: var(--sage); } .kind.attribute { background: var(--brand-60); } .kind.group { background: var(--brand-40); color: var(--text); }
.kind.nodeType { background: var(--brand); } .kind.specType { background: var(--berry); } .kind.rule { background: var(--violet); } .kind.table { background: var(--coral); } .kind.function { background: #6b4fa0; } .kind.readView { background: #5a7f8f; } .kind.values, .kind.objects { background: var(--line-strong); color: var(--text); }
.kind.hook { background: #2f7a6b; } .kind.profile, .kind.task { background: #8a5a2b; } .kind.dependencyTable { background: #b0563f; } .kind.accessLayer, .kind.view, .kind.link, .kind.extension { background: #4a6a8a; }

/* ---------------------------------------------------------------- Seite (DynamicPage / ObjectPage) */
.page { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.page-head { background: var(--surface); padding: 1rem 2rem 0; box-shadow: var(--shadow0); position: sticky; top: var(--shell-h); z-index: 20; }
.page-head .crumbs { font-size: 0.8125rem; color: var(--muted); margin-bottom: 0.25rem; display: flex; gap: 0.375rem; flex-wrap: wrap; }
.page-head .crumbs a { color: var(--accent); }
.page-head .titlebar { display: flex; align-items: center; gap: 1rem; min-height: 2.5rem; }
.page-head .titlebar h1 { font-size: 1.25rem; }
.page-head .titlebar .sub { color: var(--muted); font-size: 0.875rem; }
.page-head .titlebar .toolbar { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.page-head .kpis { display: flex; gap: 2rem; padding: 0.75rem 0 0.25rem; flex-wrap: wrap; }
.page-head .kpi .l { font-size: 0.75rem; color: var(--label); }
.page-head .kpi .v { font-size: 1rem; font-weight: 600; }
.anchors { display: flex; gap: 0.25rem; margin-top: 0.5rem; overflow-x: auto; }
.anchors a { padding: 0.625rem 0.75rem; color: var(--text); font-weight: 400; border-bottom: 0.1875rem solid transparent; white-space: nowrap; }
.anchors a:hover { color: var(--brand); text-decoration: none; }
.anchors a.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.page-head .tabs { margin-top: 0.5rem; }
.page-body { padding: 1rem 2rem 6rem; display: flex; flex-direction: column; gap: 1rem; }
.page-foot { position: sticky; bottom: 0; z-index: 25; display: flex; gap: 0.5rem; justify-content: flex-end; align-items: center; padding: 0.5rem 2rem; background: var(--surface); box-shadow: 0 -0.125rem 0.25rem rgba(34,53,72,.12); }
.page-foot .left { margin-right: auto; display: flex; gap: 0.5rem; align-items: center; }
.card { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow0); }
.section { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow0); padding: 1rem 1.25rem 1.25rem; scroll-margin-top: calc(var(--shell-h) + var(--mx-head-h, 8.75rem) + 0.75rem); }
.section > h2 { font-size: 1rem; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.section > h2 .toolbar { margin-left: auto; display: flex; gap: 0.375rem; }
.subsection + .subsection { margin-top: 1.25rem; }
.subsection > h3 { font-size: 0.875rem; color: var(--text); margin-bottom: 0.625rem; }
.draft-badge { color: var(--brand); font-weight: 600; font-size: 0.8125rem; display: inline-flex; gap: 0.25rem; align-items: center; }

/* Formular (SimpleForm / Form, Beschriftung oben) */
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.875rem 1.5rem; }
.form .f { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.form .f.wide { grid-column: 1 / -1; }
.form label, .lbl { font-size: 0.8125rem; color: var(--label); display: flex; gap: 0.25rem; }
.form label .req { color: var(--err); }
.form .v { min-height: 1.5rem; word-break: break-word; }
.form .v.empty { color: var(--muted); }
.form .msg { font-size: 0.75rem; }
pre.pre { margin: 0; font-family: var(--mono); font-size: 0.8125rem; white-space: pre; overflow: auto; background: var(--bg); padding: 0.75rem; border-radius: var(--radius); max-height: 36rem; }

/* ---------------------------------------------------------------- Filterleiste (FilterBar) */
.filterbar { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: flex-end; padding: 0.75rem 0 1rem; }
.filterbar .f { display: flex; flex-direction: column; gap: 0.25rem; width: 13rem; }
.filterbar .f.search { width: 18rem; }
.filterbar .go { display: flex; gap: 0.5rem; margin-left: auto; }

/* ---------------------------------------------------------------- Tabelle (sap.m.Table / ResponsiveTable) */
/* overflow-x: auto statt hidden – breite Tabellen ohne eigenes .tbl-scroll (z. B. Nachrichtenliste im Integrationsmonitor)
   werden sonst rechts abgeschnitten; die runden Ecken schneidet auto ebenso zu */
.tbl-wrap { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow0); overflow-x: auto; overflow-y: hidden; }
.section .tbl-wrap { box-shadow: none; border: 1px solid var(--line); border-radius: var(--radius); }
.tbl-bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.625rem 1rem; border-bottom: 1px solid var(--line); min-height: 3rem; }
.tbl-bar h3 { font-size: 0.875rem; }
.tbl-bar .toolbar { margin-left: auto; display: flex; gap: 0.375rem; align-items: center; }
.tbl-bar .open-in { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; color: var(--muted); margin-right: 0.5rem; white-space: nowrap; }
.tbl-bar .open-in select { width: auto; }
.tbl-scroll { overflow: auto; max-height: calc(100vh - 16rem); }
.section .tbl-scroll { max-height: 34rem; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { position: sticky; top: 0; z-index: 2; background: var(--surface); text-align: left; font-weight: 600; color: var(--label); font-size: 0.8125rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line-strong); white-space: nowrap; user-select: none; }
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--brand); }
.tbl th .sort { font-size: 0.6875rem; margin-left: 0.25rem; }
.tbl td { padding: var(--cell-py) 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr { cursor: default; }
.tbl tbody tr.nav { cursor: pointer; }
.tbl tbody tr:hover { background: var(--hover); }
.tbl tbody tr.sel { background: var(--sel); }
.tbl td code { overflow-wrap: anywhere; } /* lange technische Bezeichner (Ereignisart, Pfad) dürfen umbrechen */
.tbl td.chev { width: 2rem; color: var(--muted); text-align: right; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td .inp { height: calc(var(--ctl-h) - 0.25rem); }
.tbl td.edit { padding: 0.25rem 0.5rem; }
.tbl td.sel-cell, .tbl th.sel-cell { width: 2.5rem; padding-right: 0; }
.tbl .t2 { color: var(--muted); font-size: 0.8125rem; }
.tbl-empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.tbl-more { padding: 0.5rem; text-align: center; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- Kacheln (GenericTile) */
.lp-body { padding: 1.5rem 2rem 4rem; max-width: 110rem; }
.lp-hero { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.lp-hero h1 { font-size: 1.5rem; }
.lp-group { margin-bottom: 2rem; scroll-margin-top: calc(var(--shell-h) + 1rem); }
.lp-group > h2 { font-size: 1.125rem; margin: 0 0 0.75rem; }
.tiles { display: flex; flex-wrap: wrap; gap: 1rem; }
.tile { width: 11rem; height: 11rem; border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow0); padding: 1rem; display: flex; flex-direction: column; color: var(--text); cursor: pointer; position: relative; overflow: hidden; transition: box-shadow .12s; }
.tile:hover { box-shadow: var(--shadow1); text-decoration: none; background: #fbfcfd; }
:root[data-theme="dark"] .tile:hover { background: var(--raised); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tile:hover { background: var(--raised); } }
.tile:focus-visible { outline: 0.125rem solid var(--brand); outline-offset: 0.125rem; }
/* Titel nie mitten im Wort trennen: lange Wörter verkleinert die Startseite (fitTiles), Untertitel höchstens 4 Zeilen */
.tile .t { font-weight: 700; font-size: 0.875rem; line-height: 1.25; overflow-wrap: normal; word-break: normal; hyphens: manual; flex: none; }
.tile .s { color: var(--muted); font-size: 0.75rem; margin-top: 0.25rem; line-height: 1.3; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; min-height: 0; }
.tile .foot { margin-top: auto; display: flex; align-items: flex-end; gap: 0.5rem; flex: none; padding-top: 0.25rem; }
.tile .foot .ic { width: 2rem; height: 2rem; color: var(--brand); }
.tile .kpi { margin-left: auto; text-align: right; }
.tile .kpi b { font-size: 1.75rem; font-weight: 400; color: var(--brand); display: block; line-height: 1; }
.tile .kpi span { font-size: 0.6875rem; color: var(--muted); }
.tile .ribbon { position: absolute; top: 0.875rem; right: -1.75rem; width: 6.5rem; transform: rotate(45deg); text-align: center; font-size: 0.625rem; font-weight: 700; letter-spacing: 0.02em; padding: 0.125rem 0; box-shadow: 0 0.0625rem 0.125rem rgb(0 0 0 / 0.15); pointer-events: none; }
.tile .ribbon.rb-neu { background: var(--lime); color: #1d2d3e; }
.tile .ribbon.rb-basic { background: #3B5E78; color: #fff; }
.tile .ribbon.rb-prio { background: var(--berry); color: #fff; }
/* Platz für das Band nur in der ersten Zeile (Abstandshalter rechts), die weiteren Zeilen nutzen die volle Breite */
.tile:has(.ribbon) .t::before { content: ''; float: right; width: 1.75rem; height: 1.1rem; }

/* DataPoint als Fortschritt (Listen, z. B. Vollständigkeit) */
.dp-progress { display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dp-progress .bar { width: 5rem; height: 0.375rem; border-radius: 0.25rem; background: var(--line); overflow: hidden; }
.dp-progress .bar i { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.dp-progress.s1 .bar i { background: var(--err); } .dp-progress.s2 .bar i { background: var(--warn-c); } .dp-progress.s3 .bar i { background: var(--ok); }
.dp-progress .n { font-size: 0.8125rem; }
/* Meldungsziel in einer Tabellenzeile ohne Eingabefeld */
.tbl tr.state-error-row td, .tbl td.state-error { background: var(--err-bg); }
/* Meldungen nach dem Sichern (Anzeige) */
.strip.save-msgs { margin-bottom: 1rem; }
.strip.save-msgs .msg-line { margin-top: 0.25rem; display: flex; gap: 0.375rem; align-items: flex-start; }
.strip.save-msgs .msg-line .ic { width: 1rem; height: 1rem; }

/* ---------------------------------------------------------------- Ladeanzeige */
.busy { display: inline-flex; gap: 0.25rem; padding: 1rem; }
.busy i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--brand); animation: mxb 1s infinite ease-in-out; }
.busy i:nth-child(2) { animation-delay: .15s; } .busy i:nth-child(3) { animation-delay: .3s; }
@keyframes mxb { 0%, 80%, 100% { transform: scale(.4); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
.center { display: flex; align-items: center; justify-content: center; padding: 3rem; }
.overlay-busy { position: fixed; inset: 0; z-index: 80; background: rgba(245,246,247,.4); display: flex; align-items: center; justify-content: center; }

/* ---------------------------------------------------------------- Wertehilfe-Dialog */
.vh-list { display: flex; flex-direction: column; }
.vh-list .vh-row { display: grid; grid-template-columns: minmax(6rem, 14rem) 1fr; gap: 0.75rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.vh-list .vh-row:hover, .vh-list .vh-row.active { background: var(--hover); }
.vh-list .vh-row b { font-weight: 600; word-break: break-all; }

@media (max-width: 40rem) {
  .page-head, .page-body, .page-foot, .lp-body { padding-left: 1rem; padding-right: 1rem; }
  .shellbar .search { display: none; }
  .shellbar .title small { display: none; }
  .tile { width: calc(50% - 0.5rem); height: 10rem; }
}

.shellbar .avatar.agent { box-shadow: 0 0 0 0.125rem var(--violet, #6b4fa0); }

/* ------------------------------------------------------------------ Produktionsweg-Graph (ui/flowgraph.js) */
.fg { position: relative; min-height: 0; }
.fg-scroll { overflow: auto; max-width: 100%; }
.fg-svg { display: block; font-family: var(--font); user-select: none; }
.fg-col { fill: var(--surface); stroke: var(--line); }
.fg-colh { fill: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.fg-lane rect { fill: transparent; stroke: var(--line-strong); stroke-dasharray: 4 4; }
.fg-lane text { fill: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.fg-lane.on rect { stroke: var(--brand); stroke-dasharray: none; fill: var(--brand-10); fill-opacity: .35; }
.fg-edge path { fill: none; stroke: var(--brand-40); opacity: .9; transition: opacity .15s, stroke .15s; cursor: pointer; }
.fg-arrow { fill: var(--brand-40); }
.fg-arrow.on { fill: var(--brand); }
.fg-edge.feasible path { stroke: var(--ok-line); }
.fg-edge.conditional path { stroke: var(--cond); stroke-dasharray: 8 3; }
.fg-edge.infeasible path { stroke: var(--err-line); opacity: .35; stroke-dasharray: 5 4; }
.fg-edge.hov path { stroke: var(--brand); opacity: 1; }
.fg-elabel { display: none; pointer-events: none; }
.fg-elabel rect { fill: var(--raised); stroke: var(--line-strong); }
.fg-elabel text { fill: var(--text); font-size: 11px; }
.fg-elabel.always, .fg-edge.hov .fg-elabel { display: block; }
.has-hl .fg-edge:not(.on) .fg-elabel.always { display: none; }
.has-hl .fg-edge.on path { stroke-width: 3px !important; }
.has-hl .fg-edge path { opacity: .15; }
.has-hl .fg-edge.on path { opacity: 1; stroke: var(--brand); }
.has-hl .fg-node { opacity: .38; }
.has-hl .fg-node.on { opacity: 1; }
.fg-node { cursor: pointer; outline: none; transition: opacity .15s; }
.fg-box { fill: var(--raised); stroke: var(--line-strong); stroke-width: 1px; filter: drop-shadow(0 1px 1.5px rgba(34,53,72,.18)); }
.fg-stripe { fill: var(--brand-40); }
.fg-node:hover .fg-box, .fg-node:focus-visible .fg-box { stroke: var(--brand); }
.fg-node.sel .fg-box { stroke: var(--brand); stroke-width: 2.5px; }
.fg-node.on .fg-box { stroke: var(--brand); stroke-width: 2px; }
.fg-node.unused { opacity: .45; }
.fg-node.feasible .fg-stripe { fill: var(--ok-line); }
.fg-node.conditional .fg-stripe { fill: var(--cond); }
.fg-node.conditional .fg-box { fill: var(--cond-bg); }
.fg-node.infeasible .fg-stripe { fill: var(--err-line); }
.fg-node.infeasible .fg-box { fill: var(--err-bg); }
.fg-node.unknown .fg-stripe { fill: var(--grey); }
.fg-t { fill: var(--text); font-size: 13px; font-weight: 700; }
.fg-s { fill: var(--muted); font-size: 11px; }
.fg-s2 { fill: var(--text); font-size: 11px; }
.fg-yield { fill: var(--muted); font-size: 11px; font-weight: 700; }
.fg-badge { display: inline-block; padding: 0.0625rem 0.5rem; border-radius: 1rem; font-size: 0.75rem; font-weight: 600; border: 1px solid var(--line-strong); color: var(--muted); background: var(--surface); white-space: nowrap; }
.fg-badge.feasible { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.fg-badge.conditional { color: var(--cond-text); background: var(--cond-bg); border-color: var(--cond); }
.fg-badge.infeasible { color: var(--err); background: var(--err-bg); border-color: var(--err-line); }
.fg-badge.unknown { color: var(--muted); }
.fg-legend { display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.75rem; color: var(--muted); align-items: center; }
.fg-legend i { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 0.1875rem; margin-right: 0.25rem; vertical-align: -0.125rem; background: var(--brand-40); }
.fg-legend i.feasible { background: var(--ok-line); } .fg-legend i.conditional { background: var(--cond); } .fg-legend i.infeasible { background: var(--err-line); } .fg-legend i.unknown { background: var(--grey); }
@media print { .fg-scroll { overflow: visible; } }

.shellbar .tenant { cursor: pointer; font-family: inherit; font-size: 0.75rem; font-weight: 700; padding: 0.125rem 0.625rem; border-radius: 1rem; background: var(--brand-10); color: var(--brand); border: 1px solid var(--brand-40); margin-right: 0.5rem; white-space: nowrap; }

.has-q .fg-node { opacity: .25; }
.has-q .fg-node.match { opacity: 1; }
.has-q .fg-node.match .fg-box { stroke: var(--info-line); stroke-width: 2.5px; }
.fg-curve { width: 100%; max-width: 22rem; height: auto; display: block; font-family: var(--font); }
.fg-curve .grid { stroke: var(--line); }
.fg-curve .tick { fill: var(--muted); font-size: 10px; }
.fg-curve .axis { fill: var(--label); font-size: 11px; }
.fg-curve .limit { fill: none; stroke: var(--brand); stroke-width: 2; }
.fg-curve .ok-area { fill: var(--ok-bg); opacity: .9; }
.fg-curve .pt { fill: var(--brand); }
.fg-curve .req { stroke: var(--surface); stroke-width: 2; }
.fg-curve .req.feasible { fill: var(--ok-line); }
.fg-curve .req.infeasible { fill: var(--err-line); }
@media print {
  .shellbar, .pw-side, .pw-head .tools button, .pw-head .tools input { display: none !important; }
  .pw-split { display: block; }
  .pw-graph { overflow: visible; background: #fff; }
}
.inp.sm { height: 1.75rem; font-size: 0.8125rem; padding: 0 0.5rem; }
/* Datumsfeld (mx.dateInput): Text im Format der App-Sprache, native Auswahl unsichtbar dahinter */
.date-wrap { position: relative; }
.date-wrap .date-pick { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }

/* ---------------------------------------------------------------- Polygon (ui/polygon.js): Grafik Breite × Dicke, Eckpunkte, Probe */
.pg-head { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: center; margin-bottom: 0.875rem; }
.pg-fact { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.pg-fact .l { font-size: 0.75rem; color: var(--label); }
.pg-fact .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.pg-fact.grow { flex: 1; align-items: flex-end; }
.pg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, 21rem); gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .pg { grid-template-columns: minmax(0, 1fr); } }
.pg-main { min-width: 0; }
.pg-chart { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); overflow: hidden; touch-action: none; }
.pg-chart [data-svg] { line-height: 0; }
.pg-svg { display: block; width: 100%; height: auto; font-family: var(--font); user-select: none; }
.pg-svg text { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.pg-svg .pg-axt { fill: var(--text); font-size: 12px; font-weight: 600; }
.pg-svg .pg-frame { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1; }
.pg-svg .pg-grid line { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.pg-svg .pg-area { fill: var(--brand); fill-opacity: 0.16; stroke: none; transition: fill 0.2s, fill-opacity 0.2s; }
.pg-svg .pg-area.r-out { fill: var(--brand); fill-opacity: 0.1; }
.pg-svg .pg-area.r-in, .pg-svg .pg-area.r-edge { fill: var(--ok-line); fill-opacity: 0.14; }
.pg-svg .pg-edge { fill: none; stroke: var(--brand); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.pg-svg .pg-close { fill: none; stroke: var(--brand); stroke-width: 2; stroke-dasharray: 6 5; opacity: 0.85; }
.pg-svg .pg-edge.x, .pg-svg .pg-close.x { stroke: var(--warn-c); }
.pg-svg .pg-edge.flash, .pg-svg .pg-close.flash { stroke: var(--warn-c); stroke-width: 4; }
.pg-svg .pg-arrow { fill: var(--brand); }
.pg-svg .pg-xm circle { fill: var(--warn-bg); stroke: var(--warn-c); stroke-width: 1.75; }
.pg-svg .pg-xm path { stroke: var(--warn-c); stroke-width: 2; stroke-linecap: round; }
.pg-svg .pg-pt { cursor: pointer; outline: none; }
.pg-svg.editing .pg-pt { cursor: grab; }
.pg-chart.dragging, .pg-chart.dragging .pg-pt { cursor: grabbing; }
.pg-svg .pg-pt .hit { fill: transparent; }
.pg-svg .pg-pt .dot { fill: var(--surface); stroke: var(--brand); stroke-width: 2.25; transition: r 0.12s; }
.pg-svg .pg-pt .lbl { fill: var(--text); font-size: 11px; font-weight: 700; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.pg-svg .pg-pt.hov .dot, .pg-svg .pg-pt:focus-visible .dot { fill: var(--brand-20); stroke-width: 3; }
.pg-svg .pg-pt.sel .dot { fill: var(--brand); stroke: var(--surface); stroke-width: 2.5; }
.pg-svg .pg-pt.sel .hit { fill: var(--brand); fill-opacity: 0.16; }
.pg-svg .pg-pt.flash .dot { stroke: var(--warn-c); stroke-width: 3; }
.pg-svg .pg-probe .g { stroke-width: 1.25; stroke-dasharray: 3 4; }
.pg-svg .pg-probe .halo { fill-opacity: 0.18; }
.pg-svg .pg-probe .dot { stroke: var(--surface); stroke-width: 2; }
.pg-svg .pg-probe.r-in .g, .pg-svg .pg-probe.r-edge .g { stroke: var(--ok-line); } .pg-svg .pg-probe.r-in circle, .pg-svg .pg-probe.r-edge circle { fill: var(--ok-line); }
.pg-svg .pg-probe.r-out .g { stroke: var(--err-line); } .pg-svg .pg-probe.r-out circle { fill: var(--err-line); }
.pg-svg .pg-probe.r-none .g, .pg-svg .pg-probe.r-gray .g { stroke: var(--muted); } .pg-svg .pg-probe.r-none circle, .pg-svg .pg-probe.r-gray circle { fill: var(--muted); }
.pg-tip { position: absolute; z-index: 3; pointer-events: none; background: var(--raised); color: var(--text); box-shadow: var(--shadow1); border-radius: var(--radius-s); padding: 0.25rem 0.5rem; font-size: 0.75rem; white-space: nowrap; }
.pg-read { position: absolute; top: 0.5rem; right: 0.625rem; z-index: 2; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.125rem 0.375rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pg-legend { display: flex; flex-wrap: wrap; gap: 0.375rem 1rem; align-items: center; margin-top: 0.5rem; color: var(--muted); }
.pg-legend span { display: inline-flex; align-items: center; gap: 0.375rem; }
.pg-legend .sw { display: inline-block; width: 1.25rem; height: 0.75rem; flex: none; }
.pg-legend .sw.area { background: color-mix(in srgb, var(--brand) 18%, transparent); border: 1px solid var(--brand-40); border-radius: 2px; }
.pg-legend .sw.edge { height: 0; border-top: 2.25px solid var(--brand); }
.pg-legend .sw.close { height: 0; border-top: 2px dashed var(--brand); }
.pg-legend .sw.xm { width: 0.75rem; border-radius: 50%; background: var(--warn-bg); border: 1.75px solid var(--warn-c); }
.pg-legend .pg-zero { margin-left: auto; gap: 0.375rem; color: var(--text); }
.pg-side { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.pg-side h3, .pg-issues h3, .pg-use h3 { font-size: 0.875rem; margin-bottom: 0.375rem; }
.pg-probe-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem; background: var(--surface); }
.pg-probe-box p { margin: 0 0 0.5rem; }
.pg-probe-in { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.5rem; align-items: end; }
.pg-probe-in label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.75rem; color: var(--label); min-width: 0; }
.pg-probe-in .inp { width: 100%; }
.pg-result:not(:empty) { margin-top: 0.625rem; }
.pg-verdict { display: flex; gap: 0.625rem; align-items: flex-start; padding: 0.5rem 0.625rem; border-radius: var(--radius); border: 1px solid; }
.pg-verdict b { font-size: 1rem; }
.pg-verdict.ok { background: var(--ok-bg); border-color: var(--ok-line); } .pg-verdict.ok .ic { color: var(--ok); }
.pg-verdict.err { background: var(--err-bg); border-color: var(--err-line); } .pg-verdict.err .ic { color: var(--err); }
.pg-verdict.warn { background: var(--warn-bg); border-color: var(--warn-line); } .pg-verdict.warn .ic { color: var(--warn-c); }
.pg-src { margin-top: 0.375rem; }
.pg-pts-head { margin-bottom: 0.375rem; }
.pg-pts-head h3 { margin: 0; }
.pg-pts-box .tbl-scroll { max-height: 27.5rem; }
.pg-pts-box p { margin: 0.375rem 0 0; }
.pg-tbl td, .pg-tbl th { padding: 0.3125rem 0.625rem; }
.pg-tbl td.edit { padding: 0.1875rem 0.375rem; }
.pg-tbl td .inp { height: 1.75rem; width: 100%; min-width: 4.5rem; text-align: right; }
.pg-tbl td:first-child .inp { min-width: 3.25rem; }
.pg-tbl tbody tr { cursor: pointer; }
.pg-tbl tbody tr.hov { background: var(--hover); }
.pg-tbl tbody tr.sel { background: var(--sel); box-shadow: inset 3px 0 0 var(--brand); }
.pg-tbl tbody tr.flash { box-shadow: inset 3px 0 0 var(--warn-c); }
.pg-tbl tbody tr.pg-incomplete td { color: var(--warn); }
.pg-issues { margin-top: 1rem; }
.pg-issue-list { list-style: none; margin: 0.375rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.pg-issue-list li { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.3125rem 0.5rem; border-radius: var(--radius-s); cursor: default; outline: none; }
.pg-issue-list li:hover, .pg-issue-list li:focus-visible { background: var(--hover); }
.pg-issue-list li .ic { margin-top: 0.125rem; }
.pg-issue-list .sev-error .ic { color: var(--err); } .pg-issue-list .sev-warn .ic { color: var(--warn-c); } .pg-issue-list .sev-info .ic { color: var(--info); }
.pg-use { margin-top: 1.25rem; }
.pg-use h4 { margin: 0.875rem 0 0.375rem; font-size: 0.8125rem; color: var(--label); }
.pg-cond { display: inline-block; margin-right: 0.5rem; }
.pg-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.pg-chip { display: inline-flex; gap: 0.375rem; align-items: baseline; padding: 0.1875rem 0.625rem; border-radius: 1rem; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }
.pg-chip:hover { border-color: var(--brand); text-decoration: none; }
.pg-mini { display: block; }
.pg-mini .poly { fill: var(--brand); fill-opacity: 0.22; stroke: var(--brand); stroke-width: 1.5; stroke-linejoin: round; }
.pg-more { margin-top: 0.375rem; }
.pg-more summary { cursor: pointer; color: var(--accent); margin-bottom: 0.375rem; }
/* Herkunft eines Werts (Wertetabelle der Objektseite): Symbol + Text, Tooltip, Absprung */
.ob-link { display: inline-flex; max-width: 100%; text-decoration: none; }
a.ob-link:hover .ob { border-color: currentColor; }
.ob { display: inline-flex; align-items: center; gap: 0.25rem; max-width: 100%; padding: 0 0.375rem; border: 1px solid transparent; border-radius: 0.75rem; font-size: 0.8125rem; line-height: 1.375rem; white-space: nowrap; color: var(--info); background: var(--info-bg); }
.ob > span { overflow: hidden; text-overflow: ellipsis; }
.ob .ic { width: 0.875rem; height: 0.875rem; vertical-align: 0; }
.ob-manual { color: var(--ok); background: var(--ok-bg); }
.ob-import, .ob-interface { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.ob-feas { color: var(--warn); background: var(--warn-bg); }
.ob.ob-over { color: var(--warn); background: var(--warn-bg); }

/* ---------------------------------------------------------------- Bereichsscrollen (einheitlich für alle Apps mit klebenden Köpfen)
   Shell-Leiste fest oben; darunter ein deckender Seitenkopf (.mx-head) und optional ein deckendes Band (.mx-band, z. B.
   Schrittleiste oder Reiter) – beide klebend, ohne Lücke übereinander. Die tatsächlichen Höhen misst mx.stickyHeads()
   (ResizeObserver) in --mx-head-h / --mx-band-h; eine unten angedockte Leiste meldet ihre Höhe in --mx-foot-h.
   Seitenspalten (.mx-rail) kleben darunter mit eigener Scrollhöhe, Sprungziele (.mx-anchor) halten Abstand zum Kopf.
   Die Seite scrollt als Dokument (html.mx-flow): sonst endet der Bereich der klebenden Leisten nach einer Bildschirmhöhe. */
html.mx-flow, html.mx-flow body { height: auto; }
html.mx-flow body.mx { min-height: 100vh; }
body.mx > .shellbar { flex: none; }
.mx-head { position: sticky; top: var(--shell-h); z-index: 22; background: var(--surface); transition: box-shadow .15s; }
.mx-head.scrolled, .page-head.scrolled { box-shadow: var(--shadow1); }
.mx-band { position: sticky; top: calc(var(--shell-h) + var(--mx-head-h, 0px)); z-index: 21; background: var(--bg); transition: box-shadow .15s; }
.mx-band.scrolled { box-shadow: 0 1px 0 var(--line), 0 0.375rem 0.75rem -0.5rem rgba(34,53,72,.3); }
.mx-rail { --mx-rail-top: calc(var(--shell-h) + var(--mx-head-h, 0px) + var(--mx-band-h, 0px) + var(--mx-rail-gap, 0.75rem));
  position: sticky; top: var(--mx-rail-top); max-height: calc(100vh - var(--mx-rail-top) - var(--mx-foot-h, 0px) - 0.75rem); overflow: auto; scrollbar-width: thin; }
.mx-anchor { scroll-margin-top: calc(var(--shell-h) + var(--mx-head-h, 0px) + var(--mx-band-h, 0px) + 0.75rem); }
@media (max-width: 860px) { .mx-head.mx-head-flow { position: static; box-shadow: var(--shadow0); } .mx-rail.mx-rail-flow { position: static; max-height: none; overflow: visible; } }
@media print { .mx-head, .mx-band, .mx-rail { position: static !important; max-height: none !important; overflow: visible !important; box-shadow: none !important; } }

/* ---------------------------------------------------------------- Navigation in der Shell-Leiste (ui/nav.js)
   Rückweg „← App · Objekt“, Pfad Bereich › App › Objekt, „Weiter zu“, App-Wechsler (Strg/⌘+K). Alles einzeilig in der
   festen Höhe der Shell-Leiste (--shell-h): bei wenig Platz kürzen sich zuerst Bereich und Zwischenebenen, dann die App,
   der Rückweg bleibt (nur Pfeil und kurzer Text). */
.shellbar .sb-nav { display: flex; align-items: center; gap: 0.5rem; min-width: 0; flex: 0 1 auto; height: 2rem; padding-left: 0.75rem; border-left: 1px solid var(--line-strong); }
.shellbar .sb-path { min-width: 0; flex: 0 1 auto; display: flex; }
.shellbar .sb-path ol { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; min-width: 0; }
.shellbar .sb-path li { display: flex; align-items: center; min-width: 0; white-space: nowrap; }
.shellbar .sb-path li > a, .shellbar .sb-path li > span:not(.sb-sep) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; border-radius: var(--radius-s); }
.shellbar .sb-sep { color: var(--muted); margin: 0 0.4375rem; font-size: 1rem; line-height: 1; opacity: .8; flex: none; }
.shellbar .sb-path li.sb-area { flex: 0 3 auto; }
.shellbar .sb-path li.sb-area a { color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.shellbar .sb-path li.sb-area a:hover, .shellbar .sb-path li.sb-mid a:hover { color: var(--accent); }
.shellbar .sb-path li.sb-app { flex: 0 2 auto; }
.shellbar .sb-path li.sb-app:not(.cur) .title { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.shellbar .sb-path li.sb-app:not(.cur) .title small { display: none; }
.shellbar .sb-path li.sb-app .title:hover { text-decoration: none; color: var(--accent); }
.shellbar .sb-path li.sb-mid { flex: 0 4 auto; max-width: 14rem; }
.shellbar .sb-path li.sb-mid a, .shellbar .sb-path li.sb-mid span:not(.sb-sep) { color: var(--muted); font-size: 0.875rem; }
.shellbar .sb-path li.sb-more { display: none; }
.shellbar .sb-morebtn { font: inherit; font-weight: 700; color: var(--muted); background: transparent; border: 0; border-radius: var(--radius-s); height: 1.5rem; padding: 0 0.375rem; cursor: pointer; }
.shellbar .sb-morebtn:hover { background: var(--hover); color: var(--accent); }
.shellbar .sb-path li.sb-obj { flex: 0 1 auto; }
.shellbar .sb-path li.sb-obj span[aria-current] { font-size: 1rem; font-weight: 700; color: var(--text); max-width: 28rem; }
/* Rückweg: dezente Pille in Markenfarbe, gleich links neben dem Pfad */
.shellbar .sb-back { display: inline-flex; align-items: center; gap: 0.375rem; height: 1.875rem; padding: 0 0.75rem 0 0.5rem; border-radius: 0.9375rem; background: var(--brand-10); border: 1px solid var(--brand-20); color: var(--brand); font-weight: 600; font-size: 0.8125rem; max-width: 18rem; min-width: 2rem; flex: 0 1 auto; white-space: nowrap; animation: sb-in .18s ease-out; }
.shellbar .sb-back .l { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.shellbar .sb-back:hover { background: var(--brand-20); text-decoration: none; }
.shellbar .sb-back .ic { flex: none; }
.shellbar .sb-back + .sb-path { padding-left: 0.25rem; }
@keyframes sb-in { from { opacity: 0; transform: translateX(-0.375rem); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .shellbar .sb-back { animation: none; } }
/* Weiter zu: kleine Schaltfläche hinter dem Objekt */
.shellbar .sb-next { display: inline-flex; align-items: center; gap: 0.3125rem; flex: none; height: 1.75rem; padding: 0 0.5rem 0 0.5625rem; border: 1px solid var(--line-strong); border-radius: 0.875rem; background: transparent; color: var(--accent); font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.shellbar .sb-next:hover, .shellbar .sb-next[aria-expanded="true"] { background: var(--brand-10); border-color: var(--brand-40); }
.shellbar .sb-next .ic.dn { width: 0.75rem; height: 0.75rem; opacity: .8; }
.shellbar .sb-morebtn:focus-visible, .shellbar .sb-next:focus-visible, .shellbar .sb-back:focus-visible, .shellbar .sb-path a:focus-visible { outline: 0.125rem solid var(--brand); outline-offset: 0.0625rem; }
.popover.sb-nextpop { min-width: 17rem; }
.popover .sb-nh { padding: 0.375rem 1rem 0.25rem; font-size: 0.6875rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.popover .item .sb-nt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.popover .item .sb-nt b { font-weight: 600; }
.popover .item .sb-nt small { color: var(--muted); font-size: 0.75rem; }
.popover .item:focus-visible { outline: none; background: var(--sel); box-shadow: inset 0.1875rem 0 0 var(--brand); }
.popover .item[aria-disabled="true"] { color: var(--muted); cursor: default; }
/* App-Wechsler */
dialog.nav-sw { border: 0; padding: 0; margin: 9vh auto auto; width: min(40rem, calc(100vw - 2rem)); max-height: min(36rem, 82vh); border-radius: var(--radius-l); background: var(--raised); color: var(--text); box-shadow: var(--shadow2); overflow: hidden; }
dialog.nav-sw[open] { display: flex; }
dialog.nav-sw::backdrop { background: rgba(29,45,62,.42); }
.nav-sw .sw-box { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.nav-sw .sw-top { display: flex; align-items: center; gap: 0.625rem; padding: 0.75rem 0.75rem 0.75rem 1.125rem; border-bottom: 1px solid var(--line); }
.nav-sw .sw-top > .ic { color: var(--muted); width: 1.125rem; height: 1.125rem; }
.nav-sw .sw-top input { flex: 1; min-width: 0; height: 2.25rem; border: 0; background: transparent; font: inherit; font-size: 1rem; color: var(--text); outline: none; }
.nav-sw .sw-top input::placeholder { color: var(--placeholder); }
.nav-sw .sw-top input::-webkit-search-cancel-button { display: none; }
.nav-sw .sw-x { flex: none; width: 2rem; height: 2rem; border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.nav-sw .sw-x:hover { background: var(--hover); }
.nav-sw .sw-list { overflow: auto; padding: 0.375rem 0 0.5rem; flex: 1; min-height: 0; scrollbar-width: thin; }
.nav-sw .sw-h { padding: 0.625rem 1.125rem 0.25rem; font-size: 0.6875rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.nav-sw .sw-opt { display: grid; grid-template-columns: 1.25rem minmax(0, auto) minmax(0, 1fr); align-items: center; gap: 0.75rem; padding: 0.4375rem 1.125rem; color: var(--text); text-decoration: none; scroll-margin: 2rem 0 0.5rem; }
.nav-sw .sw-opt .ic { color: var(--muted); }
.nav-sw .sw-opt .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-sw .sw-opt .s { color: var(--muted); font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-sw .sw-opt.on { background: var(--sel); box-shadow: inset 0.1875rem 0 0 var(--brand); text-decoration: none; }
.nav-sw .sw-opt.on .ic { color: var(--brand); }
.nav-sw .sw-none { padding: 1.5rem 1.125rem; color: var(--muted); }
.nav-sw .sw-foot { display: flex; align-items: center; gap: 1rem; padding: 0.5rem 1.125rem; border-top: 1px solid var(--line); font-size: 0.75rem; color: var(--muted); background: var(--surface); }
.nav-sw kbd { font: inherit; font-size: 0.6875rem; font-weight: 700; padding: 0.0625rem 0.3125rem; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 0.25rem; background: var(--raised); color: var(--text); margin-right: 0.125rem; }
@media (max-width: 1100px) {
  .shellbar .sb-path li.sb-mid { display: none; }
  .shellbar .sb-path li.sb-more { display: flex; }
  .shellbar .sb-path.has-obj .title small { display: none; }
}
@media (max-width: 860px) {
  .shellbar .sb-path li.sb-area { display: none; }
  .shellbar .sb-next .l { display: none; }
  .shellbar .sb-next { padding: 0 0.4375rem; }
  .shellbar .sb-back { max-width: 12rem; }
}
@media (max-width: 40rem) {
  .shellbar { padding: 0 0.5rem 0 0.25rem; gap: 0.25rem; }
  .shellbar .logo { padding: 0 0.375rem; }
  .shellbar .sb-nav { padding-left: 0.5rem; gap: 0.375rem; }
  .shellbar .sb-path.has-obj li.sb-app, .shellbar .sb-path.has-obj li.sb-more { display: none; }
  .shellbar .sb-path.has-obj li.sb-obj > .sb-sep { display: none; }
  .shellbar .sb-path li.sb-obj span[aria-current] { font-size: 0.9375rem; }
  .shellbar .sb-back { max-width: 8.5rem; padding: 0 0.5rem 0 0.4375rem; gap: 0.25rem; flex-shrink: 0; }
  .shellbar .sb-back .o, .shellbar .sb-next .ic.dn { display: none; }
  .shellbar .tenant { max-width: 5.5rem; overflow: hidden; text-overflow: ellipsis; margin-right: 0.25rem; }
  .nav-sw .sw-opt { grid-template-columns: 1.25rem minmax(0, 1fr); }
  .nav-sw .sw-opt .s { grid-column: 2; margin-top: -0.25rem; }
  .nav-sw .sw-foot span:not(.grow) { display: none; }
}
@media print { .shellbar .sb-back, .shellbar .sb-next, .shellbar .sb-apps { display: none !important; } }

/* Melder: Anhänge im Dialog „Fehler oder Wunsch melden“ (mx.melden) und unter „Meine Meldungen“ */
.mel-drop { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: center; padding: 0.75rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); font-size: 0.875rem; cursor: pointer; text-align: center; }
.mel-drop:hover, .mel-drop.over, .mel-drop:focus-visible { border-color: var(--brand); background: var(--brand-10, var(--hover)); color: var(--text); }
.mel-drop[hidden] { display: none; }
.mel-files { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.mel-files:empty { display: none; }
.mel-file { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 0.5rem; align-items: center; width: 15rem; padding: 0.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.mel-file img, .mel-file .ic { grid-row: 1 / 3; width: 3rem; height: 2.25rem; object-fit: cover; border-radius: calc(var(--radius) / 2); background: var(--hover); }
.mel-file .ic { padding: 0.5rem 0.875rem; color: var(--muted); }
.mel-file .n { font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mel-file .s { grid-column: 2; font-size: 0.75rem; color: var(--muted); }
.mel-file button { grid-row: 1 / 3; grid-column: 3; }
a.mel-file { color: var(--text); text-decoration: none; grid-template-columns: 3rem minmax(0, 1fr); }
a.mel-file:hover { border-color: var(--brand); }
.mel-files-hint { margin-top: 0.25rem; }
.toast-act { margin-left: 0.75rem; font: inherit; font-weight: 700; color: inherit; background: transparent; border: 1px solid rgba(255,255,255,.6); border-radius: var(--radius-s, .25rem); padding: 0.125rem 0.5rem; cursor: pointer; }
.toast-act:hover { background: rgba(255,255,255,.15); }
.toast.warn { background: #8a4b00; }
