:root {
  --mp-page-bg: #eef2f6;
  --mp-panel-bg: #ffffff;
  --mp-panel-soft: #f7f9fb;
  --mp-border: #d9e1e8;
  --mp-text: #203040;
  --mp-muted: #617181;
  --mp-accent: #285f87;
  --mp-accent-rgb: 40, 95, 135;
  --mp-shadow: 0 10px 30px rgba(26, 45, 66, .08);
  --mp-radius: 16px;
}

body.app-shell {
  min-height: 100vh;
  background: var(--mp-page-bg);
  color: var(--mp-text);
}

body.theme-neutral {
  --mp-page-bg: #eef1f4;
  --mp-panel-bg: #ffffff;
  --mp-panel-soft: #f5f7f9;
  --mp-border: #d7dde3;
  --mp-text: #263442;
  --mp-muted: #697683;
  --mp-accent: #41657d;
  --mp-accent-rgb: 65, 101, 125;
  --bs-primary: #41657d;
  --bs-primary-rgb: 65, 101, 125;
  --bs-link-color: #365d76;
  --bs-link-hover-color: #29495e;
}

body.theme-light {
  --mp-page-bg: #f2f7fb;
  --mp-panel-bg: #ffffff;
  --mp-panel-soft: #f6fbff;
  --mp-border: #d9e7f1;
  --mp-text: #17324a;
  --mp-muted: #60778b;
  --mp-accent: #1769aa;
  --mp-accent-rgb: 23, 105, 170;
  --bs-primary: #1769aa;
  --bs-primary-rgb: 23, 105, 170;
  --bs-link-color: #1769aa;
  --bs-link-hover-color: #0f4f82;
}

body.theme-dark {
  --mp-page-bg: #111820;
  --mp-panel-bg: #18222d;
  --mp-panel-soft: #202c38;
  --mp-border: #354453;
  --mp-text: #edf4f8;
  --mp-muted: #a8b8c5;
  --mp-accent: #6eb4e6;
  --mp-accent-rgb: 110, 180, 230;
  --mp-shadow: 0 12px 34px rgba(0, 0, 0, .24);
  --bs-primary: #6eb4e6;
  --bs-primary-rgb: 110, 180, 230;
  --bs-link-color: #8ac9f3;
  --bs-link-hover-color: #b6ddf8;
}

.app-panel,
body.app-shell .card,
body.app-shell .modal-content,
body.app-shell .list-group-item,
body.app-shell .toolbar,
body.app-shell .legend {
  background-color: var(--mp-panel-bg);
  border-color: var(--mp-border);
}

body.app-shell .card {
  border-radius: var(--mp-radius);
  box-shadow: var(--mp-shadow);
  overflow: hidden;
}

body.app-shell .card-header {
  background: var(--mp-panel-soft);
  border-color: var(--mp-border);
}

body.app-shell .text-muted,
body.app-shell .form-text {
  color: var(--mp-muted) !important;
}

body.app-shell .form-control,
body.app-shell .form-select,
body.app-shell .input-group-text {
  border-color: var(--mp-border);
}

body.app-shell .btn-primary {
  --bs-btn-bg: var(--mp-accent);
  --bs-btn-border-color: var(--mp-accent);
  --bs-btn-hover-bg: color-mix(in srgb, var(--mp-accent) 84%, #000);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--mp-accent) 84%, #000);
  --bs-btn-active-bg: color-mix(in srgb, var(--mp-accent) 75%, #000);
  --bs-btn-active-border-color: color-mix(in srgb, var(--mp-accent) 75%, #000);
}

body.app-shell .btn-outline-primary {
  --bs-btn-color: var(--mp-accent);
  --bs-btn-border-color: var(--mp-accent);
  --bs-btn-hover-bg: var(--mp-accent);
  --bs-btn-hover-border-color: var(--mp-accent);
  --bs-btn-active-bg: var(--mp-accent);
  --bs-btn-active-border-color: var(--mp-accent);
}

body.app-shell .page-kicker {
  color: var(--mp-accent);
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .76rem;
}

body.app-shell .brand-mark {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  color: var(--mp-accent);
  background: rgba(var(--mp-accent-rgb), .12);
  border: 1px solid rgba(var(--mp-accent-rgb), .22);
  font-size: 1.35rem;
}

body.app-shell .section-title {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1rem;
}

body.app-shell .section-number {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: var(--mp-accent);
  background: rgba(var(--mp-accent-rgb), .12);
  font-weight: 700;
}

.theme-choice {
  position: relative;
  height: 100%;
}

.theme-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-choice label {
  height: 100%;
  display: block;
  padding: 1rem;
  border: 1px solid var(--mp-border);
  border-radius: 14px;
  background: var(--mp-panel-bg);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.theme-choice input:checked + label {
  border-color: var(--mp-accent);
  box-shadow: 0 0 0 3px rgba(var(--mp-accent-rgb), .16);
  transform: translateY(-1px);
}

.theme-preview {
  height: 86px;
  border-radius: 11px;
  border: 1px solid rgba(90, 105, 120, .24);
  overflow: hidden;
  margin-bottom: .8rem;
}

.theme-preview-bar {
  height: 21px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
}

.theme-preview-bar::before,
.theme-preview-bar::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .4;
}

.theme-preview-content {
  display: grid;
  grid-template-columns: 31% 1fr;
  gap: 7px;
  padding: 9px;
}

.theme-preview-content span {
  display: block;
  height: 42px;
  border-radius: 6px;
}

.preview-neutral { background: #eef1f4; color: #41657d; }
.preview-neutral .theme-preview-bar { background: #fff; }
.preview-neutral .theme-preview-content span { background: #fff; border: 1px solid #d7dde3; }
.preview-neutral .theme-preview-content span:last-child { background: #f7f9fb; }

.preview-light { background: #f2f7fb; color: #1769aa; }
.preview-light .theme-preview-bar { background: #fff; }
.preview-light .theme-preview-content span { background: #fff; border: 1px solid #d9e7f1; }
.preview-light .theme-preview-content span:last-child { background: #eaf5fc; }

.preview-dark { background: #111820; color: #6eb4e6; }
.preview-dark .theme-preview-bar { background: #18222d; }
.preview-dark .theme-preview-content span { background: #18222d; border: 1px solid #354453; }
.preview-dark .theme-preview-content span:last-child { background: #202c38; }

.install-summary {
  border: 1px solid var(--mp-border);
  background: var(--mp-panel-soft);
  border-radius: 14px;
  padding: 1rem;
}

.install-checks .badge {
  border: 1px solid var(--mp-border);
  background: var(--mp-panel-soft) !important;
  color: var(--mp-text) !important;
  padding: .55rem .7rem;
  font-weight: 550;
}

body.theme-dark .table,
body.theme-dark .table > :not(caption) > * > * {
  --bs-table-bg: var(--mp-panel-bg);
  --bs-table-striped-bg: #1e2a35;
  --bs-table-color: var(--mp-text);
  --bs-table-border-color: var(--mp-border);
}

body.theme-dark .table-primary {
  --bs-table-bg: #263c4d;
  --bs-table-color: #f3f8fb;
  --bs-table-border-color: #3c5263;
}

body.theme-dark .toolbar,
body.theme-dark .legend,
body.theme-dark .sticky-col,
body.theme-dark .med-card,
body.theme-dark .filter-chip.btn,
body.theme-dark #tableView > .bg-white {
  background: var(--mp-panel-bg) !important;
  color: var(--mp-text);
  border-color: var(--mp-border) !important;
}

body.theme-dark .table thead.sticky-head th {
  background: #263440 !important;
}

body.theme-dark .filter-chip.btn {
  --bs-btn-color: var(--mp-text);
  --bs-btn-bg: var(--mp-panel-bg);
  --bs-btn-border-color: var(--mp-border);
  --bs-btn-hover-bg: var(--mp-panel-soft);
  --bs-btn-hover-border-color: var(--mp-border);
}

body.theme-dark .alert-light {
  --bs-alert-color: var(--mp-text);
  --bs-alert-bg: var(--mp-panel-soft);
  --bs-alert-border-color: var(--mp-border);
}

body.theme-dark .list-group-item-action:hover,
body.theme-dark .list-group-item-action:focus {
  background: var(--mp-panel-soft);
}

body.theme-light .card,
body.theme-light .toolbar {
  box-shadow: 0 12px 32px rgba(21, 88, 137, .07);
}

body.theme-neutral .card,
body.theme-neutral .toolbar {
  box-shadow: 0 8px 24px rgba(42, 56, 67, .055);
}

@media (max-width: 767.98px) {
  body.app-shell .card { border-radius: 13px; }
  .theme-preview { height: 72px; }
}

@media print {
  body.app-shell {
    background: #fff !important;
    color: #000 !important;
  }
}

.backup-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid var(--mp-border);
  background: var(--mp-panel-soft);
  color: var(--mp-accent);
  font-size: 1.45rem;
  font-weight: 700;
}

/* ---------- Hilfe & Anleitung ---------- */
.help-page {
  scroll-behavior: smooth;
}

.help-page code {
  color: var(--mp-accent);
  background: rgba(var(--mp-accent-rgb), .08);
  border: 1px solid rgba(var(--mp-accent-rgb), .14);
  border-radius: .38rem;
  padding: .08rem .32rem;
  overflow-wrap: anywhere;
}

.help-skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 1100;
  padding: .6rem .85rem;
  border-radius: .6rem;
  background: var(--mp-accent);
  color: #fff;
}

.help-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: color-mix(in srgb, var(--mp-panel-bg) 94%, transparent);
  border-bottom: 1px solid var(--mp-border);
  backdrop-filter: blur(12px);
}

.help-brand {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  color: var(--mp-text);
}

.help-brand:hover {
  color: var(--mp-text);
}

.help-intro,
.help-sidebar,
.help-section {
  background: var(--mp-panel-bg);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
}

.help-intro {
  padding: clamp(1.4rem, 3vw, 2.5rem);
  box-shadow: var(--mp-shadow);
}

.help-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
}

.help-status-grid > div {
  padding: .85rem;
  border-radius: .85rem;
  background: var(--mp-panel-soft);
  border: 1px solid var(--mp-border);
}

.help-status-grid span,
.help-status-grid strong {
  display: block;
}

.help-status-grid span {
  color: var(--mp-muted);
  font-size: .8rem;
  margin-bottom: .15rem;
}

.help-sidebar {
  position: sticky;
  top: 6.5rem;
  padding: .8rem;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
}

.help-sidebar-title {
  padding: .35rem .7rem .7rem;
  font-weight: 650;
  color: var(--mp-muted);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.help-sidebar .nav-link {
  color: var(--mp-text);
  border-radius: .7rem;
  padding: .48rem .7rem;
  font-size: .92rem;
}

.help-sidebar .nav-link:hover {
  background: var(--mp-panel-soft);
}

.help-sidebar .nav-link.active {
  background: rgba(var(--mp-accent-rgb), .13);
  color: var(--mp-accent);
  font-weight: 650;
}

.help-mobile-nav {
  display: none;
}

.help-section {
  scroll-margin-top: 7.2rem;
  padding: clamp(1.25rem, 2.6vw, 2rem);
  margin-bottom: 1.25rem;
  box-shadow: 0 5px 18px rgba(30, 50, 70, .035);
}

.help-section h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.3vw, 1.75rem);
}

.help-section h3 {
  margin-top: 1.6rem;
  margin-bottom: .65rem;
  font-size: 1.08rem;
}

.help-section p:last-child,
.help-section ul:last-child,
.help-section ol:last-child {
  margin-bottom: 0;
}

.help-callout,
.help-tip {
  padding: 1rem 1.1rem;
  border-radius: .9rem;
  border: 1px solid rgba(var(--mp-accent-rgb), .22);
  background: rgba(var(--mp-accent-rgb), .09);
}

.metric-card {
  height: 100%;
  border: 1px solid var(--mp-border);
  background: var(--mp-panel-soft);
  border-radius: .9rem;
  padding: .95rem;
}

.viz-node {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1rem;
  border: 1px solid var(--mp-border);
  border-radius: .9rem;
  background: var(--mp-panel-soft);
}

.viz-node span {
  color: var(--mp-muted);
  font-size: .92rem;
}

.help-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .8rem;
}

.help-steps li {
  display: grid;
  grid-template-columns: 2.3rem minmax(0, 1fr);
  gap: .85rem;
  align-items: start;
  padding: .9rem;
  border: 1px solid var(--mp-border);
  border-radius: .9rem;
  background: var(--mp-panel-soft);
}

.help-steps li > span {
  width: 2.3rem;
  height: 2.3rem;
  display: grid;
  place-items: center;
  border-radius: .75rem;
  color: var(--mp-accent);
  background: rgba(var(--mp-accent-rgb), .12);
  font-weight: 700;
}

.help-steps p {
  margin: .15rem 0 0;
  color: var(--mp-muted);
}

.help-feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin: 1rem 0;
}

.help-feature-list > div {
  padding: .85rem;
  border-radius: .85rem;
  border: 1px solid var(--mp-border);
  background: var(--mp-panel-soft);
}

.help-feature-list strong,
.help-feature-list span {
  display: block;
}

.help-feature-list span {
  margin-top: .2rem;
  color: var(--mp-muted);
  font-size: .9rem;
}

.help-figure {
  margin: 1.35rem 0 0;
}

.help-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--mp-border);
  border-radius: .9rem;
  background: var(--mp-panel-soft);
}

.help-figure figcaption {
  padding: .65rem .2rem 0;
  color: var(--mp-muted);
  font-size: .88rem;
}

.help-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--mp-text);
  --bs-table-border-color: var(--mp-border);
}

.help-code-example {
  padding: 1rem;
  border: 1px solid var(--mp-border);
  border-radius: .85rem;
  background: var(--mp-panel-soft);
}

.help-accordion .accordion-item,
.help-accordion .accordion-button,
.help-accordion .accordion-body {
  color: var(--mp-text);
  background: var(--mp-panel-bg);
  border-color: var(--mp-border);
}

.help-accordion .accordion-button:not(.collapsed) {
  color: var(--mp-accent);
  background: rgba(var(--mp-accent-rgb), .09);
  box-shadow: inset 0 calc(-1 * var(--bs-accordion-border-width)) 0 var(--mp-border);
}

.help-footer-section {
  border-color: rgba(var(--mp-accent-rgb), .28);
  background: rgba(var(--mp-accent-rgb), .06);
}

.help-footer {
  border-top: 1px solid var(--mp-border);
  background: var(--mp-panel-bg);
}

body.theme-dark .help-section,
body.theme-dark .help-intro,
body.theme-dark .help-sidebar {
  box-shadow: none;
}

@media (max-width: 991.98px) {
  .help-mobile-nav {
    display: block;
    padding: 1rem;
    border-radius: var(--mp-radius);
    border: 1px solid var(--mp-border);
    background: var(--mp-panel-bg);
  }

  .help-page aside {
    display: none;
  }

  .help-topbar {
    position: static;
  }

  .help-section {
    scroll-margin-top: 1rem;
  }
}

@media (max-width: 575.98px) {
  .help-status-grid,
  .help-feature-list {
    grid-template-columns: 1fr;
  }

  .help-section,
  .help-intro {
    border-radius: 13px;
  }
}

@media print {
  .help-page {
    background: #fff !important;
    color: #000 !important;
    font-size: 10.5pt;
  }

  .help-page .container {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
  }

  .help-intro,
  .help-section {
    background: #fff !important;
    color: #000 !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 0 8mm !important;
    break-inside: auto;
  }

  .help-section {
    break-before: page;
  }

  .help-section:first-of-type {
    break-before: auto;
  }

  .help-figure,
  .help-table,
  .help-steps li,
  .metric-card,
  .viz-node,
  .alert,
  .help-callout,
  .help-tip {
    break-inside: avoid;
  }

  .help-figure img {
    max-height: 115mm;
    object-fit: contain;
  }

  .help-page a {
    color: #000 !important;
    text-decoration: none !important;
  }

  .help-page code {
    color: #000 !important;
    background: #f3f3f3 !important;
    border-color: #ccc !important;
  }

  .help-accordion .accordion-collapse {
    display: block !important;
  }

  .help-accordion .accordion-button::after {
    display: none !important;
  }
}


/* Developer credit */
.app-developer-footer {
  margin-top: 2.5rem;
  border-top: 1px solid var(--mp-border);
  background: var(--mp-panel-bg);
}

.developer-credit {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}

.developer-logo-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 42px;
  flex: 0 0 auto;
  padding: .28rem .55rem;
  border-radius: .75rem;
  background: #10283a;
  border: 1px solid rgba(255, 255, 255, .15);
}

.developer-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.developer-copy {
  display: grid;
  line-height: 1.25;
}

.developer-copy strong {
  font-size: .92rem;
  color: var(--mp-text);
}

.developer-copy a {
  font-size: .84rem;
  color: var(--mp-muted);
  text-decoration: none;
}

.developer-copy a:hover,
.developer-copy a:focus {
  color: var(--mp-accent);
  text-decoration: underline;
}

.developer-label {
  color: var(--mp-muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.developer-profile-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--mp-border);
  border-radius: .9rem;
  background: var(--mp-panel-soft);
}

.developer-profile-card .developer-logo-frame {
  width: 118px;
  height: 58px;
}

@media (max-width: 575.98px) {
  .developer-credit {
    align-items: flex-start;
  }

  .developer-logo-frame {
    width: 66px;
    height: 38px;
  }
}

@media print {
  .app-developer-footer,
  .developer-credit {
    display: none !important;
  }
}
