/* ==========================================================================
   Zeitstrahl – Stylesheet
   Farb- und Formensprache inspiriert von lets.konsens.it:
   fast weißer Grund, sonniges Gelb als Akzent, kräftiges Schwarz, runde Formen.
   ========================================================================== */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/fraunces-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/source-sans-3-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/source-sans-3-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/source-sans-3-latin-700-normal.woff2') format('woff2');
}

:root {
  --bg: #fcfcfd;
  --white: #fff;
  --ink: #111114;
  --grey-100: #f4f4f6;
  --grey-200: #e8e8ed;
  --grey-300: #c3c4c6;
  --grey-400: #86888d;
  --grey-600: #545963;
  --primary-100: #fff6d6;
  --primary-200: #ffeba3;
  --primary-300: #ffd84c;
  --primary-400: #f5c518;
  --primary-600: #b37700;
  --primary-900: #664a12;
  --danger: #c4231b;

  --font-display: 'Fraunces', ui-serif, Georgia, Cambria, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --shadow-sm: 0 2px 4px rgb(0 0 0 / 0.06);
  --shadow-md: 0 4px 14px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 18px 48px rgb(0 0 0 / 0.14);
  --ring-soft: 0 0 0 1px var(--grey-100);
  --focus: 0 0 0 3px var(--primary-600);
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--primary-300); color: var(--ink); }

h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: none; box-shadow: var(--focus); }

.display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.muted { color: var(--grey-600); }
.noscript { padding: 2rem; text-align: center; }
.app { min-height: 100%; }

/* ---------- Marke ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
}
.brand__mark {
  position: relative;
  display: inline-flex;
  justify-content: space-around;
  align-items: center;
  width: 2.2rem;
  height: 1rem;
}
.brand__mark::before {
  content: '';
  position: absolute;
  inset: 50% 0 auto;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 2px;
  background: var(--primary-300);
}
.brand__mark span {
  position: relative;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--ink);
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover:not(:disabled) { background: var(--ink); color: var(--white); }
.btn:focus-visible { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--primary-600); }
.btn:disabled { background: var(--grey-200); color: var(--grey-400); box-shadow: none; cursor: not-allowed; }
.btn--primary { background: var(--primary-300); color: var(--ink); box-shadow: 0 6px 16px rgb(245 197 24 / 0.3); }
.btn--primary:hover:not(:disabled) { box-shadow: 0 6px 16px rgb(0 0 0 / 0.2); }
.btn--secondary { background: var(--white); color: var(--ink); box-shadow: var(--ring-soft), var(--shadow-md); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn--small { padding: 0.55rem 1rem; font-size: 0.95rem; }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--grey-600);
  transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover:not(:disabled) { background: var(--grey-100); color: var(--ink); }
.icon-btn:disabled { opacity: 0.4; cursor: progress; }

/* ---------- Formulare ---------- */

.input {
  appearance: none;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--grey-100);
  transition: background-color 0.15s, box-shadow 0.15s;
}
.input:focus { outline: none; background: var(--white); box-shadow: inset 0 0 0 2px var(--grey-200); }
.input:focus-visible { box-shadow: inset 0 0 0 2px var(--primary-600); }
select.input {
  padding-right: 2.2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--grey-600) 50%), linear-gradient(135deg, var(--grey-600) 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) 52%, calc(100% - 0.8rem) 52%;
  background-size: 0.3rem 0.3rem;
  background-repeat: no-repeat;
}

.field { display: grid; gap: 0.35rem; margin-bottom: 1.1rem; }
.field__label { font-weight: 600; font-size: 0.95rem; }
.field__hint { font-size: 0.85rem; color: var(--grey-400); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.year-input { display: flex; gap: 0.5rem; }
.year-input .input[type='number'] { min-width: 0; }
.input--era { width: auto; flex: none; }

.range-wrap { display: flex; align-items: center; gap: 0.6rem; min-height: 3rem; font-size: 0.85rem; color: var(--grey-400); }
.range { flex: 1; accent-color: var(--ink); }

.form-error { margin-top: 0.4rem; color: var(--danger); font-weight: 600; }
.inline-form { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.inline-form .btn { margin-top: 0 !important; flex: none; }

/* ---------- Seitenrahmen ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1rem, 4vw, 2rem);
}
.topbar__actions { display: flex; align-items: center; gap: 0.25rem; }

.sync-status { margin-right: 0.5rem; font-size: 0.85rem; font-weight: 600; color: var(--grey-400); }
.sync-status[data-state='saving'] { color: var(--primary-600); }
.sync-status[data-state='offline'] { color: var(--danger); }

/* ---------- Zugang ---------- */

.gate { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }
.gate__card {
  display: grid;
  gap: 1rem;
  width: min(420px, 100%);
  padding: 2.5rem;
  border-radius: 1.75rem;
  background: var(--white);
  box-shadow: var(--ring-soft), var(--shadow-lg);
}
.gate__title { font-size: 2.2rem; margin-top: 1rem; }
.gate__form { display: grid; gap: 0.6rem; margin-top: 0.5rem; }
.gate__form .btn { margin-top: 0.5rem; }

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

.page { max-width: 1024px; margin: 0 auto; }
.start { padding: clamp(1.5rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem) 4rem; }
.start__hero { display: grid; justify-items: center; gap: 1.25rem; text-align: center; }
.start__title { font-size: clamp(2.2rem, 6vw, 3.8rem); line-height: 1.05; max-width: 14ch; }
.start__lead { max-width: 36rem; color: var(--grey-600); font-size: 1.2rem; }
.start__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 0.75rem; }

/* Schritte auf einer Linie – das konsens-Motiv */
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 4rem 0 3rem;
  padding: 0;
  list-style: none;
}
.steps::before {
  content: '';
  position: absolute;
  top: 1rem;
  left: 16.6%;
  right: 16.6%;
  height: 2px;
  background: var(--primary-300);
}
.steps__item { position: relative; display: grid; align-content: start; justify-items: center; gap: 0.6rem; text-align: center; }
.steps__number {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  font-weight: 700;
  box-shadow: 0 0 0 6px var(--bg);
}
.steps__title { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.steps__text { color: var(--grey-600); font-size: 0.95rem; max-width: 18rem; }

.recent { max-width: 40rem; margin: 0 auto; }
.recent__title { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; margin-bottom: 0.75rem; }
.recent__list { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.recent__item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding-right: 0.4rem;
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--ring-soft), var(--shadow-sm);
}
.recent__link {
  display: flex;
  flex: 1;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  color: inherit;
  text-decoration: none;
}
.recent__link:hover .recent__name { text-decoration: underline; text-decoration-color: var(--primary-300); text-decoration-thickness: 3px; }
.recent__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent__date { flex: none; color: var(--grey-400); font-size: 0.9rem; }

/* ---------- Editor ---------- */

.editor { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
/* Editor-Leiste: Logo | Überschrift (Mitte) | Aktionen */
.topbar--editor {
  display: grid;
  grid-template-columns: 1fr minmax(0, auto) 1fr;
  padding-top: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--grey-100);
}
.topbar--editor .topbar__actions { justify-self: end; }
.editor__title { display: flex; justify-content: center; min-width: 0; }
.doc-title {
  max-width: 100%;
  padding: 0.1rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: text;
}
.doc-title:hover { background: var(--grey-100); }
.doc-title--empty { color: var(--grey-300); }
.editor__canvas { position: relative; isolation: isolate; flex: 1; min-height: 0; }
.editor__hint { padding: 0.5rem 1rem 0.9rem; text-align: center; font-size: 0.85rem; color: var(--grey-400); }

/* ---------- Zeitstrahl ---------- */

.tl-viewport { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; }
.tl-stage { position: relative; min-width: 100%; }

.tl-band { position: absolute; left: 0; right: 0; height: 50%; cursor: pointer; }
.tl-band--top { top: 0; }
.tl-band--bottom { top: 50%; }
.tl-band:focus-visible { box-shadow: inset 0 0 0 3px var(--primary-300); }

.tl-axis { position: absolute; left: 0; right: 0; top: 50%; height: 0; pointer-events: none; }
.tl-axis__line { position: absolute; top: -2px; height: 4px; border-radius: 2px; background: var(--primary-300); }
.tl-tick { position: absolute; top: -6px; width: 2px; height: 12px; margin-left: -1px; border-radius: 1px; background: var(--grey-300); }
.tl-tick--minor { top: -3px; width: 1px; height: 6px; margin-left: -0.5px; background: var(--grey-200); }
.tl-tick__label {
  position: absolute;
  top: 17px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--grey-400);
  white-space: nowrap;
}
/* Buttons an den Enden: verlängern (Doppelpfeil nach außen) und verkürzen (Pfeil nach innen) */
.tl-end {
  position: absolute;
  top: -17px;
  display: flex;
  padding: 0;
  border-radius: 999px;
  background: var(--white);
  box-shadow: var(--ring-soft), var(--shadow-md);
  pointer-events: auto;
}
.tl-end--start { transform: translateX(-100%); }
.tl-end__btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--grey-600);
  transition: background-color 0.15s, color 0.15s;
}
.tl-end__btn:hover { background: var(--ink); color: var(--white); }

.tl-ghost {
  position: absolute;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem 0.25rem 0.45rem;
  border-radius: 999px;
  background: var(--primary-300);
  box-shadow: 0 6px 16px rgb(245 197 24 / 0.35);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Verbindungslinien und Punkte auf dem Zeitstrahl (liegen unter allen Karten) */
.tl-links { position: absolute; top: 0; left: 0; z-index: 1; overflow: visible; pointer-events: none; }
.tl-link { fill: none; stroke: var(--primary-300); stroke-width: 2; }
.tl-dot { fill: var(--ink); stroke: var(--bg); stroke-width: 3; }
.tl-dot--small { stroke-width: 2; }
.tl-brace { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Jahr/Zeitraum-Eingabe im Popover */
.range-input { display: grid; gap: 0.5rem; }
.range-input__end { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0.5rem; }
.range-input__label { font-weight: 600; color: var(--grey-600); }
.check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; font-weight: 600; color: var(--grey-600); cursor: pointer; }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--ink); }
.popover-form { width: 300px; }

.anchor {
  position: absolute;
  z-index: 2;
  transform: translateX(-50%);
  pointer-events: none;
}
.anchor:hover, .anchor:focus-within { z-index: 5; }
.anchor--top { bottom: calc(50% + var(--offset, 44px)); }
.anchor--bottom { top: calc(50% + var(--offset, 44px)); }
.anchor--dragging { z-index: 6; cursor: grabbing; user-select: none; }
.anchor--dragging .anchor__block > * { pointer-events: none; }
.anchor--dragging .card { box-shadow: var(--ring-soft), var(--shadow-lg); }

/* Datumsmarken direkt am Zeitstrahl (ersetzen ggf. die normale Jahreszahl) */
.tl-markers { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.tl-marker {
  position: absolute;
  padding: 0.05rem 0.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--primary-200);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: auto;
  transition: background-color 0.15s, color 0.15s;
}
.tl-marker:hover { background: var(--ink); color: var(--white); }

/* Anschlusspunkt der Verbindungslinie am Block, zugleich Ziehgriff */
.anchor__grip {
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 2px solid var(--primary-400);
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  cursor: grab;
  touch-action: none;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}
.anchor__grip:hover { background: var(--primary-300); border-color: var(--ink); transform: scale(1.15); }
.anchor--dragging .anchor__grip { background: var(--primary-300); border-color: var(--ink); }

.anchor__block {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.anchor--top .anchor__block { flex-direction: column-reverse; }
/* dezente Linie, die alle Ereignisse eines Datums verbindet */
.anchor__block::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: -1;
  width: 2px;
  margin-left: -1px;
  background: var(--primary-300);
}
.anchor__block > * { pointer-events: auto; }


.card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0.7rem 0.9rem 0.8rem;
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--ring-soft), var(--shadow-md);
}
.card--draft { box-shadow: 0 0 0 2px var(--primary-300), var(--shadow-md); }
.card__title {
  padding-right: 1.6rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  cursor: text;
  border-radius: 4px;
}
.card__title--empty { color: var(--grey-400); font-weight: 600; }
.card__notes { display: grid; gap: 0.3rem; margin: 0.35rem 0 0; padding: 0; list-style: none; }
.card__note {
  color: var(--grey-600);
  font-size: 0.92rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: text;
  border-radius: 4px;
}
.card__title:hover, .card__note:hover { background: var(--grey-100); }
.card__images { display: grid; gap: 0.4rem; margin-top: 0.55rem; }
.card__image { display: block; padding: 0; border: 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--grey-100); }
.card__image img { display: block; width: 100%; height: auto; }
/* Oberhalb der Linie: Bilder über der Überschrift, damit die Überschrift näher am Zeitstrahl liegt */
.anchor--top .card__images { order: -1; margin: 0 0 0.55rem; }
.card__more {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.85);
  color: var(--grey-400);
  opacity: 0;
  z-index: 1;
  transition: opacity 0.15s, background-color 0.15s;
}
.card:hover .card__more, .card:focus-within .card__more, .card__more:focus-visible { opacity: 1; }
.card__more:hover { background: var(--grey-100); color: var(--ink); }
@media (hover: none) { .card__more { opacity: 0.7; } }

.anchor__add {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--ring-soft), var(--shadow-md);
  transition: background-color 0.15s, color 0.15s;
}
.anchor__add:hover { background: var(--ink); color: var(--white); }

.inline-edit {
  display: block;
  padding: 0.2rem 0.35rem;
  margin: -0.2rem -0.35rem;
  width: calc(100% + 0.7rem);
  border: 0;
  border-radius: 6px;
  background: var(--primary-100);
  box-shadow: inset 0 0 0 2px var(--primary-300);
  line-height: 1.4;
  resize: none;
  overflow: hidden;
}
.inline-edit:focus { outline: none; }
.inline-edit--title { font-weight: 700; font-size: 1rem; }
.inline-edit--doc-title { width: min(40rem, 50vw); font-size: clamp(1.15rem, 2.2vw, 1.6rem); text-align: center; line-height: 1.2; margin: 0; }

.image-preview { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: var(--radius-md); }

/* ---------- Popover & Menü ---------- */

.popover {
  position: fixed;
  z-index: 60;
  min-width: 220px;
  padding: 0.35rem;
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--ring-soft), var(--shadow-lg);
  animation: pop 0.12s ease-out;
}
.menu { display: grid; }
.menu__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.menu__item .icon { color: var(--grey-400); }
.menu__item:hover, .menu__item:focus-visible { background: var(--grey-100); box-shadow: none; }
.menu__item--danger, .menu__item--danger .icon { color: var(--danger); }
.popover-form { display: grid; gap: 0.6rem; width: 270px; padding: 0.6rem; }
.popover-form__title { font-family: var(--font-display); font-weight: 800; }

/* ---------- Dialog ---------- */

.dialog {
  width: min(560px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.dialog--wide { width: min(660px, calc(100vw - 2rem)); }
.dialog[open] { display: flex; flex-direction: column; animation: pop 0.15s ease-out; }
.dialog::backdrop { background: rgb(17 17 20 / 0.35); backdrop-filter: blur(2px); }
.dialog__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.25rem 0.75rem 1.5rem; }
.dialog__title { font-family: var(--font-display); font-weight: 800; font-size: 1.45rem; }
.dialog__body { padding: 0.25rem 1.5rem 1rem; overflow: auto; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 0.75rem; padding: 1rem 1.5rem; border-top: 1px solid var(--grey-100); }

.settings-summary {
  margin-bottom: 0.5rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--primary-100);
  color: var(--primary-900);
  font-weight: 600;
  font-size: 0.92rem;
}
.settings-summary:empty { display: none; }
.settings-section { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--grey-100); }
.settings-section__title { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.settings-section .btn { margin-top: 0.5rem; }

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  z-index: 80;
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  width: min(32rem, calc(100vw - 2rem));
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.2s ease-out;
  transition: opacity 0.3s, transform 0.3s;
}
.toast--success { background: var(--primary-300); color: var(--ink); }
.toast--error { background: var(--danger); }
.toast--leaving { opacity: 0; transform: translateY(0.5rem); }

@keyframes pop { from { opacity: 0; transform: scale(0.97); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(0.5rem); } }

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

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

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 1.25rem; justify-items: start; max-width: 22rem; margin-inline: auto; }
  .steps::before { top: 1rem; bottom: 1rem; left: 1rem; right: auto; width: 2px; height: auto; }
  .steps__item { grid-template-columns: auto 1fr; justify-items: start; text-align: left; gap: 1rem; }
  .sync-status { display: none; }
  .topbar--editor { grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.5rem; }
  .topbar--editor .brand__name { display: none; }
  .gate__card { padding: 1.75rem; }
}
