/* Studio — light, calm admin. One accent (indigo); green/amber/red only mean
   success / hint / error-or-delete. All inputs are white. See docs/DESIGN.md.
   No build step; vanilla CSS. */

:root {
  --s-primary: #4f46e5;
  --s-primary-hover: #4338ca;
  --s-primary-tint: rgba(79, 70, 229, .08);
  --s-danger: #dc2626;
  --s-danger-hover: #b91c1c;
  --s-danger-bg: #fef2f2;
  --s-danger-line: #fecaca;
  --s-input-border: #d5d9e4;
  --s-ink: #0f172a;
  --s-text: #334155;
  --s-muted: #64748b;
  --s-faint: #94a3b8;
  --s-border: #e2e8f0;
  --s-line: #eef2f6;
  --s-bg: #f6f7fb;
  --s-card: #ffffff;
  --s-ok: #16a34a;
  --s-ok-ink: #15803d;
  --s-ok-bg: #dcfce7;
  --s-warn: #f59e0b;
  --s-warn-ink: #b45309;
  --s-warn-bg: #fef3c7;
  --s-radius: 12px;
  --s-radius-sm: 8px;
  --s-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  --s-shadow-md: 0 12px 32px rgba(15, 23, 42, .10);
  --s-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --s-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --s-sidebar-w: 248px;
}

* { box-sizing: border-box; }

html, body { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--s-font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--s-ink);
  background: var(--s-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--s-primary); text-decoration: none; }
a:hover { color: var(--s-primary-hover); }

h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.01em; }

code { font-family: var(--s-mono); font-size: .85em; }

/* ---------- App shell ---------- */

.s-layout { display: flex; min-height: 100vh; }
body.flush-page { overflow: hidden; }
body.flush-page .s-layout { height: 100vh; min-height: 0; overflow: hidden; }

.s-side {
  width: var(--s-sidebar-w);
  flex: none;
  background: var(--s-card);
  border-right: 1px solid var(--s-border);
  display: flex;
  flex-direction: column;
  padding: 18px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.s-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 20px 20px;
  font-size: 16px;
  font-weight: 800;
  color: var(--s-ink);
}
.s-brand .mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--s-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: -.3px;
}
.s-brand .sub { color: var(--s-faint); font-weight: 600; }
/* sidebar: logo (or mark) on top, name below; collapsible to an icon rail */
.s-brand.s-brand-stack { flex-direction: column; align-items: flex-start; gap: 8px; }
.s-brand-stack .brand-logo { display: block; max-height: 44px; max-width: 190px; width: auto; height: auto; object-fit: contain; }
.s-brand-stack .name { font-size: 15px; line-height: 1.2; }
.logo-preview { margin-bottom: 16px; padding: 16px; border: 1px dashed var(--s-border); border-radius: var(--s-radius-sm); background: #f8fafc; }
.logo-preview img { display: block; max-height: 64px; max-width: 100%; }
@media (min-width: 901px) {
  .s-side { transition: width .18s ease; overflow-x: hidden; }
  .s-layout.s-collapsed { --s-sidebar-w: 72px; }
  .s-collapsed .s-brand.s-brand-stack { align-items: center; padding: 4px 8px 16px; }
  .s-collapsed .s-brand-stack .name { display: none; }
  .s-collapsed .s-brand-stack .brand-logo { max-width: 48px; max-height: 40px; }
  .s-collapsed .s-nav a { font-size: 0; gap: 0; justify-content: center; margin: 2px 10px; padding: 11px 0; }
  .s-collapsed .s-nav .sep { margin: 8px 16px; }
  .s-collapsed .s-nav-h { font-size: 0; height: 1px; background: var(--s-line); margin: 10px 16px; }
  .s-collapsed .s-side-foot { flex-direction: column; justify-content: center; padding: 12px 0 2px; gap: 8px; }
  .s-collapsed .s-side-foot .who { display: none; }
}

.s-nav { display: flex; flex-direction: column; }
.s-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 12px;
  padding: 10px 12px;
  border-radius: var(--s-radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--s-text);
}
.s-nav a svg { flex: none; }
.s-nav a:hover { background: var(--s-line); color: var(--s-ink); }
.s-nav a.active { color: var(--s-primary); background: var(--s-primary-tint); }
.s-nav .sep { height: 1px; background: var(--s-line); margin: 10px 20px; }
.s-nav-h { margin: 16px 20px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--s-faint, #94a3b8); }

.s-side-foot {
  margin-top: auto;
  padding: 14px 16px 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--s-line);
}
.s-avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  background: var(--s-ink);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.s-side-foot .who { flex: 1; min-width: 0; }
.s-side-foot .who .n { font-size: 13px; font-weight: 700; color: var(--s-ink); }
.s-side-foot .who .r { font-size: 11px; color: var(--s-faint); }
.s-side-foot button {
  background: none; border: 0; padding: 4px; cursor: pointer;
  color: var(--s-faint); display: inline-flex;
}
.s-side-foot button:hover { color: var(--s-primary); }

.s-body { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.s-top {
  height: 58px;
  flex: none;
  background: var(--s-card);
  border-bottom: 1px solid var(--s-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.s-crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--s-faint); }
.s-crumb .cur { color: var(--s-text); font-weight: 600; }
.s-crumb .sl { color: #cbd5e1; }
.s-top-actions { display: flex; align-items: center; gap: 16px; }
.s-top-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: 0; background: none; color: var(--s-faint); cursor: pointer; text-decoration: none; }
.s-top-btn.has-label { width: auto; padding: 0 12px; border-radius: 999px; gap: 6px; font-size: 13px; font-weight: 600; }
.s-top-btn.has-label .lbl { white-space: nowrap; }
@media (max-width: 760px) { .s-top-btn.has-label { width: 34px; padding: 0; } .s-top-btn.has-label .lbl { display: none; } }
a.s-top-btn:hover { background: var(--s-bg, #f1f5f9); color: var(--s-primary); }
.s-top-btn:disabled { cursor: default; opacity: .7; }
.s-top-badge { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box; border-radius: 9px; background: #dc2626; color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; }

.s-main { flex: 1; padding: 28px 32px; max-width: 1200px; width: 100%; }
.s-main.wide { max-width: none; }
.s-main.flush { padding: 0; max-width: none; display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.s-main.flush > .messages { margin: 12px 28px 0; flex: none; }

.s-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.s-page-head h1 { font-size: 22px; }
.s-page-head p { margin: 4px 0 0; font-size: 13px; color: var(--s-muted); }
.s-page-head .tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Cards ---------- */

.s-card {
  background: var(--s-card);
  border: 1px solid var(--s-border);
  border-radius: var(--s-radius);
  box-shadow: var(--s-shadow);
  padding: 20px;
}
.s-card + .s-card { margin-top: 16px; }
.s-card h2 { font-size: 14px; font-weight: 700; margin-bottom: 14px; }

.s-grid { display: grid; gap: 16px; }
.s-grid.cols-2 { grid-template-columns: 1.5fr 1fr; }
.s-grid.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.s-stat { padding: 17px 20px; }
.s-stat .top { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--s-muted); }
.s-stat .n { font-size: 29px; font-weight: 800; margin-top: 8px; letter-spacing: -.02em; color: var(--s-ink); }
.s-stat .l { font-size: 11px; color: var(--s-faint); margin-top: 2px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: var(--s-radius-sm);
  border: 1px solid var(--s-border);
  background: var(--s-card);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--s-ink);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: #cbd5e1; color: var(--s-ink); text-decoration: none; }
.btn svg { flex: none; }
.btn-primary { background: var(--s-primary); border-color: var(--s-primary); color: #fff; }
.btn-primary:hover { background: var(--s-primary-hover); border-color: var(--s-primary-hover); color: #fff; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--s-line); border-color: transparent; }
.btn-danger { color: var(--s-danger); border-color: var(--s-danger-line); }
.btn-danger:hover { background: var(--s-danger-bg); border-color: #fca5a5; color: var(--s-danger-hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Segmented toggle ---------- */

.seg { display: inline-flex; padding: 3px; background: var(--s-line); border-radius: var(--s-radius-sm); }
.seg a, .seg button, .seg span {
  padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 700;
  color: var(--s-muted); border: 0; background: none; cursor: pointer; font-family: inherit;
}
.seg .on, .seg a.active { background: var(--s-card); color: var(--s-ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }

/* ---------- Tables ---------- */

.s-table { width: 100%; border-collapse: collapse; }
.s-table th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--s-faint); padding: 0 16px 10px;
}
.s-table td { padding: 13px 16px; font-size: 13px; border-top: 1px solid var(--s-line); color: var(--s-text); }
.s-table tr:hover td { background: #fafbfc; }
.s-table .strong { font-weight: 600; color: var(--s-ink); }
.s-table .right { text-align: right; }
.s-table .muted { color: var(--s-faint); }

/* ---------- Badges / status ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
}
.badge.published, .badge.pub { background: var(--s-ok-bg); color: var(--s-ok-ink); }
.badge.draft { background: var(--s-warn-bg); color: var(--s-warn-ink); }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; display: inline-block; }
.dot.pub { background: var(--s-ok); }
.dot.draft { background: var(--s-warn); }

.status-line { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.status-line.pub { color: var(--s-ok-ink); }
.status-line.draft { color: var(--s-warn-ink); }

.chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 6px; background: var(--s-line); color: var(--s-muted);
  font-size: 11px; font-weight: 600;
}

/* ---------- Forms ---------- */

.s-form label,
.s-label { display: block; font-size: 12px; font-weight: 700; color: var(--s-text); margin: 14px 0 6px; }
.s-form label:first-child { margin-top: 0; }

.s-form input[type=text], .s-form input[type=url], .s-form input[type=email],
.s-form input[type=password], .s-form input[type=number], .s-form input[type=date], .s-form textarea, .s-form select,
.s-field {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--s-input-border);
  border-radius: var(--s-radius-sm);
  font: inherit;
  font-size: 13px;
  background: #fff;
  color: var(--s-ink);
}
.s-form input:focus, .s-form textarea:focus, .s-form select:focus, .s-field:focus {
  outline: none;
  border-color: var(--s-primary);
  box-shadow: 0 0 0 3px var(--s-primary-tint);
}
.s-form textarea { min-height: 72px; resize: vertical; }
/* Bestätigung mit Passwort/Code (Offene Änderungen, außerhalb von .s-form): Beschriftung über dem Feld */
.s-confirm-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--s-text); }
.s-confirm-field .s-field { width: 260px; max-width: 100%; }

.s-form input:disabled, .s-form select:disabled { background: #fff; color: var(--s-faint); }

.s-form input[type=file] {
  font-size: 12px; color: var(--s-muted); padding: 7px 8px; width: 100%;
  border: 1px dashed var(--s-border); border-radius: var(--s-radius-sm); background: var(--s-bg);
}
.s-form input[type=file]::file-selector-button {
  font: inherit; font-weight: 600; font-size: 12px; margin-right: 10px;
  padding: 6px 12px; border-radius: 6px; border: 1px solid var(--s-border);
  background: var(--s-card); color: var(--s-ink); cursor: pointer;
}
.s-form input[type=file]::file-selector-button:hover { border-color: #cbd5e1; }

.s-form .help,
.field-help { color: var(--s-faint); font-size: 12px; margin-top: 5px; }
.s-form .errorlist, ul.errorlist {
  color: var(--s-danger); font-size: 12px; margin: 5px 0 0; padding-left: 1rem; list-style: disc;
}

.s-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.s-form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }

.s-form-actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.s-fieldrow { margin-bottom: 14px; }
.s-fieldrow:last-child { margin-bottom: 0; }
.s-fieldrow > label:first-child { margin-top: 0; }
.s-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.s-tile { height: 64px; border: 2px solid transparent; border-radius: 10px; background: #e2e8f0; color: #0f172a; font-weight: 600; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; text-shadow: 0 1px 6px rgba(255,255,255,.6); }
.s-tiles .s-tile-dark { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.s-tiles .s-tile { display: flex; margin: 0; font-size: 13px; }
.s-tile:hover { filter: brightness(1.06); }
.s-tile.on { border-color: #4f46e5; box-shadow: 0 0 0 2px #fff inset; }
.s-fieldrow.has-error input, .s-fieldrow.has-error textarea, .s-fieldrow.has-error select { border-color: var(--s-danger); }

/* toggle switch — the checkbox is visually hidden but sits over the track for
   clicks; .track and .knob are real elements so it renders the same everywhere. */
.s-form label.s-switch,
.s-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; }
.s-switch > input {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 40px; height: 22px; margin: 0; opacity: 0; cursor: pointer; z-index: 1;
}
.s-switch .track {
  flex: none; width: 40px; height: 22px; border-radius: 999px;
  background: var(--s-border); position: relative; transition: background .15s;
}
.s-switch .knob {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .25); transition: transform .15s;
}
.s-switch > input:checked ~ .track { background: var(--s-primary); }
.s-switch > input:checked ~ .track .knob { transform: translateX(18px); }
.s-switch .switch-label { font-size: 13px; font-weight: 600; color: var(--s-text); white-space: nowrap; }
.s-switch.wrap { align-items: flex-start; }
.s-switch.wrap .switch-label { white-space: normal; }

/* ---------- Messages ---------- */

.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li {
  padding: 11px 14px; border-radius: var(--s-radius-sm); margin-bottom: 8px;
  border: 1px solid var(--s-border); background: var(--s-card); font-size: 13px;
}
.messages li.success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.messages li.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.messages li.warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* ---------- Login ---------- */

.s-login-wrap { display: flex; min-height: 100vh; }
.s-login-brand {
  position: relative; width: 46%; max-width: 620px; flex: none;
  background: var(--s-ink); overflow: hidden; padding: 64px;
  display: flex; flex-direction: column;
}
.s-login-brand .slash {
  position: absolute; inset: 0; background: var(--s-primary); opacity: .13;
  clip-path: polygon(0 0, 100% 0, 100% 64%, 0 100%);
}
.s-login-brand .glow {
  position: absolute; right: -140px; bottom: -140px; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle at 32% 32%, rgba(99, 102, 241, .4), transparent 70%);
}
.s-login-brand > * { position: relative; }
.s-login-brand .logo { display: flex; align-items: center; gap: 11px; font-size: 22px; font-weight: 800; color: #fff; }
.s-login-brand .logo .mark {
  width: 40px; height: 40px; border-radius: 11px; background: var(--s-primary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; letter-spacing: -.5px;
}
.s-login-brand .pitch { margin-top: auto; max-width: 400px; }
.s-login-brand .pitch h1 { font-size: 32px; line-height: 1.18; color: #fff; }
.s-login-brand .pitch p { font-size: 15px; line-height: 1.65; color: #cbd5e1; margin: 16px 0 0; }

.s-login-form { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }
.s-login-form .inner { width: 360px; }
.s-login-form h2 { font-size: 25px; }
.s-login-form .lede { font-size: 14px; color: var(--s-muted); margin: 6px 0 28px; }

@media (max-width: 820px) {
  .s-login-brand { display: none; }
}

/* ---------- Page tree ---------- */

.tree { padding: 10px; }
.tree-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.tree-search { flex: 1 1 240px; max-width: 380px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--s-border); border-radius: var(--s-radius-sm); background: var(--s-card); color: var(--s-faint); }
.tree-search input { flex: 1; border: 0; outline: 0; padding: 9px 0; font: inherit; background: none; color: var(--s-ink); min-width: 0; }
.tree-tools select { padding: 8px 10px; border: 1px solid var(--s-border); border-radius: var(--s-radius-sm); background: var(--s-card); font: inherit; color: var(--s-text); }
.tree-head, .tree-row {
  display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) 150px 130px 76px 124px; gap: 10px; align-items: center;
}
.tree-head {
  padding: 8px 14px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--s-faint);
}
.tree-row { padding: 8px 14px; min-height: 54px; border-radius: 9px; }
.tree-row[hidden] { display: none; }
.tree-row:hover { background: var(--s-bg); }
.tree.no-lang .tree-head, .tree.no-lang .tree-row { grid-template-columns: minmax(0, auto) minmax(0, 1fr) 150px 130px 124px; }
.tree.no-lang .c-lang { display: none; }
.tree-row .t-first { display: flex; align-items: center; min-width: 22px; }
.tree-row .tg { all: unset; cursor: pointer; width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--s-faint); }
.tree-row .tg:hover { background: var(--s-border); color: var(--s-ink); }
.tree-row .tg:focus-visible { outline: 2px solid var(--s-primary); }
.tree-row .tg.closed svg { transform: rotate(-90deg); }
.tree-row .tg-spacer { width: 22px; }
.tree-row .t-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tree-row .t-line { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.tree-row .t-title { color: var(--s-ink); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tree-row .t-count { flex: none; font-size: 11px; font-weight: 700; color: var(--s-faint); background: var(--s-bg); border: 1px solid var(--s-border); border-radius: 10px; padding: 0 7px; line-height: 17px; }
.tree-row .t-url { font-size: 11px; color: var(--s-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row .t-type { min-width: 0; }
.tree-row .t-type .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
.tree-row .row-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; opacity: 0; }
.tree-row:hover .row-actions, .tree-row:focus-within .row-actions { opacity: 1; }
@media (max-width: 900px) { .tree-row .row-actions { opacity: 1; } .tree-head .c-lang, .tree-row .c-lang, .tree-row .t-type { display: none; } .tree-head, .tree-row, .tree.no-lang .tree-head, .tree.no-lang .tree-row { grid-template-columns: minmax(0, auto) minmax(0, 1fr) 110px 100px; } .tree-head span:nth-child(3) { display: none; } }
.icon-btn {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--s-border);
  background: var(--s-card); display: inline-flex; align-items: center; justify-content: center;
  color: var(--s-muted); cursor: pointer;
}
.icon-btn:hover { border-color: #cbd5e1; color: var(--s-ink); }
.icon-btn.form { padding: 0; }
.icon-btn form { display: contents; }

/* ---------- Type picker ---------- */

.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.type-card { display: block; padding: 18px; border: 1px solid var(--s-border); border-radius: var(--s-radius); background: var(--s-card); box-shadow: var(--s-shadow); }
.type-card:hover { border-color: var(--s-primary); text-decoration: none; }
.type-card .name { font-size: 14px; font-weight: 800; color: var(--s-ink); }
.type-card .desc { font-size: 12px; color: var(--s-muted); margin-top: 4px; }

/* ---------- Page editor (split + live preview) ---------- */

.editor { flex: 1; display: flex; flex-direction: column; min-height: 0; height: 100%; }
.editor-single { flex: 1; display: flex; min-height: 0; overflow-y: auto; }

.editor-form {
  width: 100%; max-width: 780px; margin: 0 auto; flex: none;
  overflow-y: auto; min-height: 0;
}
.editor-form-inner { padding: 18px 20px 40px; }

.editor-head { padding: 4px 2px 16px; }
.editor-head .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.editor-head .row + .row { margin-top: 10px; }

.fgroup { border: 1px solid var(--s-border); border-radius: 10px; background: var(--s-card); margin-bottom: 12px; overflow: hidden; }
.fgroup > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 14px; cursor: pointer; list-style: none; user-select: none;
}
.fgroup > summary::-webkit-details-marker { display: none; }
.fgroup > summary .t { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; color: var(--s-ink); }
.fgroup > summary .caret { color: #cbd5e1; transition: transform .15s; }
.fgroup[open] > summary .caret { transform: rotate(90deg); }
.fgroup > summary .count { font-size: 11px; color: var(--s-faint); }
.fgroup .fgroup-body { padding: 0 14px 16px; }

/* ---------- Navigation editor (drag card lists) ---------- */
.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; }

.nav-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--s-border); }
.nav-tab {
  background: none; border: 0; padding: 9px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
  color: var(--s-muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.nav-tab.on { color: var(--s-primary); border-bottom-color: var(--s-primary); }

.menu-editor { margin-bottom: 8px; }
.sortlist { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.sortcard {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--s-border); border-radius: var(--s-radius-sm); background: var(--s-card);
  padding: 12px; margin: 0;
}
.sortcard.has-error { border-color: #f3b4b4; }
.sortcard.sortable-ghost { opacity: .4; }
.drag-handle {
  flex: none; width: 30px; height: 30px; border: 0; background: var(--s-line); border-radius: 6px;
  cursor: grab; color: var(--s-faint); font-size: 15px; line-height: 1;
}
.drag-handle:focus-visible { outline: 2px solid var(--s-primary); outline-offset: 2px; }
.drag-handle:active { cursor: grabbing; }
.sc-body { flex: 1; min-width: 0; }
.sc-foot { display: flex; align-items: center; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.mi-del { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #b91c1c; cursor: pointer; margin-left: auto; }
.mi-target[hidden] { display: none; }

/* ---------- Section builder (flexible content) ---------- */
.section-builder { border: 1px dashed var(--s-border); border-radius: var(--s-radius-sm); padding: 12px; background: var(--s-bg); }
.sb-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.sb-section { border: 1px solid var(--s-border); border-radius: var(--s-radius-sm); background: var(--s-card); padding: 0; margin: 0; display: block; }
.sb-section.sortable-ghost { opacity: .4; }
.sb-section-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--s-line); }
.sb-section-title { flex: 1; font-size: 13px; }
.sb-section-tools { display: flex; gap: 4px; }
.sb-section-body { padding: 12px 14px 16px; }
.sb-section-body[hidden] { display: none; }
.sb-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 8px; border-top: 1px solid var(--s-line); }
.sb-add-label { font-size: 12px; font-weight: 700; color: var(--s-muted); margin-right: 4px; }
.sb-list-field { margin: 10px 0; }
.sb-list-label { font-size: 12px; font-weight: 700; color: var(--s-text); margin-bottom: 6px; }
.sb-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.sb-row { padding: 10px; }
.s-fieldrow-check { flex-direction: row; align-items: center; gap: 8px; }

.save-bar {
  height: 62px; flex: none; background: var(--s-card); border-top: 1px solid var(--s-border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.save-bar .state { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--s-muted); }
.save-bar .state .ok { color: var(--s-ok); display: inline-flex; }
.save-bar .actions { display: flex; align-items: center; gap: 10px; }

/* ---------- Rich text (TinyMCE) ---------- */

.s-form .tox-tinymce { border: 1px solid var(--s-border); border-radius: var(--s-radius-sm); }
.s-form .tox .tox-toolbar__primary { background: #fbfcfe; }
.s-form textarea.js-richtext { min-height: 220px; }

/* ---------- Asset picker ---------- */

.asset-picker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px; border: 1px solid var(--s-border); border-radius: var(--s-radius-sm); }
.asset-preview { max-height: 52px; border-radius: 6px; border: 1px solid var(--s-border); display: block; }
.asset-preview-slot:empty::after { content: attr(data-empty); color: var(--s-faint); font-size: 12px; }
.asset-preview-slot { flex: 1; min-width: 0; font-size: 12px; color: var(--s-muted); }

#asset-modal {
  border: 1px solid var(--s-border); border-radius: 14px; padding: 0;
  width: min(760px, 94vw); box-shadow: 0 30px 70px rgba(15, 23, 42, .35);
}
#asset-modal::backdrop { background: rgba(15, 23, 42, .42); }
.asset-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px; border-bottom: 1px solid var(--s-line); margin: 0;
}
.asset-modal-head strong { font-size: 15px; font-weight: 700; }
.asset-modal-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px; padding: 16px; max-height: 60vh; overflow: auto;
}
.asset-cell {
  border: 1px solid var(--s-border); border-radius: 10px; background: var(--s-card);
  padding: 0; cursor: pointer; overflow: hidden; font: inherit; text-align: left;
}
.asset-cell:hover { border-color: var(--s-primary); }
.asset-cell img { width: 100%; height: 96px; object-fit: cover; display: block; background: var(--s-line); }
.asset-cell span { display: block; padding: 8px 10px; font-size: 11px; font-weight: 600; }

.asset-modal-bar { display: flex; align-items: center; gap: 10px; padding: 8px 18px; border-bottom: 1px solid var(--s-line); font-size: 12px; color: var(--s-muted); }
.asset-modal-bar:empty { display: none; }
.asset-modal-bar .err { color: #b91c1c; }
#asset-modal.drag { outline: 3px dashed var(--s-primary); outline-offset: -8px; }
.asset-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 12px; padding: 24px 8px; text-align: center; color: var(--s-muted); }

/* ---------- Media library ---------- */

.dropzone {
  border: 1.5px dashed #cbd5e1; border-radius: var(--s-radius); background: var(--s-card);
  padding: 22px; display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--s-muted); font-size: 13px; text-align: center;
}
.dropzone.drag { border-color: var(--s-primary); background: var(--s-primary-tint); }

/* ---------- Inline formsets (product gallery + documents) ---------- */
.fs-drop {
  display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed #cbd5e1; border-radius: var(--s-radius-sm); background: var(--s-card);
  padding: 16px; margin-bottom: 12px; cursor: pointer;
  color: var(--s-muted); font-size: 13px; text-align: center; transition: border-color .15s, background .15s;
}
.fs-drop:hover { border-color: var(--s-primary); }
.fs-drop.drag { border-color: var(--s-primary); background: var(--s-primary-tint); }
.fs-add { margin-top: 4px; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.media-grid figure { margin: 0; border: 1px solid var(--s-border); border-radius: 10px; overflow: hidden; background: var(--s-card); }
.media-grid img { width: 100%; height: 118px; object-fit: cover; display: block; background: var(--s-line); }
.media-grid figcaption { padding: 8px 10px; font-size: 11px; }
.media-grid figcaption .fn { font-weight: 600; color: var(--s-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-grid figcaption .dim { color: var(--s-faint); }
.media-grid figcaption .acts { margin-top: 6px; display: flex; gap: 8px; }

/* ---------- Catalogue (master / detail) ---------- */

.cat-page { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 24px 28px; }
.cat-page-head { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }

.cat-split { flex: 1; display: flex; gap: 18px; min-height: 0; }
.cat-list {
  width: 380px; flex: none; background: var(--s-card); border: 1px solid var(--s-border);
  border-radius: var(--s-radius); box-shadow: var(--s-shadow); display: flex; flex-direction: column;
  overflow: hidden; min-height: 0;
}
.cat-list-head { flex: none; padding: 14px 14px 12px; border-bottom: 1px solid var(--s-line); display: flex; flex-direction: column; gap: 10px; }
.cat-list-body { flex: 1; padding: 8px; overflow-y: auto; min-height: 0; }
.prow { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; }
.prow:hover { background: var(--s-bg); }
.prow.on { background: var(--s-primary-tint); box-shadow: inset 3px 0 0 var(--s-primary); }
.prow .thumb {
  width: 36px; height: 36px; flex: none; border-radius: 8px; object-fit: cover;
  background: linear-gradient(135deg, #0f172a, #334155);
}
.prow .info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.prow .info .n { display: block; font-size: 13px; font-weight: 600; color: var(--s-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .info .c { display: block; font-size: 11px; color: var(--s-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .status-line { flex: none; font-size: 11px; }

.cat-detail {
  flex: 1 1 auto; min-width: 0; background: var(--s-card); border: 1px solid var(--s-border);
  border-radius: var(--s-radius); box-shadow: var(--s-shadow); display: flex; flex-direction: column;
  overflow: hidden; min-height: 0;
}
.cat-detail .body { flex: 1; overflow-y: auto; padding: 20px 24px; min-height: 0; }
.cat-detail .foot { flex: none; border-top: 1px solid var(--s-line); padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; }
.cat-photo { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.cat-photo img, .cat-photo .ph {
  width: 96px; height: 96px; flex: none; border-radius: 10px; object-fit: cover;
  background: linear-gradient(135deg, #0f172a, #334155);
}
.section-rule { display: flex; align-items: center; gap: 10px; margin: 20px 0 12px; }
.section-rule .t { font-size: 13px; font-weight: 800; color: var(--s-ink); }
.section-rule .l { flex: 1; height: 1px; background: var(--s-line); }

/* ---------- Settings hub ---------- */

.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.settings-card { display: block; padding: 18px; border: 1px solid var(--s-border); border-radius: var(--s-radius); background: var(--s-card); box-shadow: var(--s-shadow); }
.settings-card:hover { border-color: var(--s-primary); text-decoration: none; }
.settings-card .ico { width: 36px; height: 36px; border-radius: 9px; background: var(--s-primary-tint); color: var(--s-primary); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.settings-card .name { font-size: 14px; font-weight: 800; color: var(--s-ink); }
.settings-card .desc { font-size: 12px; color: var(--s-muted); margin-top: 4px; }

/* ---------- Utilities ---------- */

.muted { color: var(--s-muted); }
.faint { color: var(--s-faint); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.hr { height: 1px; background: var(--s-line); border: 0; margin: 0; }
.empty { padding: 40px; text-align: center; color: var(--s-muted); font-size: 13px; }

/* ---------- Responsive ---------- */

.s-side-toggle { display: inline-flex; }
@media (max-width: 900px) {
  .s-side {
    position: fixed; z-index: 60; left: 0; top: 0; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: var(--s-shadow-md);
  }
  .s-side.open { transform: translateX(0); }
  .s-side-toggle { display: inline-flex; }
  .cat-split { flex-direction: column; }
  .cat-list { width: 100%; max-height: 320px; }
  .s-grid.cols-2, .s-grid.stats { grid-template-columns: 1fr; }
}

/* ---------- Media library: filter, detail, file tiles ---------- */

.media-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.media-search {
  flex: 1 1 260px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border: 1px solid var(--s-border); border-radius: var(--s-radius-sm); background: var(--s-card); color: var(--s-faint);
}
.media-search input { flex: 1; border: 0; outline: 0; padding: 9px 0; font: inherit; background: none; color: var(--s-ink); }
.media-thumb { display: block; }
.media-grid .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.chip.warn { background: var(--s-warn-bg); color: var(--s-warn-ink); }
.asset-file {
  display: flex; align-items: center; justify-content: center; height: 118px;
  background: var(--s-line); color: var(--s-muted); font-weight: 800; font-size: 15px; letter-spacing: .06em;
}
.asset-cell .asset-file { height: 96px; }
.asset-file.big { height: 180px; border-radius: 8px; font-size: 22px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 20px; font-size: 13px; color: var(--s-muted); }
.media-detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.media-detail .s-card + .s-card { margin-top: 16px; }
.media-detail-img { display: block; max-width: 100%; max-height: 380px; margin: 0 auto 14px; border-radius: 8px; border: 1px solid var(--s-border); }
.media-facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 0; font-size: 13px; }
.media-facts dt { font-weight: 700; color: var(--s-muted); }
.media-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.usage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.usage-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.asset-modal-head { gap: 12px; }
.asset-modal-head input[type=search] {
  flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--s-border);
  border-radius: var(--s-radius-sm); font: inherit;
}
@media (max-width: 860px) { .media-detail { grid-template-columns: 1fr; } }

/* ---------- Folded blocks in the catalog forms (translations: _languages.html, rarely changed fields: _advanced.html) ---------- */

.lang-fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.lang-fold > summary::-webkit-details-marker { display: none; }
.lang-fold > summary .t { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 700; color: var(--s-ink); }
.lang-fold > summary svg { color: #cbd5e1; transition: transform .15s; }
.lang-fold[open] > summary svg { transform: rotate(90deg); }
.lang-fold .langs { display: flex; gap: 12px; font-size: 12px; font-weight: 600; }
.lang-fold .langs .ok { color: #15803d; }
.lang-fold .lang-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--s-border); }
.lang-fold .lang-block h3 { margin: 0 0 10px; font-size: 13px; color: var(--s-muted); }

/* ---------- Live preview (own tab, studio/preview_window.html) ---------- */

body.pvw { display: flex; flex-direction: column; height: 100vh; margin: 0; background: #eef1f5; }
.pv-bar {
  flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--s-card); border-bottom: 1px solid var(--s-border);
}
.pv-bar .seg button { all: unset; cursor: pointer; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--s-muted); }
.pv-bar .seg button.active { background: var(--s-card); color: var(--s-ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.pv-status { flex: 1; font-size: 12px; color: var(--s-faint); text-align: right; }
.pv-status.bad { color: #b42318; font-weight: 600; }
.pvw-stage { flex: 1; min-height: 0; overflow: hidden; padding: 12px; display: flex; justify-content: center; }
.pvw-stage.gone iframe { filter: grayscale(1); opacity: .75; }
.pvw-stage iframe {
  flex: none; border: 0; background: #fff; transform-origin: top center;
  box-shadow: 0 4px 18px rgba(15, 23, 42, .12); border-radius: 6px;
}
#pv-toggle.active { border-color: var(--s-primary); color: var(--s-primary); background: var(--s-primary-tint); }
.pv-hint { font-size: 12px; color: #b42318; margin-right: 8px; }
.pv-scroll { display: flex; align-items: center; gap: 8px; }
.pv-scroll input[type=range] { width: 160px; }

/* ---------- Navigation editor: dropdown children, settings sections ---------- */

.mi-row.mi-child { margin-left: calc(var(--d, 1) * 28px + 8px); border-left: 3px solid var(--s-primary-tint); }
.s-form h2.s-form-section { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: var(--s-muted); margin: 26px 0 4px; padding-top: 16px; border-top: 1px solid var(--s-line); }
.s-form h2.s-form-section:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }

/* code-ish inputs: JSON-LD, inline HTML */
.s-form textarea.mono, .s-form textarea.mono-soft, .sb-row textarea.mono-soft {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.5;
}
.list-builder .sb-list-field { margin-top: 2px; }

/* code editor (Ace) — design files and page HTML */
.code-editor { width: 100%; border: 1px solid var(--s-border); border-radius: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.code-errors { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: #fef2f2; color: #991b1b; font-size: 13px; }
.code-errors li { margin: 2px 0 2px 16px; }
.design-list { display: grid; gap: 12px; }
.design-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; background: #fff; border: 1px solid var(--s-border); border-radius: 12px; }
.design-row .name { font-weight: 600; }
.design-row .desc { color: #64748b; font-size: 13px; margin-top: 2px; }
.design-versions { font-size: 13px; }
.design-versions td, .design-versions th { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--s-border); }

/* ---------- Webhooks ---------- */
.badge.err { background: var(--s-danger-bg); color: var(--s-danger-hover); }
.wh-url { font-size: 11px; font-weight: 400; word-break: break-all; }
.wh-events { display: grid; gap: 6px; }
.wh-events label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.wh-events code, .wh-facts code { font-size: 11px; color: var(--s-faint); }
.wh-secret { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.wh-secret input { flex: 1; height: 36px; padding: 0 10px; border: 1px solid var(--s-line); border-radius: 8px; background: #f8fafc; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.wh-facts th { width: 150px; text-align: left; padding: 10px 16px; vertical-align: top; }
.wh-pre {
  background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 8px;
  font-size: 12px; line-height: 1.5; overflow: auto; max-height: 520px; white-space: pre-wrap; word-break: break-word;
}
.s-form-actions form { display: inline; margin: 0; }

/* ---------- Vorlagen ---------- */
.lib-sub { margin-top: 28px; }
.lib-sub h2 { margin: 0; font-size: 18px; }
.lib-key { font-size: 11px; font-weight: 400; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.lib-empty { margin: 0; padding: 20px; }
.lib-label { display: block; font-size: 13px; font-weight: 700; color: var(--s-ink); margin: 16px 0 6px; }
.lib-usage { margin: 8px 0 0; font-size: 12px; color: var(--s-warn-ink); background: var(--s-warn-bg); padding: 6px 10px; border-radius: 6px; }
.lib-actions { display: flex; gap: 8px; margin-top: 16px; }
.lib-checks { display: grid; gap: 8px; }
.lib-checks label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.lib-checks .lib-all { font-weight: 700; padding-bottom: 6px; border-bottom: 1px solid var(--s-line); }
.code-insert { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.code-insert select { max-width: 280px; height: 30px; font-size: 12px; }
.code-insert .hint { font-size: 12px; color: var(--s-faint); }
.code-fields .lbl, .code-fields-ask .lbl { font-size: 12px; font-weight: 650; color: var(--s-muted, #64748b); }
.code-fields-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; padding: 8px 10px; border-radius: 10px; background: #eef2ff; }
.code-fields-ask[hidden] { display: none; }
.code-fields-ask input { flex: 1 1 220px; max-width: 360px; height: 30px; }
.code-fields-msg { margin: 0 0 8px; min-height: 0; }
.code-fields-msg:empty { display: none; }
.code-fields-msg.bad { color: #b45309; background: #fef3c7; padding: 6px 10px; border-radius: 8px; }
.s-switch.lib-switch { display: flex; width: fit-content; margin-bottom: 10px; }
.lib-select { height: 32px; padding: 0 8px; border: 1px solid var(--s-border); border-radius: 8px; background: #fff; font-size: 13px; color: var(--s-ink); }

/* ---------- Einwilligung ---------- */
.cs-summary { display: flex; flex-wrap: wrap; gap: 28px; }
.cs-summary > div { display: grid; gap: 2px; }
.cs-summary span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.cs-warn { background: var(--s-warn-bg); color: var(--s-warn-ink); border-color: transparent; max-width: 720px; margin-bottom: 16px; }
.wh-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.lib-cat { display: flex; flex-direction: column; align-items: flex-start; }

/* ---------- Einrichtungsassistent ---------- */
.wz-form { overflow-y: auto; }
.wz-form .inner { max-width: 460px; padding: 40px 0; }
.wz-h { font-size: 14px; margin: 22px 0 10px; color: var(--s-ink); }
.wz-page { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 10px; cursor: pointer; }
.wz-page input { margin-top: 3px; }
.wz-page .muted { font-weight: 400; }
.wz-lang { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 8px; padding: 8px 10px; border: 1px solid var(--s-border); border-radius: var(--s-radius-sm); }
.wz-lang .check { margin: 0; font-size: 13px; }

/* ---------- Weiterleitungen ---------- */
.rd-search { margin: 0 0 12px; display: flex; gap: 8px; align-items: center; }
.rd-pages { margin-top: 12px; display: flex; gap: 10px; align-items: center; font-size: 13px; }

/* ---------- White-Label ---------- */
.s-brand .brand-logo { max-height: 34px; max-width: 180px; display: block; }
.s-login-brand .logo .brand-logo { max-height: 44px; max-width: 240px; display: block; }

/* ---------- Zwei-Faktor ---------- */
.mfa-setup { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.mfa-qr svg { width: 200px; height: 200px; display: block; }
.mfa-steps { padding-left: 18px; line-height: 1.7; margin-top: 0; }
.mfa-secret { font-size: 12px; word-break: break-all; }
.mfa-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; list-style: none; padding: 0; font-size: 16px; }
.s-side-foot a.who { color: inherit; text-decoration: none; }
@media print { .s-side, .s-top, .s-form-actions { display: none !important; } }

/* ---------- Page editor, one writing surface (PageType.editor == "single") ---------- */

.editor-form.wide { max-width: 1240px; container-type: inline-size; }
.ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@container (max-width: 860px) { .ed-grid { grid-template-columns: minmax(0, 1fr); } }
.ed-title {
  display: block; width: 100%; box-sizing: border-box; font-size: 26px; font-weight: 800; padding: 8px 4px;
  border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; outline: none;
  color: var(--s-ink);
}
.s-form input.ed-title { width: 100%; font-size: 26px; font-weight: 800; padding: 8px 4px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; box-shadow: none; }
.s-form input.ed-title:focus { border-bottom-color: var(--s-primary); box-shadow: none; }
.ed-link { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 12.5px; color: var(--s-muted); margin: 0 4px 14px; }
.ed-link .pre { white-space: nowrap; }
.s-form input.ed-slug { width: 200px; height: 28px; padding: 2px 8px; font-size: 12.5px; border-radius: 6px; }
.ed-card { border-radius: 12px; }
.ed-foot { font-size: 12px; color: var(--s-muted); margin: 14px 4px 0; }
.ed-foot a { color: var(--s-primary); font-weight: 600; }
.ed-side .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.side-box { border: 1px solid var(--s-border); border-radius: 12px; background: var(--s-card); margin-bottom: 12px; padding: 14px 16px; }
.side-box h4 { margin: 0 0 10px; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--s-muted); }
.side-box .hint { font-size: 11.5px; color: var(--s-muted); margin: 8px 0 0; line-height: 1.45; }
.side-box .vlink { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #64748b; }
.side-box.fold > summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; font-weight: 700; font-size: 13px; }
.side-box.fold > summary::-webkit-details-marker { display: none; }
.side-box.fold[open] > summary { margin-bottom: 8px; }
.side-box.fold > summary .caret { color: var(--s-faint); display: inline-flex; transition: transform .15s; }
.side-box.fold[open] > summary .caret { transform: rotate(180deg); }
.side-box.tools { display: flex; gap: 8px; flex-wrap: wrap; border-style: dashed; }

/* new page: title + start choice */
.newpage { max-width: 1000px; }
.np-title { display: block; width: 100%; box-sizing: border-box; font-size: 22px; font-weight: 800; padding: 12px 14px; border: 1px solid var(--s-border); border-radius: 10px; }
.s-form input.np-title { font-size: 22px; font-weight: 800; padding: 12px 14px; }
.np-hint { font-size: 12.5px; color: var(--s-muted); margin: 8px 2px 0; }
.np-h { font-size: 13px; font-weight: 800; margin: 26px 0 10px; color: var(--s-ink); }
.tcard { position: relative; display: block; cursor: pointer; padding: 16px 18px; border: 2px solid var(--s-border); border-radius: 12px; background: var(--s-card); }
.tcard:hover { border-color: #cbd5e1; }
.tcard:has(input:checked) { border-color: var(--s-primary); box-shadow: 0 0 0 3px var(--s-primary-tint); }
.tcard input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.tcard .name { display: block; font-size: 14px; font-weight: 800; color: var(--s-ink); }
.tcard .desc { display: block; font-size: 12px; color: var(--s-muted); margin-top: 4px; }
.tcard .tag { position: absolute; top: 10px; right: 12px; font-size: 10.5px; font-weight: 700; color: var(--s-muted); background: var(--s-line); padding: 2px 8px; border-radius: 999px; }
.tcard .thumb { display: block; height: 54px; border-radius: 6px; margin-bottom: 10px; background: repeating-linear-gradient(#eef2f6 0 6px, #f8fafc 6px 12px); }
.tcard .thumb.blank { background: #fff; border: 1px dashed #cbd5e1; }
.newpage .type-grid { align-items: stretch; }
.ed-modebar { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.ed-card .code-editor { border-radius: 0 0 12px 12px; }
#ed-html-pane[hidden] { display: none; }
.side-box select { width: 100%; box-sizing: border-box; }

/* "Was möchtest du erstellen?" — two big cards, everything else below */
.start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; max-width: 760px; }
.start-card {
  display: block; padding: 22px 22px 20px; background: var(--s-card); border: 1px solid var(--s-border);
  border-radius: 14px; box-shadow: var(--s-shadow); text-decoration: none;
  transition: border-color .15s ease-out, box-shadow .15s ease-out, transform .15s ease-out;
}
.start-card:hover { border-color: var(--s-primary); box-shadow: 0 0 0 3px var(--s-primary-tint); text-decoration: none; transform: translateY(-1px); }
.start-card .ico { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 11px; background: var(--s-primary-tint); color: var(--s-primary); margin-bottom: 14px; }
.start-card .name { display: block; font-size: 16px; font-weight: 800; color: var(--s-ink); }
.start-card .desc { display: block; font-size: 13px; color: var(--s-muted); margin-top: 6px; line-height: 1.5; }
.start-more { margin-top: 28px; }
.start-more > summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--s-muted); margin-bottom: 12px; }
a.tcard { text-decoration: none; }
a.tcard:hover { border-color: var(--s-primary); text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .start-card { transition: none; } .start-card:hover { transform: none; } }
.ed-card.ed-list { padding: 16px 18px; margin-top: 12px; }
.settings-group { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--s-faint); margin: 26px 0 10px; }
.settings-group:first-of-type { margin-top: 6px; }

/* in-page editing (prototype) */
.inline-shell { height: calc(100vh - 57px - 64px); background: var(--s-bg); }
.inline-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }

/* Footer-Baukasten */
.fb-grid { display: grid; grid-template-columns: minmax(320px, 520px) 1fr; gap: 20px; align-items: start; padding-bottom: 80px; }
@media (max-width: 1100px) { .fb-grid { grid-template-columns: 1fr; } }
.fb-editor > .s-card { margin-bottom: 14px; }
.fb-h { font-size: 14px; font-weight: 800; margin: 0 0 10px; }
.fb-picker { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.fb-cell { width: 38px; height: 38px; border-radius: 8px; border: 1.5px solid var(--s-input-border); background: #fff; cursor: pointer;
  transition: background-color .15s ease-out, border-color .15s ease-out; }
.fb-cell.on { background: var(--s-primary-tint); border-color: var(--s-primary); }
.fb-cell.hover { background: rgba(79, 70, 229, .16); border-color: var(--s-primary); }
.fb-count { margin-left: 10px; font-size: 13px; font-weight: 700; color: var(--s-text); }
.fb-col-head { display: flex; justify-content: space-between; align-items: center; }
.fb-tools { display: inline-flex; gap: 4px; }
.fb-tools button { border: 1px solid var(--s-border); background: #fff; border-radius: 6px; width: 28px; height: 28px; cursor: pointer; color: var(--s-text); }
.fb-tools button:hover:not(:disabled) { border-color: var(--s-primary); color: var(--s-primary); }
.fb-tools button:disabled { opacity: .35; cursor: default; }
.fb-block { border: 1px solid var(--s-border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.fb-block-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.fb-block-body { margin-top: 8px; display: grid; gap: 8px; }
.fb-block-body input[type=text], .fb-block-body textarea, .fb-block-body select, .fb-add { width: 100%; box-sizing: border-box; background: #fff;
  border: 1px solid var(--s-input-border); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; }
.fb-check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; margin-right: 12px; }
.fb-note { font-size: 12.5px; margin: 0; }
.fb-preview { position: sticky; top: 12px; }
.fb-frame { margin-top: 10px; border: 1px solid var(--s-border); border-radius: 12px; background: #e9ecf4; padding: 12px; overflow-x: auto; }
.fb-frame iframe { display: block; margin: 0 auto; width: 100%; height: 480px; border: 0; background: #fff; border-radius: 8px; }
.s-form .fb-check { display: inline-flex; margin: 0 14px 0 0; font-weight: 600; }
.s-form .fb-block-body { margin-top: 8px; }

/* Kopfbereich: three arrangement cards with a tiny sketch */
.hb-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.hb-choice { text-align: left; padding: 12px; border: 1.5px solid var(--s-border); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--s-text);
  transition: border-color .15s ease-out, box-shadow .15s ease-out; display: grid; gap: 10px; }
.hb-choice:hover { border-color: var(--s-primary); }
.hb-choice.on { border-color: var(--s-primary); box-shadow: 0 0 0 3px var(--s-primary-tint); color: var(--s-ink); }
.hb-sketch { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px; background: var(--s-bg); border-radius: 8px; }
.hb-sketch i { display: block; height: 8px; border-radius: 4px; background: #c7cbe0; flex: 0 0 22px; }
.hb-sketch i:nth-child(1) { background: var(--s-primary); }
.hb-sketch.hb-left i:nth-child(2) { flex: 1; margin-left: auto; max-width: 40px; margin-left: auto; }
.hb-sketch.hb-left i:nth-child(2) { margin-left: auto; }
.hb-sketch.hb-middle i:nth-child(2) { margin: 0 auto; flex: 0 0 44px; }
.hb-sketch.hb-stacked { flex-wrap: wrap; justify-content: center; height: 40px; padding-top: 6px; }
.hb-sketch.hb-stacked i:nth-child(1) { flex: 0 0 34px; }
.hb-sketch.hb-stacked i:nth-child(2) { flex: 0 0 50px; }
.hb-sketch.hb-stacked i:nth-child(3) { display: none; }
.fb-editor .s-card .s-switch { display: flex; margin: 0 0 10px; }
.fb-editor .s-card .s-switch:last-child { margin-bottom: 0; }

/* media: selection, usage, delete confirmation */
.media-grid figure { position: relative; }
.media-grid .pick { position: absolute; top: 8px; left: 8px; z-index: 2; width: 24px; height: 24px; border-radius: 7px; background: rgba(255,255,255,.92); border: 1px solid var(--s-border); display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity .12s; }
.media-grid figure:hover .pick, .media-grid figure.picked .pick, .media-grid .pick:focus-within { opacity: 1; }
.media-grid figure.picked { outline: 2px solid var(--s-primary); outline-offset: -2px; border-radius: 10px; }
.bulk-bar { position: sticky; top: 66px; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 14px; background: var(--s-card); border: 1px solid var(--s-border); border-radius: 10px; box-shadow: var(--s-shadow-md); font-size: 13px; font-weight: 600; }
.bulk-bar[hidden] { display: none; }
.chip.use { text-decoration: none; background: var(--s-primary-tint); color: var(--s-primary); }
.chip.faint { opacity: .7; }
.use-row { margin: 6px 0; font-size: 13px; }
.use-more summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--s-primary); margin-top: 8px; }
.use-filter { width: 100%; margin: 8px 0; padding: 7px 10px; border: 1px solid var(--s-border); border-radius: var(--s-radius-sm); font: inherit; }
.use-scroll { max-height: 280px; overflow: auto; }
.usage-list li[hidden] { display: none; }
.del-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.del-list li { display: flex; gap: 12px; align-items: center; }
.del-thumb { flex: none; width: 52px; height: 52px; border-radius: 8px; background: var(--s-bg); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.del-thumb img { width: 100%; height: 100%; object-fit: cover; }
.del-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13px; }
.del-where { font-size: 12px; color: var(--s-faint); }

.s-top-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--s-primary); border: 2px solid var(--s-card); box-sizing: content-box; }
.s-top-dot[hidden] { display: none; }
.notes { max-width: 760px; display: grid; gap: 14px; }
.notes .note h3 { margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; }
.note-body { font-size: 14px; line-height: 1.55; color: var(--s-text); }
.note-body ul { margin: 6px 0 6px 18px; padding: 0; }
.note-body li { margin: 4px 0; }
.note-body p { margin: 6px 0; }
.note-body code { font-size: 12px; background: var(--s-bg); padding: 1px 5px; border-radius: 5px; }
.notes .note.current { border-color: var(--s-primary); }

/* AI drafts: before / after */
.s-diff { width: 100%; border-collapse: collapse; table-layout: fixed; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.s-diff th { text-align: left; font-weight: 600; padding: 6px 8px; font-family: inherit; opacity: .7; }
.s-diff td { padding: 1px 8px; vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; border: 0; }
.s-diff td.ln, .s-diff th.ln { width: 44px; text-align: right; opacity: .5; user-select: none; }
.s-diff tr.del .l, .s-diff tr.change .l { background: rgba(220, 38, 38, .16); }
.s-diff tr.add .r, .s-diff tr.change .r { background: rgba(22, 163, 74, .18); }
.s-diff tr.skip td { text-align: center; opacity: .6; background: rgba(128, 128, 128, .08); padding: 3px; }

/* Studio → Design → Effekte */
.fx-edit .fx-h { margin: 22px 0 10px; font-size: 15px; }
.fx-preview { position: relative; height: 240px; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; text-shadow: 0 1px 12px rgba(0,0,0,.45); }
.fx-preview > span { position: relative; z-index: 1; padding: 0 16px; text-align: center; }
.fx-colors { display: flex; flex-wrap: wrap; gap: 18px; }
.fx-color { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.fx-color input[type=color] { width: 64px; height: 40px; padding: 2px; border: 1px solid var(--line, #e2e8f0); border-radius: 8px; background: #fff; cursor: pointer; }
.fx-code { display: flex; gap: 10px; max-width: 520px; }
.fx-code input { flex: 1; font-family: ui-monospace, Menlo, monospace; }

/* Studio → Vorlagen → Neu: choose a starting point */
.lib-step { margin: 18px 0 10px; font-size: 15px; }
.lib-step:first-child { margin-top: 0; }
.lib-starters { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.lib-starters .lib-starter { position: relative; display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 12px 14px 12px 38px; border: 2px solid var(--line, #e2e8f0); border-radius: 12px; background: #fff; cursor: pointer; }
.lib-starter input { position: absolute; left: 13px; top: 15px; margin: 0; }
.lib-starter .t { font-weight: 650; font-size: 14px; }
.lib-starter .d { font-size: 12.5px; color: var(--s-muted, #64748b); }
.lib-starter:hover { border-color: #a5b4fc; }
.lib-starter:has(input:checked) { border-color: #4f46e5; background: #eef2ff; }

/* An empty list: one sentence, one button (studio/_empty.html) */
.s-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px 20px; text-align: center; color: var(--s-muted, #64748b); }
.s-empty p { margin: 0; max-width: 46em; }

/* TinyMCE dialogs with several buttons (building block: Entfernen, In eigenen Text umwandeln, Übernehmen) must not push a button out of the box */
.tox .tox-dialog__footer { flex-wrap: wrap; gap: 8px; }

/* Handbuch */
.manual { max-width: 820px; display: grid; gap: 14px; }
.man-note { margin: 0; padding: 10px 14px; font-size: 13px; }
.man-body { line-height: 1.6; }
.man-body h1 { margin: 0 0 12px; font-size: 24px; }
.man-body h2 { margin: 26px 0 8px; font-size: 19px; }
.man-body h3 { margin: 20px 0 6px; font-size: 16px; }
.man-body p, .man-body ul, .man-body ol, .man-body blockquote, .man-body figure { margin: 0 0 12px; }
.man-body ul, .man-body ol { padding-left: 22px; }
.man-body li { margin-bottom: 4px; }
.man-body img { max-width: 100%; height: auto; border: 1px solid var(--s-border, #e2e8f0); border-radius: 8px; }
.man-body figure figcaption { font-size: 12px; color: var(--s-faint); margin-top: 4px; }
.man-body blockquote { padding: 8px 14px; border-left: 3px solid var(--s-primary); background: var(--s-bg, #f1f5f9); border-radius: 0 8px 8px 0; }
.man-body code { font-size: .92em; padding: 1px 5px; border-radius: 4px; background: var(--s-bg, #f1f5f9); }
.man-body pre { overflow-x: auto; padding: 10px 14px; border-radius: 8px; background: var(--s-bg, #f1f5f9); }
.man-body pre code { padding: 0; background: none; }
.man-body hr { border: 0; border-top: 1px solid var(--s-border, #e2e8f0); margin: 20px 0; }
.man-table { overflow-x: auto; margin-bottom: 12px; }
.man-table table { border-collapse: collapse; width: 100%; font-size: 14px; }
.man-table th, .man-table td { text-align: left; vertical-align: top; padding: 6px 10px; border: 1px solid var(--s-border, #e2e8f0); }
.man-table th { background: var(--s-bg, #f1f5f9); }
.man-nav { display: flex; justify-content: space-between; gap: 12px; margin: 0; font-weight: 600; }

/* Aus HTML übernehmen */
.hi-notes { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.hi-notes .hi-warn { color: #92400e; }
.hi-h { margin: 14px 0 6px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.hi-marks { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 4px; }
.hi-picker { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--s-primary); border-radius: 10px; background: var(--s-bg, #f1f5f9); }
.hi-sug { display: grid; gap: 6px; }

/* Handyansicht (0.90.1): nichts darf die Seite breiter machen als den Bildschirm */
.s-switch .switch-label { white-space: normal; min-width: 0; overflow-wrap: anywhere; }
.s-switch { max-width: 100%; }
.s-card > .s-switch, .s-card > label.s-switch { display: flex; margin: 0 0 10px; }
.fb-editor, .fb-preview { min-width: 0; }
@media (max-width: 1100px) { .fb-grid { grid-template-columns: minmax(0, 1fr); } .fb-preview { position: static; } }
.s-crumb { min-width: 0; }
.s-crumb .cur { min-width: 0; }
@media (max-width: 760px) {
  .s-top { padding: 0 14px; gap: 8px; }
  .s-crumb { flex: 1 1 auto; overflow: hidden; }
  .s-crumb > *, .s-crumb .cur { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .s-top-actions { flex: none; gap: 4px; }
  .s-card:has(table) { overflow-x: auto; }
  .notes .note, .note-body, .note-body * { overflow-wrap: anywhere; min-width: 0; }
}
@media (max-width: 760px) { .actions, .s-form-actions { flex-wrap: wrap; } .actions .btn, .s-form-actions .btn { max-width: 100%; } }
.s-page-head p + .btn, .s-page-head p + .btn-sm { margin-top: 10px; }

/* Sprachauswahl (Anmeldeseite, Einrichtungsassistent): die gewählte Sprache ist hervorgehoben */
.s-lang-switch { margin: 0 0 16px; font-size: 13px; color: var(--s-faint); }
.s-lang-switch a { text-decoration: none; }
.s-lang-switch a:hover { text-decoration: underline; }
.s-lang-switch a.is-current { font-weight: 800; color: var(--s-text); }
