/* Story-Studio – Erscheinungsbild „Hochkant“
   Schiefergrauer Rahmen, die Story ist die Bühne. Weiß ist die einzige Handlungsfarbe,
   Sand markiert Gewähltes. Archivo schmal in Versalien für Bezeichnungen. */

@font-face { font-family: 'Archivo'; src: url('/schriften/archivo.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('/schriften/archivo-kursiv.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-style: italic; font-display: swap; }
@font-face { font-family: 'Anton'; src: url('/schriften/anton.woff2') format('woff2'); font-weight: 400; font-display: block; }
@font-face { font-family: 'Bricolage Grotesque'; src: url('/schriften/bricolage.woff2') format('woff2'); font-weight: 200 800; font-display: block; }
@font-face { font-family: 'Gloock'; src: url('/schriften/gloock.woff2') format('woff2'); font-weight: 400; font-display: block; }
@font-face { font-family: 'Instrument Serif'; src: url('/schriften/instrument-serif.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: block; }
@font-face { font-family: 'Instrument Serif'; src: url('/schriften/instrument-serif-kursiv.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: block; }
@font-face { font-family: 'Zilla Slab'; src: url('/schriften/zilla-slab-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: block; }
@font-face { font-family: 'Zilla Slab'; src: url('/schriften/zilla-slab-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: block; }
@font-face { font-family: 'Zilla Slab'; src: url('/schriften/zilla-slab-400-kursiv.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: block; }
@font-face { font-family: 'Permanent Marker'; src: url('/schriften/permanent-marker.woff2') format('woff2'); font-weight: 400; font-display: block; }
@font-face { font-family: 'JetBrains Mono'; src: url('/schriften/jetbrains-mono.woff2') format('woff2'); font-weight: 100 800; font-display: block; }

:root {
  --void: #0a0a0b;
  --grund: #0e0f12;
  --ink: #131418;
  --slate: #1b1e24;
  --mist: #272c35;
  --linie: #2f3540;
  --linie-hell: #414957;
  --fog: #5a6472;
  --text: #eceef1;
  --text-2: #a4acb9;
  --text-3: #7b8493;
  --sand: #c7b9a6;
  --weiss: #f4f4f2;
  --rot: #f0646a;
  --gelb: #e9b949;
  --gruen: #57c690;
  --hilfslinie: #ff4fa3;

  --r-s: 4px;
  --r: 6px;
  --r-l: 10px;

  --schrift: 'Archivo', system-ui, -apple-system, sans-serif;
  --kopf-hoehe: 56px;
  --leiste-breite: 76px;
  --sicher-unten: env(safe-area-inset-bottom, 0px);
  --sicher-oben: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--grund);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 15px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--sand); outline-offset: 2px; }
[hidden] { display: none !important; }
.unsichtbar { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Grundbausteine ---------- */

.etikett {
  font-stretch: 75%;
  font-weight: 650;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.wortmarke {
  font-stretch: 62%;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 0.9;
  margin: 0;
}

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--linie-hell);
  border-radius: var(--r);
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.knopf:hover { background: var(--mist); border-color: var(--fog); }
.knopf:active { background: var(--slate); }
.knopf:disabled, .knopf[aria-disabled='true'] { opacity: 0.42; cursor: not-allowed; background: transparent; }
.knopf--primaer { background: var(--weiss); border-color: var(--weiss); color: var(--void); }
.knopf--primaer:hover { background: #dcdcd8; border-color: #dcdcd8; }
.knopf--primaer:active { background: #c9c9c4; }
.knopf--primaer:disabled { background: var(--weiss); border-color: var(--weiss); }
.knopf--gefahr { color: var(--rot); border-color: color-mix(in srgb, var(--rot) 45%, transparent); }
.knopf--gefahr:hover { background: color-mix(in srgb, var(--rot) 14%, transparent); border-color: var(--rot); }
.knopf--leise { border-color: transparent; }
.knopf--breit { width: 100%; }
.knopf--gross { min-height: 48px; font-size: 15px; }
.knopf .symbol { flex: none; }

.symbol-knopf {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: transparent;
  color: var(--text);
  transition: background-color 150ms ease, color 150ms ease;
}
.symbol-knopf:hover { background: var(--mist); }
.symbol-knopf[aria-pressed='true'] { background: var(--mist); color: var(--sand); border-color: var(--linie-hell); }
.symbol-knopf:disabled { opacity: 0.35; cursor: not-allowed; background: transparent; }

.feld, .auswahlfeld {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--linie);
  border-radius: var(--r);
  background: var(--slate);
  color: var(--text);
  transition: border-color 150ms ease;
}
.feld:hover, .auswahlfeld:hover { border-color: var(--linie-hell); }
.feld:focus, .auswahlfeld:focus { outline: none; border-color: var(--sand); }
.feld::placeholder { color: var(--text-3); }
textarea.feld { min-height: 96px; resize: vertical; line-height: 1.4; }
.auswahlfeld {
  appearance: none;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.feldgruppe { display: grid; gap: 6px; }
.aufklapp .feldgruppe + .feldgruppe { margin-top: 10px; }

.regler { width: 100%; accent-color: var(--weiss); height: 28px; }

.hinweistext { color: var(--text-2); font-size: 13.5px; margin: 0; }
.fehlertext { color: var(--rot); font-size: 13.5px; margin: 0; }

/* Meldungen */
.meldungen {
  position: fixed; left: 50%; bottom: calc(24px + var(--sicher-unten)); transform: translateX(-50%);
  display: grid; gap: 8px; z-index: 100; width: min(92vw, 420px); pointer-events: none;
}
.meldung {
  padding: 12px 16px; border-radius: var(--r); background: var(--weiss); color: var(--void);
  font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: opacity 250ms ease, transform 250ms ease;
}
.meldung--fehler { background: var(--rot); color: #1a0506; }
.meldung--weg { opacity: 0; transform: translateY(6px); }

/* Segmente: Seiten wie Instagrams Fortschrittsbalken */
.segmente { display: flex; gap: 4px; align-items: center; }
.segment {
  flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.28);
  border: 0; padding: 0;
}
.segment--aktiv { background: var(--weiss); }

/* ---------- Anmeldung ---------- */

.anmeldung {
  min-height: 100%; display: grid; place-items: center; padding: 24px;
}
.anmeldung__rahmen {
  position: relative;
  width: min(100%, 380px);
  aspect-ratio: 9 / 16;
  max-height: calc(100vh - 48px);
  border: 1px solid var(--linie);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--slate), var(--ink) 60%);
  padding: 22px 26px 30px;
  display: flex; flex-direction: column;
}
.anmeldung__rahmen .segmente { margin-bottom: 18px; }
.anmeldung__marke { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; }
.anmeldung__punkt { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--linie-hell); display: grid; place-items: center; color: var(--sand); }
.anmeldung__titel { font-size: clamp(64px, 18vw, 92px); margin-top: auto; }
.anmeldung__titel span { display: block; color: var(--sand); }
.anmeldung form { display: grid; gap: 12px; margin-top: 26px; }

/* ---------- Übersicht ---------- */

.uebersicht { max-width: 1200px; margin: 0 auto; padding: calc(18px + var(--sicher-oben)) 20px 80px; }
.uebersicht__kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.uebersicht__kopf .wortmarke { font-size: 30px; }
.uebersicht__kopf .wortmarke span { color: var(--sand); margin-left: 0.12em; }
.abschnitt { margin-top: 34px; }
.abschnitt__kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.abschnitt__titel { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }

.vorlagen-reihe {
  display: grid; grid-auto-flow: column; grid-auto-columns: 148px; gap: 14px;
  overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity;
  scrollbar-width: thin; scrollbar-color: var(--linie-hell) transparent;
}
.story-karte {
  display: grid; gap: 8px; align-content: start; text-align: left;
  border: 0; background: none; padding: 0; scroll-snap-align: start; color: inherit;
}
.story-karte__bild {
  position: relative; border-radius: var(--r-l); overflow: hidden; aspect-ratio: 9 / 16;
  background: var(--slate); outline: 1px solid var(--linie); outline-offset: -1px;
  transition: outline-color 150ms ease;
}
.story-karte__bild canvas { display: block; width: 100% !important; height: 100%; }
.story-karte__bild .segmente { position: absolute; left: 8px; right: 8px; top: 7px; }
.story-karte__bild .segment { height: 2px; }
.story-karte:hover .story-karte__bild, .story-karte:focus-visible .story-karte__bild { outline: 2px solid var(--weiss); }
.story-karte:focus-visible { outline: none; }
.story-karte__name { font-weight: 650; font-size: 14px; line-height: 1.25; }
.story-karte__info { color: var(--text-3); font-size: 12.5px; margin-top: -4px; }
.story-karte--leer .story-karte__bild { display: grid; place-items: center; color: var(--text-2); background: var(--ink); }

.projekte-gitter { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.projekt { position: relative; }
.projekt__menue { position: absolute; top: 14px; right: 6px; }
.projekt__menue .symbol-knopf { background: rgba(10, 10, 11, 0.62); height: 34px; min-width: 34px; }
.projekt__menue .symbol-knopf:hover { background: var(--mist); }

.leer-hinweis {
  border: 1px dashed var(--linie-hell); border-radius: var(--r-l); padding: 28px; color: var(--text-2);
  display: grid; gap: 8px; justify-items: start;
}

.auftraege { display: grid; border-top: 1px solid var(--linie); }
.auftrag {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--linie);
}
.auftrag__bild { width: 44px; aspect-ratio: 9 / 16; border-radius: var(--r-s); background: var(--slate); object-fit: cover; display: grid; place-items: center; color: var(--text-3); }
.auftrag__titel { font-weight: 650; }
.auftrag__info { color: var(--text-2); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.auftrag__fehler { color: var(--rot); font-size: 13px; margin-top: 2px; }
.auftrag__aktionen { display: flex; gap: 8px; align-items: center; }

.zustand { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; }
.zustand::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.zustand--geplant { color: var(--sand); }
.zustand--laeuft { color: var(--weiss); }
.zustand--fertig { color: var(--gruen); }
.zustand--fehler { color: var(--rot); }
.zustand--abgebrochen { color: var(--text-3); }

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

.editor {
  position: fixed; inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--leiste-breite);
  grid-template-rows: calc(var(--kopf-hoehe) + var(--sicher-oben)) minmax(0, 1fr) auto;
  grid-template-areas: 'kopf kopf' 'buehne leiste' 'eigenschaften leiste';
  background: var(--grund);
  overflow: hidden;
}

.editor__kopf {
  grid-area: kopf; display: flex; align-items: center; gap: 8px;
  padding: var(--sicher-oben) 12px 0; border-bottom: 1px solid var(--linie); background: var(--ink);
  min-width: 0;
}
.editor__titel { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.editor__name {
  border: 1px solid transparent; background: transparent; border-radius: var(--r-s);
  font-weight: 650; font-size: 15px; padding: 2px 6px; min-width: 0; width: min(100%, 360px); text-overflow: ellipsis;
}
.editor__name:hover { border-color: var(--linie); }
.editor__name:focus { outline: none; border-color: var(--sand); background: var(--slate); }
.editor__speicherstand { font-size: 12px; color: var(--text-3); padding-left: 7px; }
.editor__speicherstand--fehler { color: var(--rot); }
.editor__kopf-rechts { display: flex; align-items: center; gap: 4px; }
.editor__trenner { width: 1px; height: 24px; background: var(--linie); margin: 0 6px; }

.editor__buehne {
  grid-area: buehne; position: relative; overflow: hidden;
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse at 50% 40%, #171a20 0%, var(--grund) 70%);
}

.buehne__mitte { position: relative; display: grid; justify-items: center; gap: 10px; }

.seitenleiste { display: flex; align-items: center; gap: 8px; width: 100%; }
.seitenleiste .segmente { flex: 1; min-width: 0; }
.seitenleiste .segment { height: 4px; cursor: pointer; transition: background-color 150ms ease; }
.seitenleiste .segment:hover { background: rgba(255, 255, 255, 0.55); }
.seitenleiste .segment--aktiv:hover { background: var(--weiss); }
.seitenleiste__zahl { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.seitenleiste .symbol-knopf { height: 28px; min-width: 28px; }

.rahmen {
  position: relative;
  border-radius: 12px;
  overflow: visible;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 18px 60px rgba(0, 0, 0, 0.55);
}
.rahmen canvas.leinwand { display: block; border-radius: 12px; will-change: transform; transform: translateZ(0); }

.nachbar {
  position: absolute; top: 50%; transform: translateY(-50%);
  border: 0; padding: 0; background: none; opacity: 0.32; border-radius: 10px; overflow: hidden;
  transition: opacity 150ms ease;
}
.nachbar:hover { opacity: 0.6; }
.nachbar canvas { display: block; }

.auswahl-ebene {
  position: absolute; inset: 0; touch-action: none; border-radius: 12px;
  user-select: none; -webkit-user-select: none;
}
.auswahl-ebene--ziehen { cursor: grabbing; }

.zonen-ebene { position: absolute; inset: 0; pointer-events: none; border-radius: 12px; overflow: hidden; }
.zonen-ebene svg { width: 100%; height: 100%; display: block; }

.schwebe {
  position: absolute; pointer-events: none; left: 0; top: 0; will-change: transform;
  outline: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.auswahl {
  position: absolute; pointer-events: none; left: 0; top: 0; will-change: transform;
  outline: 1.5px solid var(--weiss);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.auswahl--gesperrt { outline-style: dashed; }
.auswahl--zuschnitt { outline: 2px dashed var(--sand); }

.griff {
  position: absolute; pointer-events: auto; width: 14px; height: 14px;
  margin: -7px 0 0 -7px; background: var(--weiss);
  border: 1px solid rgba(0, 0, 0, 0.45); border-radius: 2px;
  touch-action: none;
}
.griff::before { content: ''; position: absolute; inset: -12px; }
@media (pointer: fine) { .griff::before { inset: -5px; } }
.griff--n, .griff--s { width: 22px; height: 7px; margin: -4px 0 0 -11px; border-radius: 4px; }
.griff--e, .griff--w { width: 7px; height: 22px; margin: -11px 0 0 -4px; border-radius: 4px; }
.griff--nw, .griff--se { cursor: nwse-resize; }
.griff--ne, .griff--sw { cursor: nesw-resize; }
.griff--n, .griff--s { cursor: ns-resize; }
.griff--e, .griff--w { cursor: ew-resize; }
.griff--dreh {
  width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%;
  display: grid; place-items: center; color: var(--void); cursor: grab;
}
.griff--dreh .symbol { width: 16px; height: 16px; }

.hilfslinie { position: absolute; background: var(--hilfslinie); pointer-events: none; }
.hilfslinie--x { top: 0; bottom: 0; width: 1px; }
.hilfslinie--y { left: 0; right: 0; height: 1px; }

.winkelanzeige {
  position: absolute; pointer-events: none; padding: 3px 7px; border-radius: var(--r-s);
  background: var(--void); color: var(--weiss); font-size: 12px; font-variant-numeric: tabular-nums;
  transform: translate(-50%, -140%);
}

.text-bearbeitung {
  position: absolute; margin: 0; border: 0; outline: 1.5px solid var(--sand);
  resize: none; overflow: hidden; background: transparent; padding: 0;
  white-space: pre-wrap; overflow-wrap: break-word; transform-origin: center center;
  caret-color: currentColor;
}

/* Werkzeugleiste: rechts senkrecht, am Handy unten waagerecht */
.editor__leiste {
  grid-area: leiste; display: flex; flex-direction: column; align-items: stretch; gap: 2px;
  padding: 10px 8px; border-left: 1px solid var(--linie); background: var(--ink);
  overflow-y: auto; z-index: 3;
}
.werkzeug {
  display: grid; justify-items: center; gap: 4px; padding: 9px 2px 8px;
  border: 1px solid transparent; border-radius: var(--r); background: transparent; color: var(--text-2);
  font-size: 10.5px; font-weight: 600; font-stretch: 85%; letter-spacing: 0.02em;
  transition: background-color 150ms ease, color 150ms ease;
}
.werkzeug:hover { background: var(--mist); color: var(--text); }
.werkzeug[aria-pressed='true'] { background: var(--mist); color: var(--sand); border-color: var(--linie-hell); }
.werkzeug__abstand { flex: 1; min-height: 8px; }
.werkzeug--handy { display: none; }

/* Panel: schiebt sich zwischen Bühne und Leiste */
.panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 100%);
  background: var(--ink); border-left: 1px solid var(--linie);
  display: flex; flex-direction: column; z-index: 4;
  animation: panel-rein 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.panel--breit { width: min(420px, 100%); }
@keyframes panel-rein { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel__kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--linie); }
.panel__titel { font-size: 15px; font-weight: 700; margin: 0; }
.panel__inhalt { padding: 16px 18px 28px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.panel__abschnitt + .panel__abschnitt { margin-top: 22px; }
.panel__abschnitt > .etikett { display: block; margin-bottom: 10px; }
.griffleiste { display: none; }

.kachelgitter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kachelgitter--drei { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.textvorlage {
  display: block; width: 100%; text-align: left; padding: 14px; border-radius: var(--r);
  border: 1px solid var(--linie); background: var(--slate); color: var(--text);
  transition: border-color 150ms ease, background-color 150ms ease;
}
.textvorlage:hover { border-color: var(--fog); background: var(--mist); }
.textvorlage + .textvorlage { margin-top: 8px; }

.formkachel {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: var(--r);
  border: 1px solid var(--linie); background: var(--slate); color: var(--text);
}
.formkachel:hover { border-color: var(--fog); background: var(--mist); }

.fotogitter { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fotokachel {
  aspect-ratio: 1; border: 0; padding: 0; border-radius: var(--r-s); overflow: hidden; background: var(--slate);
  outline: 1px solid var(--linie); outline-offset: -1px;
}
.fotokachel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fotokachel:hover { outline: 2px solid var(--weiss); }

.farbreihe { display: flex; flex-wrap: wrap; gap: 8px; }
.farbfeld {
  width: 36px; height: 36px; border-radius: var(--r); border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0; position: relative; background-clip: padding-box;
}
.farbfeld:hover { border-color: var(--weiss); }
.farbfeld[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--grund), 0 0 0 4px var(--weiss); }
.farbfeld--marke::after {
  content: attr(data-kurz); position: absolute; left: 3px; bottom: 1px; font-size: 9px; font-weight: 700;
  font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.05em; color: var(--farbfeld-schrift, #fff);
}
.farbfeld--ohne { background: linear-gradient(135deg, transparent 46%, var(--rot) 46%, var(--rot) 54%, transparent 54%), var(--slate); }
.verlauf-feld { width: 56px; }

.ebenenliste { display: grid; gap: 4px; }
.ebene {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 6px 6px 6px 10px; border-radius: var(--r); border: 1px solid transparent; background: var(--slate);
  text-align: left; color: var(--text); width: 100%;
}
.ebene:hover { border-color: var(--linie-hell); }
.ebene--gewaehlt { border-color: var(--sand); }
.ebene__name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px;
  border: 0; background: none; color: inherit; text-align: left; padding: 8px 0; min-width: 0;
}
.ebene__aktionen { display: flex; }
.ebene__aktionen .symbol-knopf { height: 32px; min-width: 32px; }

/* Eigenschaften der Auswahl, unten wie eine Bildunterschrift */
.editor__eigenschaften {
  grid-area: eigenschaften; border-top: 1px solid var(--linie); background: var(--ink);
  min-height: 64px; display: flex; align-items: center; z-index: 2;
}
.eigenschaften {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px; overflow-x: auto; width: 100%;
  scrollbar-width: none;
}
.eigenschaften::-webkit-scrollbar { display: none; }
.eigenschaften__gruppe { display: flex; align-items: center; gap: 4px; flex: none; }
.eigenschaften__trenner { width: 1px; height: 26px; background: var(--linie); margin: 0 6px; flex: none; }
.eigenschaften__titel { color: var(--text-2); font-size: 13px; padding-right: 6px; white-space: nowrap; }
.eigenschaften .auswahlfeld { width: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.eigenschaften .knopf { min-height: 36px; padding: 0 12px; }
.eigenschaften .symbol-knopf { height: 36px; min-width: 36px; }

.zahlfeld { display: flex; align-items: center; border: 1px solid var(--linie); border-radius: var(--r); background: var(--slate); }
.zahlfeld input { width: 52px; border: 0; background: transparent; text-align: center; min-height: 34px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.zahlfeld input::-webkit-inner-spin-button { -webkit-appearance: none; }
.zahlfeld input:focus { outline: none; }
.zahlfeld .symbol-knopf { height: 34px; min-width: 30px; border-radius: 0; }
.zahlfeld__einheit { color: var(--text-3); font-size: 12px; padding-right: 8px; }

.farbknopf {
  flex: none; width: 36px; height: 36px; border-radius: var(--r); border: 1px solid var(--linie-hell); padding: 4px; background: var(--slate);
}
.farbknopf span { display: block; width: 100%; height: 100%; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.15); }
.farbknopf--text { display: inline-grid; place-items: center; font-weight: 800; font-size: 15px; padding: 2px 4px 6px; }
.farbknopf--text span { height: 4px; margin-top: auto; border: 0; }

.reglergruppe { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; white-space: nowrap; }
.reglergruppe .regler { width: 120px; }

/* Aufklapper (Farbwahl, Mehr) */
.aufklapp {
  position: fixed; z-index: 60; width: 280px; max-width: calc(100vw - 16px);
  background: var(--slate); border: 1px solid var(--linie-hell); border-radius: var(--r-l);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); padding: 14px;
}
.aufklapp .etikett { display: block; margin: 0 0 8px; }
.aufklapp .farbreihe + .etikett { margin-top: 14px; }
.aufklapp__eigene { display: flex; gap: 8px; margin-top: 14px; align-items: center; }
.aufklapp__eigene input[type='color'] { width: 40px; height: 40px; border: 1px solid var(--linie-hell); border-radius: var(--r); background: var(--slate); padding: 3px; }
.aufklapp__eigene .feld { font-variant-numeric: tabular-nums; text-transform: uppercase; }
.aufklapp--liste { width: 240px; padding: 6px; }
.menuepunkt {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0;
  border-radius: var(--r); background: transparent; text-align: left; color: var(--text); font-size: 14px;
}
.menuepunkt:hover { background: var(--mist); }
.menuepunkt--gefahr { color: var(--rot); }
.menuepunkt .symbol { flex: none; color: var(--text-2); }
.menuepunkt--gefahr .symbol { color: var(--rot); }
.menuepunkt:disabled { opacity: 0.4; cursor: not-allowed; background: transparent; }

/* Fertigstellen */
.befunde { display: grid; gap: 6px; }
.befund {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 10px 12px; border-radius: var(--r); background: var(--slate); border: 1px solid var(--linie);
  text-align: left; color: var(--text); font-size: 13.5px; width: 100%;
}
.befund:hover { border-color: var(--linie-hell); }
.befund--muss { border-color: color-mix(in srgb, var(--rot) 50%, var(--linie)); }
.befund--muss .symbol { color: var(--rot); }
.befund--hinweis .symbol { color: var(--gelb); }
.befund__seite { color: var(--text-3); font-size: 12px; }
.befund-ok { display: flex; gap: 10px; align-items: center; color: var(--gruen); font-weight: 600; }

.seitenstreifen { display: grid; grid-auto-flow: column; grid-auto-columns: 64px; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.seitenstreifen button { border: 0; padding: 0; background: none; border-radius: var(--r-s); }
.seitenstreifen canvas { display: block; border-radius: var(--r-s); outline: 1px solid var(--linie); }
.seitenstreifen button:hover canvas { outline: 2px solid var(--weiss); }

.konto {
  width: 100%; text-align: left; color: var(--text); font: inherit;
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--linie); border-radius: var(--r); background: var(--slate);
}
.konto--waehlbar { cursor: pointer; }
.konto--gewaehlt { border-color: var(--sand); }
.konto__bild {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--mist); color: var(--sand); font-weight: 750; font-stretch: 75%; text-transform: uppercase;
}
.konto__name { font-weight: 650; }
.konto__info { color: var(--text-2); font-size: 12.5px; }
.konto__fehler { color: var(--rot); font-size: 12.5px; }
.konto + .konto { margin-top: 8px; }

.umschalter { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--linie); border-radius: var(--r); padding: 3px; gap: 3px; background: var(--slate); }
.umschalter button { border: 0; border-radius: var(--r-s); background: transparent; min-height: 36px; color: var(--text-2); font-weight: 600; font-size: 14px; }
.umschalter button[aria-pressed='true'] { background: var(--weiss); color: var(--void); }

.fortschritt { display: grid; gap: 8px; }
.fortschritt__seite { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 12px; align-items: center; }
.fortschritt__seite canvas { border-radius: var(--r-s); }
.fortschritt__status { font-size: 13.5px; color: var(--text-2); }
.fortschritt__status--fertig { color: var(--gruen); }
.fortschritt__status--fehler { color: var(--rot); }
.fortschritt__status--laeuft::after { content: ''; display: inline-block; width: 10px; height: 10px; margin-left: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: drehen 0.8s linear infinite; vertical-align: -1px; }
@keyframes drehen { to { transform: rotate(360deg); } }

.ergebnis { display: grid; gap: 10px; padding: 16px; border-radius: var(--r-l); border: 1px solid var(--linie); background: var(--slate); }
.ergebnis__titel { font-size: 17px; font-weight: 700; margin: 0; }

/* Einstellungen */
.einstellungen { max-width: 760px; margin: 0 auto; padding: calc(18px + var(--sicher-oben)) 20px 80px; }
.einstellungen__kopf { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.einstellungen__kopf h1 { font-size: 22px; margin: 0; }
.karte { border: 1px solid var(--linie); border-radius: var(--r-l); background: var(--ink); padding: 20px; }
.karte + .karte { margin-top: 16px; }
.karte__titel { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.karte__text { color: var(--text-2); margin: 0 0 16px; font-size: 14px; }
.anleitung { color: var(--text-2); font-size: 14px; margin-top: 14px; }
.anleitung summary { cursor: pointer; color: var(--text); font-weight: 600; }
.anleitung ol { padding-left: 20px; margin: 10px 0 0; display: grid; gap: 6px; }
.anleitung code { background: var(--slate); border: 1px solid var(--linie); border-radius: var(--r-s); padding: 1px 5px; font-size: 12.5px; }
.zeile { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.zeile--zwischen { justify-content: space-between; }
.statuszeile { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.statuszeile .symbol { flex: none; margin-top: 1px; }
.statuszeile--gut .symbol { color: var(--gruen); }
.statuszeile--warnung .symbol { color: var(--gelb); }

.markenformular { display: grid; gap: 16px; }
.markenformular__farben { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.markenfarbe { display: grid; gap: 6px; justify-items: start; font-size: 12.5px; color: var(--text-2); }
.markenfarbe input[type='color'] { width: 100%; height: 44px; border: 1px solid var(--linie-hell); border-radius: var(--r); background: var(--slate); padding: 3px; }
.markenformular__schriften { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.logo-feld { display: flex; gap: 12px; align-items: center; }
.logo-feld__bild { width: 88px; height: 56px; border-radius: var(--r); background: var(--slate) center / contain no-repeat; border: 1px solid var(--linie); display: grid; place-items: center; color: var(--text-3); overflow: hidden; }
.logo-feld__bild img { max-width: 100%; max-height: 100%; }

/* ---------- Hilfe ---------- */

.hilfe-ebene { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.hilfe {
  pointer-events: auto; position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%);
  background: var(--ink); border-left: 1px solid var(--linie-hell);
  box-shadow: -18px 0 50px rgba(0, 0, 0, 0.45);
  display: flex; flex-direction: column; padding-top: var(--sicher-oben);
  animation: panel-rein 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.hilfe__kopf { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--linie); }
.hilfe__kopf .panel__titel { flex: 1; }
.hilfe__suche { position: relative; padding: 14px 18px 12px; border-bottom: 1px solid var(--linie); }
.hilfe__suche .symbol { position: absolute; left: 30px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.hilfe__feld { padding-left: 40px; min-height: 44px; font-size: 16px; }
.hilfe__feld::-webkit-search-cancel-button { filter: invert(0.7); }
.hilfe__inhalt { flex: 1; overflow-y: auto; padding: 18px 18px calc(32px + var(--sicher-unten)); overscroll-behavior: contain; }
.hilfe__abschnitt + .hilfe__abschnitt, .artikel + .hilfe__abschnitt { margin-top: 24px; }
.hilfe__abschnitt > .etikett { display: block; margin-bottom: 10px; }
.hilfe__weitere { border-top: 1px solid var(--linie); padding-top: 18px; }
.hilfe__leer p { margin: 0 0 6px; }

.artikel__titel { font-size: 20px; font-weight: 700; line-height: 1.25; margin: 4px 0 12px; letter-spacing: -0.01em; }
.artikel p { margin: 0 0 12px; color: var(--text); line-height: 1.55; }
.artikel strong { color: var(--weiss); font-weight: 650; }
.artikel ol { margin: 0 0 14px; padding: 0; list-style: none; counter-reset: schritt; display: grid; gap: 10px; }
.artikel li {
  counter-increment: schritt; position: relative; padding-left: 34px; line-height: 1.5;
}
.artikel li::before {
  content: counter(schritt); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: var(--r-s);
  background: var(--mist); color: var(--sand); font-size: 12.5px; font-weight: 700; display: grid; place-items: center;
}
.tipp { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 12px 14px; border: 1px solid var(--linie); border-radius: var(--r); background: var(--slate); margin-bottom: 12px; }
.tipp .symbol { color: var(--sand); margin-top: 2px; }
.tipp p { margin: 0; color: var(--text-2); }
.artikel__siehe { margin-top: 18px; }
.artikel__siehe .etikett { display: block; margin-bottom: 8px; }

.themen { display: flex; flex-wrap: wrap; gap: 8px; }
.thema {
  border: 1px solid var(--linie-hell); border-radius: var(--r); background: transparent; color: var(--text);
  padding: 7px 11px; font-size: 13.5px; font-weight: 600; text-align: left;
}
.thema:hover { background: var(--mist); border-color: var(--fog); }
.trefferliste { display: grid; border-top: 1px solid var(--linie); }
.treffer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left;
  padding: 11px 2px; border: 0; border-bottom: 1px solid var(--linie); background: none; color: var(--text); font-size: 14.5px;
}
.treffer:hover { color: var(--weiss); background: var(--slate); }
.treffer .symbol { color: var(--text-3); flex: none; }
.einstellungen__hilfe { margin-left: auto; }

/* ---------- Einführung ---------- */

.einfuehrung-ebene {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px;
  background: rgba(5, 6, 8, 0.74);
  animation: einblenden 160ms ease-out;
}
@keyframes einblenden { from { opacity: 0; } to { opacity: 1; } }
.einfuehrung {
  width: min(400px, 100%); background: var(--ink); border: 1px solid var(--linie-hell); border-radius: 14px;
  padding: 16px 20px 18px; display: grid; gap: 12px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}
.einfuehrung .segment { height: 3px; }
.einfuehrung__bild {
  aspect-ratio: 16 / 9; border-radius: var(--r-l); display: flex; align-items: center; justify-content: center; gap: 22px;
  background: radial-gradient(ellipse at 50% 60%, var(--mist), var(--slate) 75%);
  border: 1px solid var(--linie); cursor: pointer; margin-top: 4px;
}
.einfuehrung__symbol {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--linie-hell); background: var(--ink); color: var(--sand);
}
.einfuehrung__zahl { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; margin-top: 4px; }
.einfuehrung__titel { font-size: 22px; font-weight: 700; margin: -6px 0 0; letter-spacing: -0.01em; }
.einfuehrung__text { margin: 0; color: var(--text-2); line-height: 1.55; min-height: 4.6em; }
.einfuehrung__text strong { color: var(--weiss); font-weight: 650; }
.einfuehrung__knoepfe { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.einfuehrung__knoepfe .knopf--primaer { min-width: 112px; }

@media (max-width: 760px) {
  .hilfe { width: 100%; border-left: 0; }
  .einfuehrung-ebene { align-items: end; padding: 0; }
  .einfuehrung { width: 100%; border-radius: 14px 14px 0 0; padding-bottom: calc(18px + var(--sicher-unten)); }
}

/* ---------- Handy ---------- */

@media (max-width: 760px) {
  .editor {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: calc(52px + var(--sicher-oben)) minmax(0, 1fr) auto auto;
    grid-template-areas: 'kopf' 'buehne' 'eigenschaften' 'leiste';
  }
  .editor__kopf { padding-left: 4px; padding-right: 8px; }
  .editor__trenner { display: none; }
  .editor__leiste {
    flex-direction: row; border-left: 0; border-top: 1px solid var(--linie);
    padding: 4px 6px calc(4px + var(--sicher-unten)); overflow-x: auto; overflow-y: hidden; gap: 0;
    scrollbar-width: none;
  }
  .editor__leiste::-webkit-scrollbar { display: none; }
  .werkzeug { flex: 1 0 58px; padding: 7px 2px 6px; }
  .werkzeug__abstand { display: none; }
  .werkzeug--handy { display: grid; }
  .nur-desktop { display: none; }
  .editor__eigenschaften { min-height: 56px; }
  .eigenschaften { padding: 8px 10px; }
  .nachbar { display: none; }
  .panel, .panel--breit {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: 100%;
    max-height: min(68vh, calc(100% - 60px)); border-left: 0; border-top: 1px solid var(--linie-hell);
    border-radius: 14px 14px 0 0; padding-bottom: var(--sicher-unten); z-index: 30;
    box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.55);
    animation: blatt-rein 220ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  .panel--voll { max-height: calc(100% - 20px - var(--sicher-oben)); height: calc(100% - 20px - var(--sicher-oben)); }
  .griffleiste { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--linie-hell); margin: 8px auto 0; }
  .panel__kopf { padding-top: 6px; }
  .kachelgitter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vorlagen-reihe { grid-auto-columns: 118px; }
  .projekte-gitter { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
  .markenformular__farben { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uebersicht__kopf .wortmarke { font-size: 26px; }
  .knopf--fertig .knopf__lang { display: none; }
}
@keyframes blatt-rein { from { transform: translateY(24px); opacity: 0.4; } to { transform: none; opacity: 1; } }

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