/* 4smile-Designsprache (CRM-Palette) */
:root {
  --brand-50: #f8f5f3;
  --brand-100: #f2dfdc;
  --brand-300: #d8ecec;
  --brand-400: #b4ddde;
  --brand-600: #627596;
  --brand-700: #2d4267;
  --brand-800: #192946;
  --accent: #ecc9c3;
  --mint: #b4ddde;
  --steel: #b5c4db;
  --canvas: #fffdfa;
  --ink: #1d1d1b;
  --warn: #b4442f;
  --shadow-card: 0 20px 60px rgba(25, 41, 70, 0.12);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-700); }
h1 { font-size: 2rem; line-height: 1.05; margin: 0.4rem 0 0.6rem; color: var(--brand-800); }
h2 { font-size: 1.2rem; margin: 0 0 0.6rem; color: var(--brand-800); }
h3 { font-size: 1rem; margin: 0 0 0.4rem; color: var(--brand-800); }
p { margin: 0 0 0.6rem; }
.eyebrow { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--brand-600); margin: 0 0 0.4rem; font-weight: 600; }
.eyebrow.on-dark { color: var(--steel); }
.muted { color: var(--brand-600); font-size: 0.9rem; }
.small { font-size: 0.82rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pre { white-space: pre-wrap; }
[hidden] { display: none !important; }

/* Shell */
.shell { display: flex; gap: 1.5rem; padding: 1.25rem; min-height: 100vh; align-items: flex-start; }
.sidebar {
  position: sticky; top: 1.25rem; flex: 0 0 290px; width: 290px; min-height: calc(100vh - 2.5rem);
  display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem;
  background: var(--brand-800); color: #fff; border: 4px solid var(--brand-800); border-radius: 34px; box-shadow: var(--shadow-card);
}
.logo-box { display: block; background: #fff; border-radius: 26px; padding: 1rem; }
.logo-box img { display: block; width: 100%; max-width: 190px; height: auto; }
.sidebar nav { display: flex; flex-direction: column; gap: 0.6rem; }
.nav-pill {
  position: relative; border-radius: 999px; border: 2px solid rgba(255, 255, 255, 0.15); background: rgba(255, 255, 255, 0.1); color: #fff;
  padding: 0.7rem 1rem; font-size: 0.85rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; text-decoration: none; transition: 0.15s;
}
.nav-pill:hover { border-color: var(--accent); background: var(--accent); color: var(--brand-800); }
.nav-pill.active { border-color: var(--brand-400); background: var(--mint); color: var(--brand-800); }
.nav-pill .zahl { position: absolute; right: 0.8rem; top: 50%; transform: translateY(-50%); background: var(--accent); color: var(--brand-800); border-radius: 999px; min-width: 1.5rem; padding: 0 0.4rem; text-align: center; font-size: 0.75rem; }
.nav-sep { height: 1px; background: rgba(255, 255, 255, 0.15); margin: 0.2rem 0; }
.user-card { margin-top: auto; border-radius: 28px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.1); padding: 1rem; }
.user-name { font-weight: 700; margin: 0; }
.user-hint { font-size: 0.8rem; color: var(--steel); margin: 0.2rem 0 0.6rem; }
.user-card select.input { width: 100%; margin-bottom: 0.6rem; }
.topbar { display: none; }
.view { flex: 1; min-width: 0; max-width: 1180px; padding-top: 0.5rem; }

/* Buttons */
.btn {
  display: inline-flex; min-height: 2.75rem; align-items: center; justify-content: center; gap: 0.4rem;
  border-radius: 999px; border: 1px solid transparent; padding: 0.6rem 1.15rem;
  font: inherit; font-size: 0.82rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em;
  text-decoration: none; cursor: pointer; transition: 0.15s; color: var(--brand-800); background: transparent; white-space: nowrap;
}
.btn:focus-visible, .input:focus-visible, .chip input:focus-visible + span { outline: none; box-shadow: 0 0 0 3px var(--brand-300); }
.btn.primary { border-color: var(--brand-400); background: var(--mint); box-shadow: inset 0 -2px 0 rgba(25, 41, 70, 0.12); }
.btn.primary:hover { background: var(--brand-300); }
.btn.secondary { border-color: var(--brand-800); background: var(--accent); box-shadow: inset 0 -2px 0 rgba(25, 41, 70, 0.12); }
.btn.secondary:hover { background: var(--brand-100); }
.btn.outline { border-color: var(--brand-800); background: #fff; }
.btn.outline:hover, .btn.ghost:hover { background: var(--brand-50); }
.btn.danger { color: var(--warn); }
.btn.small { min-height: 2.1rem; padding: 0.35rem 0.85rem; font-size: 0.72rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.icon-btn { height: 3rem; width: 3rem; border-radius: 18px; border: 2px solid var(--brand-800); background: #fff; color: var(--brand-800); font-size: 1.2rem; cursor: pointer; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-700); text-decoration: underline; cursor: pointer; }

/* Karten & Kopf */
.card {
  border-radius: 30px; border: 4px solid var(--brand-800); background: rgba(255, 255, 255, 0.9);
  padding: 1.25rem; box-shadow: var(--shadow-card); margin-bottom: 1.25rem;
}
.card.flush { padding: 0; overflow: hidden; }
.card.flush.stapel { overflow-x: auto; }
.card.soft { border-width: 2px; box-shadow: none; }
.card.hinweis { border-width: 2px; border-color: var(--brand-400); background: var(--brand-300); box-shadow: none; }
.card.warnung { border-width: 2px; border-color: var(--accent); background: var(--brand-100); box-shadow: none; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.card-head h2 { margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.actions, .row-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.form-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; align-items: center; margin-top: 1rem; }
.crumb { margin: 0 0 0.3rem; font-size: 0.9rem; }
.crumb a { text-decoration: none; }
.leer { color: var(--brand-600); font-style: italic; }

/* Chips / Badges */
.badge { display: inline-block; border-radius: 999px; background: var(--brand-50); border: 1px solid var(--brand-100); padding: 0.15rem 0.65rem; font-size: 0.74rem; font-weight: 600; color: var(--brand-800); white-space: nowrap; }
.badge.st-geplant { background: #fff; border-color: var(--steel); }
.badge.st-in_vorbereitung { background: var(--brand-50); border-color: var(--steel); }
.badge.st-vorbereitet { background: var(--brand-300); border-color: var(--brand-400); }
.badge.st-durchgefuehrt { background: var(--steel); border-color: var(--steel); }
.badge.st-zur_kenntnis { background: var(--accent); border-color: var(--accent); }
.badge.st-abgeschlossen { background: var(--brand-800); border-color: var(--brand-800); color: #fff; }
.badge.st-verschoben { background: #fff; border-style: dashed; border-color: var(--brand-600); }
.badge.st-keins { background: transparent; border-style: dashed; border-color: var(--brand-600); color: var(--brand-600); }
.badge.ueberfaellig { background: #fff; border-color: var(--warn); color: var(--warn); }
.badge.vs-erreicht { background: var(--brand-300); }
.badge.vs-in_arbeit { background: var(--brand-50); }
.badge.vs-nicht_erreicht { background: var(--brand-100); color: var(--warn); }
.badge.vs-entfallen { background: #fff; color: var(--brand-600); text-decoration: line-through; }

/* Kennzahlen */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.9rem; margin-bottom: 1.25rem; }
.tile { border-radius: 24px; border: 2px solid var(--brand-800); background: #fff; padding: 0.9rem 1.1rem; }
.tile-num { font-size: 2rem; font-weight: 700; line-height: 1; margin: 0; color: var(--brand-800); }
.tile.warn .tile-num { color: var(--warn); }
.tile .eyebrow { margin-top: 0.35rem; letter-spacing: 0.1em; }
.fortschritt { height: 10px; border-radius: 999px; background: var(--brand-50); border: 1px solid var(--brand-100); overflow: hidden; margin: 0.4rem 0 1.25rem; }
.fortschritt span { display: block; height: 100%; background: var(--brand-800); }

/* Tabellen */
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { background: var(--brand-800); color: #fff; text-transform: uppercase; font-weight: 600; font-size: 0.72rem; letter-spacing: 0.06em; text-align: left; padding: 0.7rem 0.9rem; border-bottom: 2px solid var(--accent); }
.table td { padding: 0.6rem 0.9rem; border-top: 1px solid var(--brand-100); vertical-align: middle; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr[data-href]:hover { background: var(--brand-50); }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--brand-800); }
.person-zelle strong { display: block; }
.toolbar { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar .input { width: auto; margin: 0; min-width: 12rem; }

/* Formulare */
.field { display: block; font-size: 0.8rem; font-weight: 600; color: var(--brand-700); margin-bottom: 0.8rem; }
.input {
  display: block; width: 100%; margin-top: 0.25rem; font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  border: 2px solid var(--brand-800); border-radius: 18px; padding: 0.55rem 0.85rem;
}
textarea.input { border-radius: 20px; min-height: 5.5rem; resize: vertical; line-height: 1.45; }
select.input { appearance: auto; }
.input.compact { width: auto; margin: 0; padding: 0.3rem 0.7rem; font-size: 0.85rem; border-radius: 999px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 0 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.check { display: flex; gap: 0.5rem; align-items: center; font-size: 0.9rem; font-weight: 500; color: var(--ink); }

.form-section { padding: 1rem 0 0.4rem; border-top: 2px solid var(--brand-100); }
.form-section:first-of-type { border-top: 0; padding-top: 0; }
.form-section > h3 { display: flex; gap: 0.6rem; align-items: center; font-size: 1.05rem; }
.section-no { display: inline-grid; place-items: center; min-width: 1.9rem; height: 1.9rem; border-radius: 999px; background: var(--mint); color: var(--brand-800); font-weight: 800; font-size: 0.8rem; padding: 0 0.4rem; }
.feld { margin-bottom: 1rem; }
.feld > label, .feld > .feld-label { display: block; font-weight: 600; color: var(--brand-800); margin-bottom: 0.15rem; }
.feld .pflicht { color: var(--warn); }
.feld .hilfe { font-size: 0.82rem; color: var(--brand-600); margin: 0 0 0.3rem; }
.feld.fehlt .input { border-color: var(--warn); }

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.3rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; border-radius: 999px; border: 2px solid var(--brand-800); background: #fff; padding: 0.35rem 0.85rem; font-size: 0.86rem; cursor: pointer; transition: 0.1s; }
.chip span:hover { background: var(--brand-50); }
.chip input:checked + span { background: var(--brand-800); color: #fff; }
.chip input:disabled + span { opacity: 0.4; cursor: not-allowed; }
.kein-bedarf { margin-top: 0.5rem; }
.optionen { display: grid; gap: 0.35rem; margin-top: 0.3rem; }

.save-state { font-size: 0.8rem; color: var(--brand-600); min-width: 7rem; text-align: right; }
.save-state.fehler { color: var(--warn); }

/* Rückblick auf Vereinbarungen */
.rueckblick-item { border: 2px solid var(--brand-100); border-radius: 20px; padding: 0.8rem 1rem; margin-bottom: 0.6rem; background: #fff; }
.rueckblick-item .bewertung { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0; }

/* Vereinbarungen */
.vb { border: 2px solid var(--brand-800); border-radius: 22px; padding: 0.9rem 1rem 0.3rem; margin-bottom: 0.8rem; background: #fff; }
.vb .field { margin-bottom: 0.55rem; }
.vb textarea.input { min-height: 3rem; }
.vb-kopf { display: flex; justify-content: space-between; gap: 0.6rem; align-items: center; margin-bottom: 0.4rem; }
.vb-liste { list-style: none; margin: 0; padding: 0; }
.vb-liste > li { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 1rem; padding: 0.7rem 0; border-top: 1px solid var(--brand-100); }
.vb-liste > li:first-child { border-top: 0; }
.vb-liste .meta { font-size: 0.82rem; color: var(--brand-600); }
.staende { margin: 0.3rem 0 0; padding-left: 1rem; font-size: 0.82rem; color: var(--brand-700); }

/* Gesprächsseite */
.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.tab { border-radius: 999px; border: 2px solid var(--brand-800); background: #fff; color: var(--brand-800); padding: 0.45rem 0.95rem; font-size: 0.8rem; font-weight: 700; text-decoration: none; text-transform: uppercase; letter-spacing: 0.02em; }
.tab:hover { background: var(--brand-50); }
.tab.active { background: var(--brand-800); color: #fff; }
.tab .punkt { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); margin-left: 0.35rem; vertical-align: middle; }

.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; margin: 0.4rem 0 1rem; }
.step { border-radius: 16px; border: 2px solid var(--brand-100); padding: 0.5rem 0.6rem; font-size: 0.78rem; font-weight: 600; color: var(--brand-600); background: #fff; }
.step.done { border-color: var(--brand-800); background: var(--brand-800); color: #fff; }
.step.current { border-color: var(--brand-800); background: var(--mint); color: var(--brand-800); }
.step small { display: block; font-weight: 400; opacity: 0.85; }
.kv { display: grid; grid-template-columns: 11rem 1fr; gap: 0.35rem 1rem; margin: 0; }
.kv dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-600); padding-top: 0.15rem; }
.kv dd { margin: 0; }
.verlauf-liste { list-style: none; margin: 0; padding: 0; font-size: 0.86rem; }
.verlauf-liste li { padding: 0.4rem 0; border-top: 1px solid var(--brand-100); }
.verlauf-liste li:first-child { border-top: 0; }

/* Gesprächsführung */
.phasen-nav { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.3rem; margin-bottom: 1rem; }
.phase-pill { flex: none; display: flex; gap: 0.45rem; align-items: center; border-radius: 999px; border: 2px solid var(--brand-800); background: #fff; padding: 0.35rem 0.85rem 0.35rem 0.4rem; font: inherit; font-size: 0.82rem; cursor: pointer; color: var(--brand-800); }
.phase-pill .no { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand-50); font-weight: 800; font-size: 0.78rem; }
.phase-pill.active { background: var(--brand-800); color: #fff; }
.phase-pill.active .no { background: var(--mint); color: var(--brand-800); }
.phase-pill.notiert .no { background: var(--accent); }
.phase-kopf { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.timer { display: flex; gap: 0.5rem; align-items: center; font-variant-numeric: tabular-nums; }
.timer .zeit { font-size: 1.4rem; font-weight: 700; color: var(--brand-800); }
.timer .zeit.drueber { color: var(--warn); }
.fragen { margin: 0.4rem 0 0.8rem; padding-left: 1.2rem; font-size: 1.05rem; }
.fragen li { margin-bottom: 0.3rem; }
.gegenueber { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0.6rem 0 1rem; }
.seite { border-radius: 22px; border: 2px solid var(--brand-100); background: #fff; padding: 0.8rem 1rem; }
.seite.fk { border-color: var(--steel); }
.seite.ma { border-color: var(--accent); }
.seite h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand-600); }
.antwort { margin-bottom: 0.7rem; }
.antwort .frage { font-size: 0.8rem; color: var(--brand-600); margin: 0; }
.antwort .wert { margin: 0.1rem 0 0; white-space: pre-wrap; }
.uebernehmen { float: right; font-size: 0.75rem; }

/* Protokoll-Ansicht */
.protokoll-ansicht .abschnitt { margin-bottom: 1rem; }
.protokoll-ansicht .abschnitt h3 { border-bottom: 2px solid var(--brand-100); padding-bottom: 0.2rem; }
.protokoll-ansicht .feld-lesen { margin-bottom: 0.5rem; }
.protokoll-ansicht .feld-lesen .frage { font-size: 0.8rem; color: var(--brand-600); margin: 0; }
.vb-tabelle td, .vb-tabelle th { font-size: 0.82rem; }
.kenntnis-box { border-radius: 24px; border: 2px solid var(--brand-800); background: var(--brand-300); padding: 1rem 1.2rem; }

/* Vorlagen-Editor */
.ed-section { border: 2px solid var(--brand-800); border-radius: 24px; padding: 1rem; margin-bottom: 1rem; background: #fff; }
.ed-section-kopf { display: grid; grid-template-columns: 1fr auto; gap: 0.6rem; align-items: end; }
.ed-feld { border: 1px solid var(--brand-100); border-left: 4px solid var(--mint); border-radius: 14px; padding: 0.7rem 0.8rem 0.2rem; margin: 0.6rem 0; background: var(--canvas); }
.ed-feld .grid-4 { align-items: end; }
.ed-tools { display: flex; gap: 0.2rem; justify-content: flex-end; }
.ed-tools button { border: 1px solid var(--brand-100); background: #fff; border-radius: 10px; width: 2rem; height: 2rem; cursor: pointer; color: var(--brand-800); }
.ed-tools button:hover { background: var(--brand-50); }
.ed-key { font-family: ui-monospace, Menlo, monospace; font-size: 0.7rem; color: var(--brand-600); }
.bezug-liste { max-height: 14rem; overflow: auto; border: 1px solid var(--brand-100); border-radius: 12px; padding: 0.4rem 0.6rem; background: #fff; }
.bezug-liste label { display: flex; gap: 0.4rem; font-size: 0.8rem; font-weight: 400; color: var(--ink); padding: 0.15rem 0; }
.sticky-bar { position: sticky; bottom: 0.75rem; z-index: 5; display: flex; justify-content: flex-end; gap: 0.6rem; align-items: center; padding: 0.6rem 0.8rem; border-radius: 999px; border: 2px solid var(--brand-800); background: rgba(255, 253, 250, 0.96); box-shadow: var(--shadow-card); margin-top: 1rem; }
.kompetenz-zeile { display: grid; grid-template-columns: 1fr auto auto; gap: 0.6rem; align-items: center; padding: 0.4rem 0; border-top: 1px solid var(--brand-100); }
.kompetenz-zeile:first-child { border-top: 0; }

/* Dialog & Toast */
.dialog { border: 4px solid var(--brand-800); border-radius: 30px; padding: 1.5rem; width: min(560px, calc(100vw - 2rem)); box-shadow: var(--shadow-card); background: var(--canvas); color: var(--ink); }
.dialog::backdrop { background: rgba(25, 41, 70, 0.45); backdrop-filter: blur(3px); }
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--brand-800); color: #fff; padding: 0.7rem 1.2rem; border-radius: 999px; font-weight: 600; font-size: 0.9rem; z-index: 60; box-shadow: var(--shadow-card); max-width: calc(100vw - 2rem); }
.laden { padding: 3rem 0; text-align: center; color: var(--brand-600); }

/* Druckansichten (Bogen, Protokoll) */
body.druck .sidebar, body.druck .topbar { display: none !important; }
body.druck .shell { display: block; padding: 1rem; }
body.druck .view { max-width: 820px; margin: 0 auto; }
.druck-leiste { display: flex; gap: 0.6rem; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; padding: 0.7rem 1rem; border-radius: 24px; border: 2px solid var(--brand-800); background: var(--brand-300); }
.blatt { background: #fff; border: 1px solid var(--brand-100); border-radius: 12px; padding: 2rem 2.2rem; box-shadow: var(--shadow-card); }
.blatt-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; border-bottom: 3px solid var(--brand-800); padding-bottom: 0.8rem; margin-bottom: 1rem; }
.blatt-kopf img { width: 130px; }
.blatt h1 { font-size: 1.5rem; margin: 0 0 0.2rem; }
.meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.2rem 1.5rem; font-size: 0.88rem; margin-bottom: 1rem; }
.meta-grid span { color: var(--brand-600); }
.blatt h2 { font-size: 1.05rem; margin: 1.1rem 0 0.4rem; padding-bottom: 0.2rem; border-bottom: 1px solid var(--brand-100); }
.schreibfeld { border: 1px solid #b9c1cf; border-radius: 8px; min-height: 4.2rem; margin: 0.25rem 0 0.7rem; background: repeating-linear-gradient(to bottom, transparent 0, transparent 1.38rem, #e4e8ef 1.38rem, #e4e8ef 1.42rem); }
.schreibfeld.kurz { min-height: 2rem; }
.kaestchen { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.25rem 1.2rem; margin: 0.3rem 0 0.6rem; font-size: 0.9rem; }
.kaestchen span::before { content: '☐ '; font-size: 1.05rem; }
.blatt .frage-druck { margin: 0.4rem 0 0; font-weight: 600; font-size: 0.93rem; }
.blatt .hilfe-druck { font-size: 0.8rem; color: var(--brand-600); margin: 0; }
.blatt-fuss { margin-top: 1.4rem; padding-top: 0.6rem; border-top: 1px solid var(--brand-100); font-size: 0.78rem; color: var(--brand-600); }

/* Mittlere Fensterbreiten */
@media (max-width: 1200px) {
  .sidebar { flex-basis: 240px; width: 240px; }
}

/* Mobil */
@media (max-width: 900px) {
  .shell { flex-direction: column; padding: 0.75rem; gap: 0.75rem; }
  .topbar { display: flex; width: 100%; align-items: center; justify-content: space-between; border: 4px solid var(--brand-800); border-radius: 28px; padding: 0.5rem 0.75rem; background: #fff; }
  .topbar .logo-box { padding: 0.2rem 0.4rem; }
  .topbar .logo-box img { width: 110px; }
  .sidebar { display: none; position: static; width: 100%; flex: none; min-height: 0; border-radius: 30px; }
  .sidebar.open { display: flex; }
  .sidebar > .logo-box { display: none; }
  .view { width: 100%; }
  h1 { font-size: 1.55rem; }
  .card { border-radius: 24px; padding: 1rem; }
  .grid-2, .grid-3, .grid-4, .gegenueber, .kaestchen, .meta-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .stepper { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { padding-top: 0.4rem; }
  .blatt { padding: 1.2rem; }
  .sticky-bar { border-radius: 24px; flex-wrap: wrap; }
  .toolbar .input, .toolbar .btn { width: 100%; }

  /* Tabelle → gestapelte Karten */
  .card.flush.stapel { border: 0; box-shadow: none; background: none; border-radius: 0; overflow: visible; }
  .stapel .table thead { display: none; }
  .stapel .table, .stapel .table tbody, .stapel .table tr, .stapel .table td { display: block; }
  .stapel .table tr { border: 2px solid var(--brand-800); border-radius: 22px; background: #fff; padding: 0.6rem 0.9rem; margin-bottom: 0.75rem; }
  .stapel .table td { border: 0; padding: 0.2rem 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .stapel .table td::before { content: attr(data-label); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--brand-600); flex: none; padding-top: 0.2rem; text-align: left; }
  .stapel .table td:first-child { display: block; text-align: left; }
  .stapel .table td:first-child::before { content: none; }
  .stapel .table tfoot { display: block; }
}

/* Druck */
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  body { background: #fff; font-size: 10.5pt; }
  .sidebar, .topbar, .no-print, .toast, .druck-leiste { display: none !important; }
  .shell { display: block; padding: 0; }
  .view { max-width: none; }
  .blatt { border: 0; box-shadow: none; padding: 0; border-radius: 0; }
  .blatt h2 { break-after: avoid; }
  .frage-block, .vb-tabelle tr { break-inside: avoid; }
  .badge { border: 1px solid #999; }
}
