/* reinschau360 Studio – Oberfläche. Tokens aus DESIGN.md (Abschnitt 4 und „Studio“).
   Gehäuse/Sichtfenster wie auf der Website: dunkle Navy-Leiste rahmt helle Arbeitsflächen,
   der Raum selbst liegt in einer dunklen Bühne. Orange ist der einzige Akzent. */

@font-face {
  font-family: "Geist";
  src: url("../assets/fonts/geist-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Farbe: Logo-Navy auf kühlem Weiß, Orange als einziger Akzent (DESIGN.md, Stand 2026-10-03) */
  --bg: #f6f7f8;
  --surface: #ffffff;
  --paper: #ffffff;
  --sage: #eef1f4;
  --sage-strong: #e2e7ec;
  --sage-soft: #f2f4f6;
  --ink: #12263a;
  --text: #2c3a4b;
  --muted: #566270;
  --line: rgba(18, 38, 58, 0.1);
  --line-strong: rgba(18, 38, 58, 0.18);
  --hover: rgba(18, 38, 58, 0.05);
  --accent: #c4490a;
  --accent-hover: #ad3f08;
  --accent-press: #963607;
  --accent-tint: #fbe9de;
  --on-tint: #963607;
  --accent-soft: rgba(196, 73, 10, 0.16);
  --on-accent: #ffffff;
  --brand-orange: #e8590c;
  --navy: #12263a;
  --midnight: #0c1b2b;
  --on-dark: #f4f6f8;
  --on-dark-muted: #b7c2ce;
  --on-dark-accent: #f07a3a;
  --dark-line: rgba(244, 246, 248, 0.12);
  --dark-hover: rgba(244, 246, 248, 0.08);
  --mark: #fff3c4;
  --mark-ink: #5c4500;
  --dot-demo: #b07d00;
  --dot-live: #6fbf8e;
  --error: #b42318;
  --error-press: #9a1d13;
  --error-tint: #fbe5e2;
  --success: #1f6b45;
  --success-tint: #dcebdf;
  --shadow-sm: 0 1px 2px rgba(18, 38, 58, 0.06), 0 4px 12px -4px rgba(18, 38, 58, 0.08);
  --shadow-lift: 0 2px 4px rgba(18, 38, 58, 0.05), 0 24px 40px -20px rgba(18, 38, 58, 0.22);
  --shadow-float: 0 8px 28px -12px rgba(18, 38, 58, 0.28);

  /* Schrift: nur Geist, feste Stufen (Werkzeug, kein fluides Wachsen) */
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-xs: 0.78rem;   /* 12.5px */
  --fs-sm: 0.84rem;   /* 13.5px */
  --fs-base: 0.94rem; /* 15px */
  --fs-md: 1.06rem;   /* 17px */
  --fs-lg: 1.25rem;   /* 20px */
  --fs-xl: 1.6rem;    /* 25.6px */
  --fs-2xl: 2rem;     /* 32px */

  /* Abstand */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --rail-w: 236px;

  /* Form */
  --r-card: 20px;
  --r-plate: 12px;
  --r-input: 12px;
  --r-pill: 999px;

  /* Bewegung */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --t-press: 160ms;
  --t-ui: 220ms;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--fs-base); line-height: 1.5;
  font-feature-settings: "ss01", "cv11"; -webkit-font-smoothing: antialiased;
  caret-color: var(--accent);
  scrollbar-color: rgba(18, 38, 58, 0.25) transparent;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 650; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: var(--fs-2xl); line-height: 1.12; letter-spacing: -0.03em; }
h2 { font-size: var(--fs-lg); line-height: 1.25; }
h3 { font-size: var(--fs-md); line-height: 1.3; }
p, ul, ol { margin: 0; text-wrap: pretty; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-tint); color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.toast :focus-visible, .skip:focus-visible, .stage-empty :focus-visible, .stage-empty label:has(input:focus-visible) { outline-color: var(--on-dark); }
label.btn:has(input:focus-visible), label.drop:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.stagewrap:has(.rp-canvas:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.rail :focus-visible { outline-color: var(--on-dark); }
kbd { font: 600 0.72rem/1 var(--font); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); box-shadow: 0 1px 0 var(--line-strong); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.loading { padding: var(--s-7); color: var(--muted); }
.skip { position: absolute; left: var(--s-4); top: -100px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: var(--s-3) var(--s-4); border-radius: var(--r-pill); font-weight: 600; text-decoration: none; }
.skip:focus { top: var(--s-3); }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Gehäuse ---------- */
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.rail {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: var(--s-5);
  background: var(--midnight); color: var(--on-dark); padding: var(--s-5) var(--s-4) var(--s-4);
}
.rail-logo { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); padding: var(--s-1) var(--s-2); text-decoration: none; color: inherit; border-radius: var(--r-plate); }
.rail-logo img { width: 168px; height: auto; }
.rail-tag { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.02em; color: var(--on-dark-muted); border: 1px solid var(--dark-line); border-radius: var(--r-pill); padding: 2px 10px; margin-left: 46px; }
.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.rail-nav a {
  display: flex; align-items: center; gap: var(--s-3); min-height: 42px; padding: 0 var(--s-3); border-radius: var(--r-plate);
  color: var(--on-dark-muted); text-decoration: none; font-weight: 550; transition: background-color var(--t-press) var(--ease-out), color var(--t-press) var(--ease-out);
}
.rail-nav a .count { margin-left: auto; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; color: var(--on-dark-muted); }
.rail-nav a[aria-current="page"] { background: rgba(244, 246, 248, 0.1); color: var(--on-dark); }
.rail-nav a[aria-current="page"] .i { color: var(--on-dark-accent); }
.rail-nav .count { background: var(--dark-line); color: var(--on-dark); }
.rail-recent { display: flex; flex-direction: column; gap: 2px; margin-top: var(--s-2); }
.rail-recent p { font-size: var(--fs-xs); color: var(--on-dark-muted); padding: var(--s-2) var(--s-3) var(--s-1); }
.rail-recent a { min-height: 36px; font-size: var(--fs-sm); font-weight: 500; }
.rail-recent a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--on-dark-muted); }
.rail-dot.st-demo { background: var(--mark); }
.rail-dot.st-live { background: var(--dot-live); }
.rail-foot { margin-top: auto; font-size: var(--fs-xs); color: var(--on-dark-muted); padding: var(--s-3); border-top: 1px solid var(--dark-line); display: grid; gap: var(--s-2); }
.rail-foot a { color: var(--on-dark); }
.meter { height: 4px; border-radius: var(--r-pill); background: var(--dark-line); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--brand-orange); border-radius: inherit; min-width: 3px; }

.main { min-width: 0; outline: none; }
.page { max-width: 1240px; margin: 0 auto; padding: var(--s-6) clamp(16px, 3vw, 40px) var(--s-8); }
.page-wide { max-width: 1720px; }

@media (hover: hover) and (pointer: fine) {
  .rail-nav a:hover:not([aria-current="page"]) { background: var(--dark-hover); color: var(--on-dark); }
}

/* ---------- Bausteine ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: 40px; padding: 0 var(--s-4); border-radius: var(--r-pill); border: 1px solid var(--line-strong);
  background: var(--paper); color: var(--ink); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background-color var(--t-press) var(--ease-out), border-color var(--t-press) var(--ease-out), transform var(--t-press) var(--ease-out), color var(--t-press) var(--ease-out);
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:active:not(:disabled) { background: var(--accent-press); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--error); border-color: rgba(180, 35, 24, 0.35); }
.btn.danger.solid { background: var(--error); border-color: var(--error); color: #fff; }
.btn.sm { height: 34px; padding: 0 var(--s-3); font-size: var(--fs-sm); }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 34px; }
.btn.busy { pointer-events: none; }
.btn.busy .i { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { border-color: rgba(18, 38, 58, 0.32); background: var(--surface); }
  .btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
  .btn.ghost:hover:not(:disabled) { background: var(--hover); border-color: transparent; }
  .btn.danger:hover:not(:disabled) { background: var(--error-tint); border-color: var(--error); }
  .btn.danger.solid:hover:not(:disabled) { background: var(--error-press); border-color: var(--error-press); }
}
.btn-group { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r-pill); background: var(--sage-soft); border: 1px solid var(--line); }
.btn-group .btn { border-color: transparent; background: transparent; height: 30px; }
.btn-group .btn.sm.icon { width: 30px; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-sm); }
.panel-pad { padding: var(--s-5); }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.panel-h h2 { white-space: nowrap; display: flex; align-items: center; gap: var(--s-2); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--sage); color: var(--ink); font-size: 0.72rem; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.hint { font-size: var(--fs-sm); color: var(--muted); max-width: 75ch; }
.help { font-size: var(--fs-xs); color: var(--muted); margin-top: var(--s-1); max-width: 75ch; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; flex: none; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.st-draft { background: var(--sage-soft); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.st-demo { background: var(--mark); color: var(--mark-ink); }
.st-live { background: var(--success-tint); color: var(--success); }

/* Segmente (Status, Werkzeuge, Filter) */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-pill); background: var(--sage); border: 0; margin: 0; min-width: 0; }
.seg legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.seg label, .seg button {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 var(--s-3);
  border-radius: var(--r-pill); border: 0; background: transparent; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background-color var(--t-press) var(--ease-out), color var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out);
}
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label:has(input:checked), .seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 1px; }
.seg .count { background: rgba(18, 38, 58, 0.08); color: inherit; }
.seg [aria-pressed="true"] .count { background: var(--sage); }
.seg kbd { padding: 2px 5px; font-size: 0.68rem; box-shadow: none; background: transparent; color: inherit; }
@media (hover: hover) and (pointer: fine) {
  .seg label:hover:not(:has(input:checked)), .seg button:hover:not([aria-pressed="true"]) { color: var(--ink); background: rgba(255, 255, 255, 0.45); }
}
.st-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.st-dot.st-draft { background: var(--muted); box-shadow: none; }
.st-dot.st-demo { background: var(--dot-demo); }
.st-dot.st-live { background: var(--success); }

/* Formulare */
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-4) var(--s-4); }
.f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f.wide { grid-column: 1 / -1; }
.f label, .f .lab { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.f .opt { font-weight: 450; color: var(--muted); }
.input, .f input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), .f select, .f textarea, .search input, select.input {
  width: 100%; min-height: 42px; border: 1px solid var(--line-strong); background: var(--paper); border-radius: var(--r-input);
  padding: 9px 12px; font-size: var(--fs-base); color: var(--ink);
  transition: border-color var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out);
}
.f textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.f select, select.input { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f5468' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; cursor: pointer; }
:is(.input, .f input, .f select, .f textarea, .search input):focus { outline: none; border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft); }
:is(.input, .f input, .f select, .f textarea, .search input):focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.f [aria-invalid="true"] { border-color: var(--error) !important; box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.14) !important; }
.f .err { font-size: var(--fs-xs); color: var(--error); font-weight: 550; }
.f .err:empty { display: none; }
::placeholder { color: var(--muted); opacity: 1; }
.colorrow { display: flex; gap: var(--s-2); align-items: center; }
.colorrow input[type="color"] { width: 46px; height: 42px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--r-input); background: var(--paper); cursor: pointer; flex: none; }
.colorrow input[type="text"] { font-variant-numeric: tabular-nums; text-transform: lowercase; }
.check { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-2) 0; cursor: pointer; font-size: var(--fs-base); color: var(--ink); }
.check.f { flex-direction: row; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.check small { display: block; color: var(--muted); font-size: var(--fs-xs); }

/* Dialog */
dialog { border: 0; border-radius: var(--r-card); padding: 0; background: var(--paper); color: var(--text); width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); box-shadow: var(--shadow-lift); }
dialog::backdrop { background: rgba(18, 38, 58, 0.5); }
dialog[open] { animation: dlg-in var(--t-ui) var(--ease-out); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.dlg { padding: var(--s-5); display: grid; gap: var(--s-4); }
.dlg h2 { font-size: var(--fs-xl); letter-spacing: -0.03em; }
.dlg .lead { color: var(--muted); margin-top: calc(var(--s-3) * -1); }
.dlg-foot { display: flex; justify-content: flex-end; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-2); }

/* Meldungen */
.toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: var(--s-2); align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: var(--s-3); background: var(--midnight); color: var(--on-dark); padding: 10px 10px 10px 16px; border-radius: 14px; font-size: var(--fs-sm); font-weight: 550; box-shadow: var(--shadow-float); pointer-events: auto; animation: toast-in var(--t-ui) var(--ease-out); }
.toast:not(:has(button)) { padding-right: 16px; }
.toast.bad { background: var(--error); color: #fff; }
.toast button { border: 0; background: rgba(244, 246, 248, 0.14); color: var(--on-dark-accent); font-weight: 650; font-size: var(--fs-sm); height: 32px; padding: 0 12px; border-radius: var(--r-pill); cursor: pointer; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.banner { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-plate); background: var(--mark); color: var(--mark-ink); font-size: var(--fs-sm); font-weight: 550; margin-bottom: var(--s-5); }
.banner a { color: inherit; font-weight: 650; margin-left: auto; white-space: nowrap; }

/* ---------- Seitenkopf ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5); }
.page-head .sub { color: var(--muted); margin-top: var(--s-1); max-width: 70ch; }

/* ---------- Übersicht ---------- */
.dash-bar { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; margin-bottom: var(--s-5); }
.search { position: relative; flex: 1 1 240px; max-width: 360px; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 38px; border-radius: var(--r-pill); }
.dash-bar .sp { flex: 1; }
.dash-bar select.input { width: auto; min-height: 40px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--s-5); }
.pcard { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; color: inherit; text-decoration: none; box-shadow: var(--shadow-sm); transition: transform var(--t-ui) var(--ease-out), box-shadow var(--t-ui) var(--ease-out); }
.pcard-media { position: relative; aspect-ratio: 2 / 1; background: var(--midnight); overflow: hidden; }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; }
.pcard-media .pill { position: absolute; left: var(--s-3); top: var(--s-3); box-shadow: var(--shadow-sm); }
.ph360 { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-2); color: var(--on-dark-muted); font-size: var(--fs-sm); }
.ph360 .i { width: 30px; height: 30px; color: var(--brand-orange); }
.pcard-body { padding: var(--s-4) var(--s-4) var(--s-4); display: grid; gap: 4px; }
.pcard-body h2 { font-size: var(--fs-md); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-sub { color: var(--muted); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-foot { display: grid; gap: 2px; margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted); }
.pcard-foot .next { color: var(--ink); font-weight: 550; font-size: var(--fs-sm); }
.pcard-foot .next.done { color: var(--success); }
@media (hover: hover) and (pointer: fine) {
  .pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
}

.ptable-wrap { overflow-x: auto; }
.ptable { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.ptable th { text-align: left; font-weight: 600; color: var(--muted); font-size: var(--fs-xs); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); white-space: nowrap; }
.ptable td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.ptable tr:last-child td { border-bottom: 0; }
.ptable td.num { font-variant-numeric: tabular-nums; }
.ptable .cl { display: flex; align-items: center; gap: var(--s-3); min-width: 220px; }
.ptable .cl img, .ptable .cl .noimg { width: 64px; height: 32px; border-radius: 6px; object-fit: cover; background: var(--midnight); flex: none; }
.ptable .cl a { color: var(--ink); font-weight: 600; text-decoration: none; }
.ptable .cl a::after { content: ""; position: absolute; inset: 0; }
.ptable tbody tr { position: relative; }
@media (hover: hover) and (pointer: fine) { .ptable tbody tr:hover { background: var(--surface); } .ptable .cl a:hover { text-decoration: underline; } }

.empty { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-6); align-items: center; padding: var(--s-6); }
.empty h2 { font-size: var(--fs-xl); letter-spacing: -0.03em; }
.empty > div > p { color: var(--muted); margin-top: var(--s-2); max-width: 48ch; }
.steps { list-style: none; padding: 0; margin: var(--s-5) 0; display: grid; gap: var(--s-3); counter-reset: st; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 32px 1fr; gap: var(--s-3); align-items: start; }
.steps li::before { content: counter(st); width: 32px; height: 32px; border-radius: 50%; background: var(--sage); color: var(--ink); font-weight: 650; display: grid; place-items: center; font-size: var(--fs-sm); }
.steps strong { display: block; color: var(--ink); }
.steps span { color: var(--muted); font-size: var(--fs-sm); }
.peep { border-radius: clamp(24px, 4vw, 48px); padding: 8px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lift); }
.peep img { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; border-radius: calc(clamp(24px, 4vw, 48px) - 8px); }
.peep + figcaption { font-size: var(--fs-xs); color: var(--muted); margin-top: var(--s-2); text-align: right; }
.row-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }

/* ---------- Projekt ---------- */
.crumbs { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--s-2); }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 550; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.phead-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.ptitle { min-width: 0; }
.ptitle h1 { overflow-wrap: anywhere; }
.ptitle p { color: var(--muted); margin-top: var(--s-1); }
.pact { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.savestate { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); margin-right: var(--s-2); white-space: nowrap; }
.savestate .i { width: 15px; height: 15px; color: var(--success); }
.savestate[data-busy="1"] .i { color: var(--muted); }
.savestate[data-state="offline"], .savestate[data-state="auth"] { color: var(--mark-ink); background: var(--mark); padding: 4px 10px; border-radius: var(--r-pill); font-weight: 600; white-space: normal; }
.savestate[data-state="offline"] .i, .savestate[data-state="auth"] .i { color: var(--mark-ink); }
.tabs { display: flex; gap: var(--s-1); margin-top: var(--s-5); border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: none; }
.tabs a {
  position: relative; display: inline-flex; align-items: center; gap: var(--s-2); height: 46px; padding: 0 var(--s-3);
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; border-radius: 10px 10px 0 0;
  transition: color var(--t-press) var(--ease-out);
}
.tabs a::after { content: ""; position: absolute; left: var(--s-3); right: var(--s-3); bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transition: transform var(--t-ui) var(--ease-out); }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"]::after { transform: scaleX(1); }
.tabs a .warn { width: 7px; height: 7px; border-radius: 50%; background: var(--dot-demo); }
@media (hover: hover) and (pointer: fine) { .tabs a:hover { color: var(--ink); background: var(--hover); } }
.tabbody { padding-top: var(--s-5); }

/* ---------- Editor ---------- */
.ed { display: grid; grid-template-columns: 284px minmax(0, 1fr) 320px; gap: var(--s-4); align-items: start; }
.ed-side { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); position: sticky; top: var(--s-4); max-height: calc(100dvh - 32px); overflow: auto; scrollbar-width: thin; }
.ed-main { min-width: 0; display: flex; flex-direction: column; gap: var(--s-3); }

.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: var(--s-4) var(--s-3);
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-plate); background: var(--surface); cursor: pointer;
  transition: border-color var(--t-press) var(--ease-out), background-color var(--t-press) var(--ease-out);
}
.drop .i { width: 22px; height: 22px; color: var(--brand-orange); margin-bottom: var(--s-1); }
.drop strong { color: var(--ink); font-size: var(--fs-sm); }
.drop span { color: var(--muted); font-size: var(--fs-xs); }
.drop.over, .drop:focus-within { border-color: var(--accent); background: var(--accent-tint); }
.drop-lg { padding: var(--s-8) var(--s-5); }
.drop-lg .i { width: 30px; height: 30px; }
@media (hover: hover) and (pointer: fine) { .drop:hover { border-color: var(--accent); background: var(--sage-soft); } }

.uploads { display: grid; gap: var(--s-2); }
.upi { display: grid; gap: 6px; padding: var(--s-2) var(--s-3); border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-xs); }
.upi-row { display: flex; justify-content: space-between; gap: var(--s-2); }
.upi-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 550; }
.upi-row span:last-child { color: var(--muted); white-space: nowrap; }
.upi .bar { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.upi .bar span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 400ms var(--ease-out); }
.upi.ok .upi-row span:last-child { color: var(--success); font-weight: 600; }
.upi.bad { background: var(--error-tint); border-color: rgba(180, 35, 24, 0.25); }
.upi.bad .upi-row span:last-child, .upi .why { color: var(--error); font-weight: 550; }

.slist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sitem { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr); align-items: center; gap: 6px; padding: 4px 4px 4px 2px; border-radius: var(--r-plate); transition: background-color var(--t-press) var(--ease-out); }
.sitem .grip { color: var(--muted); opacity: 0.5; cursor: grab; display: flex; }
.sitem .grip .i { width: 14px; height: 14px; }
.sitem-main { display: flex; align-items: center; gap: var(--s-3); min-width: 0; padding: 4px; border: 0; background: transparent; border-radius: 10px; text-align: left; cursor: pointer; }
.sthumb { width: 72px; height: 36px; border-radius: 7px; overflow: hidden; background: var(--midnight); flex: none; }
.sthumb img { width: 100%; height: 100%; object-fit: cover; }
.sname { min-width: 0; display: grid; }
.sname strong { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sname small { font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sname small b { color: var(--on-tint); font-weight: 650; }
.sname small em { font-style: normal; color: var(--mark-ink); background: var(--mark); padding: 0 5px; border-radius: 4px; }
.sitem.on { background: var(--accent-tint); }
.sitem.on .sthumb { box-shadow: 0 0 0 2px var(--accent); }
.sitem.dragging { opacity: 0.4; }
.sitem.drop-before::before, .sitem.drop-after::after { content: ""; position: absolute; left: 8px; right: 8px; height: 2px; background: var(--accent); border-radius: 2px; }
.sitem.drop-before::before { top: -2px; }
.sitem.drop-after::after { bottom: -2px; }
.sbtns { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; gap: 0; padding: 2px; border-radius: 11px; background: var(--paper); box-shadow: var(--shadow-sm); opacity: 0; pointer-events: none; transition: opacity var(--t-press) var(--ease-out); }
.sitem:hover .sbtns, .sitem:has(:focus-visible) .sbtns { opacity: 1; pointer-events: auto; }
@media (hover: none) {
  .sitem { grid-template-columns: 14px minmax(0, 1fr) auto; }
  .sbtns { position: static; transform: none; opacity: 1; pointer-events: auto; background: none; box-shadow: none; }
}
.ib { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 9px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: background-color var(--t-press) var(--ease-out), color var(--t-press) var(--ease-out); }
.ib .i { width: 17px; height: 17px; }
.ib.on { color: var(--accent); }
.ib.on .i { fill: currentColor; }
@media (hover: hover) and (pointer: fine) {
  .sitem:hover:not(.on) { background: var(--hover); }
  .ib:hover { background: var(--hover); color: var(--ink); }
  .ib.del:hover { color: var(--error); }
}

.toolbar { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.toolbar .sp { flex: 1; }
.stagewrap { position: relative; border-radius: var(--r-card); overflow: hidden; background: var(--midnight); height: clamp(380px, calc(100dvh - 370px), 820px); box-shadow: var(--shadow-lift); isolation: isolate; }
.stage { position: absolute; inset: 0; --rp-accent: var(--accent); --rp-on-accent: var(--on-accent); }
.stage[data-tool="link"] .rp-canvas, .stage[data-tool="info"] .rp-canvas { cursor: crosshair; }
.stage .rp-hs { cursor: grab; touch-action: none; }
.stage[data-tool="link"]:has(.rp-canvas:focus-visible)::after, .stage[data-tool="info"]:has(.rp-canvas:focus-visible)::after { content: ""; position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; border: 2px solid var(--on-dark); box-shadow: 0 0 0 2px var(--brand-orange); pointer-events: none; }
.stage .rp-hs.dragging { cursor: grabbing; transform: translate(-50%, -50%) scale(1.1); }
.stage .rp-hs.sel { box-shadow: 0 0 0 4px var(--brand-orange), 0 0 0 7px rgba(12, 27, 43, 0.55); }
.st-chip { position: absolute; display: inline-flex; align-items: center; gap: var(--s-2); background: rgba(18, 38, 58, 0.72); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--on-dark); border-radius: var(--r-pill); padding: 7px 14px; font-size: var(--fs-sm); font-weight: 600; pointer-events: none; }
.st-name { left: var(--s-4); top: var(--s-4); max-width: calc(100% - 140px); }
.st-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-name small { color: var(--on-dark-muted); font-weight: 500; }
.compass { position: absolute; right: var(--s-4); top: var(--s-4); display: flex; align-items: center; gap: var(--s-2); padding: 5px 12px 5px 5px; }
.compass svg { width: 30px; height: 30px; }
.compass span { font-variant-numeric: tabular-nums; min-width: 4ch; text-align: right; }
.toolhint { position: absolute; left: 50%; bottom: var(--s-4); transform: translateX(-50%); background: var(--paper); color: var(--ink); font-weight: 600; font-size: var(--fs-sm); border-radius: var(--r-pill); padding: 8px 16px; white-space: nowrap; box-shadow: var(--shadow-float); pointer-events: none; }
.stage-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-2); text-align: center; color: var(--on-dark-muted); padding: var(--s-5); }
.stage-empty h2 { color: var(--on-dark); }
.stage-empty p { max-width: 44ch; }
.stage-empty .btn { margin-top: var(--s-3); }
.stage-load { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(100deg, rgba(244, 246, 248, 0) 30%, rgba(244, 246, 248, 0.06) 50%, rgba(244, 246, 248, 0) 70%) var(--midnight); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; color: var(--on-dark-muted); font-size: var(--fs-sm); font-weight: 550; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.kbd-hint { font-size: var(--fs-xs); color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px var(--s-4); }
.kbd-hint span { display: inline-flex; align-items: center; gap: 6px; }
.kbd-hint a { color: var(--ink); font-weight: 600; }

.ed-insp { padding: var(--s-4) var(--s-4) var(--s-5); display: grid; gap: var(--s-5); position: sticky; top: var(--s-4); max-height: calc(100dvh - 32px); overflow: auto; scrollbar-width: thin; }
.insp-sec { display: grid; gap: var(--s-3); }
.insp-sec + .insp-sec { padding-top: var(--s-5); border-top: 1px solid var(--line); }
.insp-sec h2 { font-size: var(--fs-md); display: flex; align-items: center; gap: var(--s-2); }
.insp-sec h2 .i { color: var(--brand-orange); }
.insp-sec h3 { font-size: var(--fs-sm); display: flex; align-items: center; gap: var(--s-2); }
.insp-sec > p { font-size: var(--fs-sm); color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: var(--s-3); font-size: var(--fs-sm); color: var(--muted); }
.kv strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.back-link { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 4px 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; justify-self: start; }
.back-link .i { width: 16px; height: 16px; }
.back-link:hover { color: var(--ink); }
.hlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hlist button { width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: var(--s-3); padding: 6px; border: 0; background: transparent; border-radius: 10px; text-align: left; cursor: pointer; }
.hlist .hic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--midnight); color: var(--on-dark); }
.hlist .hic.info { background: var(--sage); color: var(--ink); }
.hlist .hic .i { width: 16px; height: 16px; }
.hlist strong { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hlist small { display: block; font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .hlist button:hover { background: var(--hover); } }
.charcount { font-size: var(--fs-xs); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.note { font-size: var(--fs-sm); color: var(--mark-ink); background: var(--mark); border-radius: 10px; padding: var(--s-2) var(--s-3); }

/* ---------- Grundriss ---------- */
.plan { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-4); align-items: start; }
.plan-main { padding: var(--s-4); display: grid; gap: var(--s-3); }
.plan-stage { border-radius: var(--r-plate); background: var(--surface); border: 1px solid var(--line); padding: var(--s-3); }
.plan-fit { position: relative; width: min(100%, calc((100dvh - 320px) * var(--ar))); aspect-ratio: var(--ar); margin: 0 auto; cursor: crosshair; }
.plan-fit img { width: 100%; height: 100%; border-radius: 6px; -webkit-user-drag: none; user-select: none; }
.plan-pin { position: absolute; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid var(--paper); background: var(--midnight); color: var(--on-dark); font-size: var(--fs-xs); font-weight: 650; font-variant-numeric: tabular-nums; display: grid; place-items: center; cursor: grab; box-shadow: var(--shadow-float); padding: 0; touch-action: none; }
.plan-pin.on { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-float); width: 36px; height: 36px; }
.plan-pin.dragging { cursor: grabbing; }
.plan-side { padding: var(--s-4); display: grid; gap: var(--s-3); position: sticky; top: var(--s-4); }
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.plist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-1); border-radius: var(--r-plate); }
.plist li.on { background: var(--accent-tint); }
.plist .sitem-main small.set { color: var(--success); font-weight: 600; }

/* ---------- Projektdaten ---------- */
.data { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); align-items: start; }
.fsec { padding: var(--s-5); display: grid; gap: var(--s-4); }
.fsec.full { grid-column: 1 / -1; }
.fsec-h p { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s-1); max-width: 60ch; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, auto); grid-auto-flow: column; gap: 0 var(--s-6); counter-reset: ck; }
.checks li { counter-increment: ck; }
.checks .check > span::before { content: counter(ck) ". "; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .checks { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; } }
.fsec.danger { border-color: rgba(180, 35, 24, 0.25); background: linear-gradient(var(--paper), var(--paper)) padding-box; }
.fsec.danger .row-actions { justify-content: space-between; }
.bookprev { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); border-radius: var(--r-plate); background: var(--midnight); }
.bookprev .rp-btn { position: static; pointer-events: none; }
.bookprev small { color: var(--on-dark-muted); font-size: var(--fs-xs); }

/* ---------- Veröffentlichen ---------- */
.pub { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.pub .fsec + .fsec { margin-top: 0; }
.pub-col { display: grid; gap: var(--s-4); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.checklist li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: var(--s-3); align-items: start; padding: var(--s-2) 0; font-size: var(--fs-sm); color: var(--ink); }
.checklist li + li { border-top: 1px solid var(--line); }
.checklist .ci { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.checklist .ci .i { width: 15px; height: 15px; stroke-width: 2.4; }
.checklist .ok .ci { background: var(--success-tint); color: var(--success); }
.checklist .warn .ci { background: var(--mark); color: var(--mark-ink); }
.checklist .fail .ci { background: var(--error-tint); color: var(--error); }
.checklist .info .ci { background: var(--sage); color: var(--ink); }
.checklist small { display: block; color: var(--muted); font-size: var(--fs-xs); margin-top: 2px; }
.checklist a { font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; align-self: center; }
.choice { display: grid; gap: var(--s-2); border: 0; margin: 0; padding: 0; min-width: 0; }
h1[tabindex="-1"]:focus { outline: none; }
.choice label { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: var(--s-3); padding: var(--s-3) var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--r-plate); cursor: pointer; transition: border-color var(--t-press) var(--ease-out), background-color var(--t-press) var(--ease-out); }
.choice input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.choice strong { display: block; color: var(--ink); font-size: var(--fs-sm); }
.choice span { color: var(--muted); font-size: var(--fs-xs); }
.gate { background: var(--mark); color: var(--mark-ink); border-radius: var(--r-plate); padding: var(--s-3) var(--s-4); font-weight: 550; }
.gate small { color: var(--mark-ink); opacity: 0.85; }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); box-shadow: 0 0 0 1px var(--accent); }
.f textarea.code, .code { font: 500 0.8rem/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--midnight); color: var(--on-dark); border-radius: var(--r-plate); padding: var(--s-3) var(--s-4); white-space: pre-wrap; word-break: break-all; min-height: 0; border: 0; width: 100%; resize: none; }
.box { background: var(--sage-soft); border-radius: var(--r-plate); padding: var(--s-3) var(--s-4); font-size: var(--fs-sm); color: var(--text); }
.box strong { color: var(--ink); }
.progress { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 200ms linear; }

.pubstate { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; font-size: var(--fs-sm); color: var(--muted); }
.more { border-top: 1px solid var(--line); padding-top: var(--s-3); display: grid; gap: var(--s-3); }
.more summary { cursor: pointer; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); list-style-position: inside; }
.more[open] summary { margin-bottom: var(--s-1); }
.sub-h { font-size: var(--fs-sm); margin-top: var(--s-2); }
.gprog { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: var(--fs-sm); color: var(--muted); }
.gprog li.ok { color: var(--success); }
.gprog li.fail { color: var(--error); }
.btn.ghost.danger { border-color: transparent; }

/* ---------- Sicherung & Anleitung ---------- */
.stack { display: grid; gap: var(--s-4); max-width: 860px; }
.stack .fsec h2 { font-size: var(--fs-lg); }
.usage { display: grid; gap: var(--s-2); }
.usage .meter { height: 8px; background: var(--sage); }
.usage .meter span { background: var(--accent); }
.usage p { font-size: var(--fs-sm); color: var(--muted); }
.prose { display: grid; gap: var(--s-3); max-width: 70ch; }
.prose ul, .prose ol { padding-left: 1.2em; display: grid; gap: var(--s-2); }
.prose li::marker { color: var(--brand-orange); }
.keys { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.keys td { padding: var(--s-2) 0; border-bottom: 1px solid var(--line); }
.keys td:first-child { width: 40%; white-space: nowrap; }
.keys tr:last-child td { border-bottom: 0; }

/* ---------- Anmeldung ---------- */
body[data-view="login"] .rail { display: none; }
body[data-view="login"] .app { grid-template-columns: 1fr; }
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--s-5) var(--s-4); }
.login-card { width: min(420px, 100%); padding: var(--s-6); display: grid; gap: var(--s-5); }
.login-logo { width: 190px; height: auto; }
.login-card h1 { font-size: var(--fs-xl); }
.login-form { display: grid; gap: var(--s-4); }
.login-form .btn { width: 100%; height: 44px; }
.dlg .login-form { margin-top: var(--s-2); }

/* ---------- Vorschau (Rundgang wie beim Gast) ---------- */
.preview { position: fixed; inset: 0; z-index: 70; background: var(--midnight); }

/* ---------- Responsiv ---------- */
@media (min-width: 961px) and (max-width: 1599px) {
  /* Im Projekt braucht die Bühne die Breite: Leiste klappt auf Symbole zusammen */
  body[data-view="project"] { --rail-w: 76px; }
  body[data-view="project"] .rail { padding-inline: 12px; align-items: center; }
  body[data-view="project"] .rail-logo { padding: 0; }
  body[data-view="project"] .rail-logo img { width: 44px; height: 44px; object-fit: cover; object-position: left center; }
  body[data-view="project"] .rail-tag, body[data-view="project"] .rail-nav .lbl, body[data-view="project"] .rail-nav .count,
  body[data-view="project"] .rail-recent, body[data-view="project"] .rail-foot { display: none; }
  body[data-view="project"] .rail-nav a { width: 48px; justify-content: center; padding: 0; }
  body[data-view="project"] .page-wide { padding-inline: 24px; }
  .ed { grid-template-columns: 260px minmax(0, 1fr) 300px; }
}
@media (max-width: 1199px) {
  .ed { grid-template-columns: 260px minmax(0, 1fr); }
  .ed-insp { grid-column: 2; position: static; max-height: none; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .ed-insp .insp-sec + .insp-sec { padding-top: 0; border-top: 0; }
}
@media (max-width: 1080px) {
  .pub, .data { grid-template-columns: 1fr; }
  .plan { grid-template-columns: 1fr; }
  .plan-side { position: static; }
}
@media (max-width: 960px) {
  :root { --rail-w: 0px; }
  .app { grid-template-columns: 1fr; }
  .rail { position: sticky; top: 0; z-index: 40; height: auto; flex-direction: row; align-items: center; gap: var(--s-3); padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); overflow-x: auto; scrollbar-width: none; }
  .rail-logo { flex-direction: row; align-items: center; padding: 0; flex: none; }
  .rail-logo img { width: 128px; }
  .rail-tag { margin-left: 0; }
  .rail-nav { flex-direction: row; margin-left: auto; }
  .rail-nav a { min-height: 40px; padding: 0 var(--s-3); white-space: nowrap; }
  .rail-nav a .lbl-long, .rail-recent, .rail-foot { display: none; }
  .ed { grid-template-columns: 1fr; }
  .ed-main { order: -1; }
  .ed-side { position: static; max-height: none; }
  .ed-insp { grid-column: auto; }
  .stagewrap { height: min(62vh, 520px); }
  .empty { grid-template-columns: 1fr; padding: var(--s-5); }
  .page { padding-top: var(--s-5); }
}
@media (max-width: 600px) {
  h1 { font-size: var(--fs-xl); }
  .rail-nav a .lbl { display: none; }
  .rail-nav a { width: 44px; justify-content: center; padding: 0; }
  .rail-nav a .count { display: none; }
  .pact { width: 100%; }
  .pact .seg { width: 100%; }
  .pact .seg label { flex: 1; justify-content: center; padding: 0 6px; }
  .savestate { width: 100%; }
  .toolbar .seg button .lbl { display: none; }
  .toolbar .seg kbd { display: none; }
  .kbd-hint { display: none; }
  .dash-bar .search { max-width: none; flex-basis: 100%; }
  .dash-bar > .seg:first-child { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .toolbar .btn-group { display: none; }
  .grid { grid-template-columns: 1fr; }
  .fsec, .panel-pad { padding: var(--s-4); }
  .st-name { max-width: calc(100% - 120px); }
}
@media (pointer: coarse) {
  .btn, .btn.sm, .btn-group .btn { height: 44px; }
  .plan-pin { width: 44px; height: 44px; }
  .btn.icon, .btn.sm.icon { width: 44px; }
  .ib { width: 40px; height: 40px; }
  .rail-nav a { min-height: 44px; }
  .rail-logo { min-height: 44px; }
  .seg label, .seg button { height: 40px; }
}
.tabs .short { display: none; }
@media (max-width: 600px) { .tabs .long { display: none; } .tabs .short { display: inline; } .tabs a { padding: 0 var(--s-2); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
