:root {
  --bg: #f2f3f1;
  --card: #ffffff;
  --ink: #0d0d0d;
  --navy: #001745;
  --blue: #024ce0;
  --mint: #02c67c;
  --border: #d6dbe6;
}

.produktvorschau-page .demo-main {
  padding-top: 92px;
  padding-bottom: 2.5rem;
}

.produktvorschau-page .demo-container {
  display: block;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  grid-template-columns: none;
  gap: 0;
  align-items: initial;
}

.produktvorschau-page .demo-main img {
  max-width: 100%;
  height: auto;
  width: auto;
  margin-left: 0;
}

* {
  box-sizing: border-box;
}

.demo-main {
  padding-bottom: 2.5rem;
}

.demo-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.demo-hero {
  background: linear-gradient(135deg, var(--blue), var(--mint));
  color: #fff;
  padding: 2rem 0;
}

.demo-hero h1 {
  margin: 0 0 0.5rem;
}

.demo-hero p {
  margin: 0;
  max-width: 780px;
}

.demo-flow {
  margin-top: 1.2rem;
  padding: 0;
}

.demo-toolbar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 23, 69, 0.08);
}

.demo-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.demo-step {
  border: 1px solid #b8c2d8;
  background: #fff;
  color: var(--navy);
  border-radius: 8px;
  padding: 0.6rem 0.65rem;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}

.demo-step.is-active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--mint));
}

.demo-progress-wrap {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.demo-progress-wrap strong {
  font-size: 0.9rem;
  color: var(--navy);
}

.demo-progress {
  flex: 1;
  height: 8px;
  border-radius: 20px;
  background: #d8deed;
  overflow: hidden;
}

.demo-progress span {
  display: block;
  height: 100%;
  width: 33.3333%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--blue), var(--mint));
  transition: width 0.2s ease;
}

.demo-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  max-width: none;
}

.demo-stage {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 23, 69, 0.08);
}

.demo-stage {
  padding: 1rem;
}

.demo-panel {
  display: none;
}

.demo-panel.is-active {
  display: block;
}

.demo-panel h2 {
  margin-top: 0;
  margin-bottom: 0.45rem;
  color: var(--navy);
}

.demo-panel p {
  margin-top: 0;
}

.demo-intro {
  max-width: 900px;
}

.demo-intro-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 1.25rem;
  align-items: start;
}

.demo-intro-visual {
  margin: 0;
  width: fit-content;
  max-width: 320px;
  justify-self: end;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 23, 69, 0.08);
}

.demo-intro-visual img {
  display: block;
  width: fit-content;
  max-width: 100%;
  max-height: 560px;
  height: auto;
  margin: 0 auto;
}

.demo-intro p {
  margin-bottom: 0.85rem;
  color: #1f2d4f;
  line-height: 1.65;
}

.demo-intro-important {
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  background: #eef4ff;
  padding: 0.75rem 0.9rem;
  font-weight: 700;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.sample-upload-box {
  margin-top: 0.9rem;
  padding: 1.6rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
}

.sample-upload-select {
  display: none;
}

.sample-upload-select-label {
  display: none;
}

.sample-context {
  width: 100%;
  margin-bottom: 1.25rem;
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  background: #eef4ff;
  padding: 0.9rem 1rem;
  color: #1f2d4f;
}

.sample-context p {
  margin: 0 0 0.75rem;
  line-height: 1.6;
}

.sample-context p:last-child {
  margin-bottom: 0;
}

.sample-upload-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
  position: relative;
}

.sample-upload-head h3 {
  margin: 0;
  color: #000000;
  font-size: 1.45rem;
  line-height: 1.25;
  text-align: center;
}

.sample-drop-zone {
  min-height: 118px;
  width: 100%;
  border: 2px dashed var(--navy);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  background: #ffffff;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.sample-drop-zone:hover,
.sample-drop-zone:focus,
.sample-drop-zone.is-drag-over {
  outline: none;
  background: #f4f8ff;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(2, 76, 224, 0.12);
}

.sample-file-grid {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.sample-file-card {
  min-height: 74px;
  width: 100%;
  border: 1px solid #d6dbe6;
  border-radius: 8px;
  background: #f8f9fc;
  color: #1f2d4f;
  padding: 0.7rem 0.8rem 0.7rem 3.3rem;
  position: relative;
  text-align: left;
  cursor: grab;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.sample-file-card:hover,
.sample-file-card:focus,
.sample-file-card.is-selected {
  outline: none;
  background: #eef4ff;
  border-color: var(--blue);
  box-shadow: 0 8px 20px rgba(0, 23, 69, 0.1);
}

.sample-file-card:active {
  cursor: grabbing;
  transform: translateY(1px);
}

.sample-file-card strong,
.sample-file-card small {
  display: block;
}

.sample-file-card strong {
  color: var(--navy);
  font-size: 0.95rem;
}

.sample-file-card small {
  margin-top: 0.2rem;
  color: #4e5a78;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-file-type {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 7px;
  background: var(--navy);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
}

.sample-upload-separator {
  margin: 0.9rem 0 0.7rem;
  text-align: center;
  color: #000000;
}

.sample-manual-btn {
  width: min(350px, 100%);
  min-height: 42px;
  margin: 0 auto;
  border: none;
  border-radius: 6px;
  background: var(--navy);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.sample-manual-btn:hover,
.sample-manual-btn:focus {
  outline: none;
}

.manual-entry-panel {
  margin-top: 2rem;
  border: 1px solid #cfd6e6;
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  background: #eef4ff;
  padding: 1.2rem;
}

.manual-entry-panel h3 {
  margin: 0 0 0.35rem;
  color: var(--navy);
  font-size: 1.05rem;
}

.manual-entry-panel p {
  margin: 0 0 0.9rem;
  color: #1f2d4f;
}

.manual-config-grid,
.manual-personal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 0.75rem;
}

.manual-config-grid {
  margin-top: 0.8rem;
}

.manual-config-grid label,
.manual-full-label {
  display: grid;
  gap: 0.35rem;
  color: #001745;
  font-weight: 700;
}

.manual-personal-grid label {
  display: block;
  color: #001745;
  font-weight: 700;
}

.manual-config-grid label span {
  color: #1f2d4f;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.35;
}

.manual-full-label {
  margin-top: 1.1rem;
}

.manual-config-grid select,
.manual-full-label select,
.manual-full-label input,
.manual-personal-grid input,
.manual-personal-grid select {
  width: 100%;
  border: 1px solid #024ce0;
  border-radius: 8px;
  padding: 0.65rem;
  min-height: 46px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #ffffff;
}

.manual-personal-grid input,
.manual-personal-grid select {
  display: block;
  margin-top: 0.35rem;
}

.manual-config-grid select:focus,
.manual-full-label select:focus,
.manual-full-label input:focus,
.manual-personal-grid input:focus,
.manual-personal-grid select:focus {
  outline: none;
  border-color: #001745;
  box-shadow: 0 0 0 3px rgba(2, 76, 224, 0.18);
}

.manual-personal-card {
  margin-top: 1rem;
  border: 1px solid #bfcbe5;
  border-radius: 8px;
  overflow: hidden;
  background: #f8f9fc;
}

.manual-personal-card h4 {
  margin: 0;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #bfcbe5;
  background: #dfe8fb;
  color: var(--navy);
  font-size: 1rem;
}

.manual-personal-grid {
  padding: 1rem;
}

.required-marker {
  color: #d23b3b;
  margin-left: 0.1rem;
}

.manual-required-note {
  margin: 0 1rem 1rem;
  color: #1f2d4f;
  font-size: 0.86rem;
  font-weight: 600;
}

.sample-preview {
  margin-top: 0.65rem;
  border: 1px solid #d6dbe6;
  border-radius: 8px;
  background: #ffffff;
  padding: 0.65rem;
}

.sample-preview strong {
  display: block;
  margin-bottom: 0.45rem;
  color: #1f2d4f;
}

.sample-preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.34fr);
  gap: 0.75rem;
  align-items: start;
}

.sample-preview pre {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  max-height: 230px;
  overflow: auto;
  white-space: pre;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #1f2d4f;
}

.sample-interface-note {
  border-left: 3px solid var(--blue);
  background: #eef4ff;
  border-radius: 8px;
  padding: 0.75rem;
  color: #1f2d4f;
  font-size: 0.86rem;
  line-height: 1.45;
}

.field-grid label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: #1f2d4f;
  font-weight: 600;
}

.field-grid input,
.field-grid select {
  border: 1px solid #024ce0;
  border-radius: 8px;
  padding: 0.65rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: #f2f3f1;
}

.field-grid input:focus,
.field-grid select:focus,
.sample-upload-box select:focus {
  outline: none;
  border-color: #001745;
  box-shadow: 0 0 0 3px rgba(2, 76, 224, 0.18);
}

.summary {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem;
  background: #f8f9fc;
}

.summary div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.summary span {
  color: #4e5a78;
}

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

.summary-datasets {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8f9fc;
  padding: 0.75rem;
}

.summary-datasets-title {
  display: block;
  margin-bottom: 0.55rem;
  color: #1f2d4f;
}

.summary-dataset-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.summary-dataset-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  color: #1f2d4f;
}

.summary-dataset-list li strong {
  color: var(--navy);
}

.zip-content-box {
  border: 1px solid #d6dbe6;
  border-radius: 10px;
  background: #f8f9fc;
  padding: 0.75rem;
}

.zip-content-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.55rem;
  color: #1f2d4f;
  font-weight: 700;
  font-size: 0.9rem;
}

.zip-file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.zip-file-item {
  border: 1px solid #d6dbe6;
  border-radius: 8px;
  padding: 0.65rem;
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
}

.zip-file-meta {
  display: grid;
  gap: 0.2rem;
  color: #1f2d4f;
}

.zip-file-meta small {
  color: #4e5a78;
  font-size: 0.82rem;
}

.zip-file-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.result-file-preview {
  margin-top: 0.75rem;
  border: 1px solid #d6dbe6;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.75rem;
}

.result-file-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.55rem;
  color: #1f2d4f;
}

.pdf-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex: 0 0 auto;
}

.pdf-zoom-controls button {
  min-width: 2.25rem;
  height: 2rem;
  border: 1px solid #cfd6e6;
  border-radius: 6px;
  background: #ffffff;
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
}

.pdf-zoom-controls button:hover {
  background: #e6ebf6;
}

.pdf-zoom-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.result-text-viewer {
  margin: 0;
  width: 100%;
  min-height: 160px;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #1f2d4f;
  border: 1px solid #cfd6e6;
  border-radius: 8px;
  background: #ffffff;
  padding: 0.75rem;
}

.pdf-static-preview {
  --pdf-page-width: 595px;
  max-height: 560px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border: 1px solid #cfd6e6;
  border-radius: 8px;
  background: #eef2f8;
  padding: 0.75rem;
  display: grid;
  gap: 0.75rem;
}

.pdf-static-page {
  width: calc(var(--pdf-page-width) * var(--pdf-preview-zoom, 1));
  max-width: none;
  margin: 0 auto;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(31, 45, 79, 0.14);
}

.pdf-static-page svg {
  display: block;
  width: 100%;
  height: auto;
}

.pdf-static-text {
  fill: #111827;
  font-family: "Times New Roman", Times, serif;
  dominant-baseline: alphabetic;
  white-space: pre;
}

.pdf-static-text.is-bold {
  font-weight: 700;
}

.demo-actions {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.demo-btn {
  border: none;
  border-radius: 8px;
  padding: 0.6rem 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.demo-btn-primary {
  background: var(--navy);
  color: #fff;
}

.demo-btn-secondary {
  background: #e6ebf6;
  color: var(--navy);
}

.hint {
  margin-top: 0.65rem;
  font-size: 0.9rem;
  color: #4e5a78;
}

.hint.is-error {
  color: #c1121f;
  font-weight: 600;
}

.hidden {
  display: none;
}

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

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

  .demo-intro-visual {
    justify-self: start;
  }
}

@media (max-width: 720px) {
  html,
  body {
    overflow-x: hidden;
  }

  .produktvorschau-page .demo-main {
    padding-top: 76px;
    padding-bottom: 1.5rem;
  }

  .produktvorschau-page .demo-container {
    padding: 0 0.75rem;
  }

  .demo-hero {
    padding: 1.35rem 0;
  }

  .demo-hero h1 {
    font-size: 1.65rem;
    line-height: 1.2;
  }

  .demo-toolbar,
  .demo-stage {
    border-radius: 8px;
  }

  .demo-stage {
    max-width: 100%;
    overflow: hidden;
    padding: 0.75rem;
  }

  .demo-intro-visual {
    display: none;
  }

  .sample-context,
  .zip-content-box,
  .zip-file-item,
  .result-file-preview {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

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

  .demo-step {
    min-height: 44px;
    font-size: 0.78rem;
    padding: 0.55rem 0.6rem;
    text-align: center;
  }

  .demo-progress-wrap {
    align-items: stretch;
    flex-direction: column;
    gap: 0.45rem;
  }

  .sample-upload-box {
    padding: 0.85rem;
  }

  .sample-upload-head h3 {
    font-size: 1.15rem;
  }

  .sample-upload-select-label {
    display: block;
    margin: 0 0 0.4rem;
    color: var(--navy);
    font-size: 0.9rem;
    font-weight: 700;
  }

  .sample-upload-select {
    display: block;
    width: 100%;
    min-height: 46px;
    margin-bottom: 0.85rem;
    border: 1px solid #024ce0;
    border-radius: 8px;
    background: #ffffff;
    color: #001745;
    font: inherit;
    padding: 0.65rem;
  }

  .sample-drop-zone {
    display: none;
    min-height: 58px;
    border-style: solid;
    color: #4e5a78;
    background: #f8f9fc;
  }

  .sample-drop-zone span {
    font-size: 0.9rem;
    text-align: center;
  }

  .sample-file-grid,
  .manual-config-grid,
  .manual-personal-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .sample-file-card {
    min-height: 68px;
  }

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

  .sample-preview pre {
    max-height: 190px;
  }

  .summary div,
  .summary-dataset-list li,
  .zip-content-head,
  .zip-file-item {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .zip-file-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .zip-file-meta,
  .zip-file-meta strong,
  .zip-file-meta small,
  .result-file-preview-head strong {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .pdf-static-preview {
    width: 100%;
    max-width: 100%;
    max-height: 440px;
    overflow-x: hidden;
    padding: 0.5rem;
  }

  .pdf-static-page {
    width: 100%;
    max-width: 100%;
  }

  .result-file-preview-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .produktvorschau-page .demo-container {
    padding: 0 0.6rem;
  }

  .demo-toolbar {
    padding: 0.65rem;
  }

  .demo-stage {
    padding: 0.6rem;
  }

  .sample-context,
  .manual-entry-panel,
  .manual-personal-grid {
    padding: 0.75rem;
  }

  .demo-actions {
    flex-direction: column;
  }

  .demo-actions .demo-btn,
  .zip-file-actions .demo-btn {
    width: 100%;
    min-height: 44px;
  }

  .pdf-zoom-controls {
    width: 100%;
  }

  .pdf-zoom-controls button {
    flex: 1;
  }
}

@media (max-width: 420px) {
  .demo-step {
    font-size: 0.72rem;
    padding: 0.5rem 0.4rem;
  }

  .sample-file-card {
    padding-right: 0.65rem;
  }
}
