.m-toolbar,
.m-tabs,
.m-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.m-tabs {
  width: 100%;
  border-bottom: 1px solid #e0e5df;
  padding-bottom: 12px;
}
.m-workspace {
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) minmax(0, 1.8fr);
  gap: 22px;
  align-items: start;
}
.m-list {
  padding: 14px;
  max-height: 72vh;
  overflow: auto;
}
.m-row {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 9px;
  padding: 14px;
  margin-bottom: 5px;
  cursor: pointer;
  color: inherit;
}
.m-row strong,
.m-row small {
  display: block;
  overflow-wrap: anywhere;
}
.m-row small {
  margin-top: 6px;
  color: #5b6d84;
}
.m-row:hover {
  background: #f2f5ef;
}
.m-row.selected {
  background: #edf3e8;
  border-color: #bccfb2;
}
.m-detail {
  min-height: 300px;
  overflow-wrap: anywhere;
}
.m-detail h2 {
  margin-top: 0;
}
.m-detail details {
  border-top: 1px solid #e2e7df;
  padding: 16px 0;
}
.m-detail summary {
  cursor: pointer;
  font-weight: 650;
}
.m-pre {
  white-space: pre-wrap;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.m-post {
  background: #f5f7f1;
  padding: 22px;
  border-radius: 12px;
}
.m-version {
  border-top: 1px solid #e0e5df;
  margin-top: 20px;
  padding-top: 12px;
}
.m-field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  flex: 1;
  min-width: 160px;
}
.m-field > span {
  font-size: 13px;
  font-weight: 650;
  color: #3c536e;
}
.m-field input,
.m-field textarea,
.m-field select {
  font: inherit;
  width: 100%;
  border: 1px solid #d7e2f0;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: #17314d;
  box-sizing: border-box;
}
.m-field select[multiple] {
  min-height: 120px;
}
.m-form {
  max-width: 760px;
}
.m-empty {
  padding: 30px 12px;
  color: #61738a;
}
.m-dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
}
.m-dl dd {
  margin: 0;
}
.public-inquiry {
  max-width: 620px;
  margin: 40px auto;
  padding: 30px;
  background: #fff;
  border: 1px solid #e0e6dc;
  border-radius: 18px;
}
.public-inquiry h1 {
  font-size: 30px;
}
.public-inquiry .m-field {
  margin-top: 18px;
}
.public-inquiry button {
  padding: 12px 20px;
  border: 0;
  border-radius: 8px;
  background: #38512e;
  color: white;
  cursor: pointer;
}
.inquiry-page {
  background: #f2f4ee;
  color: #263323;
  font-family: system-ui, sans-serif;
  padding: 16px;
}
.honeypot {
  position: absolute;
  left: -10000px;
}
.m-toolbar .p-search {
  flex: 1;
  min-width: 200px;
}
@media (max-width: 800px) {
  .m-workspace {
    grid-template-columns: 1fr;
  }
  .m-list {
    max-height: 350px;
  }
  .public-inquiry {
    margin: 10px auto;
    padding: 22px;
  }
  .m-dl {
    grid-template-columns: 1fr;
  }
  .m-dl dd {
    margin-bottom: 10px;
  }
}
@media (min-width: 851px) {
  #portal .sidebar > nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-gutter: stable;
  }
  #portal .sidebar > .portal-brand,
  #portal .sidebar > .sidebar-bottom {
    flex-shrink: 0;
  }
}

/* Gemeinsame Themenauswahl: Hierarchie und Teilselektion bleiben sichtbar. */
.m-topic-tree {
  border: 1px solid var(--border, #d7dde5);
  border-radius: 10px;
  padding: 14px;
  max-height: 420px;
  overflow: auto;
}
.m-topic-tree legend {
  font-weight: 600;
}
.m-topic-children {
  padding-left: 22px;
  border-left: 1px solid #d7dde5;
  margin-left: 8px;
}
.m-topic-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}
.m-topic-label input {
  width: auto;
}
.m-topic-tree summary {
  cursor: pointer;
}
.m-topic-tree [hidden],
.m-form [hidden] {
  display: none !important;
}
.m-form fieldset {
  min-width: 0;
}

/* Wissensdatenbank: Browser-Tabs über Filtern, Aktionen und Artikelliste. */
.k-workspace {
  margin-top: 4px;
}
.k-tabs {
  display: flex;
  gap: 4px;
  padding: 0 10px;
  overflow-x: auto;
}
.k-tabs button {
  border: 1px solid #c7d8ed;
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  padding: 15px 22px;
  background: #e8f0fa;
  color: #345371;
  white-space: nowrap;
  font: inherit;
  cursor: pointer;
}
.k-tabs button[aria-selected='true'] {
  background: #fff;
  color: #0057bf;
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.k-content {
  background: #fff;
  border: 1px solid #d7e2f0;
  border-radius: 12px;
  padding: 20px;
  margin-top: -1px;
}
.k-filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 18px;
}
.k-filters label,
.k-form > label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  color: #435b76;
}
.k-filters label:first-child {
  flex: 1 1 220px;
}
.k-filters input,
.k-filters select,
.k-form input:not([type='checkbox']),
.k-form textarea {
  border: 1px solid #c7d8ed;
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
  color: #243b2e;
  font: inherit;
  min-width: 0;
}
.k-filters select {
  max-width: 260px;
}
.k-quick,
.k-actions,
.k-topics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.k-actions {
  padding: 14px 0;
  border-top: 1px solid #dce6f2;
}
.k-actions .p-btn {
  font-size: 12px;
}
.k-admin {
  background: #f7f5ee;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.k-admin > span {
  font-size: 12px;
  font-weight: 700;
  margin-right: 10px;
}
.k-topics {
  padding: 10px 0 18px;
  font-size: 13px;
}
.k-list {
  border-top: 1px solid #dce6f2;
}
.k-added {
  flex: 0 0 150px;
  font-size: 0.85rem;
  color: #53657b;
}
.k-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 16px;
  border-bottom: 1px solid #dce6f2;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.k-row:hover {
  background: #f4f8ff;
}
.k-row.selected {
  background: #eaf3ff;
  border-left-color: #087af0;
}
.k-row h2 {
  font-size: 18px;
  margin: 0 0 8px;
}
.k-row p {
  font-size: 14px;
  color: #435b76;
  margin: 0 0 10px;
  line-height: 1.6;
}
.k-row small {
  color: #5c7089;
}
.k-empty {
  padding: 28px 16px;
  color: #5c7089;
}
.k-form {
  display: grid;
  gap: 16px;
}
.k-topic-options {
  max-height: 45vh;
  overflow: auto;
}
.k-topic-options [hidden] {
  display: none;
}
.portal-copyright {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  opacity: 0.65;
}
@media (max-width: 700px) {
  .k-content {
    padding: 12px;
  }
  .k-tabs button {
    padding: 12px;
  }
  .k-added {
    flex: 0 0 150px;
    font-size: 0.85rem;
    color: #53657b;
  }
  .k-row {
    align-items: start;
  }
  .k-row > button {
    font-size: 12px;
  }
  .k-filters label {
    flex: 1 1 130px;
  }
}

.m-table-scroll {
  max-width: 100%;
  overflow-x: auto;
}
.m-record-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.m-record-table th,
.m-record-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line, #dde4e8);
  vertical-align: top;
}
.m-record-table th {
  font-size: 12px;
  color: #64717c;
}
.m-record-table tbody tr[data-arow] {
  cursor: pointer;
}
.m-record-table tbody tr[data-arow]:hover {
  background: #f4f7fa;
}
.m-record-table tbody tr.selected {
  background: #eaf3fb;
}
.m-record-table tbody tr:focus-visible {
  outline: 2px solid #2874ae;
  outline-offset: -2px;
}
.m-summary {
  margin: 6px 0 0;
  max-width: 650px;
  color: #64717c;
  font-size: 13px;
}

.m-active-badge {
  background: #65794b;
  color: white;
  border-color: #65794b;
}

.m-record-table td > small {
  display: block;
  margin-top: 5px;
  color: #64717c;
}

/* Kompakte Formabstände, ohne die globale Anmeldungsgestaltung zu übernehmen. */
#portal .k-filters .m-field {
  margin: 0;
  padding: 0;
}
.m-form .m-topic-tree label {
  margin: 0;
}
.m-form .m-topic-tree .m-actions {
  margin: 8px 0;
  padding: 0;
  border: 0;
}
.m-form .m-topic-tree .m-actions label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.m-form .m-topic-tree input[type='checkbox'] {
  width: auto;
}

/* Quellenwahl: gemeinsamer Modus, darunter die ausdrücklich gewählten Quellen. */
.m-source-picker {
  border: 1px solid var(--line, #d8e2ef);
  border-radius: 12px;
  padding: 16px;
  background: #f3f7fc;
}
.m-source-picker legend {
  font-weight: 600;
}
.m-source-picker [data-source-options] {
  border: 0;
  padding: 8px 0;
  max-height: 240px;
  overflow: auto;
}
.m-source-picker [data-source-options]:disabled {
  opacity: 0.5;
}

/* Redaktionelles Ergebnis bleibt unabhängig vom Lebenszyklus und von Qualität. */
.m-editorial-check {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-weight: 600;
  min-width: 10rem;
}
.m-check-passed > span {
  color: #28763e;
}
.m-check-revision > span {
  color: #a56600;
}
.m-check-error > span {
  color: #b52d36;
}
.m-check-pending > span {
  color: #77818b;
}
.m-record-table tbody tr.m-review-revision:not(.selected) {
  background: #fff8e7;
}
.m-record-table tbody tr.m-review-error:not(.selected) {
  background: #fff0f0;
}
.m-record-table tbody tr.m-review-revision:not(.selected):hover {
  background: #fff0cc;
}
.m-record-table tbody tr.m-review-error:not(.selected):hover {
  background: #ffe2e2;
}

/* Lange Titel und Zusammenfassungen dürfen ihre Spalte nicht verbreitern. */
#portal table.m-post-table {
  table-layout: fixed;
  white-space: normal;
  min-width: 1050px;
}
#portal .m-post-table th,
#portal .m-post-table td,
#portal .m-post-table th button {
  white-space: normal;
  overflow-wrap: anywhere;
}
#portal .m-post-table th:first-child {
  width: 30%;
}
#portal .m-post-table-posts th:first-child {
  width: 38%;
}
#portal .m-post-table-editorial th:nth-child(6) {
  width: 14%;
}
#portal .m-post-table th:nth-last-child(-n + 2) {
  width: 10%;
}
#portal .m-post-table .m-summary {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
#portal .m-post-table .m-editorial-check {
  min-width: 0;
}
#portal .m-post-table th,
#portal .m-post-table td {
  padding: 12px 10px;
}
#portal .m-post-table th button {
  padding: 4px 0;
  max-width: 100%;
  overflow-wrap: normal;
}
#portal .m-post-table-editorial th:nth-child(2) {
  width: 12%;
}
#portal .m-post-table-editorial th:nth-child(3) {
  width: 8%;
}
#portal .m-post-table-editorial th:nth-child(4) {
  width: 5%;
}
#portal .m-post-table-editorial th:nth-child(5) {
  width: 8%;
}
#portal .m-post-table-editorial th:nth-child(7) {
  width: 5%;
}
#portal .m-post-table-editorial th:nth-last-child(-n + 2) {
  width: 9%;
}

/* Redaktionelle Ebenen und Promptreferenz sind sichtbar voneinander getrennt. */
.m-review-section {
  margin: 0 0 1.25rem;
  padding: 1rem;
  border: 1px solid var(--border, #d5deeb);
  border-radius: 10px;
  background: #f7f9fc;
}
.m-review-section > h3 {
  margin-top: 0;
  color: #12385b;
}
.m-review-section ul {
  padding-left: 1.25rem;
}
.m-prompt-help {
  margin: 0.75rem 0;
  padding: 0.8rem;
  border: 1px solid #d5deeb;
  border-radius: 8px;
  background: #f7f9fc;
}
.m-prompt-help summary {
  cursor: pointer;
  font-weight: 600;
}
.m-prompt-help dt {
  margin-top: 0.7rem;
  font-weight: 600;
}
.m-prompt-help dd {
  margin-left: 0;
  line-height: 1.5;
}
.k-article-origin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid #d5deeb;
  background: #f7f9fc;
}
