/* ==========================================================================
   UV-Print-Konfigurator — Designsystem „Der Proofbogen“
   --------------------------------------------------------------------------
   THESIS: Die App ist der Bogen, der später im Drucker liegt. Marker sind
   Passkreuze, Warnungen sind Preflight, die vier ACRORIP-Werte stehen in der
   Slug-Zeile. Verweigert: das Karten-Dashboard mit Seitenleiste.
   OWN-WORLD: Neutralgrauer Leuchttisch, darauf weiße Bögen mit 1-px-Haarlinien
   und Passkreuzen in den Ecken. ITGHOSTS-Navy als Kopfleiste, Signalblau nur
   als aktive Kante. Mono ausschließlich für Messwerte, IDs und den Slug —
   laufender Text (Navigation, Überschriften) bleibt in der UI-Schrift.
   STORY: Der Bediener sieht auf einen Blick, in welchem Schritt er ist, was dem
   nächsten Schritt fehlt (Sperre, Preflight) und welche vier Zahlen in ACRORIP
   gehören.
   FIRST VIEWPORT (Editor): Navy-Masthead mit Logo und Schrittfolge; Werkzeug-
   leiste in vier Gruppen; links der Foto-Bogen mit Passkreuzen, rechts EIN
   durchgehender Bogen (Preflight · Objekte · Export mit Apparat-Leerzustand
   für die vier ACRORIP-Werte) statt gestapelter Karten.
   FORM: Proofbogen, Kandidat 3 meiner Liste, Seed fe5b536e (Operate).
   FINISH REVIEW: 1 Runde durchlaufen (disposition: fix). Alle 8 material_fixes
   dieser Runde sind in dieser Datei/den zugehörigen Seiten umgesetzt:
   eigene Schrift (Space Grotesk/IBM Plex Mono, selbst gehostet), rechte Spalte
   entkartet, ACRORIP-Apparatzeile vorgehalten, Mobile-Masthead bricht echt um
   (kein overflow-x:hidden-Versteck mehr), Kolophon an den Fuß geheftet,
   Kontrast von --muted und der Schrittziffern angehoben, Mono-Umfang auf
   Messwerte/IDs/Slug zurückgeführt, Preflight-Leerzustand als echter Text
   (kein generierter ::after-Inhalt mehr, siehe js/editor-page.js).
   FINISH: unreviewed and undocumented is unfinished; this build ends with the
   finish review, the verdict, and DESIGN.md
   ========================================================================== */

@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("../assets/fonts/BarlowSemiCondensed-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("../assets/fonts/BarlowSemiCondensed-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("../assets/fonts/BarlowSemiCondensed-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("../assets/fonts/BarlowSemiCondensed-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/IBMPlexMono-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #111214;
  --ink-2: #3b4048;
  --muted: #4a515c;
  --hair: #b9bec5;
  --hair-soft: #dfe2e6;
  --table: #d6dadf;
  --sheet: #fafaf8;
  --sheet-2: #f1f2f0;
  --navy: #14305a;
  --navy-2: #0f2547;
  --blue: #008ce8;
  --blue-on-navy: #55b8ff;
  --blue-text: #0a6dbb;
  --blue-soft: #e3f1fc;
  --amber: #8a5a00;
  --amber-edge: #e8a000;
  --amber-soft: #fff3d6;
  --red: #b0121f;
  --red-soft: #fde8ea;
  --green: #146c2e;
  --green-soft: #e4f4e8;

  --font-ui: "Barlow Semi Condensed", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Cascadia Mono", Consolas, "SF Mono", Menlo, "Liberation Mono", monospace;

  --fs-0: 0.75rem;   /* 12 — Apparat, Slug */
  --fs-1: 0.8125rem; /* 13 — Bedienelemente */
  --fs-2: 0.875rem;  /* 14 — Fließtext */
  --fs-3: 1rem;      /* 16 */
  --fs-4: 1.375rem;  /* 22 — Seitentitel */

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 150ms;

  /* Passkreuz: Kreis + Fadenkreuz, 1 px Tinte, 20 × 20 */
  --regmark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none' stroke='%23111214' stroke-width='1' shape-rendering='crispEdges'%3E%3Ccircle cx='10.5' cy='10.5' r='5.5' shape-rendering='geometricPrecision'/%3E%3Cpath d='M10.5 1v19M1 10.5h19'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Grundfläche: der Leuchttisch
   -------------------------------------------------------------------------- */

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

html {
  color-scheme: light;
  scrollbar-color: var(--hair) var(--table);
}

/* Grid statt Flex fuer das Sticky-Footer-Layout: ein Flex-Column-Body gibt
   Prozent-/min()-breiten Kindern (.page) keine verlaessliche Containing-Block-
   Breite (Chrome loeste sie beim ersten Fix-Versuch gegen den Inhalt statt
   gegen den Viewport auf -- Folge war horizontales Scrollen auf allen Seiten).
   Grid-Rows geben main eine eindeutige Spaltenbreite = Body-Breite. */
body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  margin: 0;
  background: var(--table);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-2);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--blue);
  accent-color: var(--blue);
}

::selection {
  background: var(--blue-soft);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

a {
  color: var(--blue-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--blue);
}

a:hover {
  color: var(--navy);
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

img {
  max-width: 100%;
  height: auto;
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--sheet-2);
  padding: 0 4px;
}

.mono,
.slug,
input[type="number"],
#projectList li > a,
#projectList li > span,
#exportResult ul,
.acrorip-apparatus,
#objectList li {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Masthead: Navy-Leiste mit Wortmarke und Schrittfolge
   -------------------------------------------------------------------------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 52px;
  padding: 0 var(--space-5);
  background: var(--navy);
  color: #fff;
  border-bottom: 1px solid var(--navy-2);
}

.masthead__brand {
  display: inline-flex;
  align-items: center;
  height: 52px;
  outline-offset: -4px;
}

.masthead__brand img {
  display: block;
  width: auto;
  height: 22px;
}

.masthead__brand:focus-visible {
  outline-color: var(--blue);
}

.steps {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--fs-0);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  counter-reset: step;
}

.steps li {
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 var(--space-3);
  color: #a8bcd6;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  white-space: nowrap;
}

.steps li:first-child {
  border-left: 0;
}

.steps li a {
  color: inherit;
  text-decoration: none;
}

.steps li a:hover {
  color: #fff;
}

.steps li[aria-current="step"] {
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--blue);
}

.steps li::before {
  content: counter(step);
  counter-increment: step;
  margin-right: var(--space-2);
  font-family: var(--font-mono);
  color: var(--blue-on-navy);
}

/* --------------------------------------------------------------------------
   Seite und Titelzeile
   -------------------------------------------------------------------------- */

.page {
  width: min(100% - 2 * var(--space-5), 760px);
  margin: var(--space-6) auto var(--space-7);
}

.page--editor {
  width: min(100% - 2 * var(--space-5), 1240px);
}

.titlebar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--fs-4);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.slug {
  font-size: var(--fs-0);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.slug b {
  font-weight: 600;
  color: var(--ink);
}

.lede {
  color: var(--ink-2);
  max-width: 62ch;
  margin-bottom: var(--space-5);
}

/* --------------------------------------------------------------------------
   Bögen und Tafeln: weiße Flächen mit Haarlinie, Passkreuze auf dem Bogen
   -------------------------------------------------------------------------- */

.sheet,
.panel {
  background: var(--sheet);
  border: 1px solid var(--hair);
}

.sheet {
  position: relative;
  padding: 24px;
  background-image: var(--regmark), var(--regmark), var(--regmark), var(--regmark);
  background-repeat: no-repeat;
  background-position:
    left 2px top 2px,
    right 2px top 2px,
    right 2px bottom 2px,
    left 2px bottom 2px;
}

.panel {
  padding: var(--space-4);
}

.panel + .panel {
  margin-top: var(--space-4);
}

h2 {
  font-size: var(--fs-0);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--hair);
}

/* Rechte Zählung im Panelkopf (z. B. Anzahl) */
h2 small {
  float: right;
  font-weight: 400;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Bedienelemente
   -------------------------------------------------------------------------- */

button,
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 34px;
  padding: 6px 12px;
  margin: 0;
  font: 600 var(--fs-1) / 1.2 var(--font-ui);
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out);
}

button:hover,
.btn:hover {
  background: var(--sheet-2);
  color: var(--ink);
}

/* Gedrückt invertiert — Zustand ohne Farbe lesbar */
button:active,
.btn:active {
  background: var(--ink);
  color: #fff;
}

.btn--primary,
#exportButton,
#uploadButton,
#saveButton {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.btn--primary:hover,
#exportButton:hover,
#uploadButton:hover,
#saveButton:hover {
  background: var(--navy-2);
  color: #fff;
}

.btn--primary:active,
#exportButton:active,
#uploadButton:active,
#saveButton:active {
  background: var(--blue);
  border-color: var(--blue);
}

/* Gesperrt gerastert — auch ohne Farbe unterscheidbar */
/* :disabled auf #exportButton/#uploadButton/#saveButton (IDs, hoehere
   Spezifitaet als .btn--primary) muss die gerasterte Sperr-Optik ueberschreiben
   -- deshalb hier zusaetzlich per ID statt nur per Pseudoklasse/Attribut. */
button:disabled,
.btn[aria-disabled="true"],
#exportButton:disabled,
#uploadButton:disabled,
#saveButton:disabled {
  cursor: not-allowed;
  color: var(--muted);
  border-color: var(--hair);
  background-color: var(--sheet);
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0 3px,
    var(--hair-soft) 3px 4px
  );
}

label {
  display: block;
  font-size: var(--fs-1);
  font-weight: 600;
  color: var(--ink-2);
}

input[type="number"],
input[type="text"] {
  min-height: 34px;
  padding: 5px 8px;
  font-size: var(--fs-2);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--hair);
  border-radius: 0;
  transition:
    border-color var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) var(--ease-out);
}

input[type="number"] {
  width: 6.5em;
  text-align: right;
}

input:hover:not(:disabled) {
  border-color: var(--ink-2);
}

input:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

input:disabled {
  color: var(--muted);
  background-color: var(--sheet);
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0 3px,
    var(--hair-soft) 3px 4px
  );
  cursor: not-allowed;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0 var(--space-2) 0 0;
  vertical-align: -3px;
}

input[type="range"] {
  width: 140px;
  vertical-align: middle;
}

/* --------------------------------------------------------------------------
   Meldungen: Status, Preflight, Ergebnis
   -------------------------------------------------------------------------- */

#status,
#message {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--hair);
  background: var(--sheet);
  color: var(--ink-2);
  white-space: pre-wrap;
}

#status:empty,
#message:empty {
  display: none;
}

#status a {
  margin-left: var(--space-2);
  font-weight: 600;
}

.error {
  color: var(--red);
  white-space: pre-wrap;
}

#status.error,
#message.error,
#exportResult.error {
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid var(--red);
}

.success {
  color: var(--green);
}

#message.success {
  background: var(--green-soft);
  border-color: var(--green);
}

/* Preflight: Amber-Klammer bindet die Zeilen an ihr Objekt. Der Leerzustand
   ist echter Text (js/editor-page.js#updateWarnings setzt ihn und die Klasse
   warning--clear), kein generierter ::after-Inhalt mehr. */
.warning {
  position: relative;
  color: var(--amber);
  white-space: pre-wrap;
  padding: 2px 0 2px var(--space-3);
  border-left: 1px solid var(--amber-edge);
}

.warning::before,
.warning::after {
  content: "";
  position: absolute;
  left: 0;
  width: 6px;
  height: 1px;
  background: var(--amber-edge);
}

.warning::before {
  top: 0;
}

.warning::after {
  bottom: 0;
}

.warning.warning--clear {
  color: var(--green);
  border-left-color: var(--green);
}

.warning.warning--clear::before,
.warning.warning--clear::after {
  background: var(--green);
}

/* --------------------------------------------------------------------------
   Listen: Projekte und Objekte als geregelte Zeilen
   -------------------------------------------------------------------------- */

#projectList,
#objectList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#projectList li,
#objectList li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 40px;
  padding: var(--space-2) 0;
  border-top: 1px solid var(--hair-soft);
}

#projectList li:first-child,
#objectList li:first-child {
  border-top: 0;
}

#projectList li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  font-size: var(--fs-2);
  color: var(--ink-2);
}

#projectList li > a {
  font-weight: 600;
}

#projectList li:only-child:not(:has(a)) {
  display: block;
  color: var(--muted);
}

#objectList li {
  font-size: var(--fs-1);
}

#objectList li button {
  min-height: 28px;
  padding: 3px 10px;
  font-size: var(--fs-0);
}

#objectList:empty::before {
  content: "Noch kein Objekt — „Neues Objekt“ wählen und einen Rahmen um das Teil ziehen.";
  display: block;
  color: var(--muted);
  font-size: var(--fs-1);
  font-family: var(--font-ui);
}

/* --------------------------------------------------------------------------
   Startseite
   -------------------------------------------------------------------------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.actions .btn {
  min-height: 40px;
  padding: 8px 16px;
}

/* --------------------------------------------------------------------------
   Foto aufnehmen (iPhone-tauglich: große Ziele)
   -------------------------------------------------------------------------- */

.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;
}

.capture__pick {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  font-size: var(--fs-3);
  cursor: pointer;
}

#photoInput:focus-visible + .capture__pick {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

#preview {
  margin-top: var(--space-4);
}

#preview:empty {
  display: none;
}

#preview img {
  display: block;
}

.capture__submit {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.capture__submit #uploadButton {
  min-height: 48px;
  font-size: var(--fs-3);
}

/* --------------------------------------------------------------------------
   Einstellungen: Schriftfeld-Raster
   -------------------------------------------------------------------------- */

.spec {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3) var(--space-5);
}

.spec label {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--hair-soft);
  margin: 0;
}

.spec label span {
  font-weight: 400;
  color: var(--muted);
  margin-left: var(--space-1);
}

#markerRows {
  display: grid;
  gap: var(--space-1);
}

.marker-row {
  display: grid;
  /* minmax(0, 1fr) statt 1fr: eine nackte 1fr-Spur darf laut Spec nicht
     unter den Content-Minimalwert ihres Inhalts schrumpfen (hier: die
     Zahlen-Inputs), was auf schmalen Fenstern die ganze Seite waagerecht
     scrollen liess (Review-Fund R1, zweiter Anlauf). minmax(0,1fr) hebt
     diese Untergrenze auf. */
  grid-template-columns: 5em minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--hair-soft);
}

.marker-row span {
  font-family: var(--font-mono);
  font-size: var(--fs-0);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.marker-row label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--muted);
}

.marker-row input[type="number"] {
  flex: 1;
  width: auto;
  min-width: 5em;
}

.release {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-3);
  border: 1px solid var(--amber-edge);
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 600;
}

.release:has(input:checked) {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.release input[type="checkbox"] {
  margin-top: 3px;
  flex: none;
}

.settings__save {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.settings__save #saveButton {
  align-self: flex-start;
  min-width: 160px;
}

/* --------------------------------------------------------------------------
   Editor: Werkzeugleiste, Bogen, rechter Apparat-Bogen
   -------------------------------------------------------------------------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin: var(--space-3) 0 var(--space-4);
  background: var(--sheet-2);
  border: 1px solid var(--hair);
}

.tool-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-left: 1px solid var(--hair);
}

/* Trenner als linke statt rechte Kante: bricht eine Gruppe in eine neue
   Zeile um (schmale Fenster, oder wenn nicht alle Gruppen in eine Zeile
   passen), zeigt die Linie am Zeilenanfang der neuen Gruppe -- nie eine
   Linie, die ins Leere einer zu kurzen Zeile laeuft (Review-Fund R2). */
.tool-group:first-child {
  border-left: 0;
}

.tool-group__label {
  align-self: center;
  margin-right: var(--space-1);
  font-size: var(--fs-0);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.toolbar label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--fs-1);
  font-weight: 500;
  color: var(--ink-2);
}

.toolbar input[type="number"] {
  width: 5.5em;
  min-height: 30px;
  padding: 3px 6px;
}

.toolbar button {
  min-height: 30px;
  padding: 4px 10px;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--space-4);
  /* stretch statt start: der rechte Apparat-Bogen reicht bis zur Unterkante
     des Foto-Bogens, auch wenn sein Inhalt kuerzer ist (Review-Fund R3) --
     kein blanker Leuchttisch mehr unterhalb einer zu kurzen Spalte. */
  align-items: stretch;
}

.bench__sheet {
  display: flex;
  flex-direction: column;
}

#canvasWrap {
  position: relative;
  margin: 0;
}

#photoCanvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  background: var(--sheet-2);
  touch-action: none;
  cursor: crosshair;
}

/* Bogen-Slug unter dem Foto */
.sheet__slug {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

/* Der rechte Apparat-Bogen: EIN durchgehendes Blatt mit Haarlinien-Abschnitten
   statt drei gestapelter Karten -- traegt die Passkreuze der .sheet-Klasse
   wie der Foto-Bogen links, keine zusaetzliche Box pro Abschnitt. */
.rail {
  display: flex;
  flex-direction: column;
}

.rail__section + .rail__section {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--hair);
}

#exportButton {
  width: 100%;
  min-height: 40px;
}

/* Apparat-Leerzustand: haelt die vier ACRORIP-Felder von der ersten Ansicht
   an sichtbar (als Gedankenstrich), bis #exportResult (unveraendertes
   Schreibziel von js/editor-page.js) sie durch einen echten Export ersetzt. */
.acrorip-apparatus {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--hair);
  font-size: var(--fs-0);
}

.acrorip-apparatus > div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}

.acrorip-apparatus dt {
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.acrorip-apparatus dd {
  color: var(--ink-2);
  font-weight: 600;
}

#exportResult:not(:empty) ~ .acrorip-apparatus {
  display: none;
}

#exportResult {
  margin-top: var(--space-3);
  white-space: pre-wrap;
}

#exportResult:empty {
  display: none;
}

#exportResult.error {
  padding: var(--space-2) var(--space-3);
}

#exportResult .success {
  animation: settle 240ms var(--ease-out);
  word-break: break-all;
}

#exportResult p + p {
  margin-top: var(--space-3);
  font-weight: 600;
}

#exportResult ul {
  list-style: none;
  padding: 0;
  margin: var(--space-2) 0 0;
  border-top: 1px solid var(--hair);
  font-size: var(--fs-2);
}

#exportResult ul li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--hair-soft);
}

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

/* --------------------------------------------------------------------------
   Fußzeile
   -------------------------------------------------------------------------- */

.colophon {
  width: min(100% - 2 * var(--space-5), 1240px);
  margin: 0 auto;
  padding: var(--space-3) 0 var(--space-5);
  border-top: 1px solid var(--hair);
  font-family: var(--font-mono);
  font-size: var(--fs-0);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Schmale Bildschirme (iPhone)
   -------------------------------------------------------------------------- */

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

@media (max-width: 640px) {
  /* Die Schrittfolge bricht auf eine eigene, volle zweite Zeile um --
     kein overflow-x:hidden mehr, das Inhalte einfach abschnitt. */
  .masthead {
    padding: var(--space-2) var(--space-3);
    row-gap: var(--space-1);
  }

  .masthead__brand {
    height: 28px;
  }

  .masthead__brand img {
    height: 18px;
  }

  /* Echtes Umbrechen statt Schrumpfen: die Labels duerfen nicht unter ihre
     Textbreite gepresst werden (das trieb vorher die gesamte Seite in
     horizontales Scrollen, Review-Fund R1) -- 2 Schritte je Zeile place. */
  .steps {
    flex: 1 1 100%;
    flex-wrap: wrap;
    row-gap: 2px;
  }

  .steps li {
    flex: 1 1 50%;
    min-width: 0;
    height: 30px;
    padding: 0 4px;
    justify-content: center;
    font-size: 0.625rem;
  }

  .steps li:nth-child(odd) {
    border-left: 0;
  }

  .steps li[aria-current="step"] {
    font-size: 0.6875rem;
  }

  .page,
  .page--editor,
  .colophon {
    width: min(100% - 2 * var(--space-4), 1240px);
    margin-top: var(--space-5);
  }

  .sheet {
    padding: 16px;
  }

  .tool-group {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--hair);
  }

  .tool-group:last-child {
    border-bottom: 0;
  }

  .marker-row {
    grid-template-columns: 4em minmax(0, 1fr) minmax(0, 1fr);
  }

  .acrorip-apparatus {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
