:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #172026;
  --muted: #66717a;
  --line: #dbe2e7;
  --teal: #087f8c;
  --teal-dark: #075f68;
  --blue: #315f9d;
  --amber: #b86b00;
  --red: #a62f2f;
  --green: #27745f;
  --shadow: 0 14px 40px rgba(23, 32, 38, 0.08);
}

* {
  box-sizing: border-box;
}

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

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.topnav {
  display: flex;
  gap: 6px;
}

.topnav a,
.back-link,
.text-link {
  color: var(--teal-dark);
  font-weight: 700;
}

.topnav a {
  padding: 9px 12px;
  border-radius: 8px;
}

.topnav a:hover {
  background: #e7f3f4;
}

.page {
  max-width: 1460px;
  margin: 0 auto;
  padding: 28px;
}

.page:has(.workflow-shell) {
  max-width: none;
  padding: 0;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 20px;
  align-items: stretch;
}

.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.intro-panel {
  display: flex;
  min-height: 360px;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(8, 127, 140, 0.12), rgba(49, 95, 157, 0.10)),
    #fff;
}

.eyebrow {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.15;
}

h1 {
  max-width: 760px;
  font-size: 38px;
}

h2 {
  font-size: 20px;
}

p {
  color: var(--muted);
}

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.stats-row,
.summary-grid,
.button-row,
.intro-actions,
.output-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.intro-actions {
  margin-top: 8px;
}

.stats-row span,
.summary-grid span {
  min-width: 120px;
  padding: 12px;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form-panel,
.action-form {
  display: grid;
  gap: 15px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

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

label {
  display: grid;
  gap: 7px;
  color: #34414a;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd8df;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input,
select {
  min-height: 42px;
  padding: 9px 11px;
}

textarea {
  min-height: 180px;
  padding: 12px;
  resize: vertical;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(8, 127, 140, 0.16);
  border-color: var(--teal);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button span {
  font-weight: 900;
}

.button.primary {
  background: var(--teal);
  color: #fff;
}

.button.primary:hover {
  background: var(--teal-dark);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button.secondary {
  background: #eef4f8;
  border-color: #cddce5;
  color: var(--ink);
}

.button.flow-button {
  position: relative;
  background: #fff7e6;
  border-color: #d99021;
  color: #6d3d00;
  box-shadow: 0 8px 22px rgba(184, 107, 0, 0.18);
}

.button.flow-button:hover {
  background: #ffefcc;
  border-color: var(--amber);
  color: #513000;
  transform: translateY(-1px);
}

.button.flow-button span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--amber);
  color: #fff;
}

.section-band {
  margin-top: 24px;
}

.demo-panel {
  border-left: 5px solid var(--teal);
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.demo-grid span {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.demo-grid strong {
  display: block;
  font-size: 24px;
}

.demo-outputs {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.section-heading,
.panel-title,
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

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

.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.project-row:hover {
  border-color: var(--teal);
}

.project-row.active-project {
  border-color: var(--teal);
  background: #eef8f8;
}

.project-row small {
  display: block;
  color: var(--muted);
}

.project-row span {
  min-width: 0;
}

.project-row strong,
.project-row small {
  overflow-wrap: anywhere;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e7f3f4;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-chip.light {
  background: #f2f5f7;
  color: #4f5e68;
}

.implemented-chip {
  background: #eaf7ef;
  color: #27623f;
}

.implemented-chip b {
  font-size: 12px;
  line-height: 1;
}

.empty-state {
  padding: 18px;
  border: 1px dashed #b9c5ce;
  border-radius: 8px;
  background: #fff;
}

.project-shell,
.steps-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.project-sidebar,
.steps-list {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 14px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.project-sidebar h1,
.steps-list h1 {
  font-size: 28px;
  overflow-wrap: anywhere;
}

.side-meta {
  display: grid;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.side-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

code {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #42515a;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
}

.project-main {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.inventory-table,
.master-preview {
  width: 100%;
  max-width: 100%;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.file-tree {
  display: grid;
  max-height: 460px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tree-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  padding: 7px 12px;
  padding-left: calc(12px + var(--depth, 0) * 22px);
  border-bottom: 1px solid #edf1f4;
}

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

.tree-row[hidden] {
  display: none;
}

.tree-dir {
  grid-template-columns: 24px minmax(0, 1fr);
  background: #f8fafb;
  color: #2b3942;
}

.tree-file {
  color: #40505a;
}

.tree-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #edf2f5;
  color: var(--teal-dark);
  font-weight: 900;
}

.tree-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-row small {
  color: var(--muted);
  white-space: nowrap;
}

.classification-layout {
  display: grid;
  gap: 16px;
}

.classification-panel,
.explorer-panel {
  min-width: 0;
}

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

.role-card {
  display: grid;
  gap: 7px;
  min-height: 138px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.role-card:hover,
.role-card.active {
  border-color: var(--teal);
  border-left-color: var(--teal);
  background: #eef8f8;
}

.role-card span {
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.role-card strong,
.role-card small,
.role-card em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.role-card small {
  color: var(--muted);
  font-size: 13px;
}

.role-card em {
  display: block;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  color: #42515a;
  font-size: 12px;
  font-style: normal;
  white-space: pre-wrap;
}

.explorer-tree .tree-row {
  grid-template-columns: 24px minmax(0, 1fr) auto auto auto auto;
}

.explorer-search {
  margin-bottom: 12px;
}

.tree-toggle {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #cddce5;
  border-radius: 6px;
  background: #edf2f5;
  color: var(--teal-dark);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.tree-toggle:hover {
  border-color: var(--teal);
}

.tree-row.collapsed > .tree-toggle {
  background: #fff;
}

.tree-row.selected-row {
  background: #eef8f8;
}

.tree-row.filtered-out,
.tree-row.hidden-by-collapse {
  display: none;
}

.selected-for {
  max-width: 260px;
  overflow: hidden;
  padding: 5px 8px;
  border: 1px solid #c7e1df;
  border-radius: 999px;
  background: #f0fbfa;
  color: #075f68;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-for:empty {
  display: none;
}

.tree-pick-button {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid #cddce5;
  border-radius: 6px;
  background: #eef4f8;
  color: var(--teal-dark);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.tree-pick-button:hover {
  border-color: var(--teal);
  background: #e7f3f4;
}

.inventory-table table,
.master-preview table {
  min-width: 760px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf2f5;
  color: #2b3942;
  font-size: 12px;
  text-transform: uppercase;
}

td {
  overflow-wrap: anywhere;
}

.pipeline-grid {
  display: grid;
  gap: 18px;
}

.warning-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--amber);
}

.sheet-select-form {
  min-width: 220px;
}

.lab-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.lab-preview-table,
.clean-table-preview {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.lab-preview-table {
  max-height: 560px;
}

.clean-table-preview,
.excel-output-preview {
  max-height: 360px;
}

.lab-preview-table table,
.clean-table-preview table,
.excel-output-preview table {
  min-width: 900px;
}

.lab-preview-table th:first-child,
.lab-preview-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}

.lab-preview-table tbody th {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 58px;
  background: #f8fafb;
  color: #52616b;
  font-size: 12px;
  text-align: right;
}

.lab-preview-table td {
  min-width: 112px;
  max-width: 220px;
  font-size: 13px;
  white-space: nowrap;
}

.lab-manual-form {
  position: sticky;
  top: 88px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.table-save-row {
  align-items: center;
  margin-top: 14px;
}

.table-save-row form {
  margin: 0;
}

.excel-output-preview {
  max-width: 100%;
  overflow: auto;
  border: 1px solid #b9c8d3;
  border-radius: 8px;
  background: #fff;
}

.excel-output-preview thead th {
  background: #1f2937;
  color: #fff;
}

.excel-output-preview tbody tr:nth-child(even) td {
  background: #f8fafb;
}

.excel-output-preview td:first-child {
  font-weight: 800;
}

.image-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.image-selection-card,
.caption-editor-row {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.image-selection-card {
  cursor: pointer;
}

.image-preview-frame {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid #dce4ea;
  border-radius: 8px;
  background: #f7fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.image-preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-selection-meta {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.image-selection-meta strong,
.image-selection-meta small {
  overflow-wrap: anywhere;
}

.image-selection-meta span {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #34414a;
  font-weight: 800;
}

.image-selection-meta input {
  min-height: 0;
}

.caption-editor-list {
  display: grid;
  gap: 14px;
}

.caption-workbench {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.caption-picker-list {
  display: grid;
  gap: 8px;
  max-height: 720px;
  overflow: auto;
  padding-right: 4px;
}

.caption-picker-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.caption-picker-item.active,
.caption-picker-item:hover {
  border-color: #123b73;
  background: #e8eef8;
}

.caption-picker-thumb {
  display: grid;
  place-items: center;
  width: 72px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: #f7fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.caption-picker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.caption-picker-item strong,
.caption-picker-item small {
  display: block;
  overflow-wrap: anywhere;
}

.caption-picker-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.caption-picker-item.is-complete small {
  color: #137333;
}

.caption-editor-panels {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.caption-editor-panel {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.caption-editor-preview {
  min-height: 260px;
}

.caption-editor-fields {
  min-width: 0;
}

.caption-saved-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #b7dfc5;
  border-radius: 8px;
  background: #effaf3;
  color: #174b2a;
}

.caption-saved-card strong {
  font-size: 15px;
}

.caption-saved-card p {
  margin: 0;
  color: #263b2d;
  white-space: pre-wrap;
}

.caption-edit-field {
  display: grid;
}

.caption-edit-field[hidden] {
  display: none;
}

.caption-panel-submit {
  justify-self: start;
}

.caption-editor-row {
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  align-items: start;
}

.caption-editor-row h3 {
  margin: 0;
  font-size: 18px;
}

.position-assignment-list {
  display: grid;
  gap: 18px;
}

.position-assignment-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.assignment-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.assignment-heading h3 {
  margin: 0;
  font-size: 18px;
}

.assignment-heading p {
  margin: 4px 0 0;
}

.assignment-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.assignment-save-button {
  min-height: 34px;
  padding: 8px 12px;
}

.assignment-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.assignment-image-card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
  padding: 10px;
  border: 1px solid #dce4ea;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.assignment-image-card input {
  min-height: 0;
}

.assignment-image-card strong,
.assignment-image-card small {
  overflow-wrap: anywhere;
}

.assignment-image-card:has(input:checked) {
  border-color: #123b73;
  background: #e8eef8;
  box-shadow: inset 0 0 0 1px rgba(18, 59, 115, 0.16);
}

.empty-choice {
  place-content: center;
  min-height: 130px;
  color: var(--muted);
  font-weight: 800;
}

.row-rot td {
  background: #fff1f1;
}

.row-orange td {
  background: #fff7ed;
}

.row-pruefen td {
  background: #fffbeb;
}

.output-list a {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  font-weight: 800;
}

.log-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.log-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.step-link {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.step-link span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f1f5f7;
  color: var(--muted);
  font-weight: 900;
}

.step-link.active {
  border-color: var(--teal);
  background: #eef8f8;
}

.step-link.active span {
  background: var(--teal);
  color: #fff;
}

.steps-editor {
  min-width: 0;
}

.editor-header {
  min-height: 78px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.editor-header h1 {
  font-size: 30px;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.editor-pane {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.editor-pane > span {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  color: #34414a;
}

.editor-pane textarea {
  min-height: calc(100vh - 230px);
  border-radius: 6px;
}

.review-pane {
  border-top: 4px solid var(--amber);
}

.review-browser-section {
  border-top: 4px solid var(--blue);
}

.review-browser-preview {
  display: grid;
  gap: 14px;
  max-width: 980px;
  padding: 22px;
  border: 1px solid #d7e1ee;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.review-browser-preview h1,
.review-browser-preview h2,
.review-browser-preview h3,
.review-browser-preview p,
.review-browser-preview ul {
  margin: 0;
}

.review-browser-preview h1 {
  padding-bottom: 12px;
  border-bottom: 2px solid #dbe7f6;
  color: var(--blue);
  font-size: 30px;
  line-height: 1.16;
}

.review-browser-preview h2 {
  margin-top: 10px;
  color: var(--blue);
  font-size: 21px;
  line-height: 1.24;
}

.review-browser-preview h3 {
  color: #2b3942;
  font-size: 17px;
  line-height: 1.3;
}

.review-browser-preview p {
  color: #43515a;
}

.review-browser-preview ul {
  display: grid;
  gap: 8px;
  padding-left: 0;
  list-style: none;
}

.review-browser-preview li {
  padding: 10px 12px;
  border-left: 4px solid #c9d6e2;
  border-radius: 6px;
  background: #f7fafc;
  color: #34414a;
}

.review-browser-preview .review-item-warning,
.review-browser-preview .review-item-open {
  border-left-color: var(--amber);
  background: #fff8e6;
}

.review-browser-preview .review-item-error {
  border-left-color: var(--red);
  background: #fff1f1;
}

.review-browser-preview .review-item-ok {
  border-left-color: var(--green);
  background: #eef8f4;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(17, 24, 30, 0.54);
}

.modal-backdrop[hidden] {
  display: none;
}

.welcome-modal {
  position: relative;
  width: min(820px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  padding: 30px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.28);
}

.welcome-modal h1 {
  margin-top: 8px;
  font-size: 34px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.process-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.process-flow span {
  min-height: 74px;
  padding: 13px;
  border: 1px solid #cddce5;
  border-radius: 8px;
  background: #f6fafb;
  font-weight: 800;
}

.modal-note {
  padding: 15px;
  border-left: 4px solid var(--amber);
  background: #fffbeb;
  border-radius: 8px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.prototype-shell {
  display: grid;
  gap: 22px;
}

.workflow-shell {
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
  align-items: stretch;
  background: var(--bg);
}

.workflow-sidebar {
  position: sticky;
  top: 68px;
  display: grid;
  gap: 16px;
  align-content: start;
  height: calc(100vh - 68px);
  max-height: calc(100vh - 68px);
  overflow: auto;
  padding: 20px 16px;
  background: #fff;
  border-right: 1px solid var(--line);
  box-shadow: 10px 0 28px rgba(23, 32, 38, 0.05);
}

.workflow-brand {
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.workflow-brand h1 {
  font-size: 24px;
}

.workflow-brand p {
  margin: 0;
}

.workflow-menu {
  display: grid;
  gap: 7px;
}

.workflow-menu-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  border-left: 4px solid transparent;
}

.workflow-menu-item span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  border-radius: 6px;
  background: #edf2f5;
  color: #52616b;
  font-size: 12px;
  font-weight: 900;
}

.workflow-menu-item strong {
  overflow: hidden;
  color: #2b3942;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.implemented-marker {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-top: 2px;
  color: #27745f;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.implemented-marker b {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: #dff2e7;
  color: #27623f;
  font-size: 10px;
}

.workflow-menu-item:hover,
.workflow-menu-item.active {
  border-color: var(--teal);
  background: #eef8f8;
}

.workflow-menu-item.erledigt {
  border-left-color: #2f8f66;
}

.workflow-menu-item.fehlt,
.workflow-menu-item.locked {
  opacity: 0.72;
  background: #f7f9fa;
}

.workflow-menu-item.locked {
  cursor: not-allowed;
}

.workflow-menu-item.active {
  border-left-color: var(--teal);
  box-shadow: inset 0 0 0 1px rgba(8, 127, 140, 0.12);
}

.workflow-menu-item.active span {
  background: var(--teal);
  color: #fff;
}

.workflow-main {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 28px;
  align-content: start;
}

.workflow-header > div,
.workflow-workspace,
.workspace-section,
.upload-grid,
.upload-strip {
  min-width: 0;
}

.workflow-header,
.workspace-section,
.workflow-footer {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.workflow-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}

.header-status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.workflow-header h1 {
  margin-top: 6px;
}

.workflow-header p {
  max-width: 760px;
  margin-bottom: 0;
}

.workflow-progress-panel {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.progress-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 14px;
  color: #34414a;
}

.progress-summary strong {
  color: var(--ink);
}

.progress-summary span {
  color: var(--muted);
  font-size: 13px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef2;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #2f8f66);
}

.missing-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px 12px 10px 28px;
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: #fffbeb;
  color: #61420a;
  font-size: 13px;
}

.workflow-workspace {
  display: grid;
  gap: 16px;
}

.workspace-section {
  padding: 22px;
}

.quiet-section {
  box-shadow: none;
  background: #fbfcfd;
}

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

.check-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
  color: #43515a;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.compact-list {
  margin-top: 12px;
}

.workflow-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.button.disabled,
.button:disabled {
  border-color: #d7e0e6;
  background: #eef2f5;
  color: #83909a;
  cursor: not-allowed;
  box-shadow: none;
}

.prototype-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: 20px;
  align-items: stretch;
}

.prototype-title,
.upload-strip,
.step-overview,
.step-detail,
.step-card,
.placeholder-workspace {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.prototype-title {
  min-height: 220px;
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(8, 127, 140, 0.10), rgba(184, 107, 0, 0.08)),
    #fff;
}

.prototype-title h1 {
  margin-top: 8px;
}

.prototype-title p {
  max-width: 780px;
  margin-bottom: 0;
}

.upload-strip {
  display: grid;
  gap: 14px;
  align-content: center;
  padding: 22px;
  border-left: 5px solid var(--teal);
}

.upload-stack {
  display: grid;
  gap: 12px;
}

.compact-upload {
  border-left-color: var(--blue);
  box-shadow: none;
}

.upload-control {
  gap: 10px;
}

.upload-control span {
  font-size: 13px;
  text-transform: uppercase;
}

.upload-control input {
  min-height: 52px;
  padding: 12px;
  background: #f8fafb;
}

.prototype-step-nav {
  position: sticky;
  top: 68px;
  z-index: 15;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  background: rgba(245, 247, 248, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(12px);
}

.prototype-step-tab {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 54px;
  padding: 8px;
  border: 1px solid #ced8df;
  border-radius: 8px;
  background: #fff;
}

.prototype-step-tab span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #edf2f5;
  color: #52616b;
  font-size: 12px;
  font-weight: 900;
}

.prototype-step-tab strong {
  min-width: 0;
  overflow: hidden;
  color: #2b3942;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prototype-step-tab:hover {
  border-color: var(--teal);
}

.prototype-step-tab.active {
  background: #eef8f8;
  border-color: var(--teal);
}

.prototype-step-tab.active span {
  background: var(--teal);
  color: #fff;
}

.step-page-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.step-overview {
  position: sticky;
  top: 186px;
  display: grid;
  gap: 14px;
  padding: 22px;
}

.step-number {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.step-overview h2 {
  font-size: 26px;
}

.step-detail {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.step-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.step-detail-header h1 {
  margin-top: 6px;
  font-size: 34px;
}

.step-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.step-card {
  min-height: 190px;
  padding: 18px;
  box-shadow: none;
}

.step-card h2,
.placeholder-workspace h2 {
  margin-bottom: 10px;
}

.step-card ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
  color: #43515a;
}

.result-card {
  border-top: 4px solid var(--green);
}

.placeholder-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: center;
  padding: 20px;
  background: #fbfcfd;
  box-shadow: none;
}

.placeholder-workspace p {
  margin-bottom: 0;
}

.placeholder-panel {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px dashed #a9b8c2;
  border-radius: 8px;
  background: #fff;
}

.placeholder-panel span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.step-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

@media (max-width: 980px) {
  .workspace-grid,
  .project-shell,
  .steps-shell,
  .editor-grid,
  .pipeline-grid,
  .form-grid.two,
  .workflow-shell,
  .upload-grid,
  .lab-workbench,
  .prototype-top,
  .step-page-layout,
  .placeholder-workspace {
    grid-template-columns: 1fr;
  }

  .project-sidebar,
  .steps-list,
  .workflow-sidebar,
  .lab-manual-form,
  .step-overview {
    position: static;
    height: auto;
    max-height: none;
  }

  .workflow-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
    overflow-x: hidden;
  }

  .workflow-menu {
    display: flex;
    gap: 8px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .workflow-menu-item {
    flex: 0 0 min(250px, 78vw);
    scroll-snap-align: start;
  }

  .workflow-main {
    padding: 20px;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 30px;
  }

  .demo-grid,
  .process-flow {
    grid-template-columns: 1fr;
  }

  .prototype-step-nav {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .step-cards {
    grid-template-columns: 1fr;
  }

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

  .explorer-tree .tree-row {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .explorer-tree .status-chip,
  .selected-for,
  .explorer-tree small,
  .tree-pick-button {
    grid-column: 2;
    justify-self: start;
  }

  .caption-editor-row {
    grid-template-columns: 1fr;
  }

  .caption-workbench,
  .caption-editor-panel {
    grid-template-columns: 1fr;
  }

  .caption-picker-list {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 18px;
  }

  .page {
    padding: 18px;
  }

  .page:has(.workflow-shell) {
    padding: 0;
  }

  .panel,
  .project-sidebar,
  .steps-list,
  .editor-header,
  .editor-pane,
  .welcome-modal {
    padding: 16px;
  }

  .welcome-modal h1 {
    font-size: 26px;
  }

  .modal-actions {
    justify-content: stretch;
  }

  .modal-actions .button {
    width: 100%;
  }

  .prototype-step-nav {
    grid-template-columns: 1fr;
  }

  .step-detail-header,
  .step-pager,
  .workflow-header,
  .workflow-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .step-detail-header h1 {
    font-size: 28px;
  }

  .prototype-step-tab strong {
    white-space: normal;
  }

  .workflow-header h1,
  .workflow-header p,
  .workflow-menu-item strong,
  .project-row strong,
  .project-row small {
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .project-row {
    align-items: flex-start;
    flex-direction: column;
  }

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

  input[type="file"] {
    min-width: 0;
  }
}

/* Brand refinement - darker, more expert-oriented */
:root {
  --bg: #f6f8fb;
  --ink: #182230;
  --muted: #5d6675;
  --line: #d8dee8;
  --teal: #123b73;
  --teal-dark: #0a2447;
  --blue: #123b73;
  --soft-blue: #e9f0fb;
  --focus: 0 0 0 3px rgba(18, 59, 115, 0.18);
}

body {
  background:
    linear-gradient(180deg, #ffffff 0, #f6f8fb 360px),
    var(--bg);
}

.brand-mark {
  background:
    linear-gradient(145deg, #07182f 0%, #0d2d5a 54%, #15549b 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 8px 20px rgba(7, 24, 47, 0.24);
  color: #ffffff;
}

.brand strong,
h1,
h2,
.panel-title h2,
.section-heading h2 {
  color: #111827;
}

.topnav a:hover,
.topnav a[aria-current="page"],
.workflow-menu-item.active {
  background: #e8eef8;
  color: #0d2d5a;
}

.eyebrow,
.role-card span,
.output-list a,
.button.secondary,
.tree-toggle,
.tree-pick-button {
  color: #123b73;
}

.button.primary {
  background: #123b73;
  box-shadow: 0 1px 2px rgba(18, 59, 115, 0.18);
}

.button.primary:hover {
  background: #0a2447;
  box-shadow: 0 3px 12px rgba(18, 59, 115, 0.25);
}

.status-chip {
  background: #e8eef8;
  color: #0d2d5a;
}

.workflow-shell {
  background:
    linear-gradient(180deg, #ffffff 0, #f6f8fb 240px),
    #f6f8fb;
}

.workflow-header {
  background:
    linear-gradient(135deg, rgba(232, 238, 248, 0.94), rgba(255, 255, 255, 0.96)),
    #fff;
}

.workflow-menu-item.active span,
.step-link.active span,
.prototype-step-tab.active span {
  background: #123b73;
}

.workflow-menu-item.active strong {
  color: #0d2d5a;
}

.button.disabled,
.button.disabled:hover,
.button.primary.disabled,
.button.primary.disabled:hover,
.button.secondary.disabled,
.button.secondary.disabled:hover,
.button:disabled,
.button:disabled:hover {
  border-color: #d7e0e6;
  background: #eef2f5;
  color: #83909a;
  cursor: not-allowed;
  box-shadow: none;
}

body:has(.backend-hero) .topbar {
  background: rgba(20, 19, 30, 0.86);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

body:has(.backend-hero) .brand-mark {
  background: linear-gradient(140deg, var(--demo-mauve), var(--demo-lavender));
  box-shadow: 0 8px 20px -8px rgba(136, 57, 239, 0.7);
}

body:has(.backend-hero) .brand strong {
  color: #f4f2fb;
}

body:has(.backend-hero) .brand small {
  color: rgba(233, 231, 243, 0.62);
}

body:has(.backend-hero) .topnav {
  border-color: rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
}

body:has(.backend-hero) .topnav a {
  color: rgba(233, 231, 243, 0.72);
}

body:has(.backend-hero) .topnav a:hover,
body:has(.backend-hero) .topnav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}

/* Absolute final polish overrides. */
body:has(.backend-hero) .topbar {
  position: fixed;
  inset: 0 0 auto 0;
  background:
    linear-gradient(180deg, rgba(20, 19, 30, 0.34), rgba(20, 19, 30, 0.08)),
    rgba(20, 19, 30, 0.04);
  border-bottom-color: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  backdrop-filter: blur(13px) saturate(1.18);
}

.app-loader {
  overflow: hidden;
  background:
    radial-gradient(900px 520px at 50% -12%, #262338, transparent 70%),
    linear-gradient(180deg, #14131e 0%, #100f18 100%);
}

.app-loader .brand-mark {
  background: linear-gradient(140deg, var(--demo-mauve), var(--demo-lavender));
  box-shadow: 0 8px 20px -8px rgba(136, 57, 239, 0.7);
}

.loader-card {
  position: relative;
  z-index: 1;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 24px 80px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

.loader-card strong {
  color: #f4f2fb;
}

.loader-card small {
  color: rgba(233, 231, 243, 0.62);
}

.loader-track {
  background: rgba(255, 255, 255, 0.10);
}

.loader-track span {
  background: linear-gradient(90deg, #8839ef, #cba6f7, #89dceb);
  box-shadow: 0 0 24px rgba(203, 166, 247, 0.65);
}

/* Absolute final polish overrides. */
body:has(.backend-hero) .topbar {
  position: fixed;
  inset: 0 0 auto 0;
  background:
    linear-gradient(180deg, rgba(20, 19, 30, 0.34), rgba(20, 19, 30, 0.08)),
    rgba(20, 19, 30, 0.04);
  border-bottom-color: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  backdrop-filter: blur(13px) saturate(1.18);
}

.app-loader {
  overflow: hidden;
  background:
    radial-gradient(900px 520px at 50% -12%, #262338, transparent 70%),
    linear-gradient(180deg, #14131e 0%, #100f18 100%);
}

.app-loader .brand-mark {
  background: linear-gradient(140deg, var(--demo-mauve), var(--demo-lavender));
  box-shadow: 0 8px 20px -8px rgba(136, 57, 239, 0.7);
}

.loader-card {
  position: relative;
  z-index: 1;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 24px 80px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

.loader-card strong {
  color: #f4f2fb;
}

.loader-card small {
  color: rgba(233, 231, 243, 0.62);
}

.loader-track {
  background: rgba(255, 255, 255, 0.10);
}

.loader-track span {
  background: linear-gradient(90deg, #8839ef, #cba6f7, #89dceb);
  box-shadow: 0 0 24px rgba(203, 166, 247, 0.65);
}

/* Final polish: transparent hero nav, landing-style loader, shimmer buttons. */
body:has(.backend-hero) .topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  background:
    linear-gradient(180deg, rgba(20, 19, 30, 0.72), rgba(20, 19, 30, 0.28)),
    rgba(20, 19, 30, 0.08);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  backdrop-filter: blur(14px) saturate(1.25);
}

body:has(.backend-hero) .backend-hero {
  padding-top: clamp(112px, 15vh, 156px);
}

body:has(.backend-hero) .topnav {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body:has(.backend-hero) .topnav a:hover,
body:has(.backend-hero) .topnav a[aria-current="page"] {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
}

.app-loader {
  overflow: hidden;
  background:
    radial-gradient(900px 520px at 50% -12%, #262338, transparent 70%),
    linear-gradient(180deg, #14131e 0%, #100f18 100%);
}

.app-loader::before,
.app-loader::after {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: linear-gradient(to right, rgba(203, 166, 247, 0.18), transparent);
  filter: blur(0.2px);
  opacity: 0.85;
  content: "";
  animation: loader-shape-float 9s ease-in-out infinite;
}

.app-loader::before {
  width: 440px;
  height: 96px;
  left: -120px;
  top: 18%;
  transform: rotate(12deg);
}

.app-loader::after {
  width: 360px;
  height: 86px;
  right: -80px;
  bottom: 18%;
  background: linear-gradient(to right, rgba(137, 220, 235, 0.16), transparent);
  transform: rotate(-16deg);
  animation-delay: -2.5s;
}

.loader-card {
  position: relative;
  z-index: 1;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 24px 80px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

.loader-card strong {
  color: #f4f2fb;
}

.loader-card small {
  color: rgba(233, 231, 243, 0.62);
}

.loader-track {
  background: rgba(255, 255, 255, 0.10);
}

.loader-track span {
  background: linear-gradient(90deg, #8839ef, #cba6f7, #89dceb);
  box-shadow: 0 0 24px rgba(203, 166, 247, 0.65);
}

.backend-btn,
body:has(.backend-hero) .button.primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.backend-btn::after,
body:has(.backend-hero) .button.primary::after {
  position: absolute;
  inset: -40% auto -40% -70%;
  z-index: 1;
  width: 55%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.36), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
  content: "";
  animation: button-shimmer 3.2s ease-in-out infinite;
}

.backend-btn-glass::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.20), transparent);
}

@keyframes button-shimmer {
  0%, 38% {
    transform: translateX(0) skewX(-18deg);
  }
  74%, 100% {
    transform: translateX(420%) skewX(-18deg);
  }
}

@keyframes loader-shape-float {
  0%, 100% {
    translate: 0 0;
  }
  50% {
    translate: 0 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-loader::before,
  .app-loader::after,
  .backend-btn::after,
  body:has(.backend-hero) .button.primary::after {
    animation: none;
  }
}

/* Backend skin wins after legacy brand overrides. */
body:has(.backend-hero) {
  background:
    radial-gradient(1200px 600px at 100% 20%, rgba(114, 135, 253, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(4, 165, 229, 0.08), transparent 55%),
    var(--demo-base);
}

body:has(.backend-hero) .topbar {
  background: rgba(20, 19, 30, 0.86);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

body:has(.backend-hero) .brand-mark {
  background: linear-gradient(140deg, var(--demo-mauve), var(--demo-lavender));
  box-shadow: 0 8px 20px -8px rgba(136, 57, 239, 0.7);
}

body:has(.backend-hero) .brand strong {
  color: #f4f2fb;
}

body:has(.backend-hero) .brand small {
  color: rgba(233, 231, 243, 0.62);
}

body:has(.backend-hero) .topnav {
  border-color: rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
}

body:has(.backend-hero) .topnav a {
  color: rgba(233, 231, 243, 0.72);
}

body:has(.backend-hero) .topnav a:hover,
body:has(.backend-hero) .topnav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}

body:has(.backend-hero) .workflow-menu-item.active span,
body:has(.backend-hero) .button.primary,
body:has(.backend-hero) .prototype-step-tab.active span {
  background: linear-gradient(140deg, var(--demo-mauve), var(--demo-lavender));
}

body:has(.backend-hero) .button.primary:hover {
  background: linear-gradient(140deg, var(--demo-mauve-deep), var(--demo-mauve));
}

/* Public backend skin - matches the high-end Gutachten demo while keeping
   the FastAPI workflow interactive. */
:root {
  --demo-base: #eff1f5;
  --demo-surface: #ffffff;
  --demo-text: #4c4f69;
  --demo-muted: #6c6f85;
  --demo-border: #ccd0da;
  --demo-mauve: #8839ef;
  --demo-mauve-deep: #7012d6;
  --demo-lavender: #7287fd;
  --demo-sky: #89dceb;
  --demo-green: #40a02b;
  --demo-peach: #fe640b;
  --demo-shadow: 0 22px 60px -28px rgba(76, 79, 105, 0.45);
}

body {
  background:
    radial-gradient(1200px 600px at 100% 20%, rgba(114, 135, 253, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(4, 165, 229, 0.08), transparent 55%),
    var(--demo-base);
  color: var(--demo-text);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

.topbar {
  min-height: 68px;
  padding: 0 clamp(18px, 4vw, 40px);
  background: rgba(20, 19, 30, 0.86);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
  backdrop-filter: blur(16px) saturate(1.4);
}

.brand {
  min-width: 260px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--demo-mauve), var(--demo-lavender));
  box-shadow: 0 8px 20px -8px rgba(136, 57, 239, 0.7);
  color: #fff;
}

.brand strong {
  color: #f4f2fb;
  font-weight: 800;
}

.brand small {
  color: rgba(233, 231, 243, 0.62);
}

.topnav {
  border-color: rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
}

.topnav a {
  color: rgba(233, 231, 243, 0.72);
}

.topnav a:hover,
.topnav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}

.backend-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(560px, 84vh, 800px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(72px, 12vh, 130px) clamp(20px, 5vw, 48px) clamp(120px, 16vh, 180px);
  background:
    radial-gradient(1200px 640px at 50% -12%, #262338, transparent 70%),
    linear-gradient(180deg, #14131e 0%, #100f18 100%);
  color: #e9e7f3;
}

.backend-hero-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(135deg, rgba(136, 57, 239, 0.12), transparent 50%, rgba(4, 165, 229, 0.12));
  filter: blur(44px);
  pointer-events: none;
}

.backend-shapes {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.backend-shape {
  position: absolute;
  opacity: 0;
  animation: backend-shape-in 2.4s cubic-bezier(0.23, 0.86, 0.39, 0.96) var(--delay, 0s) forwards;
}

.backend-shape > div {
  animation: backend-shape-float 12s ease-in-out infinite;
}

.backend-shape span {
  position: relative;
  display: block;
  width: var(--w);
  height: var(--h);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: linear-gradient(to right, var(--grad), transparent);
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(2px);
}

.backend-shape span::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.2), transparent 70%);
  content: "";
}

.backend-shape-1 { left: -4%; top: 20%; }
.backend-shape-2 { right: 0%; top: 74%; }
.backend-shape-3 { left: 3%; bottom: 6%; }
.backend-shape-4 { right: 20%; top: 14%; }
.backend-shape-5 { left: 24%; top: 9%; }

@keyframes backend-shape-in {
  from {
    opacity: 0;
    transform: translateY(-150px) rotate(calc(var(--r) - 15deg));
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(var(--r));
  }
}

@keyframes backend-shape-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(15px); }
}

.backend-hero-content {
  position: relative;
  z-index: 2;
  width: min(900px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.backend-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: clamp(24px, 4vw, 42px);
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(233, 231, 243, 0.72);
  font-size: 13px;
  font-weight: 700;
}

.backend-badge span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--demo-mauve);
  box-shadow: 0 0 12px 2px rgba(136, 57, 239, 0.85);
}

.backend-hero-title {
  margin: 0 0 clamp(20px, 3vw, 30px);
  max-width: none;
  color: #fff;
  font-size: clamp(42px, 8vw, 86px);
  font-weight: 800;
  line-height: 1.02;
}

.backend-hero-title span {
  display: block;
}

.backend-hero-title span:first-child {
  background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.82));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.backend-hero-title-grad {
  background: linear-gradient(90deg, #cba6f7 0%, #f4f2fb 50%, var(--demo-sky) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.backend-hero-sub {
  max-width: 68ch;
  margin: 0 auto clamp(28px, 4vw, 40px);
  color: rgba(233, 231, 243, 0.56);
  font-size: clamp(15px, 1.8vw, 20px);
  font-weight: 400;
  line-height: 1.6;
}

.backend-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.backend-btn {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
}

.backend-btn-primary {
  background: linear-gradient(135deg, var(--demo-mauve), var(--demo-mauve-deep));
  color: #fff;
  box-shadow: 0 14px 34px -12px rgba(136, 57, 239, 0.75);
}

.backend-btn-glass {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(6px);
}

.backend-btn:hover {
  transform: translateY(-2px);
}

.backend-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.backend-trust li {
  color: rgba(233, 231, 243, 0.48);
  font-size: 13px;
  font-weight: 800;
}

.backend-hero-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: 170px;
  background: linear-gradient(to bottom, transparent, var(--demo-base));
  pointer-events: none;
}

.backend-fu {
  opacity: 0;
  animation: backend-fade-up 1s cubic-bezier(0.25, 0.4, 0.25, 1) calc(0.4s + var(--fu, 0) * 0.18s) forwards;
}

@keyframes backend-fade-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}

.backend-stats {
  position: relative;
  z-index: 5;
  width: min(1440px, calc(100% - 32px));
  margin: 16px auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.backend-stats article {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px;
  border: 1px solid var(--demo-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--demo-shadow);
  backdrop-filter: blur(10px);
}

.backend-stats strong {
  color: var(--demo-text);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  line-height: 1;
}

.backend-stats span {
  color: var(--demo-muted);
  font-size: 13.5px;
  font-weight: 700;
}

.backend-explanation {
  position: relative;
  z-index: 4;
  width: min(1440px, calc(100% - 32px));
  margin: clamp(-78px, -6vw, -46px) auto 22px;
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.45fr);
  gap: 14px;
  align-items: stretch;
}

.backend-explanation-heading,
.backend-explain-grid article {
  border: 1px solid var(--demo-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.90);
  box-shadow: var(--demo-shadow);
  backdrop-filter: blur(10px);
}

.backend-explanation-heading {
  padding: clamp(22px, 3vw, 30px);
}

.backend-kicker {
  display: inline-flex;
  margin-bottom: 9px;
  color: var(--demo-mauve-deep);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.backend-explanation h2,
.backend-explanation h3 {
  margin: 0;
  color: var(--demo-text);
}

.backend-explanation h2 {
  font-size: clamp(24px, 2.8vw, 34px);
}

.backend-explanation p {
  margin: 10px 0 0;
  color: var(--demo-muted);
}

.backend-explain-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.backend-explain-grid article {
  padding: 22px;
}

.backend-explain-grid span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--demo-mauve), var(--demo-lavender));
  color: #fff;
  font-weight: 850;
}

.backend-explain-grid h3 {
  font-size: 18px;
}

#workflow {
  scroll-margin-top: 82px;
}

.workflow-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 40px) clamp(16px, 4vw, 40px) 64px;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  background: transparent;
}

.workflow-sidebar,
.workflow-header,
.workspace-section,
.workflow-footer,
.workflow-progress-panel {
  border-color: var(--demo-border);
  border-radius: 16px;
  background: var(--demo-surface);
  box-shadow: 0 12px 34px -22px rgba(76, 79, 105, 0.5);
}

.workflow-sidebar {
  top: 88px;
  height: auto;
  max-height: calc(100vh - 110px);
  padding: 20px;
  border: 1px solid var(--demo-border);
}

.workflow-menu-item {
  border-radius: 11px;
  background: #f5f6fa;
}

.workflow-menu-item.active {
  background: rgba(136, 57, 239, 0.08);
  box-shadow: 0 0 0 4px rgba(136, 57, 239, 0.14);
}

.workflow-menu-item.active span,
.button.primary,
.prototype-step-tab.active span {
  background: linear-gradient(140deg, var(--demo-mauve), var(--demo-lavender));
}

.button.primary:hover {
  background: linear-gradient(140deg, var(--demo-mauve-deep), var(--demo-mauve));
}

.eyebrow,
.workflow-menu-item.active strong,
.status-chip,
.button.secondary,
.tree-toggle,
.tree-pick-button {
  color: var(--demo-mauve-deep);
}

.status-chip {
  background: rgba(136, 57, 239, 0.10);
}

.implemented-chip {
  background: rgba(64, 160, 43, 0.14);
  color: #2f7a1f;
}

@media (prefers-reduced-motion: reduce) {
  .backend-shape,
  .backend-shape > div,
  .backend-fu {
    opacity: 1;
    animation: none;
  }
}

@media (max-width: 1040px) {
  .backend-explanation {
    grid-template-columns: 1fr;
  }

  .backend-explain-grid {
    grid-template-columns: 1fr;
  }

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

  .workflow-shell {
    grid-template-columns: 1fr;
  }

  .workflow-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .backend-hero {
    min-height: 620px;
    padding-top: 76px;
  }

  .backend-stats {
    grid-template-columns: 1fr;
  }

  .backend-shape span {
    transform: scale(0.72);
    transform-origin: left center;
  }
}

.workspace-section.review-browser-section {
  border-top: 4px solid var(--blue);
}

.button.disabled,
.button.disabled:hover,
.button.primary.disabled,
.button.primary.disabled:hover,
.button.secondary.disabled,
.button.secondary.disabled:hover,
.button:disabled,
.button:disabled:hover {
  border-color: #d7e0e6;
  background: #eef2f5;
  color: #83909a;
  cursor: not-allowed;
  box-shadow: none;
}

.button.disabled,
.button.disabled:hover,
.button.primary.disabled,
.button.primary.disabled:hover,
.button.secondary.disabled,
.button.secondary.disabled:hover,
.button:disabled,
.button:disabled:hover {
  border-color: #d7e0e6;
  background: #eef2f5;
  color: #83909a;
  cursor: not-allowed;
  box-shadow: none;
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(18, 59, 115, 0.08), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
  opacity: 1;
  visibility: visible;
  transition:
    opacity 420ms ease,
    visibility 420ms ease;
}

.app-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(360px, 100%);
  padding: 30px 28px;
  text-align: center;
}

.loader-mark {
  width: 56px;
  height: 56px;
  font-size: 16px;
}

.loader-card strong {
  display: block;
  color: #111827;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: 0;
}

.loader-card small {
  display: block;
  margin-top: 3px;
  color: #5d6675;
  font-size: 14px;
}

.loader-track {
  position: relative;
  width: min(260px, 72vw);
  height: 5px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce5f2;
}

.loader-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, #07182f, #123b73, #15549b);
  animation: loader-progress 1100ms ease-in-out infinite;
}

@keyframes loader-progress {
  0% {
    transform: translateX(-105%);
  }

  55% {
    width: 54%;
  }

  100% {
    transform: translateX(250%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-loader,
  .loader-track span {
    transition: none;
    animation: none;
  }
}

.project-row.active-project,
.role-card.active,
.step-link.active,
.tree-row.selected-row {
  border-color: #bccbe3;
  background: #f2f6fc;
}

.role-card.active {
  border-left-color: #123b73;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #123b73;
}

/* Schritt 5 - Vor-Ort-Erfassung Launch-Panel */
.hint-text {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.summary-list {
  margin: 4px 0 14px;
  padding-left: 18px;
  color: var(--ink);
}

.summary-list li {
  margin: 3px 0;
}

/* Professional UI refresh - Google Workspace inspired */
:root {
  --bg: #f8fafd;
  --panel: #ffffff;
  --ink: #1f1f1f;
  --muted: #5f6368;
  --line: #dfe3ea;
  --line-strong: #c7ced8;
  --teal: #1a73e8;
  --teal-dark: #1558b0;
  --blue: #1a73e8;
  --amber: #f9ab00;
  --red: #d93025;
  --green: #188038;
  --soft-blue: #e8f0fe;
  --soft-green: #e6f4ea;
  --soft-red: #fce8e6;
  --soft-amber: #fef7e0;
  --surface: #f1f4f9;
  --shadow: 0 1px 2px rgba(60, 64, 67, 0.08), 0 8px 24px rgba(60, 64, 67, 0.08);
  --shadow-strong: 0 2px 6px rgba(60, 64, 67, 0.10), 0 18px 42px rgba(60, 64, 67, 0.12);
  --radius: 8px;
  --radius-sm: 6px;
  --focus: 0 0 0 3px rgba(26, 115, 232, 0.18);
}

html {
  background: var(--bg);
  text-rendering: geometricPrecision;
}

body {
  background:
    linear-gradient(180deg, #ffffff 0, #f8fafd 340px),
    var(--bg);
  color: var(--ink);
  font-family: "Google Sans", "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a,
button,
input,
select,
textarea {
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.topbar {
  min-height: 64px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(218, 220, 224, 0.86);
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.06);
}

.brand {
  min-width: 236px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #1a73e8 0 48%, #188038 48% 68%, #f9ab00 68% 82%, #d93025 82%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42), 0 4px 12px rgba(26, 115, 232, 0.22);
  font-size: 13px;
  letter-spacing: 0;
}

.brand strong {
  display: block;
  color: #202124;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.brand small {
  color: #6f747b;
  font-size: 12px;
  line-height: 1.25;
}

.topnav {
  align-items: center;
  gap: 4px;
  padding: 6px;
  border: 1px solid #edf0f4;
  border-radius: 999px;
  background: #f8fafd;
}

.topnav a {
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  color: #3c4043;
  font-size: 14px;
  font-weight: 600;
}

.topnav a:hover,
.topnav a[aria-current="page"] {
  background: var(--soft-blue);
  color: #174ea6;
}

.page {
  max-width: 1520px;
  padding: 32px;
}

.panel,
.project-sidebar,
.steps-list,
.editor-header,
.editor-pane,
.workflow-header,
.workspace-section,
.workflow-footer,
.prototype-title,
.upload-strip,
.step-overview,
.step-detail,
.step-card,
.placeholder-workspace {
  border-color: #e0e4ea;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel,
.workspace-section,
.step-detail,
.editor-pane {
  padding: 24px;
}

.panel-title,
.section-heading,
.editor-header {
  align-items: flex-start;
}

.panel-title h2,
.section-heading h2,
.editor-pane > span {
  color: #202124;
}

.eyebrow {
  color: #1a73e8;
  font-size: 11px;
  font-weight: 700;
}

h1 {
  color: #202124;
  font-size: clamp(32px, 3.2vw, 48px);
  font-weight: 750;
  line-height: 1.08;
}

h2 {
  color: #202124;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.24;
}

p {
  color: #5f6368;
  font-size: 15px;
}

.intro-panel {
  min-height: 390px;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(232, 240, 254, 0.95), rgba(230, 244, 234, 0.72)),
    #fff;
  position: relative;
}

.intro-panel::after {
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(26, 115, 232, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.34);
  content: "";
}

.intro-panel > * {
  position: relative;
  z-index: 1;
}

.stats-row span,
.summary-grid span,
.demo-grid span {
  border-color: #e3e7ee;
  background: rgba(255, 255, 255, 0.72);
}

.stats-row strong,
.summary-grid strong,
.demo-grid strong {
  color: #202124;
  font-size: 24px;
  font-weight: 750;
}

label {
  color: #3c4043;
  font-size: 13px;
  font-weight: 650;
}

input,
select,
textarea {
  border-color: #dadce0;
  border-radius: var(--radius-sm);
  background: #fff;
  color: #202124;
}

input,
select {
  min-height: 46px;
  padding: 10px 12px;
}

textarea {
  border-radius: var(--radius-sm);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #bdc1c6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #1a73e8;
  box-shadow: var(--focus);
  outline: none;
}

.button {
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.button.primary {
  background: #1a73e8;
  box-shadow: 0 1px 2px rgba(26, 115, 232, 0.18);
}

.button.primary:hover {
  background: #1558b0;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.22);
}

.button.secondary {
  background: #fff;
  border-color: #dadce0;
  color: #1a73e8;
}

.button.secondary:hover {
  background: #f8fafd;
  border-color: #c6ccd5;
}

.button.flow-button {
  background: #fff;
  border-color: #f4c247;
  color: #8a5a00;
  box-shadow: none;
}

.button.flow-button:hover {
  background: var(--soft-amber);
  color: #6f4700;
}

.button.disabled,
.button.disabled:hover,
.button.primary.disabled,
.button.primary.disabled:hover,
.button.secondary.disabled,
.button.secondary.disabled:hover,
.button:disabled,
.button:disabled:hover {
  border-color: #d7e0e6;
  background: #eef2f5;
  color: #83909a;
  cursor: not-allowed;
  box-shadow: none;
}

.status-chip {
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--soft-blue);
  color: #174ea6;
  font-size: 12px;
  font-weight: 700;
}

.status-chip.light {
  border-color: #e0e4ea;
  background: #f8fafd;
  color: #5f6368;
}

.implemented-chip {
  background: var(--soft-green);
  color: #137333;
}

.empty-state {
  border-color: #cbd3df;
  background: #fbfcff;
  color: #5f6368;
}

.project-row,
.step-link,
.role-card,
.workflow-menu-item,
.tree-row,
.output-list a {
  border-color: #e0e4ea;
  background: #fff;
}

.project-row,
.role-card,
.workflow-menu-item,
.step-link {
  box-shadow: 0 1px 1px rgba(60, 64, 67, 0.04);
}

.project-row:hover,
.role-card:hover,
.step-link:hover,
.output-list a:hover {
  border-color: #c7d5f7;
  box-shadow: 0 2px 10px rgba(60, 64, 67, 0.08);
}

.project-row.active-project,
.role-card.active,
.step-link.active,
.workflow-menu-item.active,
.tree-row.selected-row {
  border-color: #c7d5f7;
  background: #f4f8ff;
}

.role-card {
  min-height: 148px;
  border-left-width: 3px;
}

.role-card.active {
  border-left-color: #1a73e8;
}

.role-card span {
  color: #1a73e8;
}

.role-card em {
  border-top-color: #edf0f4;
  color: #5f6368;
}

.workflow-shell {
  grid-template-columns: 312px minmax(0, 1fr);
  background:
    linear-gradient(180deg, #fff 0, #f8fafd 220px),
    #f8fafd;
}

.workflow-sidebar {
  top: 64px;
  height: calc(100vh - 64px);
  max-height: calc(100vh - 64px);
  padding: 18px 14px;
  border-right-color: #e0e4ea;
  background: #fff;
  box-shadow: 1px 0 3px rgba(60, 64, 67, 0.05);
}

.workflow-brand {
  gap: 6px;
  padding: 8px 8px 16px;
}

.workflow-brand h1 {
  font-size: 25px;
}

.workflow-brand p {
  color: #5f6368;
  font-size: 13px;
}

.workflow-menu {
  gap: 4px;
}

.workflow-menu-item {
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: none;
}

.workflow-menu-item span {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f1f3f4;
  color: #5f6368;
}

.workflow-menu-item strong {
  color: #3c4043;
  font-size: 13px;
  font-weight: 650;
}

.workflow-menu-item:hover {
  background: #f1f4f9;
}

.workflow-menu-item.active {
  border-color: transparent;
  background: var(--soft-blue);
  box-shadow: none;
}

.workflow-menu-item.active span {
  background: #1a73e8;
}

.workflow-menu-item.active strong {
  color: #174ea6;
}

.implemented-marker {
  color: #188038;
  font-size: 10px;
}

.implemented-marker b {
  background: #d7f1df;
  color: #137333;
}

.workflow-main {
  gap: 20px;
  padding: 28px 32px 32px;
}

.workflow-header {
  align-items: flex-start;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(232, 240, 254, 0.78), rgba(255, 255, 255, 0.92)),
    #fff;
}

.workflow-header h1 {
  margin-top: 5px;
  font-size: clamp(30px, 3vw, 44px);
}

.workflow-header p {
  color: #5f6368;
  font-size: 16px;
}

.workflow-footer {
  align-items: center;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
}

.upload-grid {
  gap: 16px;
}

.upload-strip {
  border-left: 0;
  background:
    linear-gradient(180deg, #fff, #fbfcff);
}

.compact-upload {
  border-left: 0;
}

.upload-control input {
  min-height: 58px;
  border-style: dashed;
  background: #f8fafd;
}

.file-tree,
.inventory-table,
.master-preview,
.lab-preview-table,
.clean-table-preview,
.excel-output-preview {
  border-color: #e0e4ea;
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.tree-row {
  min-height: 42px;
  border-bottom-color: #edf0f4;
}

.tree-dir {
  background: #f8fafd;
}

.tree-icon,
.tree-toggle,
.step-link span,
.prototype-step-tab span,
.step-number {
  background: #eef2f7;
  color: #5f6368;
}

.tree-toggle,
.tree-pick-button {
  border-color: #dadce0;
  background: #fff;
  color: #1a73e8;
}

.tree-toggle:hover,
.tree-pick-button:hover {
  border-color: #c7d5f7;
  background: var(--soft-blue);
}

.selected-for {
  border-color: #c7d5f7;
  background: var(--soft-blue);
  color: #174ea6;
}

table {
  color: #202124;
}

th,
td {
  border-bottom-color: #edf0f4;
}

th {
  background: #f1f4f9;
  color: #3c4043;
  font-weight: 750;
}

tbody tr:hover td {
  background: #fbfcff;
}

.excel-output-preview thead th {
  background: #202124;
}

.row-rot td {
  background: var(--soft-red);
}

.row-orange td,
.row-pruefen td {
  background: var(--soft-amber);
}

.warning-list {
  color: #8a5a00;
}

.demo-panel {
  border-left: 0;
}

.output-list a {
  color: #1a73e8;
}

.project-sidebar,
.steps-list {
  top: 88px;
}

.project-sidebar h1,
.steps-list h1,
.editor-header h1 {
  font-size: 30px;
}

.lab-manual-form {
  border-color: #e0e4ea;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-backdrop {
  background: rgba(32, 33, 36, 0.52);
  backdrop-filter: blur(6px);
}

.welcome-modal {
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-strong);
}

.modal-close {
  border-radius: 50%;
  color: #5f6368;
}

.modal-note {
  border-left-color: #f9ab00;
  background: var(--soft-amber);
}

@media (max-width: 980px) {
  .workflow-shell {
    grid-template-columns: 1fr;
  }

  .workflow-sidebar {
    height: auto;
    max-height: none;
    padding: 14px;
  }

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

  .workflow-main {
    padding: 20px;
  }
}

@media (max-width: 640px) {
  .topbar {
    gap: 12px;
    min-height: auto;
    padding: 12px 16px;
  }

  .brand {
    min-width: 0;
  }

  .topnav {
    width: 100%;
    justify-content: space-between;
  }

  .topnav a {
    flex: 1;
    padding: 8px 10px;
    text-align: center;
  }

  .page {
    padding: 16px;
  }

  .workflow-main {
    padding: 16px;
  }

  .workflow-menu {
    display: flex;
    grid-template-columns: none;
    gap: 8px;
    margin: 0 -4px;
    overflow-x: auto;
    padding: 2px 4px 8px;
    scroll-snap-type: x proximity;
  }

  .workflow-menu-item {
    flex: 0 0 min(250px, 78vw);
    scroll-snap-align: start;
  }

  .workflow-sidebar {
    gap: 10px;
    padding: 12px 12px 4px;
  }

  .workflow-brand {
    padding: 4px 4px 8px;
  }

  .workflow-brand h1 {
    font-size: 22px;
  }

  .workflow-header,
  .workspace-section,
  .panel {
    padding: 18px;
  }

  .button {
    width: 100%;
  }

  .button-row,
  .intro-actions,
  .header-status-stack {
    width: 100%;
  }
}

/* Final brand override - dark blue expert identity */
:root {
  --bg: #f6f8fb;
  --ink: #182230;
  --muted: #5d6675;
  --line: #d8dee8;
  --teal: #123b73;
  --teal-dark: #0a2447;
  --blue: #123b73;
  --soft-blue: #e9f0fb;
  --focus: 0 0 0 3px rgba(18, 59, 115, 0.18);
}

body {
  background:
    linear-gradient(180deg, #ffffff 0, #f6f8fb 360px),
    var(--bg);
}

.brand-mark {
  background:
    linear-gradient(145deg, #07182f 0%, #0d2d5a 54%, #15549b 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 8px 20px rgba(7, 24, 47, 0.24);
  color: #ffffff;
}

.topnav a:hover,
.topnav a[aria-current="page"],
.workflow-menu-item.active {
  background: #e8eef8;
  color: #0d2d5a;
}

.eyebrow,
.role-card span,
.output-list a,
.button.secondary,
.tree-toggle,
.tree-pick-button {
  color: #123b73;
}

.button.primary {
  background: #123b73;
  box-shadow: 0 1px 2px rgba(18, 59, 115, 0.18);
}

.button.primary:hover {
  background: #0a2447;
  box-shadow: 0 3px 12px rgba(18, 59, 115, 0.25);
}

.status-chip {
  background: #e8eef8;
  color: #0d2d5a;
}

.workflow-header {
  background:
    linear-gradient(135deg, rgba(232, 238, 248, 0.94), rgba(255, 255, 255, 0.96)),
    #fff;
}

.workflow-menu-item.active span,
.step-link.active span,
.prototype-step-tab.active span {
  background: #123b73;
}

.workflow-menu-item.active strong {
  color: #0d2d5a;
}

.button.disabled,
.button.disabled:hover,
.button.primary.disabled,
.button.primary.disabled:hover,
.button.secondary.disabled,
.button.secondary.disabled:hover,
.button:disabled,
.button:disabled:hover {
  border-color: #d7e0e6;
  background: #eef2f5;
  color: #83909a;
  cursor: not-allowed;
  box-shadow: none;
}

/* Final live backend overrides. Keep this at the file end. */
body:has(.backend-hero) .topbar {
  position: fixed;
  inset: 0 0 auto 0;
  background:
    linear-gradient(180deg, rgba(20, 19, 30, 0.34), rgba(20, 19, 30, 0.08)),
    rgba(20, 19, 30, 0.04);
  border-bottom-color: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  backdrop-filter: blur(13px) saturate(1.18);
}

body:has(.backend-hero) .brand-mark {
  background: linear-gradient(140deg, var(--demo-mauve), var(--demo-lavender));
  box-shadow: 0 8px 20px -8px rgba(136, 57, 239, 0.7);
}

body:has(.backend-hero) .brand strong {
  color: #f4f2fb;
}

body:has(.backend-hero) .brand small {
  color: rgba(233, 231, 243, 0.62);
}

body:has(.backend-hero) .topnav {
  border-color: rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
}

body:has(.backend-hero) .topnav a {
  color: rgba(233, 231, 243, 0.72);
}

body:has(.backend-hero) .topnav a:hover,
body:has(.backend-hero) .topnav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}

.app-loader {
  overflow: hidden;
  background:
    radial-gradient(900px 520px at 50% -12%, #262338, transparent 70%),
    linear-gradient(180deg, #14131e 0%, #100f18 100%);
}

.app-loader .brand-mark {
  background: linear-gradient(140deg, var(--demo-mauve), var(--demo-lavender));
  box-shadow: 0 8px 20px -8px rgba(136, 57, 239, 0.7);
}

.loader-card {
  position: relative;
  z-index: 1;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 24px 80px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

.loader-card strong {
  color: #f4f2fb;
}

.loader-card small {
  color: rgba(233, 231, 243, 0.62);
}

.loader-track {
  background: rgba(255, 255, 255, 0.10);
}

.loader-track span {
  background: linear-gradient(90deg, #8839ef, #cba6f7, #89dceb);
  box-shadow: 0 0 24px rgba(203, 166, 247, 0.65);
}
