/* ------------------------------------------------------------------
   Formulare – Oberfläche (helles Apple-Design)
------------------------------------------------------------------ */

:root {
  --accent: #0071e3;
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #8e8e93;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sidebar: 248px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p  { margin: 0 0 10px; }

/* ---------- Ladezustand & Fehlerseite ---------- */

.app-loading { display: grid; place-items: center; min-height: 100vh; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fatal {
  max-width: 540px; margin: 15vh auto; padding: 28px;
  background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.fatal h1 { margin-bottom: 10px; }
.fatal .hint { color: var(--text-2); font-size: 13px; }
code { background: var(--line-soft); padding: 1px 5px; border-radius: 5px; font-size: 13px; }

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

.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.auth-box {
  width: 100%; max-width: 400px; background: var(--card);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 32px;
}
.auth-logo {
  width: 52px; height: 52px; border-radius: 14px; background: var(--accent);
  display: grid; place-items: center; margin-bottom: 18px;
}
.auth-logo svg { width: 26px; height: 26px; fill: #fff; }
.auth-logo-img { max-width: 190px; max-height: 70px; margin-bottom: 20px; display: block; }
.auth h1 { font-size: 22px; margin-bottom: 4px; }
.auth .sub { color: var(--text-2); font-size: 14px; margin-bottom: 22px; }
.auth .row { margin-top: 16px; }

/* ---------- Gerüst ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar);
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--line-soft);
  padding: 20px 12px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px; min-height: 34px;
  padding: 4px 10px 18px; font-weight: 600; font-size: 15px;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--accent);
  display: grid; place-items: center; flex: 0 0 28px;
}
.brand-mark svg { width: 15px; height: 15px; fill: #fff; }
.brand-logo { max-width: 100%; max-height: 52px; width: auto; object-fit: contain; }

.nav-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); padding: 14px 10px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px; color: var(--text);
  font-size: 14px; cursor: pointer; border: 0; background: none;
  width: 100%; text-align: left; font-family: inherit;
}
.nav-item svg { width: 17px; height: 17px; fill: var(--text-2); flex: 0 0 17px; }
.nav-item:hover { background: rgba(0,0,0,.045); }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item.active svg { fill: #fff; }
.nav-count {
  margin-left: auto; font-size: 12px; color: var(--text-3);
  background: var(--line-soft); border-radius: 9px; padding: 0 7px;
}
.nav-item.active .nav-count { background: rgba(255,255,255,.25); color: #fff; }

.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 9px; cursor: pointer; width: 100%; border: 0; background: none;
  font-family: inherit; text-align: left;
}
.user-chip:hover { background: rgba(0,0,0,.045); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--line-soft);
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
  color: var(--text-2); flex: 0 0 30px;
}
.user-chip .who { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .role { font-size: 11px; color: var(--text-3); }

.main { flex: 1; min-width: 0; padding: 28px 32px 64px; }
.page { max-width: 980px; margin: 0 auto; }
.page-head {
  display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-head .grow { flex: 1; min-width: 200px; }
.page-head .sub { color: var(--text-2); font-size: 14px; margin-top: 2px; }

/* ---------- Karten ---------- */

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); margin-bottom: 18px; overflow: hidden;
}
.card-head {
  padding: 16px 18px 0; display: flex; align-items: center; gap: 12px;
}
.card-head h2 { flex: 1; }
.card-body { padding: 16px 18px; }
.card-pad-0 .card-body { padding: 0; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.stat { background: var(--card); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat .num { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.stat .lbl { color: var(--text-2); font-size: 13px; }

/* ---------- Listen ---------- */

.list { list-style: none; margin: 0; padding: 0; }
.list-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px; border-bottom: 1px solid var(--line-soft);
  cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0;
  width: 100%; text-align: left; font-family: inherit; font-size: 15px; color: var(--text);
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: #fafafd; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .ttl { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.chev { width: 8px; height: 13px; fill: var(--text-3); flex: 0 0 8px; }

.tile-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tile {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm); cursor: pointer; border: 0; font-family: inherit;
  text-align: left; display: flex; flex-direction: column; gap: 6px; color: var(--text);
  transition: transform .12s ease, box-shadow .12s ease;
}
.tile:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.tile .tile-icon {
  width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, #fff);
  display: grid; place-items: center; margin-bottom: 4px;
}
.tile .tile-icon svg { width: 18px; height: 18px; fill: var(--accent); }
.tile .name { font-weight: 600; font-size: 15px; }
.tile .desc { font-size: 13px; color: var(--text-2); }

/* ---------- Kleinteile ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500;
  padding: 3px 9px; border-radius: 20px; background: var(--line-soft); color: var(--text-2);
  white-space: nowrap;
}
.badge.done  { background: rgba(52,199,89,.14);  color: #1a7f37; }
.badge.draft { background: rgba(255,149,0,.16);  color: #9a5b00; }
.badge.off   { background: rgba(255,59,48,.12);  color: #b3261e; }
.badge.admin { background: color-mix(in srgb, var(--accent) 14%, #fff); color: var(--accent); }

.progress { height: 5px; border-radius: 3px; background: var(--line-soft); overflow: hidden; min-width: 60px; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s ease; }

.empty { text-align: center; padding: 44px 20px; color: var(--text-2); }
.empty svg { width: 34px; height: 34px; fill: var(--line); margin-bottom: 10px; }

.hint { font-size: 13px; color: var(--text-2); }
.muted { color: var(--text-2); }
.right { margin-left: auto; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.spacer { height: 10px; }

/* ---------- Schaltflächen ---------- */

.btn {
  appearance: none; white-space: nowrap; border: 1px solid var(--line); background: var(--card); color: var(--text);
  font-family: inherit; font-size: 14px; font-weight: 500; padding: 8px 15px;
  border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  line-height: 1.2; transition: background .12s ease, opacity .12s ease;
}
.btn:hover { background: #fbfbfd; }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .45; cursor: default; }
.btn svg { width: 15px; height: 15px; fill: currentColor; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, #fff); }
.btn-danger:hover { background: rgba(255,59,48,.06); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(0,0,0,.05); }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 12px 22px; font-size: 16px; border-radius: 12px; }

/* ---------- Formularfelder ---------- */

.field { margin-bottom: 16px; }
.field > label, .lbl-text {
  display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px;
}
.req { color: var(--red); margin-left: 2px; }
.field .help { font-size: 12.5px; color: var(--text-3); margin-top: 5px; }
.field .err { font-size: 12.5px; color: var(--red); margin-top: 5px; }

input:not([type]), input[type=text], input[type=password], input[type=email],
input[type=number], input[type=date], input[type=time], input[type=search],
input[type=tel], input[type=url], select, textarea {
  width: 100%; font-family: inherit; font-size: 16px; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; outline: none; transition: border-color .12s ease, box-shadow .12s ease;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path fill='%238e8e93' d='M6 8 0 2l1.4-1.4L6 5.2 10.6.6 12 2z'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; background-size: 10px; padding-right: 34px; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
input.invalid, textarea.invalid, select.invalid { border-color: var(--red); }
input[type=color] { width: 46px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

.field-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.fields-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr 1fr; }
.fields-grid > .field.full { grid-column: 1 / -1; }

.check-list { display: flex; flex-direction: column; gap: 2px; }
.check {
  display: flex; align-items: center; gap: 10px; padding: 9px 2px; cursor: pointer; font-size: 15px;
}
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: 0 0 20px; margin: 0; }

.segmented {
  display: inline-flex; background: var(--line-soft); border-radius: 9px; padding: 2px; gap: 2px;
}
.segmented button {
  border: 0; background: none; font-family: inherit; font-size: 14px; padding: 6px 16px;
  border-radius: 7px; cursor: pointer; color: var(--text-2); font-weight: 500;
}
.segmented button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }

.switch-row { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.switch { position: relative; width: 50px; height: 30px; flex: 0 0 50px; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track {
  position: absolute; inset: 0; background: var(--line); border-radius: 15px;
  transition: background .18s ease; pointer-events: none;
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .18s ease;
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(20px); }

/* ---------- Anhänge & Unterschrift ---------- */

.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.thumb {
  position: relative; width: 92px; height: 92px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line-soft); background: var(--line-soft);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .pdf { display: grid; place-items: center; height: 100%; font-size: 11px; color: var(--text-2); padding: 6px; text-align: center; }
.thumb .del {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; border: 0; cursor: pointer; font-size: 14px;
  line-height: 1; display: grid; place-items: center; padding: 0;
}
.uploading { opacity: .5; }

.sig-pad {
  border: 1px dashed var(--line); border-radius: 12px; background: #fff;
  touch-action: none; width: 100%; height: 170px; display: block;
}
.sig-actions { display: flex; gap: 8px; margin-top: 8px; }
.sig-image { max-width: 280px; border: 1px solid var(--line-soft); border-radius: 10px; background: #fff; }

/* ---------- Ausfüllen ---------- */

.fill-head {
  position: sticky; top: 0; z-index: 20; margin: -28px -32px 20px; padding: 12px 32px;
  background: rgba(245,245,247,.86); backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 14px;
}
.fill-head .ttl { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-state { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }

.section-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.section-head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 15px 18px; background: none; border: 0; border-radius: var(--radius);
  font-family: inherit; text-align: left; cursor: pointer; color: var(--text);
}
@media (hover: hover) { .section-head:hover { background: #fafafd; } }
.section-head h3 { flex: 1; font-size: 20px; letter-spacing: -0.015em; }
.sec-count { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.section-head .caret {
  width: 12px; height: 8px; fill: var(--text-3); flex: 0 0 12px; transition: transform .18s ease;
}
.section-card.collapsed .caret { transform: rotate(-90deg); }
.section-card.collapsed .section-body,
.section-card.collapsed .section-help { display: none; }
.section-card.collapsed .section-head { padding-bottom: 15px; }
.section-card .section-help { padding: 0 18px 4px; font-size: 13px; color: var(--text-2); }
.section-card .section-body { padding: 4px 18px; }
.section-card > .section-body:first-child { padding-top: 16px; }

.info-note {
  background: color-mix(in srgb, var(--accent) 7%, #fff);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, #fff);
  border-radius: 10px; padding: 11px 13px; font-size: 14px; margin-bottom: 16px;
}
/* Symbole in Fließtext bleiben klein – ohne Regel füllt ein SVG die Breite. */
.info-note svg, .sub svg, .meta svg, p svg, .hint svg {
  width: 15px; height: 15px; fill: var(--accent); vertical-align: -3px;
}
.sub svg, .meta svg { fill: var(--text-2); width: 13px; height: 13px; vertical-align: -2px; }

.sticky-actions {
  margin-top: 8px; position: sticky; bottom: 0; margin: 0 -32px; padding: 14px 32px calc(14px + env(safe-area-inset-bottom));
  background: rgba(245,245,247,.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line-soft); display: flex; gap: 10px; align-items: center;
}

/* ---------- Ansicht einer Ausfüllung ---------- */

.answers { list-style: none; margin: 0; padding: 0; }
.answers li { padding: 12px 18px; border-bottom: 1px solid var(--line-soft); display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.answers li:last-child { border-bottom: 0; }
.answers .q { color: var(--text-2); font-size: 13.5px; }
.answers .a { font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.answers .a.empty-val { color: var(--text-3); }
.answers .sec-title { display: block; grid-column: 1 / -1; font-weight: 600; font-size: 16px; background: #fafafd; }

/* ---------- Tabelle ---------- */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.data th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 600; }
table.data tbody tr:hover { background: #fafafd; }
table.data tbody tr { cursor: pointer; }
table.data td.wrap { white-space: normal; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin-bottom: 0; min-width: 150px; flex: 1; }
.filters .field.narrow { flex: 0 0 150px; }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 100;
  display: grid; place-items: center; padding: 20px; overflow-y: auto;
}
.modal {
  background: var(--card); border-radius: var(--radius-lg); box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; margin: auto;
}
.modal.wide { max-width: 720px; }
.modal-head { padding: 20px 22px 0; display: flex; align-items: center; gap: 12px; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 18px 22px; }
.modal-foot {
  padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-end;
  position: sticky; bottom: 0; background: var(--card);
}

/* ---------- Hinweise ---------- */

.toasts {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast {
  background: rgba(28,28,30,.94); color: #fff; padding: 11px 18px; border-radius: 12px;
  font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.25); max-width: 90vw;
  animation: toast-in .22s ease;
}
.toast.err { background: rgba(190,40,32,.96); }
.toast.ok  { background: rgba(30,120,60,.96); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

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

.editor-field {
  border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px 14px;
  margin-bottom: 10px; background: #fff;
}
.editor-field.open { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.ef-head { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.ef-head .type { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.ef-head .lab { font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ef-body { padding-top: 14px; border-top: 1px solid var(--line-soft); margin-top: 12px; }
.drag-handle { cursor: grab; fill: var(--text-3); width: 14px; height: 14px; flex: 0 0 14px; }
.editor-field.dragging { opacity: .4; }
.editor-section {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 16px 18px; margin-bottom: 16px;
}
input.section-title-input {
  font-size: 17px; font-weight: 600; border: 0; border-radius: 0;
  padding: 4px 0; background: none;
}
input.section-title-input:focus { box-shadow: none; border-bottom: 2px solid var(--accent); }
.type-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.type-picker button {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 12px 8px;
  font-family: inherit; font-size: 13px; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; gap: 6px; color: var(--text);
}
.type-picker button:hover { border-color: var(--accent); color: var(--accent); }
.type-picker svg { width: 18px; height: 18px; fill: currentColor; }
.opt-row { display: flex; gap: 8px; margin-bottom: 6px; align-items: center; }
.opt-row input { flex: 1; }

.logo-box {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px; border: 1px dashed var(--line); border-radius: 12px; background: #fcfcfe;
}
.logo-preview {
  max-width: 220px; max-height: 80px; object-fit: contain; display: block;
}
.logo-empty { color: var(--text-3); font-size: 13px; }

/* ---------- Mobile ---------- */

.tabbar { display: none; }

@media (max-width: 820px) {
  .sidebar { display: none; }
  .main { padding: 16px 16px calc(76px + env(safe-area-inset-bottom)); }
  .mobile-top {
    display: flex; align-items: center; gap: 10px; margin: -16px -16px 14px;
    padding: 12px 16px; background: rgba(255,255,255,.82);
    backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; z-index: 30;
  }
  .mobile-top .t { font-weight: 600; flex: 1; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--line-soft); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar button {
    flex: 1; border: 0; background: none; padding: 8px 4px 7px; font-family: inherit;
    font-size: 10.5px; color: var(--text-2); display: flex; flex-direction: column;
    align-items: center; gap: 3px; cursor: pointer;
  }
  .tabbar button svg { width: 21px; height: 21px; fill: var(--text-2); }
  .tabbar button.active, .tabbar button.active svg { color: var(--accent); fill: var(--accent); }
  .fill-head { margin: -16px -16px 14px; padding: 10px 16px; top: 0; }
  .sticky-actions { margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); bottom: calc(54px + env(safe-area-inset-bottom)); }
  .fields-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .answers li { grid-template-columns: 1fr; gap: 3px; }
  .page-head h1 { font-size: 22px; }
  .modal { max-height: 92vh; }
  .filters .field.narrow { flex: 1 1 140px; }
}

@media (min-width: 821px) {
  .mobile-top { display: none; }
}

/* ---------- Druck / PDF ---------- */

@media print {
  .sidebar, .tabbar, .mobile-top, .sticky-actions, .fill-head, .toasts,
  .btn, .row-actions, .no-print { display: none !important; }
  body, html { background: #fff; }
  .main { padding: 0; }
  .card, .section-card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .answers li { break-inside: avoid; }
  .print-head { display: block !important; margin-bottom: 18px; }
  a[href]::after { content: ''; }
}
.print-head { display: none; }
