/* PROGNOMAT – Basis-Stylesheet (server-gerenderte Seiten). Die Design-Tokens auf :root
   werden auch vom Vue-Frontend verwendet. */

:root {
  color-scheme: light;
  --pg-bg: #f5f6f8;
  --pg-surface: #ffffff;
  --pg-surface-2: #eef1f5;
  --pg-border: #d8dde5;
  --pg-text: #18202b;
  --pg-text-muted: #5b6676;
  --pg-accent: #1f5f8b;
  --pg-accent-contrast: #ffffff;
  --pg-accent-soft: #e3eef6;
  --pg-positive: #1d7a4f;
  --pg-negative: #b23b3b;
  --pg-warning: #a86a00;
  --pg-band: rgba(31, 95, 139, 0.16);
  --pg-base: #7a8594;
  --pg-scen: #1f5f8b;
  --pg-actual: #c2571a;
  --pg-radius: 6px;
  --pg-font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --pg-font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --pg-space-1: 4px;
  --pg-space-2: 8px;
  --pg-space-3: 12px;
  --pg-space-4: 16px;
  --pg-space-5: 24px;
  --pg-space-6: 40px;
  --pg-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --pg-header-h: 56px;
  --pg-max-w: 1320px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --pg-bg: #0f141a;
    --pg-surface: #171e26;
    --pg-surface-2: #1f2832;
    --pg-border: #2c3744;
    --pg-text: #e5e9ef;
    --pg-text-muted: #98a3b3;
    --pg-accent: #5aa6d6;
    --pg-accent-contrast: #0b1520;
    --pg-accent-soft: #1b3346;
    --pg-positive: #4cbf86;
    --pg-negative: #e57373;
    --pg-warning: #e0a63a;
    --pg-band: rgba(90, 166, 214, 0.22);
    --pg-base: #8b96a5;
    --pg-scen: #5aa6d6;
    --pg-actual: #f08a4b;
    --pg-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --pg-bg: #0f141a;
  --pg-surface: #171e26;
  --pg-surface-2: #1f2832;
  --pg-border: #2c3744;
  --pg-text: #e5e9ef;
  --pg-text-muted: #98a3b3;
  --pg-accent: #5aa6d6;
  --pg-accent-contrast: #0b1520;
  --pg-accent-soft: #1b3346;
  --pg-positive: #4cbf86;
  --pg-negative: #e57373;
  --pg-warning: #e0a63a;
  --pg-band: rgba(90, 166, 214, 0.22);
  --pg-base: #8b96a5;
  --pg-scen: #5aa6d6;
  --pg-actual: #f08a4b;
  --pg-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--pg-bg);
  color: var(--pg-text);
  font-family: var(--pg-font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--pg-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 var(--pg-space-3); font-weight: 600; }
h1 { font-size: 1.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 var(--pg-space-3); }
code, pre, .mono { font-family: var(--pg-font-mono); font-size: 0.88em; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--pg-text-muted); }
.small { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }

.skip-link { position: absolute; left: -999px; top: 0; }
.skip-link:focus { left: var(--pg-space-3); top: var(--pg-space-3); z-index: 100; background: var(--pg-surface); padding: var(--pg-space-2) var(--pg-space-3); }

:focus-visible { outline: 2px solid var(--pg-accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- Kopfzeile */

.site-header {
  background: var(--pg-surface);
  border-bottom: 1px solid var(--pg-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .inner {
  max-width: var(--pg-max-w);
  margin: 0 auto;
  height: var(--pg-header-h);
  padding: 0 var(--pg-space-4);
  display: flex;
  align-items: center;
  gap: var(--pg-space-5);
}
.brand {
  display: flex; align-items: center; gap: var(--pg-space-2);
  font-weight: 700; letter-spacing: 0.08em; color: var(--pg-text); font-size: 0.98rem;
}
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }
.main-nav { display: flex; gap: var(--pg-space-1); flex: 1; }
.main-nav a {
  color: var(--pg-text-muted); padding: 6px 10px; border-radius: var(--pg-radius); font-weight: 500;
}
.main-nav a:hover { background: var(--pg-surface-2); color: var(--pg-text); text-decoration: none; }
.main-nav a.active { color: var(--pg-accent); background: var(--pg-accent-soft); }
.header-tools { display: flex; align-items: center; gap: var(--pg-space-3); font-size: 0.9rem; }
.lang-switch { display: inline-flex; border: 1px solid var(--pg-border); border-radius: var(--pg-radius); overflow: hidden; }
.lang-switch a { padding: 3px 8px; color: var(--pg-text-muted); font-size: 0.8rem; font-weight: 600; }
.lang-switch a.active { background: var(--pg-surface-2); color: var(--pg-text); }
.lang-switch a:hover { text-decoration: none; }
.user-chip { color: var(--pg-text-muted); white-space: nowrap; }
.user-chip .role { font-size: 0.75rem; border: 1px solid var(--pg-border); border-radius: 99px; padding: 0 6px; margin-left: 4px; }
.inline-form { display: inline; margin: 0; }
.link-button { background: none; border: 0; padding: 0; color: var(--pg-accent); cursor: pointer; font: inherit; }
.link-button:hover { text-decoration: underline; }

.nav-toggle { display: none; background: none; border: 1px solid var(--pg-border); border-radius: var(--pg-radius); padding: 4px 8px; color: var(--pg-text); cursor: pointer; }

@media (max-width: 860px) {
  .site-header .inner { flex-wrap: wrap; height: auto; padding-top: var(--pg-space-2); padding-bottom: var(--pg-space-2); gap: var(--pg-space-2); }
  .nav-toggle { display: inline-block; margin-left: auto; }
  .main-nav, .header-tools { display: none; width: 100%; }
  .site-header.open .main-nav { display: flex; flex-direction: column; flex: 0 0 100%; }
  .site-header.open .main-nav a { display: flex; align-items: center; gap: 10px; }
  .site-header.open .nav-icon { display: block; }
  .site-header.open .header-tools { display: flex; flex-wrap: wrap; padding-bottom: var(--pg-space-2); }
}

.nav-icon { flex: none; display: none; }
.install-app { background: none; border: 1px solid var(--pg-border); border-radius: var(--pg-radius); padding: 3px 8px; color: var(--pg-accent); cursor: pointer; font: inherit; font-size: 0.82rem; }
.install-app:hover { background: var(--pg-accent-soft); }

/* Brotkrumen über dem Inhalt (templates/layout.php, App\Core\Navigation) */
.breadcrumbs { margin: calc(-1 * var(--pg-space-2)) 0 var(--pg-space-3); font-size: 0.82rem; color: var(--pg-text-muted); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; }
.breadcrumbs li { display: inline-flex; align-items: center; min-width: 0; }
.breadcrumbs li + li::before { content: "›"; margin: 0 7px; color: var(--pg-text-muted); opacity: .7; }
.breadcrumbs a { color: var(--pg-text-muted); }
.breadcrumbs a:hover { color: var(--pg-accent); }
.breadcrumbs [aria-current] { color: var(--pg-text); font-weight: 500; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Unterpunkte des aktiven Bereichs */
.subnav-list { list-style: none; margin: 2px 0 6px; padding: 0 0 0 20px; display: none; }
.subnav-list a { display: block; color: var(--pg-text-muted); padding: 4px 10px 4px 18px; border-radius: var(--pg-radius); font-size: 0.88rem; border-left: 1px solid var(--pg-border); border-top-left-radius: 0; border-bottom-left-radius: 0; }
.subnav-list a:hover { background: var(--pg-surface-2); color: var(--pg-text); text-decoration: none; }
.subnav-list a.active { color: var(--pg-accent); border-left: 2px solid var(--pg-accent); padding-left: 17px; font-weight: 600; background: none; }
.site-header.open .subnav-list { display: block; }

/* Desktop: Navigation als Seitenleiste links (Kopf wird zur festen Spalte, mobil bleibt die obere Leiste) */
@media (min-width: 1024px) {
  :root { --pg-sidebar-w: 224px; --pg-header-h: 0px; }
  body { padding-left: var(--pg-sidebar-w); }
  .site-header {
    position: fixed; top: 0; bottom: 0; left: 0; width: var(--pg-sidebar-w);
    border-bottom: 0; border-right: 1px solid var(--pg-border); overflow-y: auto;
  }
  .site-header .inner {
    min-height: 100%; height: auto; max-width: none; flex-direction: column; align-items: stretch; gap: var(--pg-space-3);
    padding: var(--pg-space-4) var(--pg-space-3);
  }
  .brand { padding: 2px var(--pg-space-2) var(--pg-space-2); }
  .main-nav { flex-direction: column; gap: 2px; flex: 1; }
  .main-nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; }
  .nav-icon { display: block; opacity: .85; }
  .main-nav a.active .nav-icon { opacity: 1; }
  .main-nav a.has-news::after { margin-left: auto; vertical-align: middle; }
  .header-tools { flex-direction: column; align-items: flex-start; gap: var(--pg-space-2); padding: var(--pg-space-3) var(--pg-space-2) 0; border-top: 1px solid var(--pg-border); }
  .user-chip { white-space: normal; }
  .subnav-list { display: block; }
  .section-tabs { display: none !important; }   /* Atlas-/Verwaltungsreiter stehen auf dem Desktop in der Seitenleiste */
}
@media (min-width: 1024px) and (max-height: 640px) {
  .main-nav a { padding-top: 5px; padding-bottom: 5px; }
}

/* ------------------------------------------------------------------ Layout */

main { flex: 1; width: 100%; }
/* KI-Assistent offen: Inhalt neben der Seitenleiste (Breite setzt apps/Assistant.vue) */
body.assistant-open { padding-right: var(--pg-assist-w, 420px); }
.container { max-width: var(--pg-max-w); margin: 0 auto; padding: var(--pg-space-5) var(--pg-space-4); }
.container.wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--pg-space-4); flex-wrap: wrap; margin-bottom: var(--pg-space-4); }
.page-head h1 { margin: 0; }
.page-head .subtitle { color: var(--pg-text-muted); margin: 2px 0 0; }

.grid { display: grid; gap: var(--pg-space-4); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--pg-surface);
  border: 1px solid var(--pg-border);
  border-radius: var(--pg-radius);
  padding: var(--pg-space-4);
}
.card h2, .card h3 { margin-bottom: var(--pg-space-2); }
.card-link { display: block; color: inherit; transition: border-color .15s; }
.card-link:hover { border-color: var(--pg-accent); text-decoration: none; }
.card-link .more { color: var(--pg-accent); font-weight: 500; font-size: 0.9rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--pg-space-3); margin: var(--pg-space-5) 0; }
.stat { background: var(--pg-surface); border: 1px solid var(--pg-border); border-radius: var(--pg-radius); padding: var(--pg-space-3) var(--pg-space-4); }
.stat .value { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--pg-text-muted); font-size: 0.85rem; }

.hero { padding: var(--pg-space-5) 0 var(--pg-space-2); max-width: 820px; }
.hero h1 { font-size: 2rem; margin-bottom: var(--pg-space-3); }
.hero p { font-size: 1.05rem; color: var(--pg-text-muted); }

section + section { margin-top: var(--pg-space-6); }

/* ---------------------------------------------------------------- Tabellen */

.table-wrap { overflow-x: auto; border: 1px solid var(--pg-border); border-radius: var(--pg-radius); background: var(--pg-surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--pg-border); text-align: left; vertical-align: top; }
table.data th { background: var(--pg-surface-2); font-weight: 600; font-size: 0.8rem; color: var(--pg-text-muted); text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
/* sortierbare Spalten (assets/js/tablesort.js) */
table.data th .th-sort { font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
table.data th .th-sort:hover, table.data th .th-sort:focus-visible { color: var(--pg-text); }
table.data th .th-sort-mark { font-size: 0.65rem; min-width: 8px; }
table.data th .th-sort:hover .th-sort-mark:empty::after { content: '▲'; opacity: 0.35; }
table.data th.num .th-sort { flex-direction: row-reverse; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: color-mix(in srgb, var(--pg-surface-2) 50%, transparent); }
table.data td.actions { white-space: nowrap; text-align: right; }
table.data input[type="text"], table.data input[type="number"] { width: 100%; min-width: 70px; }

/* --------------------------------------------------------------- Formulare */

label { display: block; font-weight: 500; font-size: 0.88rem; margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  font: inherit; color: var(--pg-text); background: var(--pg-surface);
  border: 1px solid var(--pg-border); border-radius: var(--pg-radius);
  padding: 6px 10px; width: 100%; max-width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--pg-accent); outline: none; box-shadow: 0 0 0 3px var(--pg-accent-soft); }
.field { margin-bottom: var(--pg-space-3); }
.form-row { display: flex; flex-wrap: wrap; gap: var(--pg-space-3); align-items: flex-end; }
.form-row .field { flex: 1 1 160px; margin-bottom: 0; }
.form-narrow { max-width: 420px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-weight: 500; font-size: 0.9rem;
  padding: 6px 14px; border-radius: var(--pg-radius);
  border: 1px solid var(--pg-border); background: var(--pg-surface); color: var(--pg-text);
  cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--pg-surface-2); text-decoration: none; }
.btn-primary { background: var(--pg-accent); border-color: var(--pg-accent); color: var(--pg-accent-contrast); }
.btn-primary:hover { background: color-mix(in srgb, var(--pg-accent) 88%, black); }
.btn-danger { color: var(--pg-negative); }
.btn-small { padding: 2px 8px; font-size: 0.8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-group { display: inline-flex; gap: var(--pg-space-2); flex-wrap: wrap; }

/* ----------------------------------------------------------- Hinweise/Badges */

.notice { border: 1px solid var(--pg-border); border-left-width: 4px; border-radius: var(--pg-radius); padding: var(--pg-space-3) var(--pg-space-4); background: var(--pg-surface); margin-bottom: var(--pg-space-4); }
.notice-info { border-left-color: var(--pg-accent); }
.notice-success { border-left-color: var(--pg-positive); }
.notice-error { border-left-color: var(--pg-negative); }
.notice-warning { border-left-color: var(--pg-warning); }

.badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--pg-surface-2); color: var(--pg-text-muted); border: 1px solid var(--pg-border); white-space: nowrap; }
.badge-done, .badge-ok, .badge-A { color: var(--pg-positive); border-color: color-mix(in srgb, var(--pg-positive) 40%, transparent); }
.badge-failed, .badge-cancelled { color: var(--pg-negative); border-color: color-mix(in srgb, var(--pg-negative) 40%, transparent); }
.badge-running, .badge-loading, .badge-queued { color: var(--pg-warning); border-color: color-mix(in srgb, var(--pg-warning) 40%, transparent); }
.badge-superseded { opacity: .7; }
.badge-skipped { color: var(--pg-text-muted, inherit); }
.badge-accent { color: var(--pg-accent); border-color: color-mix(in srgb, var(--pg-accent) 40%, transparent); }

.progress { height: 6px; background: var(--pg-surface-2); border-radius: 99px; overflow: hidden; min-width: 80px; }
.progress > span { display: block; height: 100%; background: var(--pg-accent); }

.tabs { display: flex; gap: var(--pg-space-1); border-bottom: 1px solid var(--pg-border); margin-bottom: var(--pg-space-4); overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--pg-text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs a:hover { color: var(--pg-text); text-decoration: none; }
.tabs a.active { color: var(--pg-accent); border-bottom-color: var(--pg-accent); }

.subnav { display: flex; gap: var(--pg-space-3); flex-wrap: wrap; margin-bottom: var(--pg-space-4); font-size: 0.92rem; }
.subnav a { color: var(--pg-text-muted); }
.subnav a.active { color: var(--pg-accent); font-weight: 600; }

.token-box { font-family: var(--pg-font-mono); background: var(--pg-surface-2); padding: var(--pg-space-2) var(--pg-space-3); border-radius: var(--pg-radius); word-break: break-all; user-select: all; }

.pagination { display: flex; gap: var(--pg-space-2); align-items: center; margin-top: var(--pg-space-3); }

details.inline-edit summary { cursor: pointer; color: var(--pg-accent); list-style: none; }
details.inline-edit summary::-webkit-details-marker { display: none; }
details.inline-edit[open] { background: var(--pg-surface-2); padding: var(--pg-space-3); border-radius: var(--pg-radius); }

.source-list { list-style: none; padding: 0; margin: 0; font-size: 0.85rem; color: var(--pg-text-muted); }
.source-list li + li { margin-top: 4px; }

/* ---------------------------------------------------------- Vue-Mountpoints */

.vue-mount { min-height: 200px; }
.mount-loading { color: var(--pg-text-muted); padding: var(--pg-space-5) 0; }

/* -------------------------------------------------------------- Fußzeile */

.site-footer { border-top: 1px solid var(--pg-border); background: var(--pg-surface); margin-top: var(--pg-space-6); }
.site-footer .inner { max-width: var(--pg-max-w); margin: 0 auto; padding: var(--pg-space-4); display: flex; justify-content: space-between; gap: var(--pg-space-4); flex-wrap: wrap; font-size: 0.85rem; color: var(--pg-text-muted); }

/* ---------------------------------------------------------- Einbettung */

body.embed { background: var(--pg-surface); min-height: 0; }
body.embed main { padding: var(--pg-space-2); }
.embed-credit { font-size: 0.75rem; color: var(--pg-text-muted); padding: 0 var(--pg-space-2) var(--pg-space-2); }

/* ---------------------------------------------------------------- Login */

.auth-card { max-width: 400px; margin: var(--pg-space-6) auto; }

.error-page { text-align: center; padding: var(--pg-space-6) 0; }
.error-page .code { font-size: 3rem; font-weight: 700; color: var(--pg-text-muted); }
.error-page pre { text-align: left; overflow: auto; background: var(--pg-surface-2); padding: var(--pg-space-3); border-radius: var(--pg-radius); font-size: 0.75rem; max-height: 50vh; }

@media print {
  .site-header, .site-footer, .btn, .tabs { display: none !important; }
  body { background: #fff; }
}
.sr-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------- Hilfe & Kurzhilfe */

.help-tip {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: 0.1em;
  width: 1.15em; height: 1.15em; margin: 0 0 0 0.3em; padding: 0; flex: none;
  border: 1px solid color-mix(in srgb, var(--pg-accent) 45%, var(--pg-border)); border-radius: 50%;
  background: var(--pg-surface); color: var(--pg-accent);
  font: 600 0.72rem/1 var(--pg-font); cursor: pointer; text-transform: none; letter-spacing: 0;
}
h1 .help-tip, h2 .help-tip { font-size: 0.6em; }
.help-tip:hover, .help-tip[aria-expanded="true"] { background: var(--pg-accent); border-color: var(--pg-accent); color: var(--pg-accent-contrast); }
.help-tip:focus-visible { outline: 2px solid var(--pg-accent); outline-offset: 2px; }
/* größere Trefferfläche auf Touch-Geräten, ohne das Layout zu verschieben */
@media (pointer: coarse) { .help-tip { position: relative; } .help-tip::after { content: ""; position: absolute; inset: -10px; } }

.help-pop {
  position: absolute; z-index: 1000; width: min(340px, calc(100vw - 16px));
  background: var(--pg-surface); color: var(--pg-text);
  border: 1px solid var(--pg-border); border-radius: var(--pg-radius);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.16), var(--pg-shadow);
  font-size: 0.88rem; line-height: 1.5; text-align: left; font-weight: 400;
}
.help-pop::before {
  content: ""; position: absolute; top: -6px; left: calc(var(--help-arrow, 20px) - 6px); width: 10px; height: 10px;
  background: var(--pg-surface); border-left: 1px solid var(--pg-border); border-top: 1px solid var(--pg-border); transform: rotate(45deg);
}
.help-pop.is-above::before { top: auto; bottom: -6px; transform: rotate(225deg); }
.help-pop:focus { outline: none; }
.help-pop__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--pg-space-2); padding: var(--pg-space-3) var(--pg-space-3) 0 var(--pg-space-4); }
.help-pop__title { font-size: 0.95rem; }
.help-pop__close { background: none; border: 0; color: var(--pg-text-muted); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0 2px; }
.help-pop__close:hover { color: var(--pg-text); }
.help-pop__body { padding: var(--pg-space-2) var(--pg-space-4) var(--pg-space-3); }
.help-pop__body p { margin: 0 0 var(--pg-space-2); }
.help-pop__muted { color: var(--pg-text-muted); }
.help-pop__more { font-weight: 500; }

.help-search { max-width: 520px; margin-bottom: var(--pg-space-5); }
.help-search input { font-size: 1rem; padding: 10px 12px; }
.help-sections { display: grid; gap: var(--pg-space-4); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.help-sections .card h2 { font-size: 1.05rem; }
.help-list { list-style: none; margin: 0; padding: 0; }
.help-list li + li { margin-top: var(--pg-space-2); }
.help-list a { font-weight: 500; }
.help-list .muted { display: block; font-size: 0.84rem; line-height: 1.4; }
.help-az { columns: 3 240px; column-gap: var(--pg-space-5); list-style: none; padding: 0; margin: 0; font-size: 0.92rem; }
.help-az li { break-inside: avoid; padding: 2px 0; }

.help-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: var(--pg-space-6); align-items: start; }
@media (max-width: 900px) { .help-layout { grid-template-columns: minmax(0, 1fr); } }
.help-crumbs { font-size: 0.88rem; color: var(--pg-text-muted); margin-bottom: var(--pg-space-2); }
.help-summary { border-left: 4px solid var(--pg-accent); background: var(--pg-accent-soft); padding: var(--pg-space-3) var(--pg-space-4); border-radius: var(--pg-radius); margin-bottom: var(--pg-space-5); }
.help-summary strong { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pg-accent); margin-bottom: 2px; }
.help-summary p { margin: 0; }
.help-body { max-width: 760px; line-height: 1.65; }
.help-body h2 { margin-top: var(--pg-space-5); }
.help-body h3 { margin-top: var(--pg-space-4); }
.help-body ul, .help-body ol { padding-left: 1.3em; margin: 0 0 var(--pg-space-3); }
.help-body li + li { margin-top: 4px; }
.help-body dl { margin: 0 0 var(--pg-space-3); }
.help-body dt { font-weight: 600; margin-top: var(--pg-space-3); }
.help-body dd { margin: 2px 0 0; }
.help-body .formula { font-family: var(--pg-font-mono); font-size: 0.86rem; background: var(--pg-surface-2); border-radius: var(--pg-radius); padding: var(--pg-space-2) var(--pg-space-3); overflow-x: auto; white-space: pre; }
.help-body .tip { border: 1px solid var(--pg-border); border-left: 4px solid var(--pg-positive); border-radius: var(--pg-radius); padding: var(--pg-space-2) var(--pg-space-3); background: var(--pg-surface); }
.help-body .caution { border: 1px solid var(--pg-border); border-left: 4px solid var(--pg-warning); border-radius: var(--pg-radius); padding: var(--pg-space-2) var(--pg-space-3); background: var(--pg-surface); }
.help-body table.data { margin-bottom: var(--pg-space-3); }
.help-ref { margin-top: var(--pg-space-5); }
.help-ref h2 { font-size: 1.1rem; }
.help-ref .ref-item { padding: var(--pg-space-3) 0; border-top: 1px solid var(--pg-border); scroll-margin-top: calc(var(--pg-header-h) + 16px); }
.help-ref .ref-item:target { background: var(--pg-accent-soft); margin: 0 calc(-1 * var(--pg-space-3)); padding-left: var(--pg-space-3); padding-right: var(--pg-space-3); border-radius: var(--pg-radius); }
.help-ref .ref-item h3 { margin: 0 0 4px; }
.help-ref .ref-meta { font-size: 0.84rem; color: var(--pg-text-muted); margin-bottom: 4px; }
.help-ref .ref-item p { margin: 0; }
.help-aside { position: sticky; top: calc(var(--pg-header-h) + 16px); font-size: 0.9rem; }
.help-aside h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pg-text-muted); }
.help-aside ul { list-style: none; padding: 0; margin: 0 0 var(--pg-space-5); }
.help-aside li { padding: 3px 0; }
.help-aside a[aria-current="page"] { font-weight: 600; color: var(--pg-text); }
@media (max-width: 900px) { .help-aside { position: static; } }

/* --------------------------------------------------------- Release Notes */

.release-versions { grid-template-columns: repeat(auto-fit, minmax(180px, 220px)); margin-top: 0; }
.release { scroll-margin-top: calc(var(--pg-header-h) + 16px); max-width: 820px; }
.release + .release { margin-top: var(--pg-space-6); padding-top: var(--pg-space-5); border-top: 1px solid var(--pg-border); }
.release-head h2 { margin-bottom: 2px; }
.release-items { list-style: none; padding: 0; margin: 0; }
.release-items li { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: var(--pg-space-3); align-items: baseline; padding: 6px 0; line-height: 1.55; }
.release-items .badge { justify-self: start; }
.release-new { color: var(--pg-positive); border-color: color-mix(in srgb, var(--pg-positive) 40%, transparent); }
.release-improved { color: var(--pg-accent); border-color: color-mix(in srgb, var(--pg-accent) 40%, transparent); }
.release-fixed { color: var(--pg-warning); border-color: color-mix(in srgb, var(--pg-warning) 40%, transparent); }
.release-changed { color: var(--pg-negative); border-color: color-mix(in srgb, var(--pg-negative) 40%, transparent); }
@media (max-width: 600px) { .release-items li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
/* Hinweis auf eine noch nicht angesehene Version im Menü */
.main-nav a.has-news::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 5px; vertical-align: 0.35em; border-radius: 50%; background: var(--pg-accent); }

/* ------------------------------------------------------------- Rechenweg (gläsernes Modell) */
.pg-trace__bar { gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.pg-trace__layout { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .pg-trace__layout { grid-template-columns: 1fr; } }
.pg-trace__targets { display: flex; flex-direction: column; gap: 2px; max-height: 560px; overflow: auto; }
.pg-trace__target { display: flex; justify-content: space-between; gap: .5rem; width: 100%; text-align: left; font: inherit; color: inherit;
  background: transparent; border: 1px solid transparent; border-radius: 6px; padding: .3rem .5rem; cursor: pointer; }
.pg-trace__target:hover { background: var(--color-surface-2, rgba(127,127,127,.08)); }
.pg-trace__target.is-active { border-color: var(--color-border, #ccc); background: var(--color-surface, #fff); font-weight: 600; }
.pg-trace__tval { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pg-trace__formula code { white-space: normal; }
.pg-trace__table td code { white-space: normal; }
.pg-trace__param { display: block; }
