html {
  font-size: 87.5%;
}

body {
  background: #f4f6f9;
}

main {
  min-height: calc(100vh - 132px);
}

.lucide {
  width: 1rem;
  height: 1rem;
  stroke-width: 2;
  flex: 0 0 auto;
}

h1 .lucide,
h2 .lucide,
.navbar-brand .lucide {
  width: 1.15em;
  height: 1.15em;
}

.card {
  box-shadow: 0 .125rem .35rem rgba(30, 60, 90, .08);
}

.card-header,
.card-footer {
  background: rgba(248, 249, 250, .82);
}

.active-config-bar {
  background: #eef5fb;
}

.active-card {
  background: linear-gradient(135deg, #fff 0%, #edf5fb 100%);
}

.metric {
  background: rgba(248, 249, 250, .9);
  border: 1px solid #d9e2ea;
  border-radius: .35rem;
  padding: .85rem 1rem;
  height: 100%;
}

.metric span {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: #687887;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.metric strong {
  display: block;
  font-size: 1.65rem;
  margin-top: .15rem;
}

.metric small {
  display: block;
  margin-top: .1rem;
  color: #687887;
  font-size: .75rem;
}

.environment-prod {
  background: #d9534f;
  color: #fff;
}

.environment-test {
  background: #f0ad4e;
  color: #212529;
}

.environment-dev {
  background: #5cb85c;
  color: #fff;
}

.environment-other {
  background: #6c757d;
  color: #fff;
}

.environment-int { background: #176b87; color: #fff; }
.environment-kons { background: #6f42c1; color: #fff; }
.environment-staging { background: #946200; color: #fff; }

.tool-placeholder {
  border: 1px dashed #aebdca;
  border-radius: .35rem;
  padding: 1rem;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  background: #f8fafc;
}

.tool-placeholder > .lucide {
  width: 1.35rem;
  height: 1.35rem;
  color: var(--bs-primary);
}

.tool-placeholder span {
  color: #6c757d;
  font-size: .9rem;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 1.4fr);
  gap: .7rem 1rem;
  margin-bottom: 0;
}

.detail-list dt {
  color: #6c757d;
  font-weight: 500;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem;
}

thead th {
  color: #687887 !important;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .035em;
  white-space: nowrap;
}

.table-sm > :not(caption) > * > * {
  padding: .65rem .65rem;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .3rem .48rem;
}

.icon-button .lucide {
  width: .95rem;
  height: .95rem;
}

.empty-icon {
  width: 2rem;
  height: 2rem;
  opacity: .5;
}

.alert > .lucide {
  margin-top: .1rem;
}

.badge .lucide {
  width: .8rem;
  height: .8rem;
}

@media (max-width: 767.98px) {
  main,
  .navbar .container-fluid,
  .active-config-bar .container-fluid,
  footer {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .detail-list {
    grid-template-columns: 1fr;
    gap: .2rem;
  }

  .detail-list dd {
    margin-bottom: .65rem;
  }
}

/* Importer / Dateiinventar */
.table .font-monospace {
  font-size: .78rem;
}

.analysis-error {
  background: var(--bs-danger);
  color: #fff;
}

.analysis-warning {
  background: var(--bs-warning);
  color: #212529;
}

.analysis-info {
  background: var(--bs-info);
  color: #fff;
}

/* Finding-Arbeitsliste */
.finding-filter-form .form-label {
  color: #687887;
  font-weight: 600;
}

.finding-groups {
  background: #f8fafc;
}

.finding-group-heading {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem 1rem;
  background: #e9eff5;
  border-top: 1px solid #d9e2ea;
  border-bottom: 1px solid #d9e2ea;
}

.finding-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: .85rem 1rem;
  background: #fff;
  border-bottom: 1px solid #e1e7ec;
  border-left: .25rem solid transparent;
}

.finding-item:last-child {
  border-bottom: 0;
}

.finding-item.finding-status-reviewed {
  border-left-color: var(--bs-success);
  background: #f4fbf7;
}

.finding-item.finding-status-ignored {
  border-left-color: var(--bs-secondary);
  background: #f1f3f5;
  opacity: .78;
}

.finding-main {
  min-width: 0;
}

.finding-title {
  overflow-wrap: anywhere;
}

.finding-actions {
  display: flex;
  gap: .35rem;
  flex: 0 0 auto;
}

.status-open {
  background: #dfe7ee;
  color: #32495d;
}

.status-reviewed {
  background: var(--bs-success);
  color: #fff;
}

.status-ignored {
  background: var(--bs-secondary);
  color: #fff;
}

/* Stream-Detail und Variablenhervorhebung */
.selected-usage {
  box-shadow: inset .25rem 0 0 var(--bs-primary);
}

.usage-location {
  border: 1px solid #d9e2ea;
  border-radius: .3rem;
  padding: .65rem;
  background: #f8fafc;
}

.usage-excerpt,
.raw-json {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: .78rem;
  background: #202a33;
  color: #e9f0f5;
  border-radius: .3rem;
  padding: .8rem;
  max-height: 65vh;
  overflow: auto;
}

.usage-excerpt mark,
.raw-json mark {
  background: #ffe38a;
  color: #202a33;
  border-radius: .15rem;
  padding: 0 .12rem;
}

@media (max-width: 767.98px) {
  .finding-item {
    flex-direction: column;
  }
}

/* Variablenlisten und Detailansicht */
.table > tbody > tr.variable-unused > * {
  background-color: #fdecec;
  font-weight: 600;
}

.table > tbody > tr.variable-unused > td:first-child {
  border-left: 4px solid #dc3545;
}

.variable-link {
  font-weight: 600;
  text-decoration: none;
}

.variable-link:hover {
  text-decoration: underline;
}

.variable-value {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: .82rem;
  background: #f4f7f9;
  border: 1px solid #d9e2ea;
  border-radius: .3rem;
  padding: .8rem;
  max-height: 28rem;
  overflow: auto;
}

/* Deprecated-Node-Arbeitsliste */
.metric-link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.metric-link:hover {
  color: inherit;
  border-color: var(--bs-warning);
  background: #fff8df;
}

.deprecated-worklist {
  background: #f8fafc;
}

.deprecated-stream-group + .deprecated-stream-group {
  border-top: 1px solid #d9e2ea;
}

.deprecated-stream-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  background: #e9eff5;
  border-bottom: 1px solid #d9e2ea;
}

.deprecated-node-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  background: #fff8df;
  border-bottom: 1px solid #eadca7;
  border-left: .25rem solid var(--bs-warning);
}

.deprecated-node-item.finding-status-reviewed {
  background: #f4fbf7;
  border-left-color: var(--bs-success);
}

.deprecated-node-item.finding-status-ignored {
  background: #f1f3f5;
  border-left-color: var(--bs-secondary);
  opacity: .78;
}

.deprecated-node-main {
  min-width: 0;
}

.selected-deprecated-node {
  box-shadow: inset .3rem 0 0 var(--bs-warning);
  background: #fff8df;
}

@media (max-width: 767.98px) {
  .deprecated-node-item {
    flex-direction: column;
  }
}

.source-quality-card .source-box {
  height: 100%;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  padding: 0.75rem;
  background: rgba(255,255,255,0.65);
}

.source-quality-card .source-box strong {
  display: block;
  word-break: break-word;
}

/* Stream-Grafik */
.stream-graph-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem;
}

.stream-graph-toolbar {
  border: 1px solid #d9e2ea;
  border-radius: .45rem .45rem 0 0;
  background: #eef5fb;
  padding: .6rem .75rem;
}

.stream-graph-canvas {
  position: relative;
  min-height: 620px;
  max-height: 72vh;
  overflow: auto;
  border: 1px solid #d9e2ea;
  border-top: 0;
  border-radius: 0 0 .45rem .45rem;
  background-color: #f8fafc;
  background-image:
    linear-gradient(#e5edf4 1px, transparent 1px),
    linear-gradient(90deg, #e5edf4 1px, transparent 1px);
  background-size: 24px 24px;
}

.stream-graph-world {
  position: relative;
  transform-origin: 0 0;
  transition: transform .12s ease-out;
}

.stream-graph-svg {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.stream-graph-link {
  fill: none;
  stroke: #7f95aa;
  stroke-width: 2.25;
}

.stream-graph-link-success {
  stroke: #198754;
}

.stream-graph-link-failed {
  stroke: #dc3545;
}

.stream-graph-link-trigger {
  stroke: #2f7fb8;
  stroke-dasharray: 5 4;
}

.stream-graph-arrow {
  fill: #7f95aa;
}

.stream-graph-arrow-success {
  fill: #198754;
}

.stream-graph-arrow-failed {
  fill: #dc3545;
}

.stream-graph-arrow-trigger {
  fill: #2f7fb8;
}

.stream-graph-node {
  position: absolute;
  z-index: 2;
  text-align: left;
  border: 1px solid #afc0cf;
  border-radius: .55rem;
  background: #fff;
  color: #243746;
  padding: .65rem .75rem;
  box-shadow: 0 .18rem .45rem rgba(36, 55, 70, .16);
  cursor: pointer;
}

.stream-graph-node:hover,
.stream-graph-node-active {
  border-color: var(--bs-primary);
  box-shadow: 0 .25rem .7rem rgba(47, 127, 184, .26);
}

.stream-graph-node-title {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-weight: 700;
  min-width: 0;
}

.stream-graph-node-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-graph-node-class,
.stream-graph-node-uuid {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem;
  color: #647789;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: .18rem;
}

.stream-graph-node-start {
  border-color: var(--bs-primary);
  background: #eef7ff;
}

.stream-graph-node-deprecated {
  border-color: #dc3545;
  background: #fdecec;
  box-shadow: 0 .18rem .45rem rgba(220, 53, 69, .18);
}

.stream-graph-node-selected {
  outline: 4px solid rgba(255, 193, 7, .52);
  border-color: #f0ad4e;
}

.stream-graph-node-variable {
  outline: 4px solid rgba(91, 192, 222, .36);
  border-color: var(--bs-info);
}

.stream-graph-details {
  position: sticky;
  top: 7.5rem;
  max-height: 72vh;
  overflow: auto;
}

.stream-graph-properties {
  display: grid;
  gap: .5rem;
}

.stream-graph-property {
  border: 1px solid #d9e2ea;
  border-radius: .35rem;
  overflow: hidden;
  background: #fff;
}

.stream-graph-property-key {
  background: #edf3f8;
  padding: .35rem .55rem;
  font-weight: 600;
  color: #526778;
  font-size: .78rem;
}

.stream-graph-property-value {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: .55rem;
  font-size: .74rem;
  max-height: 14rem;
  overflow: auto;
  background: #fbfdff;
}

.stream-graph-empty {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: #687887;
  text-align: center;
  padding: 2rem;
}

.stream-graph-empty .lucide {
  width: 2rem;
  height: 2rem;
}

@media (max-width: 1199.98px) {
  .stream-graph-shell {
    grid-template-columns: 1fr;
  }

  .stream-graph-details {
    position: static;
    max-height: none;
  }
}

/* v0.9.1: Gruppierte Deprecated-Arbeitsliste */
.deprecated-grouped-worklist {
  background: #f8fafc;
}

.deprecated-stream-row {
  display: grid;
  grid-template-columns: minmax(16rem, 28%) minmax(0, 1fr);
  border-bottom: 1px solid #d9e2ea;
}

.deprecated-stream-row:last-child {
  border-bottom: 0;
}

.deprecated-stream-cell {
  padding: 1rem;
  background: #e9eff5;
  border-right: 1px solid #d9e2ea;
  min-width: 0;
}

.deprecated-nodes-cell {
  padding: .7rem;
  display: grid;
  gap: .55rem;
  min-width: 0;
}

.deprecated-node-compact {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .75rem;
  background: #fff8df;
  border: 1px solid #eadca7;
  border-left: .25rem solid var(--bs-warning);
  border-radius: .45rem;
}

.deprecated-node-compact.finding-status-reviewed {
  background: #f4fbf7;
  border-color: #bfe8cd;
  border-left-color: var(--bs-success);
}

.deprecated-node-compact.finding-status-ignored {
  background: #f1f3f5;
  border-color: #d7dce0;
  border-left-color: var(--bs-secondary);
  opacity: .78;
}

.deprecated-node-compact-main {
  min-width: 0;
}

.deprecated-node-class {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: .86rem;
  font-weight: 600;
}

.deprecated-node-compact-actions {
  display: flex;
  gap: .3rem;
  flex: 0 0 auto;
}

@media (max-width: 991.98px) {
  .deprecated-stream-row {
    grid-template-columns: 1fr;
  }

  .deprecated-stream-cell {
    border-right: 0;
    border-bottom: 1px solid #d9e2ea;
  }
}

@media (max-width: 575.98px) {
  .deprecated-node-compact {
    flex-direction: column;
  }
}

.dashboard-link-card {
  color: inherit;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.dashboard-link-card:hover {
  color: inherit;
  transform: translateY(-1px);
  border-color: rgba(47, 97, 146, 0.35);
  box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.08);
}

.variable-value-cell {
  max-width: 38rem;
}

/* Stream-Übersicht */
.stream-area-badge {
  border: 1px solid rgba(0,0,0,.08);
}

.stream-area-fx,
.stream-area-badge.stream-area-fx {
  background: #e8f3ff;
  color: #1b5f9e;
}

.stream-area-io,
.stream-area-badge.stream-area-io {
  background: #e9f8ef;
  color: #2f7a45;
}

.stream-area-co,
.stream-area-badge.stream-area-co {
  background: #fff2dc;
  color: #9a6200;
}

.stream-area-hk,
.stream-area-badge.stream-area-hk {
  background: #fdecec;
  color: #b02a37;
}

.stream-area-unknown,
.stream-area-badge.stream-area-unknown {
  background: #f8f9fa;
  color: #6c757d;
}

.stream-table td {
  vertical-align: top;
}

.dashboard-link-card .lucide {
  color: var(--bs-primary);
}


/* v0.9.5: Dateiinventar-Unterseite */
.file-inventory-table td:first-child {
  max-width: 42rem;
}

.graph-legend-line {
  position: relative;
  padding-left: 2.1rem;
  line-height: 1.2;
}

.graph-legend-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1.65rem;
  height: 2px;
  transform: translateY(-50%);
  background: #7f95aa;
}

.graph-legend-success::before { background: #198754; }
.graph-legend-failed::before { background: #dc3545; }
.graph-legend-trigger::before {
  background: repeating-linear-gradient(90deg, #2f7fb8 0 6px, transparent 6px 10px);
}

.table-compact { font-size: .9rem; }
.table-compact > :not(caption) > * > * { padding: .38rem .55rem; }

.metadata-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.metadata-field-chip {
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-danger-soft > * {
  background-color: #fdecec !important;
}

.table-warning-soft > * {
  background-color: #fff6dd !important;
}

.code-block {
  background: #1f2933;
  color: #f8fafc;
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 1rem;
  overflow: auto;
  white-space: pre;
  border-radius: 0 0 var(--bs-card-border-radius) var(--bs-card-border-radius);
}

.code-block-large {
  max-height: 70vh;
}

/* Script detail viewer */
.script-dialog { width: 96vw; max-width: none; height: 94vh; max-height: 96vh; padding: 0; border: 0; border-radius: 0.5rem; }
.script-dialog::backdrop { background: rgb(0 0 0 / 60%); }
.script-dialog-open { overflow: hidden; }
.script-dialog .script-viewer { height: 100%; margin: 0 !important; display: flex; flex-direction: column; }
.script-dialog .script-pane:not(.d-none) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.script-dialog .code-block { flex: 1; max-height: none; min-height: 0; }
.script-viewer .code-block { font-size: var(--script-font-size, 14px); tab-size: 2; }
.script-wrap .code-block { white-space: pre-wrap; overflow-wrap: anywhere; }
.script-viewer .hljs-keyword, .script-viewer .hljs-selector-tag { color: #c792ea; }
.script-viewer .hljs-string, .script-viewer .hljs-regexp { color: #c3e88d; }
.script-viewer .hljs-number, .script-viewer .hljs-literal { color: #f78c6c; }
.script-viewer .hljs-comment { color: #a4b3bf; font-style: italic; }
.script-viewer .hljs-title, .script-viewer .hljs-built_in { color: #82aaff; }
.script-viewer .hljs-attr, .script-viewer .hljs-params { color: #ffcb6b; }
.script-pane {
  position: relative;
}

.script-pane-label {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.35rem 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.075);
  background: rgba(248, 249, 250, 0.96);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
}


.app-main {
  padding: 1rem;
}

.card-body {
  padding: 1rem;
}

.table {
  margin-bottom: 0.75rem;
}

.table-compact {
  font-size: 0.9rem;
}

.table-compact > :not(caption) > * > * {
  padding: 0.35rem 0.5rem;
}
/* Keep help topics visible below the sticky navigation when following anchors. */
body:has(nav a[href="/help"][aria-current="page"]) main section[id] {
  scroll-margin-top: 10rem;
}
.operation-progress { width: min(38rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow-y: auto; }
.operation-progress::backdrop { background: rgb(0 0 0 / 45%); }
.operation-progress [hidden] { display: none !important; }
.configuration-archive .archive-note { min-width: 12rem; max-width: 28rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.import-notice { transition: opacity 0.3s ease; }
.import-notice.is-dismissing { opacity: 0; }
.comparison-fields { table-layout: fixed; width: 100%; }
.comparison-fields th:first-child { width: 22%; }
.comparison-fields td { width: 39%; vertical-align: top; }
.comparison-fields .comparison-before { background: rgba(220, 53, 69, 0.06); }
.comparison-fields .comparison-after { background: rgba(25, 135, 84, 0.06); }
.comparison-value { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 28rem; overflow: auto; margin: 0; font-size: 0.8rem; color: inherit; }
@media (prefers-reduced-motion: reduce) { .import-notice { transition: none; } }
