/* ==========================================================================
   Creator Security & Compliance Check – Stylesheet
   Heller Apple-Stil, keine externen Ressourcen. Enthält am Ende ein
   eigenes A4-Druck-Layout für "Als PDF speichern".
   ========================================================================== */

:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.08);
  --line: #d2d2d7;
  --track: #e8e8ed;

  /* Ampelfarben (sparsam einsetzen) */
  --green: #1a7f37;
  --green-soft: rgba(26, 127, 55, 0.1);
  --yellow: #e68a00;
  --yellow-soft: rgba(230, 138, 0, 0.13);
  --red: #d7373f;
  --red-soft: rgba(215, 55, 63, 0.1);

  --radius-card: 22px;
  --radius-item: 14px;
  --radius-pill: 980px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

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

/* ---------- Layout ---------- */

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 64px 16px 56px;
}

.intro {
  text-align: center;
  margin-bottom: 40px;
}

/* Nach der Startansicht: Kopf kompakter, ohne Einleitungstext */
body:not([data-view="start"]) .intro {
  margin-bottom: 28px;
}

body:not([data-view="start"]) .intro .lead {
  display: none;
}

body:not([data-view="start"]) .intro h1 {
  font-size: clamp(24px, 4.6vw, 32px);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

h1 {
  font-size: clamp(30px, 6.4vw, 48px);
}

h2 {
  font-size: clamp(24px, 5vw, 30px);
  line-height: 1.15;
}

h3,
h4 {
  font-size: 19px;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h2:focus {
  outline: none;
}

.lead {
  margin: 16px auto 0;
  max-width: 620px;
  font-size: clamp(17px, 2.6vw, 21px);
  color: var(--text-2);
}

/* ---------- Karten ---------- */

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 40px;
}

.card + .card {
  margin-top: 16px;
}

.section-title {
  margin-bottom: 6px;
}

.section-sub {
  margin: 0 0 24px;
  font-size: 15px;
  color: var(--text-2);
}

/* Übergang zwischen den Ansichten */
.stage-enter {
  animation: stageIn 0.4s var(--ease) both;
}

.stage-leave {
  animation: stageOut 0.18s var(--ease) both;
}

@keyframes stageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@keyframes stageOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-8px); }
}

/* ---------- Startansicht ---------- */

.start {
  text-align: center;
}

.areas-overview {
  /* Flex statt Grid, damit eine unvollständige letzte Zeile zentriert steht */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
  text-align: left;
}

.areas-overview li {
  flex: 0 0 calc((100% - 20px) / 3);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-item);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.area-num {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  line-height: 26px;
  text-align: center;
}

.start-hint {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--text-3);
}

/* ---------- Fortschritt ---------- */

.progress {
  margin-bottom: 16px;
}

.progress.is-hidden {
  display: none;
}

.progress-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 16px;
  margin-bottom: 8px;
  font-size: 14px;
}

.progress-label {
  font-weight: 600;
}

.progress-area {
  color: var(--text-2);
}

.progress-track {
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--line);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.45s var(--ease);
}

/* ---------- Frage / Aussage ---------- */

.question-area {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-3);
}

.question-title {
  font-size: clamp(21px, 4.2vw, 28px);
  line-height: 1.2;
}

.question-hint {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--text-2);
}

/* ---------- Auswahlfelder ---------- */

.choice-list {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

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

.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-item);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.choice:hover {
  border-color: var(--text-3);
}

/* Native Radio-Buttons visuell ersetzen, aber zugänglich lassen */
.choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.choice-mark {
  flex: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  transition: border-color 0.2s var(--ease), border-width 0.2s var(--ease);
}

.choice-text {
  min-width: 0;
}

.choice-title {
  display: block;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.choice-desc {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-2);
}

.choice.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.choice.is-selected .choice-mark {
  border-color: var(--accent);
  border-width: 6px;
}

.choice input:focus-visible ~ .choice-mark {
  outline: 3px solid rgba(0, 113, 227, 0.35);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
}

.actions-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 11px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent);
  font: inherit;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), opacity 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn:focus-visible,
.btn-inline:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.35);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
}

.btn-secondary:hover {
  background: var(--accent-soft);
}

/* "Zurück" / "Check wiederholen" als ruhiger Textlink */
.btn-link {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
  padding-left: 4px;
  padding-right: 4px;
}

.btn-link:hover {
  text-decoration: underline;
}

.actions > .btn-primary {
  margin-left: auto;
}

.btn-large {
  min-height: 50px;
  padding: 14px 32px;
}

.btn-inline {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  border-radius: 4px;
}

.btn-inline:hover {
  text-decoration: underline;
}

/* ---------- Ampel ---------- */

.tone--green  { --tone: var(--green);  --tone-soft: var(--green-soft); }
.tone--yellow { --tone: var(--yellow); --tone-soft: var(--yellow-soft); }
.tone--red    { --tone: var(--red);    --tone-soft: var(--red-soft); }

/*
 * Ampel-Lichter: oben/links Rot, Mitte Gelb, unten/rechts Grün.
 * Nur das aktive Licht ist gefüllt – über die Position bleibt die Stufe
 * auch in Graustufen oder bei Farbsehschwäche eindeutig.
 */
.ampel,
.lights {
  display: inline-flex;
}

.ampel i,
.lights i {
  display: block;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--bg);
}

.ampel[data-level="red"] i:nth-child(1),
.lights[data-level="red"] i:nth-child(1) {
  background: var(--red);
  border-color: var(--red);
}

.ampel[data-level="yellow"] i:nth-child(2),
.lights[data-level="yellow"] i:nth-child(2) {
  background: var(--yellow);
  border-color: var(--yellow);
}

.ampel[data-level="green"] i:nth-child(3),
.lights[data-level="green"] i:nth-child(3) {
  background: var(--green);
  border-color: var(--green);
}

/* Große Ampel im Ergebnis */
.ampel {
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-pill);
}

.ampel i {
  width: 44px;
  height: 44px;
  border-width: 2px;
  background: var(--surface);
}

.ampel[data-level="red"] i:nth-child(1) { box-shadow: 0 0 18px rgba(215, 55, 63, 0.45); }
.ampel[data-level="yellow"] i:nth-child(2) { box-shadow: 0 0 18px rgba(230, 138, 0, 0.45); }
.ampel[data-level="green"] i:nth-child(3) { box-shadow: 0 0 18px rgba(26, 127, 55, 0.4); }

/* Kleine Ampel in Zeilen und Legende */
.lights {
  gap: 3px;
  vertical-align: middle;
}

.lights i {
  width: 9px;
  height: 9px;
}

/* ---------- Ergebnis: Zusammenfassung ---------- */

.report-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 0 0 12px;
  padding: 0 4px;
  font-size: 14px;
  color: var(--text-2);
}

.summary {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 32px;
}

.score-line {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
}

.score-number {
  font-size: 60px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.score-pct {
  margin-left: 2px;
  font-size: 0.5em;
  letter-spacing: 0;
}

.score-label {
  font-size: 14px;
  line-height: 1.35;
  color: var(--text-2);
}

.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--tone-soft);
  border: 1px solid var(--tone);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.summary-title {
  margin-top: 12px;
  font-size: clamp(24px, 4.6vw, 30px);
}

.summary-text {
  margin: 10px 0 0;
  color: var(--text-2);
}

.summary-phase {
  margin: 14px 0 0;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 12px;
  font-size: 15px;
}

/* Überschrift: Aufhänger nur auf der Startseite, danach der Name des Checks */
.h1-run,
body:not([data-view="start"]) .h1-start,
body:not([data-view="start"]) .intro .eyebrow {
  display: none;
}

body:not([data-view="start"]) .h1-run {
  display: inline;
}

/* Warnhinweis, wenn die kritischste Kategorie nicht grün ist */
.summary-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0 0;
  padding: 12px 16px;
  background: var(--tone-soft);
  border: 1px solid var(--tone);
  border-radius: 12px;
  font-size: 15px;
}

.summary-alert .lights {
  flex: none;
  margin-top: 6px;
}

/* ---------- Kritischste Kategorie (Account-Sicherheit) ---------- */

.critical-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border: 1px solid var(--text);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: 2px;
  color: var(--text);
}

.question-area .critical-tag {
  font-size: 10px;
}

.area-row--critical {
  margin: -6px -12px 0;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-item);
}

.area-row--critical .bar-track {
  height: 14px;
}

.area-count {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
}

/* Plattform-Tipp unter einer Aussage bzw. Empfehlung */
.question-tip,
.measure-tip {
  margin: 12px 0 0;
  padding: 10px 14px;
  background: var(--accent-soft);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text);
}

.measure-tip {
  margin-top: 8px;
}

/* ---------- Ergebnis: Bereiche ---------- */

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

.area-row + .area-row {
  margin-top: 18px;
}

.area-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 8px;
  font-size: 16px;
}

.area-name {
  font-weight: 600;
}

.area-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.tone-word {
  font-size: 13px;
  color: var(--text-2);
}

.area-pct {
  min-width: 3.2em;
  font-weight: 600;
  text-align: right;
}

.bar-track {
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--track);
  overflow: hidden;
}

.bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--tone, var(--accent));
  transition: width 0.9s var(--ease);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 24px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  font-size: 13px;
  color: var(--text-2);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Ergebnis: Risikobereiche / Maßnahmen ---------- */

.measures {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: measure;
}

.measures li {
  position: relative;
  padding: 20px 20px 20px 62px;
  background: var(--bg);
  border-radius: var(--radius-item);
  counter-increment: measure;
}

.measures li + li {
  margin-top: 10px;
}

.measures li::before {
  content: counter(measure);
  position: absolute;
  left: 20px;
  top: 20px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  line-height: 28px;
  text-align: center;
}

.measure-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}

.measure-title {
  min-width: 0;
  font-size: 17px;
  -webkit-hyphens: auto;
  hyphens: auto;
  overflow-wrap: break-word;
}

.measure-area {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-3);
}

.measure-text {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.5;
}

.all-done {
  margin: 0;
  padding: 18px 20px;
  background: var(--green-soft);
  border-radius: var(--radius-item);
}

/* Antwort-Status: Symbol + Text, damit nichts nur über Farbe läuft */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}

.status::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.status--2 {
  background: var(--green-soft);
  color: var(--green);
}

.status--2::before {
  background: currentColor;
}

.status--1 {
  background: var(--yellow-soft);
  color: #8a5300;
}

.status--1::before {
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

.status--0 {
  background: var(--red-soft);
  color: #b3262e;
}

/* ---------- Ergebnis: Antwortübersicht ---------- */

.answers-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
  cursor: pointer;
}

.answers-details summary::-webkit-details-marker {
  display: none;
}

.answers-details summary .section-title {
  margin: 0;
}

.answers-details summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border: solid var(--text-2);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.2s var(--ease);
}

.answers-details[open] summary::after {
  transform: rotate(-135deg) translateY(-3px);
}

.answers-details summary:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.35);
  outline-offset: 6px;
  border-radius: 6px;
}

.answers-table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: 15px;
}

.answers-table th,
.answers-table td {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.answers-table thead th {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
}

.answers-table .num {
  width: 36px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.answers-table .ans {
  padding-left: 12px;
  text-align: right;
}

.answers-table .group-row th {
  padding-top: 18px;
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Ergebnis: nächste Schritte ---------- */

.next-divider {
  height: 1px;
  margin: 28px 0 24px;
  background: var(--line);
}

.company-field {
  display: block;
}

.company-field span {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-2);
}

.company-field input {
  width: 100%;
  max-width: 420px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font: inherit;
  color: var(--text);
}

.company-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2);
}

.actions-result {
  justify-content: flex-start;
  margin-top: 20px;
}

.disclaimer {
  margin: 16px 0 0;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius-item);
  font-size: 14px;
  color: var(--text-2);
}

.disclaimer strong {
  color: var(--text);
}

/* ---------- Datenschutz-Hinweis ---------- */

.trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 560px;
  margin: 32px auto 0;
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}

.trust-icon {
  flex: none;
  width: 16px;
  height: 16px;
  fill: var(--green);
}

/* Druckelemente auf dem Bildschirm ausblenden */
.print-header,
.print-closing {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .stage-enter,
  .stage-leave {
    animation: none;
  }
  .progress-bar,
  .bar-fill {
    transition: none;
  }
}

/* ---------- Kleine Bildschirme ---------- */

@media screen and (max-width: 680px) {
  .page {
    padding-top: 40px;
  }

  .intro {
    margin-bottom: 28px;
  }

  .card {
    padding: 28px 20px;
  }

  .areas-overview li {
    flex-basis: calc((100% - 10px) / 2);
  }

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

  .choice {
    padding: 14px;
    gap: 12px;
  }

  .summary {
    gap: 20px;
  }

  .ampel {
    gap: 8px;
    padding: 9px;
  }

  .ampel i {
    width: 32px;
    height: 32px;
  }

  .score-number {
    font-size: 48px;
  }

  .measures li {
    padding: 16px 16px 16px 54px;
  }

  .measures li::before {
    left: 16px;
    top: 16px;
  }

  /* Antworttabelle: feste Spalten, Status darf umbrechen */
  .answers-table {
    table-layout: fixed;
  }

  .answers-table .num {
    width: 28px;
  }

  .answers-table th.ans,
  .answers-table td.ans {
    width: 112px;
  }

  .answers-table td {
    -webkit-hyphens: auto;
    hyphens: auto;
  }

  .answers-table .status {
    white-space: normal;
    text-align: left;
  }
}

@media screen and (max-width: 420px) {
  /* Fragebogen: "Weiter" oben, "Zurück" darunter */
  .actions:not(.actions-result) {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .actions-right {
    flex-direction: column-reverse;
    align-items: stretch;
    margin-left: 0;
  }

  .actions > .btn-primary {
    margin-left: 0;
  }

  .actions-result .btn,
  .card--next .btn-large {
    width: 100%;
  }

  .areas-overview li {
    flex-basis: 100%;
  }

  .summary {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  /* Ampel auf schmalen Geräten waagerecht */
  .ampel {
    flex-direction: row;
  }
}

/* ==========================================================================
   Druck-Layout ("Als PDF speichern")
   A4-Bericht mit Kopf (Titel, Name, Datum) und Fußzeile in den
   Seitenrändern. Ampelstufen bleiben über Lichtposition, Klartext und
   Muster auch in Graustufen erkennbar.
   ========================================================================== */

/* Fußzeile in den Seitenrändern: wiederholt sich auf jeder Seite, ohne
   Inhalte zu überdecken (Chrome, Edge, Brave; andere Browser zeigen
   stattdessen die Abschlusszeile .print-closing). */
@page {
  size: A4;
  margin: 16mm 15mm 18mm;

  @bottom-left {
    content: "Erstellt mit boecker-advisory.de";
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 8pt;
    color: #86868b;
  }

  @bottom-right {
    content: "Seite " counter(page) " von " counter(pages);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 8pt;
    color: #86868b;
  }
}

@media print {
  :root {
    --surface: #ffffff;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    font-size: 10pt;
    line-height: 1.38;
  }

  .page {
    max-width: none;
    padding: 0;
  }

  /* Bedienelemente und Bildschirm-Kopf ausblenden */
  .intro,
  .progress,
  .no-print,
  .actions,
  .report-meta,
  .trust,
  .answers-details summary::after {
    display: none !important;
  }

  .stage-enter,
  .stage-leave {
    animation: none !important;
  }

  .bar-fill {
    transition: none !important;
  }

  /* Kopf */
  .print-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1.5pt solid var(--text);
  }

  .print-title {
    font-size: 18pt;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
  }

  .print-context {
    margin-top: 3px;
    font-size: 9pt;
    color: var(--text-2);
  }

  .print-meta {
    text-align: right;
  }

  .print-name {
    font-size: 11pt;
    font-weight: 700;
    letter-spacing: -0.01em;
  }

  .print-date {
    font-size: 9pt;
    color: var(--text-2);
  }

  .print-closing {
    display: block;
    margin: 8px 0 0;
    font-size: 8pt;
    color: var(--text-3);
    text-align: right;
  }

  /* Karten: weiß mit feiner Linie statt grauer Fläche (tonersparend) */
  .card {
    padding: 12px 16px;
    border: 0.75pt solid var(--line);
    border-radius: 10px;
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }

  .card + .card {
    margin-top: 10px;
  }

  /* Lange Abschnitte dürfen umbrechen, einzelne Einträge nicht */
  .card--measures,
  .card--answers {
    break-inside: auto;
    page-break-inside: auto;
  }

  .section-title {
    font-size: 12.5pt;
    break-after: avoid;
    page-break-after: avoid;
  }

  .section-sub {
    margin: 2px 0 10px;
    font-size: 8.5pt;
  }

  /* Zusammenfassung */
  .summary {
    gap: 18px;
  }

  .ampel {
    gap: 4px;
    padding: 5px;
    border: 0.75pt solid var(--text-3);
  }

  .ampel i {
    width: 7mm;
    height: 7mm;
    border: 0.75pt solid var(--text-3);
    background: #ffffff;
    box-shadow: none !important;
  }

  .score-line {
    margin-bottom: 6px;
  }

  .score-number {
    font-size: 28pt;
  }

  .score-label {
    font-size: 8.5pt;
  }

  .badge {
    padding: 2px 9px;
    font-size: 8.5pt;
  }

  .summary-title {
    margin-top: 6px;
    font-size: 15pt;
  }

  .summary-text {
    margin-top: 4px;
    font-size: 9.5pt;
  }

  .summary-phase {
    margin-top: 8px;
    padding: 6px 10px;
    border: 0.75pt solid var(--line);
    font-size: 9pt;
  }

  /* Bereiche */
  .area-row + .area-row {
    margin-top: 6px;
  }

  .area-head {
    margin-bottom: 3px;
    font-size: 10pt;
  }

  .tone-word {
    font-size: 8.5pt;
  }

  .bar-track {
    height: 8px;
    border: 0.5pt solid var(--text-3);
    background: #ffffff;
  }

  /* Muster als zweites Merkmal: Gelb schraffiert, Grün gepunktet, Rot voll */
  .tone--yellow .bar-fill {
    background: repeating-linear-gradient(-45deg, var(--yellow) 0 2px, #ffffff 2px 4px);
  }

  .tone--green .bar-fill {
    background-color: var(--green);
    background-image: radial-gradient(#ffffff 0.9px, transparent 1.1px);
    background-size: 4px 4px;
  }

  .legend {
    margin-top: 10px;
    padding-top: 8px;
    font-size: 8.5pt;
  }

  /* Risikobereiche */
  .measures li {
    padding: 7px 12px 7px 42px;
    border: 0.75pt solid var(--line);
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .measures li + li {
    margin-top: 6px;
  }

  .measures li::before {
    left: 12px;
    top: 8px;
    width: 20px;
    height: 20px;
    font-size: 9pt;
    line-height: 20px;
    border: 0.75pt solid var(--accent);
  }

  .measure-title {
    font-size: 11pt;
  }

  .measure-area {
    margin-top: 1px;
    font-size: 8pt;
  }

  .measure-text {
    margin-top: 4px;
    font-size: 9.5pt;
    line-height: 1.4;
  }

  .status {
    padding: 1px 8px;
    font-size: 8pt;
    border-color: currentColor;
  }

  .all-done {
    padding: 8px 12px;
    border: 0.75pt solid var(--green);
    font-size: 9.5pt;
  }

  /* Antwortübersicht im Druck immer vollständig */
  .answers-table {
    margin-top: 6px;
    font-size: 9pt;
  }

  .answers-table th,
  .answers-table td {
    padding: 3px 0;
  }

  .answers-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .answers-table .group-row th {
    padding-top: 8px;
    font-size: 9.5pt;
    break-after: avoid;
    page-break-after: avoid;
  }

  .disclaimer {
    margin-top: 10px;
    padding: 8px 12px;
    border: 0.75pt solid var(--line);
    font-size: 8.5pt;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Kritischste Kategorie und Hinweise */
  .summary-alert {
    margin-top: 8px;
    padding: 6px 10px;
    font-size: 9pt;
  }

  .summary-alert .lights {
    margin-top: 3px;
  }

  .critical-tag {
    font-size: 7pt;
  }

  .area-row--critical {
    margin: 0 0 4px;
    padding: 6px 8px;
    border: 1pt solid var(--text);
    border-radius: 6px;
  }

  .area-row--critical .bar-track {
    height: 10px;
  }

  .question-tip,
  .measure-tip {
    margin-top: 4px;
    padding: 4px 8px;
    border: 0.75pt solid var(--line);
    background: #ffffff;
    font-size: 8.5pt;
  }

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