:root {
  --ink: #17202a;
  --muted: #5f6b76;
  --line: #d8dee3;
  --soft: #f4f6f7;
  --paper: #ffffff;
  --green: #16745a;
  --green-soft: #e8f5ef;
  --blue: #235f86;
  --blue-soft: #eaf2f7;
  --amber: #9b5a07;
  --amber-soft: #fff4df;
  --red: #a33b32;
  --red-soft: #fbecea;
  --violet: #6c4b87;
  --violet-soft: #f2edf6;
  --header: #11181e;
  --shadow: 0 1px 2px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section-inner {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
}

.section-inner.wide {
  width: min(1560px, calc(100% - 40px));
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  color: #fff;
  background: var(--header);
  border-bottom: 1px solid #2d3942;
}

.header-inner {
  width: min(1560px, calc(100% - 40px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.brand strong,
.brand small {
  display: block;
  letter-spacing: 0;
}

.brand strong {
  font-size: 15px;
  line-height: 1.25;
}

.brand small {
  margin-top: 2px;
  color: #b8c4cb;
  font-size: 12px;
}

.brand-mark {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
  background: #cbd4d9;
}

.brand-mark::before {
  top: 15px;
  left: 5px;
  width: 22px;
  height: 2px;
}

.brand-mark::after {
  top: 5px;
  left: 15px;
  width: 2px;
  height: 22px;
}

.brand-mark span {
  position: absolute;
  width: 8px;
  height: 8px;
  border: 2px solid #48b893;
  border-radius: 50%;
}

.brand-mark span:nth-child(1) { top: 0; left: 0; }
.brand-mark span:nth-child(2) { top: 0; right: 0; }
.brand-mark span:nth-child(3) { bottom: 0; left: 0; }
.brand-mark span:nth-child(4) { right: 0; bottom: 0; }

nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

nav a {
  color: #dce3e7;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

nav a:hover,
nav a:focus-visible {
  color: #fff;
}

.baseline-band {
  padding: 54px 0 48px;
  background: #eef2f3;
  border-bottom: 1px solid var(--line);
}

.baseline-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(440px, 0.85fr);
  gap: 72px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: 40px;
  line-height: 1.08;
}

h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.2;
}

.lede {
  max-width: 760px;
  margin: 18px 0 0;
  color: #43515b;
  font-size: 17px;
  line-height: 1.6;
}

.baseline-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid #cbd3d8;
}

.baseline-facts div {
  min-width: 0;
  padding: 15px 18px 14px 0;
  border-bottom: 1px solid #cbd3d8;
}

.baseline-facts div:nth-child(odd) {
  padding-right: 28px;
  border-right: 1px solid #cbd3d8;
}

.baseline-facts div:nth-child(even) {
  padding-left: 28px;
}

.baseline-facts dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.baseline-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 650;
}

.architecture-band {
  padding: 40px 0 44px;
  background: var(--header);
  color: #f7f9fa;
}

.architecture-band .eyebrow {
  color: #60c8a5;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 28px;
  margin-bottom: 25px;
}

.section-heading.compact {
  margin-bottom: 24px;
}

.safety-note {
  padding-left: 12px;
  border-left: 3px solid #d79338;
  color: #d8e0e4;
  font-size: 12px;
  font-weight: 650;
}

.architecture-flow {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 34px minmax(190px, 1.2fr) 76px minmax(220px, 1.35fr) 34px minmax(170px, 1fr);
  gap: 10px;
  align-items: stretch;
}

.flow-node {
  min-width: 0;
  min-height: 106px;
  padding: 17px;
  border: 1px solid #44515a;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.flow-node.qgc { border-top: 4px solid #4d92bb; }
.flow-node.autopilot { border-top: 4px solid #48b893; }
.flow-node.hardware { border-top: 4px solid #d79338; }
.flow-node.neutral { border-top: 4px solid #aab6bd; }

.flow-node strong,
.flow-node small {
  display: block;
  overflow-wrap: anywhere;
}

.flow-node strong {
  margin-top: 13px;
  font-size: 15px;
}

.flow-node small {
  margin-top: 3px;
  color: #aebbc3;
  font-size: 12px;
}

.node-index {
  color: #83929b;
  font-size: 11px;
  font-weight: 750;
}

.flow-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #73838d;
  font-size: 24px;
}

.flow-link em {
  position: absolute;
  top: 10px;
  width: 76px;
  color: #91a0a8;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  text-align: center;
}

.summary-section,
.matrix-section,
.phases-section {
  padding: 50px 0 54px;
}

.summary-section {
  border-bottom: 1px solid var(--line);
}

.updated,
.result-count {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  min-width: 0;
  min-height: 124px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.metric .metric-value,
.metric .metric-label,
.metric .metric-note {
  display: block;
}

.metric .metric-value {
  margin-bottom: 8px;
  font-size: 30px;
  font-weight: 760;
  line-height: 1;
}

.metric .metric-label {
  font-size: 13px;
  font-weight: 700;
}

.metric .metric-note {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.metric.verified { border-top: 4px solid var(--green); }
.metric.implemented { border-top: 4px solid var(--blue); }
.metric.analysis { border-top: 4px solid var(--violet); }
.metric.open { border-top: 4px solid var(--amber); }
.metric.critical { border-top: 4px solid var(--red); }

.metric.skeleton {
  background: var(--soft);
  box-shadow: none;
}

.notice {
  margin-top: 18px;
  padding: 13px 15px;
  background: var(--amber-soft);
  border-left: 4px solid #d79338;
  color: #613d0f;
  font-size: 13px;
}

.matrix-section {
  background: var(--soft);
  scroll-margin-top: 68px;
}

.matrix-heading {
  margin-bottom: 20px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1.7fr) repeat(3, minmax(150px, 0.7fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 15px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.filter-bar label {
  min-width: 0;
}

.filter-bar label > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.filter-bar input,
.filter-bar select,
.reset-button {
  width: 100%;
  height: 40px;
  border: 1px solid #bdc7ce;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.filter-bar input,
.filter-bar select {
  padding: 0 11px;
}

.filter-bar input:focus,
.filter-bar select:focus,
.reset-button:focus-visible {
  outline: 3px solid rgba(35, 95, 134, 0.22);
  outline-offset: 1px;
  border-color: var(--blue);
}

.reset-button {
  width: auto;
  padding: 0 16px;
  background: #edf1f3;
  font-weight: 700;
}

.reset-button:hover {
  background: #e2e8eb;
}

.table-shell {
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 1260px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid #e0e5e8;
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
}

th {
  position: sticky;
  top: 68px;
  z-index: 5;
  background: #e9edef;
  color: #45525c;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

th:nth-child(1) { width: 10%; }
th:nth-child(2) { width: 15%; }
th:nth-child(3) { width: 17%; }
th:nth-child(4) { width: 16%; }
th:nth-child(5) { width: 18%; }
th:nth-child(6) { width: 14%; }
th:nth-child(7) { width: 48px; }

tbody tr.capability-row:hover td {
  background: #fafcfc;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.id-cell strong,
.id-cell small,
.function-cell strong,
.function-cell small {
  display: block;
}

.id-cell strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.id-cell small,
.function-cell small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.function-cell strong {
  font-size: 13px;
}

.copy-cell {
  color: #394750;
  font-size: 12px;
  line-height: 1.48;
}

.status-stack {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.status-badge,
.priority-badge,
.evidence-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 760;
  line-height: 1.2;
}

.status-verifiziert { color: #0d5c45; background: var(--green-soft); }
.status-umgesetzt { color: #194f70; background: var(--blue-soft); }
.status-in_analyse { color: #5c3e74; background: var(--violet-soft); }
.status-offen { color: #764303; background: var(--amber-soft); }
.status-wartet_auf_quellstand { color: #70302b; background: var(--red-soft); }
.status-nicht_im_scope { color: #4c5860; background: #e9edef; }

.priority-badge {
  color: #3d4850;
  background: #e9edef;
}

.evidence-badge {
  min-height: 20px;
  margin-right: 4px;
  color: #194f70;
  background: var(--blue-soft);
  vertical-align: middle;
}

.details-toggle {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #c5cdd2;
  border-radius: 4px;
  background: #fff;
  color: #33414a;
  font-size: 18px;
  line-height: 1;
}

.details-toggle:hover,
.details-toggle:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
  outline: none;
}

.detail-row td {
  padding: 0;
  background: #f8fafb;
}

.detail-panel {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr 0.8fr;
  gap: 24px;
  padding: 17px 20px 20px;
  border-left: 4px solid var(--blue);
}

.detail-panel h3 {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.detail-panel p {
  margin: 0;
  font-size: 12px;
}

.detail-panel a {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.loading-cell,
.error-cell {
  height: 120px;
  color: var(--muted);
  text-align: center;
  vertical-align: middle;
}

.error-cell {
  color: var(--red);
}

.empty-state {
  margin: 16px 0 0;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.phases-section {
  scroll-margin-top: 68px;
}

.text-link {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.phase-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: phase;
}

.phase-card {
  min-width: 0;
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  counter-increment: phase;
}

.phase-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.phase-id,
.phase-window {
  font-size: 11px;
  font-weight: 760;
}

.phase-id {
  color: var(--green);
}

.phase-window {
  color: var(--muted);
}

.phase-card h3 {
  margin: 0 0 9px;
  font-size: 16px;
}

.phase-card p {
  margin: 0;
  color: #46535c;
  font-size: 12px;
}

.phase-gate {
  display: block;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.decision-band {
  padding: 36px 0;
  color: #fff;
  background: #1d574b;
}

.decision-band .eyebrow {
  color: #aee7d2;
}

.decision-layout {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr auto;
  gap: 42px;
  align-items: center;
}

.decision-layout h2 {
  font-size: 21px;
}

.decision-layout > p {
  margin: 0;
  color: #d9ece5;
  font-size: 13px;
}

.primary-link {
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid #b7dfd1;
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.primary-link:hover,
.primary-link:focus-visible {
  background: #286b5c;
}

footer {
  padding: 22px 0;
  color: #aebac1;
  background: var(--header);
  font-size: 11px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

footer code {
  color: #dce3e7;
}

@media (max-width: 1100px) {
  .baseline-layout {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .architecture-flow {
    grid-template-columns: 1fr 30px 1fr;
  }

  .architecture-flow .flow-link:nth-of-type(2) {
    display: none;
  }

  .flow-node.autopilot {
    grid-column: 1;
    grid-row: 2;
  }

  .flow-node.hardware {
    grid-column: 3;
    grid-row: 2;
  }

  .architecture-flow .flow-link:nth-of-type(3) {
    grid-column: 2;
    grid-row: 2;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .search-field {
    grid-column: span 2;
  }

  .phase-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .decision-layout {
    grid-template-columns: 1fr 1fr;
  }

  .decision-layout .primary-link {
    width: max-content;
  }
}

@media (max-width: 720px) {
  .section-inner,
  .section-inner.wide,
  .header-inner {
    width: min(100% - 24px, 1560px);
  }

  .header-inner {
    min-height: 62px;
  }

  nav {
    gap: 12px;
  }

  nav a:nth-child(3) {
    display: none;
  }

  .brand strong {
    max-width: 210px;
    font-size: 13px;
  }

  .brand small {
    display: none;
  }

  .baseline-band {
    padding: 36px 0 34px;
  }

  h1 {
    font-size: 31px;
  }

  h2 {
    font-size: 22px;
  }

  .lede {
    font-size: 15px;
  }

  .baseline-facts {
    grid-template-columns: 1fr;
  }

  .baseline-facts div:nth-child(odd),
  .baseline-facts div:nth-child(even) {
    padding: 12px 0;
    border-right: 0;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .architecture-flow {
    grid-template-columns: 1fr;
  }

  .architecture-flow .flow-node,
  .architecture-flow .flow-link {
    grid-column: 1;
    grid-row: auto;
  }

  .architecture-flow .flow-link,
  .architecture-flow .flow-link:nth-of-type(2) {
    display: flex;
    min-height: 28px;
    transform: rotate(90deg);
  }

  .flow-link em {
    display: none;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    min-height: 112px;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: auto;
  }

  .reset-button {
    width: 100%;
  }

  th {
    top: 62px;
  }

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

  .phase-card {
    min-height: 0;
  }

  .decision-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  nav a:nth-child(2) {
    display: none;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
