/* Grundlayout */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #050612;
  color: #f5f5f7;
}

body {
  min-height: 100vh;
}

.page {
  max-width: 1150px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* Header */

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0 0 4px;
  font-size: 1.9rem;
}

.page-header p {
  margin: 0;
  color: #a7b0c0;
  font-size: 0.95rem;
}

/* Karten / Sektionen */

.section {
  margin-bottom: 18px;
}

.card {
  background: radial-gradient(circle at top left, #151a33 0, #070816 45%, #050612 100%);
  border-radius: 16px;
  padding: 18px 18px 20px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(120, 144, 180, 0.35);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.login-card {
  max-width: 520px;
  margin: 0 auto;
}

/* Systemstatus */

.status-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-top: 8px;
}

.status-card {
  background: rgba(5, 6, 18, 0.8);
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(120, 144, 180, 0.4);
}

.status-label {
  font-size: 0.85rem;
  color: #9ea9c3;
}

.status-value {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2px;
}

.status-sub {
  margin-top: 4px;
  font-size: 0.8rem;
  color: #8a94ab;
}

code {
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 0.8rem;
}

/* Buttons */

.actions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(120, 144, 180, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: #e5ecff;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn.primary {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-color: transparent;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.5);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.help-open-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  font-weight: 800;
}

.section-heading,
.label-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
}

.label-row {
  justify-content: flex-start;
}

.help-dot {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.45);
  background: rgba(8, 47, 73, 0.55);
  color: #bfdbfe;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.help-dot:hover,
.help-dot:focus-visible {
  border-color: rgba(186, 230, 253, 0.9);
  background: rgba(14, 116, 144, 0.45);
  outline: none;
}

/* Toggle-Gruppe (z.B. "Fehlercode vorhanden?") */

.toggle-group {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 4px 0 2px;
}

.toggle-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(120, 144, 180, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: #a9b6d6;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.toggle-btn:hover {
  border-color: rgba(120, 144, 180, 0.9);
}

.toggle-btn.active {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-color: transparent;
  color: #e5ecff;
}

.field-hint {
  margin: 4px 0 8px;
  font-size: 0.8rem;
  color: #a9b6d6;
}

.source-help {
  margin-top: 6px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(125, 211, 252, 0.25);
  background: rgba(8, 47, 73, 0.22);
  color: #b9c7e6;
  font-size: 0.78rem;
  line-height: 1.35;
}

.source-help strong {
  color: #dbeafe;
}

/* Status-Meldungen */

.status-ok {
  margin: 6px 0 10px;
  font-size: 0.9rem;
  color: #4ade80;
}

.status-warn {
  margin: 6px 0;
  font-size: 0.9rem;
  color: #facc15;
}

.flash-messages {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}

.flash {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.9rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.5);
}

.flash.success {
  border-color: rgba(74, 222, 128, 0.6);
}

.flash.error {
  border-color: rgba(248, 113, 113, 0.8);
}

/* Suche */

.search-form {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 2px;
}

textarea,
input[type="text"],
input[type="number"],
select {
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.7);
}

.attention-error {
  border-color: #f87171 !important;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.75) !important;
}

.attention-error.shake {
  animation: shake 0.7s ease;
}

@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

.search-row {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr;
  gap: 8px;
}

.field-group {
  display: flex;
  flex-direction: column;
}

.field-group.narrow input {
  text-align: center;
}

/* Suchstatus & Ergebnisse */

.search-status {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #cbd5f5;
}

.search-status.ok {
  color: #4ade80;
}
.search-status.error {
  color: #fb7185;
}
.search-status.pending {
  color: #fbbf24;
}

.search-results {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Ergebnis-Karten */

.result-card {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: radial-gradient(circle at top left, #111827 0, #020617 60%);
  padding: 10px 12px 12px;
}

.result-header {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.result-score {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 6px;
}

.result-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}

.auto-bmk-box {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px dashed rgba(129, 140, 248, 0.45);
  background: rgba(30, 41, 59, 0.35);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auto-bmk-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #a5b4fc;
}

.auto-bmk-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auto-bmk-row + .auto-bmk-row {
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  padding-top: 6px;
  margin-top: 2px;
}

.auto-bmk-label {
  font-size: 0.85rem;
  color: #e5e7eb;
}

.auto-bmk-meta {
  font-size: 0.75rem;
  color: #9ca3af;
}

.auto-bmk-link {
  font-size: 0.75rem;
  color: #93c5fd;
  text-decoration: underline;
  width: fit-content;
}

.auto-bmk-link:hover {
  color: #e0f2fe;
}

.lec-detail-box {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(15, 23, 42, 0.55);
}

.lec-detail-title {
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #bfdbfe;
  text-transform: uppercase;
}

.lec-detail-body {
  font-size: 0.86rem;
  line-height: 1.45;
  color: #e5e7eb;
  white-space: pre-wrap;
}

.meta-row {
  display: flex;
  gap: 4px;
  font-size: 0.8rem;
}

.meta-label {
  color: #9ca3af;
}

.meta-value {
  color: #e5e7eb;
}

.result-text .short-text {
  margin: 0 0 2px;
  font-size: 0.9rem;
  font-weight: 500;
}

.result-text .long-text {
  margin: 0;
  font-size: 0.8rem;
  color: #d1d5db;
  white-space: pre-wrap;
}

/* Chunk Cards */
.chunk-card {
  border-color: rgba(99, 102, 241, 0.35);
}

.chunk-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.chunk-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.chunk-title-link {
  color: #e5ecff;
  text-decoration: none;
}

.chunk-title-link:hover {
  text-decoration: underline;
}

.chunk-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-starterpack {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
}

.badge-community {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
}

.badge-service {
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.18);
  border-color: rgba(14, 165, 233, 0.45);
}

.badge-cross-model {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(248, 113, 113, 0.45);
}

.badge-import {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.45);
}

.chunk-meta-line {
  margin-top: 4px;
  font-size: 0.8rem;
  color: #9ca3af;
}

.chunk-id {
  margin-top: 2px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.cross-model-note {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.2);
  color: #fecaca;
  font-size: 0.78rem;
  line-height: 1.35;
}

.chunk-summary {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #d1d5db;
  white-space: pre-wrap;
}

.chunk-links {
  margin-top: 6px;
  display: flex;
  gap: 8px;
}

.chunk-link {
  color: #93c5fd;
  text-decoration: underline;
  font-size: 0.8rem;
}

.chunk-link:hover {
  color: #e0f2fe;
}

/* Chunk Detail */
.chunk-detail-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chunk-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chunk-detail-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.chunk-block {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(8, 12, 28, 0.7);
}

.chunk-block-title {
  font-size: 0.85rem;
  color: #a5b4fc;
  margin-bottom: 4px;
}

.chunk-block-body {
  font-size: 0.9rem;
  color: #e5e7eb;
  white-space: pre-wrap;
}

.chunk-text {
  font-size: 0.9rem;
  color: #e5e7eb;
  white-space: pre-wrap;
}

.chunk-list-title {
  font-size: 0.85rem;
  color: #a5b4fc;
  margin-bottom: 4px;
}

.chunk-list ul {
  margin: 4px 0 0 16px;
  padding: 0;
}

.chunk-list li {
  margin: 2px 0;
}

/* Ersatzteile Tabelle */
.parts-table {
  margin-top: 6px;
  display: grid;
  gap: 2px;
}

.parts-row {
  display: grid;
  grid-template-columns: 1.2fr 0.6fr 2fr 2fr;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.parts-row.parts-head {
  font-weight: 600;
  color: #cbd5f5;
}

.parts-cell {
  font-size: 0.8rem;
  color: #e5e7eb;
}

.bmk-link-btn {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  color: #cbd5f5;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}

.bmk-link-btn:hover {
  color: #e5e7eb;
  text-decoration: underline;
}

.bmk-link-btn:focus-visible {
  outline: 2px solid rgba(203, 213, 245, 0.6);
  outline-offset: 2px;
  border-radius: 2px;
}

.community-link {
  color: #93c5fd;
  text-decoration: underline;
}

.community-link:hover {
  color: #e0f2fe;
}

.query-expansion-note {
  margin: 8px 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(125, 211, 252, 0.32);
  background: rgba(14, 165, 233, 0.08);
  color: #bfdbfe;
  font-size: 0.82rem;
}

.related-category-hints {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 10px;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.45);
}

.related-category-label {
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 700;
}

.related-category-chip {
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.42);
  background: rgba(14, 116, 144, 0.18);
  color: #dbeafe;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.related-category-chip:hover,
.related-category-chip:focus-visible {
  border-color: rgba(186, 230, 253, 0.85);
  background: rgba(14, 116, 144, 0.34);
  outline: none;
}

.traffic {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  line-height: 1.2;
  margin-right: 6px;
}

.traffic-info {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
}

.traffic-warn {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
}

.traffic-critical {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
}

.traffic-advice {
  font-size: 0.85rem;
  opacity: 0.9;
  line-height: 1.35;
  color: #d1d5db;
}

.traffic-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.traffic-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.traffic-green {
  color: #86efac;
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.45);
}

.traffic-yellow {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
}

.traffic-red {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.45);
}

/* BMK-Details (Toggle) */

.bmk-details {
  margin-top: 2px;
  font-size: 0.8rem;
}

.bmk-details > summary {
  cursor: pointer;
  list-style: none;
  color: #a5b4fc;
}

.bmk-details > summary::-webkit-details-marker {
  display: none;
}

.bmk-details > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}

.bmk-details[open] > summary::before {
  transform: rotate(90deg);
}

.bmk-details-content {
  margin-top: 4px;
  padding-left: 8px;
  border-left: 2px solid rgba(148, 163, 184, 0.4);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Footer Kontakt */

.page-footer {
  margin: 0;
  padding: 0;
  height: 0;
  display: flex;
  justify-content: flex-end;
}

.footer-contact {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.contact-inline {
  position: static;
}

/* Modal */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10000;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 18, 0.75);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  background: #0b1020;
  border: 1px solid rgba(120, 144, 180, 0.45);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.55);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-close {
  border: 1px solid rgba(120, 144, 180, 0.6);
  background: transparent;
  color: #cbd5f5;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

/* Hilfe & Tour */

.help-panel {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 88px;
  z-index: 10020;
  width: min(390px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 252, 0.38);
  background: #0b1020;
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.65);
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.help-panel[hidden] {
  display: none;
}

.help-panel.is-open {
  transform: translateX(0);
  opacity: 1;
}

.help-panel-header,
.help-panel-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.help-panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.help-panel-body {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 2px;
}

.help-block h3 {
  margin: 0 0 6px;
  font-size: 0.92rem;
  color: #bfdbfe;
}

.help-block p {
  margin: 6px 0;
  color: #dbeafe;
  font-size: 0.86rem;
  line-height: 1.45;
}

.help-context {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  background: rgba(8, 47, 73, 0.32);
}

.help-steps {
  margin: 0;
  padding-left: 20px;
  color: #d1d5db;
  font-size: 0.86rem;
  line-height: 1.45;
}

.help-list {
  display: grid;
  gap: 6px 10px;
  grid-template-columns: 96px 1fr;
  margin: 0;
  font-size: 0.84rem;
}

.help-list dt {
  color: #e5ecff;
  font-weight: 700;
}

.help-list dd {
  margin: 0;
  color: #aab6cf;
  line-height: 1.35;
}

.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 10030;
  background: rgba(2, 6, 23, 0.58);
}

.tour-popover {
  position: fixed;
  z-index: 10040;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(186, 230, 253, 0.5);
  background: #10172a;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.62);
}

.tour-popover[hidden],
.tour-overlay[hidden] {
  display: none;
}

.tour-kicker {
  margin-bottom: 4px;
  color: #7dd3fc;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tour-popover h2 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.tour-popover p {
  margin: 0;
  color: #dbeafe;
  font-size: 0.88rem;
  line-height: 1.45;
}

.tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.tour-actions .btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.tour-target {
  position: relative;
  z-index: 10035;
  outline: 3px solid rgba(125, 211, 252, 0.9);
  outline-offset: 4px;
  border-radius: 10px;
  box-shadow: 0 0 0 8px rgba(14, 165, 233, 0.16);
}

/* Report-Seite (optional) */

.report-content {
  white-space: pre-wrap;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 0.85rem;
}

/* Responsiv */

@media (max-width: 768px) {
  .page {
    padding: 14px 12px 90px;
  }

  .page-main {
    padding-bottom: 90px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .page-footer,
  .footer-contact {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .page-header h1 {
    font-size: 1.5rem;
  }

  .page-header p {
    font-size: 0.9rem;
  }

  .card {
    padding: 14px 14px 16px;
  }

  .search-form {
    gap: 10px;
  }

  .search-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .actions-grid {
    flex-direction: column;
    gap: 10px;
  }

  .help-open-btn {
    width: 100%;
  }

  .help-panel {
    top: 10px;
    right: 10px;
    left: 10px;
    bottom: 86px;
    width: auto;
  }

  .tour-popover {
    left: 12px !important;
    right: 12px;
    width: calc(100vw - 24px) !important;
  }

  .help-list {
    grid-template-columns: 1fr;
  }

  .help-list dt {
    margin-top: 4px;
  }

  textarea,
  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="email"],
  select,
  .btn {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
  }

}

@media (min-width: 769px) and (max-width: 1024px) {
  .search-row {
    grid-template-columns: 1fr 1fr;
  }
}
.feedback-bar{
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn.small{
  padding: 6px 10px;
  font-size: 0.9rem;
}

.btn.danger{
  border: 1px solid rgba(255, 120, 120, 0.6);
  background: rgba(255, 80, 80, 0.15);
}
.btn.danger:hover{
  background: rgba(255, 80, 80, 0.25);
}

/* --- Sticky Footer Kontakt-Leiste (stabil, kein Sliding) --- */
.contact-footerbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  z-index: 9999;
}

.contact-footer-btn {
  min-height: 44px;
  width: min(520px, 100%);
  transition: none !important;
}

@media (max-width: 768px) {
  .page, .page-main { padding-bottom: 96px; }
}

.page, .page-main {
  padding-bottom: 96px;
}

body.has-results .page,
body.has-results .page-main {
  padding-bottom: 180px;
}

/* Community */
.community-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.community-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #bfdbfe;
}

.community-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.community-card {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(8, 12, 28, 0.9);
  padding: 10px 12px;
}

.community-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.community-meta {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 6px;
}

.community-section {
  margin: 6px 0;
}

.community-section strong {
  color: #cbd5f5;
}

.community-list ul {
  margin: 6px 0 0 16px;
  padding: 0;
}

.community-list li {
  margin: 2px 0;
}

.form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.admin-section-title {
  margin: 14px 0 6px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #cbd5f5;
}

.admin-review-card {
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(12, 16, 36, 0.85);
  margin-bottom: 10px;
}

.admin-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.admin-review-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.admin-review-actions textarea,
.admin-review-actions input[type="text"],
.admin-review-actions input[type="number"],
.admin-review-actions select {
  width: 100%;
}

.similarity-box {
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 8px;
  padding: 8px;
  background: rgba(120, 53, 15, 0.18);
}

.similarity-item {
  border-top: 1px solid rgba(245, 158, 11, 0.25);
  margin-top: 6px;
  padding-top: 6px;
}

.audit-note {
  border-left: 3px solid rgba(34, 197, 94, 0.7);
  padding-left: 8px;
}

.muted {
  color: #9ca3af;
  font-size: 0.85rem;
}

@media (min-width: 1024px) {
  .contact-footerbar {
    justify-content: flex-start;
    padding-left: 24px;
  }

  .contact-footer-btn {
    width: auto;
    min-width: 180px;
    max-width: 260px;
    padding: 6px 16px;
    font-size: 0.82rem;
  }
}


/* ============================================================
   Serviceberichte / Maschinenhistorie / Hersteller-Lösungen
   ============================================================ */

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  vertical-align: middle;
}

.badge-hersteller {
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.20);
  border-color: rgba(37, 99, 235, 0.55);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.data-table th {
  color: #cbd5e1;
  font-weight: 600;
}

.solution-card {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 14px 0;
}

.solution-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.solution-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.solution-card .meta {
  color: #94a3b8;
  font-size: 0.85rem;
  margin: 4px 0;
}

.solution-card .source-file {
  margin-top: 10px;
  opacity: 0.6;
  font-size: 0.78rem;
}

.pii-block {
  margin-top: 10px;
  padding: 8px 10px;
  border-left: 3px solid rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.08);
  border-radius: 6px;
}

.empty {
  color: #94a3b8;
  font-style: italic;
  padding: 12px 0;
}

/* ============================================================
   Glossar-Box (Abkürzungs-Annotation in Suchergebnissen)
   ============================================================ */

.glossary-box {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.10);
  border: 1px solid rgba(37, 99, 235, 0.30);
}

.glossary-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #93c5fd;
  margin-bottom: 4px;
}

.glossary-row {
  display: flex;
  gap: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.glossary-abbr {
  flex: 0 0 auto;
  min-width: 48px;
  font-weight: 700;
  color: #bfdbfe;
}

.glossary-term {
  color: #cbd5e1;
}

/* ============================================================
   Diagnosepfad (BMK/LSB)
   ============================================================ */

.diagnosis-path-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(20, 83, 45, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.34);
}

.diagnosis-path-title,
.diagnosis-branch-title {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #86efac;
}

.diagnosis-summary {
  margin-top: 5px;
  color: #e5e7eb;
  font-weight: 650;
  line-height: 1.45;
}

.diagnosis-meta,
.diagnosis-note {
  margin-top: 5px;
  color: #cbd5e1;
  font-size: 0.86rem;
  line-height: 1.45;
}

.diagnosis-step-list {
  margin: 8px 0 0 20px;
  padding: 0;
  color: #dbeafe;
  font-size: 0.88rem;
  line-height: 1.45;
}

.diagnosis-step-list li {
  margin: 4px 0;
}

.diagnosis-branch {
  margin-top: 9px;
}

.diagnosis-branch-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.diagnosis-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #bbf7d0;
  background: rgba(22, 101, 52, 0.38);
  border: 1px solid rgba(34, 197, 94, 0.32);
  font-size: 0.78rem;
  white-space: nowrap;
}

.page-main {
  display: block;
}

.page-header-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-headline h2 {
  margin: 0;
}

.dashboard-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.dashboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-list.compact {
  gap: 8px;
}

.dashboard-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(120, 144, 180, 0.28);
  background: rgba(5, 6, 18, 0.55);
  text-decoration: none;
  color: inherit;
}

.dashboard-list-item.static {
  cursor: default;
}

.dashboard-list-item:hover {
  border-color: rgba(96, 165, 250, 0.55);
}

.mini-meta {
  margin-top: 4px;
  font-size: 0.8rem;
  color: #9ca3af;
}

.pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.16);
  color: #bfdbfe;
  font-size: 0.78rem;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.pill.neutral {
  background: rgba(148, 163, 184, 0.12);
  color: #d1d5db;
  border-color: rgba(148, 163, 184, 0.25);
}

.pill.danger {
  background: rgba(127, 29, 29, 0.24);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.35);
}

.key-value-list {
  display: grid;
  gap: 10px;
}

.key-value-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(5, 6, 18, 0.55);
  border: 1px solid rgba(120, 144, 180, 0.25);
}

.key-value-list span {
  color: #b8c1d4;
}

@media (max-width: 720px) {
  .section-headline,
  .dashboard-list-item,
  .key-value-list div {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   Stromlauf verfolgen (Circuit Trace)
   ============================================================ */

.trace-meta {
  color: #94a3b8;
  font-size: 0.88rem;
  margin: 4px 0 10px;
}

.trace-step {
  margin: 10px 0;
  padding: 10px 12px 10px 14px;
  border-left: 3px solid rgba(56, 189, 248, 0.55);
  border-radius: 0 10px 10px 0;
  background: rgba(5, 6, 18, 0.45);
}

.trace-step-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trace-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #7dd3fc;
  font-size: 0.78rem;
  font-weight: 700;
}

.trace-items {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trace-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
  white-space: nowrap;
}

.trace-chip-link {
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.5);
  text-decoration: none;
}

.trace-chip-link:hover {
  background: rgba(56, 189, 248, 0.18);
}

button.trace-chip-link {
  cursor: pointer;
  font: inherit;
}

button.trace-chip-link:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.7);
  outline-offset: 2px;
}

.trace-check {
  margin-top: 8px;
  color: #a5b4c8;
  font-size: 0.86rem;
}

.trace-note {
  margin-top: 8px;
  color: #8b95a8;
  font-size: 0.8rem;
  font-style: italic;
}

/* Praxis vom Hersteller-Service (verlinkte Einsatzberichte) */

.praxis-box {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 8px;
  background: rgba(52, 211, 153, 0.06);
}

.praxis-box .explain-title {
  color: #6ee7b7;
}

.praxis-report {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(148, 163, 184, 0.25);
  font-size: 0.88rem;
  line-height: 1.4;
}

.praxis-date {
  color: #8b95a8;
  font-size: 0.8rem;
  margin-left: 6px;
}

.praxis-disclaimer {
  margin-top: 8px;
  color: #8b95a8;
  font-size: 0.78rem;
  font-style: italic;
}

/* Einsatzberichte-Browser: Facetten-Filter + Chips */

.reports-search {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.reports-search input[type="search"] {
  flex: 1 1 260px;
  min-width: 200px;
}

.facet-group {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  flex-wrap: wrap;
}

.facet-label {
  flex: 0 0 96px;
  color: #94a3b8;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 4px;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.4);
  background: rgba(129, 140, 248, 0.08);
  color: #c7d2fe;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.chip:hover {
  background: rgba(129, 140, 248, 0.18);
  border-color: rgba(129, 140, 248, 0.65);
}

.chip-active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
  font-weight: 600;
}

.chip-count {
  font-size: 0.72rem;
  opacity: 0.8;
  background: rgba(15, 23, 42, 0.35);
  border-radius: 999px;
  padding: 0 6px;
}

.chip-active .chip-count {
  background: rgba(255, 255, 255, 0.22);
}

.chip-static {
  cursor: default;
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.1);
  color: #cbd5e1;
  font-size: 0.78rem;
}

.chip-static:hover {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.3);
}
