:root {
  --grund: #f2f2f7;
  --flaeche: #ffffff;
  --text: #000000;
  --text-2: rgba(60, 60, 67, .6);
  --trenner: rgba(60, 60, 67, .2);
  --fuellung: rgba(118, 118, 128, .12);
  --segment-aktiv: #ffffff;
  --akzent: #007aff;
  --gefahr: #ff3b30;
  --leiste: rgba(249, 249, 249, .86);
  --schatten: 0 1px 2px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .08);
  --radius: 12px;
  color-scheme: light dark;
  --leinwand-max: 640px;
}
:root[data-theme="dunkel"] {
    --grund: #000000;
    --flaeche: #1c1c1e;
    --text: #ffffff;
    --text-2: rgba(235, 235, 245, .6);
    --trenner: rgba(84, 84, 88, .55);
    --fuellung: rgba(118, 118, 128, .24);
    --segment-aktiv: #636366;
    --akzent: #0a84ff;
    --gefahr: #ff453a;
    --leiste: rgba(22, 22, 24, .86);
    --schatten: 0 8px 24px rgba(0, 0, 0, .5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="hell"]) {
    --grund: #000000;
    --flaeche: #1c1c1e;
    --text: #ffffff;
    --text-2: rgba(235, 235, 245, .6);
    --trenner: rgba(84, 84, 88, .55);
    --fuellung: rgba(118, 118, 128, .24);
    --segment-aktiv: #636366;
    --akzent: #0a84ff;
    --gefahr: #ff453a;
    --leiste: rgba(22, 22, 24, .86);
    --schatten: 0 8px 24px rgba(0, 0, 0, .5);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--grund); color: var(--text); }
body {
  font: 400 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.01em;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--akzent) 60%, transparent); outline-offset: 2px; border-radius: 8px; }
.ic { width: 22px; height: 22px; flex: none; display: block; }

.app { min-height: 100dvh; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.tab { display: none; }
.tab.aktiv { display: block; }

.navbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  max-width: 1180px; margin: 0 auto;
}
.grosstitel { margin: 0; font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; }

.knopf-voll {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px;
  border: 0; border-radius: 999px; background: var(--akzent); color: #fff; font-weight: 600; font-size: 16px;
  transition: transform .15s ease, opacity .15s ease;
}
.knopf-voll .ic { width: 20px; height: 20px; }
.knopf-voll:active, .knopf-grau:active { transform: scale(.97); opacity: .8; }
.knopf-grau {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  border: 0; border-radius: var(--radius); background: var(--flaeche); color: var(--akzent); font-weight: 500;
  box-shadow: var(--schatten); transition: transform .15s ease, opacity .15s ease;
}

.arbeitsflaeche { max-width: 1180px; margin: 0 auto; padding: 0 16px 24px; display: grid; gap: 20px; }
@media (min-width: 900px) {
  .arbeitsflaeche { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; gap: 32px; }
  .buehne { position: sticky; top: 16px; }
}
.buehne { position: relative; }
.leinwand-rahmen {
  position: relative; width: min(100%, var(--leinwand-max), calc((100dvh - 230px) * .8)); min-width: min(100%, 280px); margin: 0 auto; aspect-ratio: 4 / 5;
}
#leinwand {
  display: block; width: 100%; height: 100%;
  border-radius: var(--radius); background: #111; box-shadow: var(--schatten);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.lade { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #fff; font-size: 15px; }
.lade[hidden] { display: none; }

.abschnitt {
  margin: 4px 16px 8px; font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: .02em; color: var(--text-2);
}
.seite { display: grid; gap: 14px; align-content: start; min-width: 0; }
.seite > .abschnitt { margin-bottom: -6px; }

.vorlagen {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px;
  scroll-snap-type: x proximity; scrollbar-width: none;
}
.vorlagen::-webkit-scrollbar { display: none; }
.vorlage {
  flex: none; width: 76px; padding: 0; border: 0; background: none; scroll-snap-align: start; text-align: center;
  color: var(--text-2); font-size: 12px; line-height: 1.2;
}
.vorlage img {
  display: block; width: 76px; height: 95px; object-fit: cover; border-radius: 10px; margin-bottom: 6px;
  box-shadow: 0 0 0 1px var(--trenner); transition: box-shadow .2s ease, transform .2s ease;
}
.vorlage[aria-checked="true"] { color: var(--text); font-weight: 600; }
.vorlage[aria-checked="true"] img { box-shadow: 0 0 0 3px var(--akzent); }
@media (min-width: 900px) {
  .vorlagen { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .vorlage { width: calc((100% - 30px) / 4); }
  .vorlage img { width: 100%; height: auto; aspect-ratio: 4 / 5; }
}

.segment {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; gap: 2px;
  background: var(--fuellung); border-radius: 9px;
}
.segment button {
  min-height: 32px; border: 0; border-radius: 7px; background: transparent; font-size: 14px; font-weight: 500;
  transition: background .2s ease, box-shadow .2s ease;
}
.segment button[aria-checked="true"] { background: var(--segment-aktiv); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 0 1px rgba(0, 0, 0, .04); font-weight: 600; }
.segment.klein button { min-height: 30px; font-size: 13px; }

.aktionen { display: flex; gap: 10px; }

.gruppe { background: var(--flaeche); border-radius: var(--radius); overflow: hidden; }
.zeile {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 16px; position: relative;
}
.zeile + .zeile::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--trenner); transform: scaleY(.5); transform-origin: top; }
.zeile label, .zeile .etikett { flex: none; min-width: 92px; }
.zeile .wert { margin-left: auto; color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; font-size: 15px; }
.zeile input[type="range"] { flex: 1; min-width: 0; accent-color: var(--akzent); height: 28px; }
.zeile select {
  flex: 1; min-width: 0; appearance: none; -webkit-appearance: none; border: 0; background: transparent; text-align: right;
  color: var(--text-2); padding-right: 18px; min-height: 32px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 8px) 55%, calc(100% - 3px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.zeile textarea {
  width: 100%; min-height: 96px; border: 0; background: transparent; resize: vertical; padding: 4px 0; line-height: 1.4;
  font-size: 17px;
}
.zeile textarea:focus { outline: none; }
.zeile.knopfzeile { padding: 0; }
.zeile.knopfzeile button {
  width: 100%; min-height: 48px; border: 0; background: transparent; color: var(--akzent); text-align: left; padding: 0 16px;
  display: flex; align-items: center; gap: 10px;
}
.zeile.knopfzeile button.gefahr { color: var(--gefahr); }
.fusszeile { margin: 6px 16px 0; font-size: 13px; color: var(--text-2); }

.schalter { position: relative; margin-left: auto; width: 51px; height: 31px; flex: none; }
.schalter input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.schalter span { position: absolute; inset: 0; border-radius: 999px; background: var(--fuellung); transition: background .2s ease; pointer-events: none; }
.schalter span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .2s ease; }
.schalter input:checked + span { background: #34c759; }
.schalter input:checked + span::after { transform: translateX(20px); }

.farben { display: flex; flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
.farbe {
  width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0; position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
}
.farbe::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2.5px solid transparent; }
.farbe[aria-checked="true"]::after { border-color: var(--akzent); }

.leer { display: grid; justify-items: center; text-align: center; padding: 18vh 32px 0; color: var(--text-2); }
.leer-icon .ic { width: 56px; height: 56px; }
.leer-titel { margin: 14px 0 4px; font-size: 22px; font-weight: 600; color: var(--text); }
.leer-text { margin: 0; max-width: 32ch; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; gap: 0;
  padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: var(--leiste); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--trenner);
}
.tabknopf {
  flex: 1; max-width: 200px; display: grid; justify-items: center; gap: 2px; border: 0; background: none;
  color: var(--text-2); font-size: 12px; font-weight: 500; padding: 4px 0; min-height: 48px; letter-spacing: 0;
}
.tabknopf .ic { width: 26px; height: 26px; }
.tabknopf.aktiv { color: var(--akzent); }

.hinweis {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px);
  background: rgba(30, 30, 32, .92); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 15px;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 20; white-space: nowrap;
}
.hinweis.zeigen { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; }
}

:root { --warn: #ff3b30; --erfolg: #34c759; }
:root[data-theme="dunkel"] { --warn: #ff453a; --erfolg: #30d158; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="hell"]) { --warn: #ff453a; --erfolg: #30d158; } }

.knopf-rund {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%;
  background: var(--fuellung); color: var(--akzent); transition: transform .15s ease, opacity .15s ease;
}
.knopf-rund .ic { width: 26px; height: 26px; }
.knopf-rund:active, .knopf-pille:active, .stepper button:active { transform: scale(.94); opacity: .75; }
.knopf-voll:disabled { opacity: .4; }
.knopf-voll.breit { width: 100%; justify-content: center; }
.knopf-text { min-height: 44px; border: 0; background: none; color: var(--akzent); font-weight: 500; padding: 0 12px; }

.lager { max-width: 720px; margin: 0 auto; padding: 0 16px 32px; }
.lager-kopf { display: grid; gap: 10px; margin-bottom: 18px; }
.lager .abschnitt { margin-top: 18px; }
.suchfeld {
  display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 10px; border-radius: 10px;
  background: var(--fuellung); color: var(--text-2);
}
.suchfeld .ic { width: 20px; height: 20px; }
.suchfeld input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font-size: 17px; padding: 7px 0; outline: none;
  -webkit-appearance: none; appearance: none;
}
.suchfeld input::placeholder { color: var(--text-2); }
.suchfeld:focus-within { box-shadow: 0 0 0 2px color-mix(in srgb, var(--akzent) 45%, transparent); }
.zaehler {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px;
  background: var(--warn); color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; vertical-align: 1px;
}
.zaehler[hidden] { display: none; }

.artikel { padding-top: 6px; padding-bottom: 6px; padding-right: 10px; }
.artikel-info {
  flex: 1; min-width: 0; display: grid; gap: 1px; padding: 4px 0; border: 0; background: none; text-align: left; min-height: 44px; align-content: center;
}
.artikel-name { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artikel-unter { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warn { color: var(--warn); font-weight: 600; }
.artikel.knapp .stepper-wert { color: var(--warn); }

.stepper { display: flex; align-items: center; flex: none; }
.stepper button {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--akzent);
  transition: transform .12s ease, opacity .12s ease;
}
.stepper button .ic { width: 30px; height: 30px; padding: 5px; border-radius: 50%; background: var(--fuellung); }
.stepper-wert { min-width: 40px; text-align: center; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

.knopf-pille {
  flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 14px 0 10px; border: 0; border-radius: 999px;
  background: color-mix(in srgb, var(--erfolg) 16%, transparent); color: var(--erfolg); font-size: 15px; font-weight: 600;
  transition: transform .12s ease, opacity .12s ease; position: relative;
}
.knopf-pille::after { content: ""; position: absolute; inset: -4px 0; }
.knopf-pille .ic { width: 20px; height: 20px; }
.kaufen-kopf { display: flex; margin-top: 4px; }
.kaufen-kopf .knopf-grau .ic { width: 20px; height: 20px; }

.leer.klein { padding: 9vh 16px 8px; }
.leer-knoepfe { display: grid; gap: 6px; justify-items: center; margin-top: 18px; }
.lade-text { text-align: center; color: var(--text-2); padding: 12vh 0; margin: 0; }
.lager-einstellungen { margin-top: 28px; }
.lager-einstellungen .etikett { flex: 1; min-width: 0; }
.schalter input:disabled + span { opacity: .45; }
.knopfzeile .ic { width: 22px; height: 22px; }

.hinweis.mit-aktion { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding-right: 8px; }
.hinweis button { border: 0; background: none; color: #64d2ff; font-weight: 600; font-size: 15px; min-height: 32px; padding: 0 8px; }

.feld {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font-size: 17px; text-align: right; padding: 6px 0;
  outline: none; -webkit-appearance: none; appearance: none;
}
.feld::placeholder { color: var(--text-2); }
.feld.zahl { font-variant-numeric: tabular-nums; }
.zeile select { font-size: 17px; }

.blatt {
  width: 100%; max-width: 560px; margin: auto auto 0; padding: 0; border: 0; color: var(--text);
  max-height: calc(100dvh - env(safe-area-inset-top) - 10px); height: fit-content;
  border-radius: 14px 14px 0 0; background: var(--grund); overflow: hidden;
}
.blatt[open] { display: flex; flex-direction: column; animation: blatt-rein .32s cubic-bezier(.32, .72, 0, 1); }
.blatt::backdrop { background: rgba(0, 0, 0, .4); animation: dunkel-rein .3s ease; }
@keyframes blatt-rein { from { transform: translateY(100%); } }
@keyframes dunkel-rein { from { opacity: 0; } }
@media (min-width: 600px) { .blatt { margin: auto; border-radius: 14px; } }
.blatt form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.blatt-kopf {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 8px 8px; flex: none;
  border-bottom: .5px solid var(--trenner); background: var(--leiste);
}
.blatt-kopf h2 { margin: 0; font-size: 17px; font-weight: 600; }
.blatt-link { min-height: 44px; border: 0; background: none; color: var(--akzent); font-size: 17px; padding: 0 8px; justify-self: start; }
.blatt-link.fett { font-weight: 600; justify-self: end; }
.blatt-link:disabled { opacity: .4; }
.blatt-inhalt {
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
  display: grid; gap: 14px; align-content: start;
}
.blatt-inhalt .fusszeile { margin-top: -6px; }
.blatt-fehler { margin: 0 16px; color: var(--warn); font-size: 15px; }
.blatt-fehler[hidden], #blatt-loeschen-gruppe[hidden] { display: none; }
.blatt .etikett { min-width: 120px; }

body.anmeldung { min-height: 100dvh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
.anmelde-karte { width: 100%; max-width: 380px; text-align: center; }
.anmelde-logo { display: block; width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 16px; box-shadow: var(--schatten); }
.anmelde-karte h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.anmelde-unter { margin: 2px 0 26px; color: var(--text-2); }
.anmelde-form { display: grid; gap: 14px; text-align: left; }
.anmelde-form .etikett { min-width: 80px; }
.anmelde-form .feld { text-align: left; }
.anmelde-fehler { margin: 0 16px; color: var(--warn); font-size: 15px; }
.anmelde-form .fusszeile { text-align: center; }
.hinweis { max-width: calc(100vw - 32px); white-space: normal; text-align: center; }
[hidden] { display: none !important; }
.blatt:focus, .blatt:focus-visible { outline: none; }
.zeile .schalter { flex: none; width: 51px; min-width: 0; }
@media (hover: none) and (pointer: coarse) {
  :focus, :focus-visible { outline: none; }
}
.zeile select:focus, .feld:focus { outline: none; }

.farbton-zeile .etikett { min-width: 0; }
.farbton {
  -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 32px; margin: 0; background: transparent; touch-action: pan-y;
}
.farbton::-webkit-slider-runnable-track {
  height: 8px; border-radius: 4px;
  background: linear-gradient(to right, hsl(0 85% 50%), hsl(60 85% 50%), hsl(120 70% 42%), hsl(180 75% 42%), hsl(240 80% 58%), hsl(300 75% 50%), hsl(359 85% 50%));
}
.farbton::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%;
  background: hsl(calc(var(--farbton, 210) * 1deg) 75% 50%); border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2), 0 4px 10px rgba(0, 0, 0, .15);
}
.farbton::-moz-range-track {
  height: 8px; border-radius: 4px;
  background: linear-gradient(to right, hsl(0 85% 50%), hsl(60 85% 50%), hsl(120 70% 42%), hsl(180 75% 42%), hsl(240 80% 58%), hsl(300 75% 50%), hsl(359 85% 50%));
}
.farbton::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: hsl(calc(var(--farbton, 210) * 1deg) 75% 50%); border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}


.nav-knoepfe { display: flex; align-items: center; gap: 8px; }
.knopf-rund.klein { width: 40px; height: 40px; }
.knopf-rund.klein .ic { width: 24px; height: 24px; }
.knopf-rund:disabled { opacity: .35; }

.kat-reiter {
  display: flex; gap: 8px; overflow-x: auto; margin: 0; padding: 2px 0 4px; scrollbar-width: none; scroll-snap-type: x proximity; border-radius: 999px;
}
.kat-reiter::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--fuellung); color: var(--text); font-size: 15px; font-weight: 500; white-space: nowrap; scroll-snap-align: start; position: relative;
  transition: background .2s ease, color .2s ease;
}
.chip[aria-selected="true"] { background: var(--text); color: var(--grund); }
.chip-zahl { font-size: 13px; opacity: .55; font-variant-numeric: tabular-nums; }
.chip-punkt { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); margin-left: -2px; }
.chip-neu { padding: 0 9px; color: var(--akzent); }
.chip-neu .ic { width: 22px; height: 22px; }

.tab-icon { position: relative; display: block; }
.tab-punkt {
  position: absolute; top: -3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--warn); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--grund);
}

.kat-liste .knopfzeile button { color: var(--text); }
.kat-liste .kat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kat-liste .kat-zahl { color: var(--text-2); font-variant-numeric: tabular-nums; }
.kat-liste .ic { color: var(--text-2); width: 20px; height: 20px; }
.kat-liste .knopfzeile:last-child button { color: var(--akzent); }
.kat-liste .knopfzeile:last-child .ic { color: var(--akzent); }
.leise { color: var(--text-2); }

.auswahl-knopf {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 4px 0 8px; border: 0; background: none;
  color: var(--text-2); font-size: 17px; max-width: 65%; text-align: right;
}
.auswahl-wert { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auswahl-wert.leise { opacity: .7; }
.auswahl-pfeil {
  width: 8px; height: 8px; flex: none; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); opacity: .7;
}
.auswahl-knopf[aria-expanded="true"] { color: var(--akzent); }
.menue {
  position: fixed; z-index: 30; inset: auto; margin: 0; border: 0; color: var(--text); min-width: 150px; max-width: calc(100vw - 16px); width: max-content; overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; border-radius: 14px; background: color-mix(in srgb, var(--flaeche) 92%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .28), 0 0 0 .5px var(--trenner); animation: menue-rein .16s ease-out;
}
@keyframes menue-rein { from { opacity: 0; transform: scale(.96); } }
.menue button {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 0 14px 0 6px; border: 0; border-radius: 8px;
  background: none; color: var(--text); font-size: 16px; text-align: left; white-space: nowrap;
}
.menue button:active, .menue button:hover { background: var(--fuellung); }
.menue-haken { width: 20px; height: 20px; display: grid; place-items: center; flex: none; color: var(--akzent); }
.menue-haken .ic { width: 20px; height: 20px; }
.menue-trenner { height: 1px; background: var(--trenner); margin: 4px 6px; }
.blatt.klein { max-width: 460px; }

.ueberlagerung { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.hilfen { position: absolute; inset: 0; overflow: hidden; border-radius: var(--radius); }
.hilfslinie { position: absolute; background: #2fd3ff; opacity: .95; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .25); }
.hilfslinie.mitte { background: #ff3b8d; }
.hilfslinie.senkrecht { top: 0; bottom: 0; width: 1px; margin-left: -.5px; }
.hilfslinie.waagerecht { left: 0; right: 0; height: 1px; margin-top: -.5px; }
.auswahl-rahmen {
  position: absolute; transform-origin: 0 0; border: 1.5px solid #fff; border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(0, 0, 0, .25);
}
.auswahl-rahmen.loeschen { border-color: #ff453a; opacity: .55; }
.auswahl-rahmen.gerastet { border-color: #ff3b8d; }
.griff {
  position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #fff; pointer-events: auto; touch-action: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45); display: grid; place-items: center; color: #111;
}
.griff::before { content: ""; position: absolute; inset: -12px; border-radius: 50%; }
.griff.ecke { right: -11px; bottom: -11px; }
.griff.breite { right: -7px; top: 50%; width: 14px; height: 30px; margin-top: -15px; border-radius: 7px; }
.griff.hoehe { bottom: -7px; left: 50%; width: 30px; height: 14px; margin-left: -15px; border-radius: 7px; }
.griff.drehen { left: 50%; bottom: -46px; margin-left: -14px; width: 28px; height: 28px; }
.griff.drehen .ic { width: 18px; height: 18px; }
.auswahl-rahmen.logo .griff.drehen { bottom: auto; top: -46px; }
.muell {
  position: absolute; left: 50%; bottom: 14px; width: 52px; height: 52px; margin-left: -26px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, .45); border: 1.5px solid rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transform: scale(.7); transition: opacity .15s ease, transform .15s ease, background .15s ease;
}
.muell .ic { width: 26px; height: 26px; }
.muell.sichtbar { opacity: 1; transform: scale(1); }
.muell.aktiv { background: #ff3b30; border-color: #ff3b30; transform: scale(1.2); }
.gesten-hinweis { margin: 10px auto 0; max-width: 46ch; text-align: center; font-size: 13px; color: var(--text-2); }
body.pipette-an #leinwand { cursor: crosshair; outline: 3px solid var(--akzent); outline-offset: 3px; }

.werkzeuge {
  display: flex; gap: 4px; overflow-x: auto; margin: 0; padding: 4px 0; scrollbar-width: none; scroll-snap-type: x proximity;
}
.werkzeuge::-webkit-scrollbar { display: none; }
.werkzeug {
  flex: none; display: grid; justify-items: center; align-content: center; gap: 4px; min-width: 68px; min-height: 64px; padding: 6px 8px; border: 0; border-radius: 14px;
  background: none; color: var(--text); font-size: 12px; font-weight: 500; letter-spacing: 0; scroll-snap-align: start;
  transition: background .15s ease, color .15s ease;
}
.werkzeug .ic { width: 26px; height: 26px; }
.werkzeug[aria-pressed="true"] { background: var(--flaeche); color: var(--akzent); box-shadow: var(--schatten); }
.werkzeug.gefahr { color: var(--gefahr); }
.werkzeug.fertig { color: var(--akzent); font-weight: 600; }
.werkzeug:active { transform: scale(.95); }
.werkzeug-trenner { flex: none; width: 1px; margin: 12px 2px; background: var(--trenner); }
@media (min-width: 900px) {
  .werkzeuge { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .werkzeug { min-width: 0; flex: 1 1 76px; }
}

.panel { display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.panel > * { flex-shrink: 0; }
.panel[hidden] { display: none; }
.panel .segment button { min-height: 36px; font-size: 14px; }
.panel .segment button .ic { width: 22px; height: 22px; margin: 0 auto; }
.panel-titel { margin: 6px 4px -4px; font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; }
.gruppe.innen { padding: 6px 16px 10px; }
.regler-zeile { display: grid; gap: 2px; padding: 8px 0; }
.regler-zeile + .regler-zeile { border-top: .5px solid var(--trenner); }
.regler-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 15px; }
.regler-kopf .wert { color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 15px; }
.regler-zeile input[type="range"] { width: 100%; margin: 0; height: 32px; accent-color: var(--akzent); }
.panel .fusszeile { margin-top: -4px; }
.panel .vorlagen { margin: 0; padding: 4px 0 6px; }
.vorlage { width: 84px; }
.vorlage img { width: 84px; height: 105px; }
@media (min-width: 900px) {
  .panel .vorlagen { margin: 0; }
  .vorlage { width: calc((100% - 30px) / 4); }
  .vorlage img { width: 100%; height: auto; }
}

.farben { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 2px; }
.farben.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); gap: 10px; }
.farbe { width: 36px; height: 36px; }
.farben.raster .farbe { width: auto; min-width: 0; max-width: 44px; height: auto; aspect-ratio: 1; justify-self: center; }
.farben.raster .farbe:not([style*="width"]) { width: 100%; }
.werkzeug-farbe { display: grid; place-items: center; background: var(--fuellung); color: var(--text); cursor: pointer; overflow: hidden; }
.werkzeug-farbe .ic { width: 22px; height: 22px; position: relative; }
.werkzeug-farbe.regenbogen { background: conic-gradient(from 90deg, #ff2d45, #ffd400, #5fd068, #2ec4b6, #4da3ff, #a67cff, #ff5fc6, #ff2d45); color: #fff; }
.werkzeug-farbe.regenbogen .ic { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.werkzeug-farbe input[type="color"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; }

.schrift-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.schrift-kachel {
  display: grid; justify-items: center; gap: 2px; padding: 10px 6px 8px; border: 0; border-radius: 12px; background: var(--flaeche); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--trenner);
}
.schrift-kachel[aria-pressed="true"] { box-shadow: inset 0 0 0 2.5px var(--akzent); }
.schrift-probe { font-size: 30px; line-height: 1.15; }
.schrift-name { font: 500 12px/1.2 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; color: var(--text-2); text-align: center; }

.form-wahl, .kachel-reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; }
.kachel {
  display: grid; justify-items: center; gap: 6px; padding: 14px 8px 12px; border: 0; border-radius: 14px; background: var(--flaeche); color: var(--text);
  font-size: 13px; font-weight: 500; text-align: center; box-shadow: inset 0 0 0 1px var(--trenner);
}
.kachel .ic { width: 28px; height: 28px; color: var(--akzent); }
.kachel:active { transform: scale(.97); }
.ic-dreh { display: block; transform: rotate(90deg); }

.texteditor {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; color: #fff;
  padding-top: env(safe-area-inset-top);
}
.texteditor[hidden] { display: none; }
.te-hintergrund { position: absolute; inset: 0; background: rgba(0, 0, 0, .62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.te-kopf { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px max(14px, env(safe-area-inset-right)) 6px max(14px, env(safe-area-inset-left)); }
.te-luft { flex: 1; }
.te-knopf {
  width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff;
}
.te-knopf .ic { width: 24px; height: 24px; }
.te-a { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; font: 700 17px/1 -apple-system, system-ui, sans-serif; border: 1.5px solid #fff; }
#te-hg[data-stufe="voll"] .te-a { background: #fff; color: #000; }
#te-hg[data-stufe="halb"] .te-a { background: rgba(255, 255, 255, .5); color: #000; }
.te-fertig { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: #fff; color: #000; font-weight: 600; font-size: 16px; }
.te-mitte { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 8px 20px; }
#te-text {
  width: 100%; max-width: 640px; border: 0; outline: none; resize: none; background: transparent; padding: .12em .3em; border-radius: .2em;
  overflow-y: auto; caret-color: #fff; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.te-leiste {
  position: relative; display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 10px max(14px, env(safe-area-inset-left)) calc(12px + env(safe-area-inset-bottom));
}
.te-leiste::-webkit-scrollbar { display: none; }
.te-schrift, .te-schnitt {
  flex: none; min-height: 38px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 16px; white-space: nowrap;
}
.te-schnitt { font: 600 14px/1 -apple-system, system-ui, sans-serif; }
.te-schrift[aria-pressed="true"], .te-schnitt[aria-pressed="true"] { background: #fff; color: #000; }
.te-trenner { flex: none; width: 1px; height: 26px; background: rgba(255, 255, 255, .35); }
.te-leiste .farbe { flex: none; width: 32px; height: 32px; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .8); }
.te-leiste .farbe[aria-checked="true"]::after { border-color: #fff; }
body.te-offen { overflow: hidden; }

@media (max-width: 899px) {
  #tab-posts .arbeitsflaeche { gap: 0; padding-bottom: calc(var(--seite-h, 120px) + 8px); }
  #tab-posts .navbar { padding-bottom: 8px; }
  #tab-posts .grosstitel { font-size: 30px; }
  .leinwand-rahmen {
    width: min(100%, var(--leinwand-max), calc((100dvh - var(--seite-h, 120px) - 196px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * .8));
  }
  .gesten-hinweis { margin-top: 6px; font-size: 12px; line-height: 1.3; }
  #tab-posts .leinwand-rahmen { min-width: min(100%, 190px); }
  #tab-posts .seite {
    position: fixed; left: 0; right: 0; bottom: calc(61px + env(safe-area-inset-bottom)); z-index: 9; gap: 6px;
    padding: 4px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
    background: var(--grund); border-top: .5px solid var(--trenner); box-shadow: 0 -10px 24px rgba(0, 0, 0, .06);
  }
  #tab-posts .panel { max-height: 30dvh; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding-top: 2px; }
  .werkzeug { min-height: 58px; }
}

.pos-raster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pos-raster.vier { grid-template-columns: repeat(4, 1fr); }
.pos-raster .kachel { padding: 10px 4px 9px; font-size: 12px; }
.pos-raster .kachel .ic { width: 24px; height: 24px; }

.te-o { font: 900 22px/1 -apple-system, system-ui, sans-serif; color: #fff; }
#te-umriss[data-an="1"] .te-o { color: transparent; -webkit-text-stroke: 1.5px #fff; }

.liefer-name { margin: 0 4px; font-size: 22px; font-weight: 600; }
.liefer-stepper { margin-left: auto; }
.stepper-feld {
  width: 64px; border: 0; background: var(--fuellung); border-radius: 8px; text-align: center; font-size: 20px; font-weight: 600;
  padding: 6px 4px; color: var(--text); font-variant-numeric: tabular-nums; -webkit-appearance: none; appearance: none; outline: none;
}
.liefer-schnell { display: flex; flex-wrap: wrap; gap: 8px; }
.liefer-schnell .chip[aria-pressed="true"] { background: var(--text); color: var(--grund); }

.panel { min-width: 0; }
.panel > * { min-width: 0; max-width: 100%; }
.menue, .blatt-inhalt { touch-action: pan-y; -webkit-overflow-scrolling: touch; }

body.gesperrt { position: fixed; left: 0; right: 0; overflow: hidden; }
html:has(dialog.blatt[open]) { overflow: hidden; overscroll-behavior: none; }
.blatt::backdrop { touch-action: none; }

/* v8 */
.hinweis { inset: auto auto calc(84px + env(safe-area-inset-bottom)) 50%; margin: 0; border: 0; overflow: visible; width: max-content; height: auto; max-width: calc(100vw - 32px); }
.hinweis:not(:popover-open) { display: block; }

.lager-kopf {
  position: sticky; top: 0; z-index: 5; margin: 0 -16px 10px; padding: 6px 16px 10px;
  background: var(--grund); transition: box-shadow .2s ease;
}
.lager-kopf.schwebt { box-shadow: 0 .5px 0 var(--trenner); }
.lager-kopf + #lager-liste > .abschnitt:first-child { margin-top: 8px; }

input.stepper-wert {
  width: 52px; min-width: 0; height: 36px; padding: 0 2px; border: 0; border-radius: 8px; background: transparent; color: var(--text);
  -webkit-appearance: none; appearance: none; outline: none; cursor: text; transition: background .15s ease;
}
input.stepper-wert:focus { background: var(--fuellung); box-shadow: inset 0 0 0 2px var(--akzent); }
.artikel.knapp input.stepper-wert { color: var(--warn); }
.stepper button:disabled { opacity: .3; cursor: default; }
.stepper button:disabled:active { transform: none; }

.einst-abschnitt { display: grid; }
.einst-abschnitt .abschnitt { margin: 0 16px 8px; }
.blatt-inhalt .einst-abschnitt .fusszeile { margin-top: 8px; }
#einst-blatt .blatt-inhalt { gap: 24px; }
#einst-blatt .etikett { flex: 1; min-width: 0; }
.blatt-geaendert { text-align: center; margin-top: 0 !important; }
.kaufen-fuss { margin-top: 14px; text-align: center; }

.leinwand-rahmen.foto-modus #leinwand { outline: 3px solid var(--akzent); outline-offset: 3px; cursor: move; }
.leinwand-rahmen.foto-modus::after {
  content: "Foto bewegen"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); pointer-events: none;
  padding: 5px 12px; border-radius: 999px; background: var(--akzent); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.werkzeuge.verteilt .werkzeug { flex: 1 1 0; min-width: 0; padding: 6px 2px; }
.elemente .knopfzeile button { color: var(--text); }
.elemente .knopfzeile .ic { color: var(--text-2); width: 20px; height: 20px; }
.elemente .el-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-link {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin-top: -4px; padding: 0 4px;
  border: 0; background: none; color: var(--akzent); font-size: 14px; font-weight: 500;
}
.panel-link.gefahr { color: var(--gefahr); }
.panel-link .ic { width: 18px; height: 18px; }
.foto-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }
.knopf-klein {
  flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 12px;
  border: 0; border-radius: 10px; background: var(--flaeche); color: var(--akzent); font-size: 14px; font-weight: 500; white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--trenner);
}
.knopf-klein .ic { width: 20px; height: 20px; }
.knopf-klein:active { transform: scale(.97); opacity: .8; }

/* v8: ruhige Übergänge */
@keyframes sanft-rein { from { opacity: 0; transform: translateY(4px); } }
@keyframes blende-rein { from { opacity: 0; } }
@keyframes blatt-raus { to { transform: translateY(100%); } }
@keyframes dunkel-raus { to { opacity: 0; } }
@keyframes blatt-raus-mitte { to { opacity: 0; transform: scale(.96); } }
.tab.aktiv { animation: blende-rein .18s ease-out; }
.panel.rein > *, .werkzeuge.rein > * { animation: sanft-rein .2s ease-out both; }
#lager-liste.rein { animation: blende-rein .18s ease-out; }
.blatt.schliesst { animation: blatt-raus .2s cubic-bezier(.4, 0, 1, 1) forwards; }
.blatt.schliesst::backdrop { animation: dunkel-raus .2s ease forwards; }
@media (min-width: 600px) {
  .blatt[open] { animation-name: blatt-rein-mitte; }
  .blatt.schliesst { animation-name: blatt-raus-mitte; }
}
@keyframes blatt-rein-mitte { from { opacity: 0; transform: scale(.96); } }
.texteditor:not([hidden]) { animation: blende-rein .16s ease-out; }
.texteditor.raus { animation: dunkel-raus .16s ease-in forwards; pointer-events: none; }
.auswahl-rahmen:not([hidden]) { animation: blende-rein .12s ease-out; }
.knopf-rund, .werkzeug, .chip, .knopf-klein, .stepper button { transition: transform .15s ease, opacity .15s ease, background .2s ease, color .2s ease; }
.panel-leer { margin: 0; padding: 18px 8px; text-align: center; font-size: 14px; color: var(--text-2); }
@media (max-width: 899px) {
  #tab-posts .panel { height: clamp(150px, 25dvh, 230px); max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::backdrop { animation-duration: .01ms !important; }
}
@media (max-width: 899px) {
  :root { --seite-h: calc(clamp(150px, 25dvh, 230px) + 85px); }
}
.schnell { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.schnell .kachel { padding: 10px 4px 9px; font-size: 12px; gap: 4px; }
.schnell .kachel .ic { width: 24px; height: 24px; }
.kachel.gefahr, .kachel.gefahr .ic { color: var(--gefahr); }

/* v8: Story 9:16 */
.leinwand-rahmen.story { aspect-ratio: 9 / 16; width: min(100%, var(--leinwand-max), calc((100dvh - 230px) * .5625)); }
@media (max-width: 899px) {
  #tab-posts .leinwand-rahmen.story {
    width: min(100%, var(--leinwand-max), calc((100dvh - var(--seite-h, 120px) - 196px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * .5625));
    min-width: min(100%, 150px);
  }
}
.story-zonen { display: none; position: absolute; inset: 0; overflow: hidden; border-radius: var(--radius); pointer-events: none; }
.leinwand-rahmen.story .story-zonen { display: block; }
.story-zonen .zone {
  position: absolute; left: 0; right: 0;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .13) 0 5px, transparent 5px 11px);
}
.story-zonen .oben { top: 0; height: calc(250 / 1920 * 100%); border-bottom: 1px dashed rgba(255, 255, 255, .55); }
.story-zonen .unten { bottom: 0; height: calc(340 / 1920 * 100%); border-top: 1px dashed rgba(255, 255, 255, .55); }
.leinwand-rahmen.foto-modus .story-zonen { opacity: .4; }
.panel .segment#p-format { flex-shrink: 0; }
