/* ===========================================================
   Anzeigenportal – Gestaltung
   Die Markenfarbe kommt aus den Einstellungen und wird in
   base.html als --brand gesetzt.
   =========================================================== */

:root {
  --brand: #2f6f4f;
  --brand-dark: #22523a;
  --brand-soft: #eef4f0;
  --brand-line: #cfe0d6;

  --ink: #1c2320;
  --ink-2: #4a5450;
  --ink-3: #7b847f;
  --line: #e2e4e2;
  --line-2: #eceeec;
  --paper: #ffffff;
  --bg: #f6f6f4;

  --ok: #2c7a4b;
  --ok-bg: #eaf5ee;
  --warn: #9a6b12;
  --warn-bg: #fdf3e0;
  --bad: #a83232;
  --bad-bg: #fbeceb;
  --info: #2b5c8a;
  --info-bg: #eaf1f8;

  --radius: 10px;
  --radius-s: 6px;
  --shadow: 0 1px 2px rgba(28, 35, 32, .05), 0 4px 14px rgba(28, 35, 32, .04);
  --shadow-lg: 0 2px 6px rgba(28, 35, 32, .07), 0 12px 32px rgba(28, 35, 32, .08);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue",
          Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

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

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 620; }
h1 { font-size: 24px; letter-spacing: -.01em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }

/* ---------- Grundgerüst ---------- */

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

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: var(--paper);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--line-2);
}
.brand img { max-width: 150px; max-height: 46px; display: block; }
.brand-name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--brand-dark);
  letter-spacing: -.01em;
  line-height: 1.2;
}
.brand-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 3px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.nav { padding: 14px 10px; flex: 1; }
.nav-group { margin-bottom: 18px; }
.nav-title {
  font-size: 10.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 8px 6px;
  font-weight: 600;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: var(--radius-s);
  color: var(--ink-2);
  font-size: 14px;
  margin-bottom: 1px;
  transition: background .12s, color .12s;
}
.nav a:hover { background: var(--line-2); text-decoration: none; color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 550; }
.nav a .ico { width: 17px; text-align: center; opacity: .75; flex: 0 0 17px; }
.nav a.active .ico { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--bad);
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  min-width: 19px;
  height: 19px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.sidebar-foot {
  border-top: 1px solid var(--line-2);
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.sidebar-foot .who { color: var(--ink); font-weight: 550; font-size: 13px; }
.sidebar-foot a { color: var(--ink-2); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 0 26px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { margin: 0; font-size: 17px; font-weight: 600; }
.topbar .spacer { flex: 1; }
.crumb { color: var(--ink-3); font-size: 13px; }
.crumb a { color: var(--ink-3); }

.content { padding: 26px; max-width: 1280px; width: 100%; }
.content.narrow { max-width: 860px; }

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

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-head h2 { margin: 0; font-size: 15.5px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line-2);
  background: #fbfbfa;
  display: flex;
  gap: 10px;
  align-items: center;
}

.grid { display: grid; gap: 20px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }

/* ---------- Kennzahlen ---------- */

.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat .label {
  font-size: 12px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  margin-bottom: 6px;
}
.stat .value { font-size: 27px; font-weight: 640; letter-spacing: -.02em; line-height: 1.1; }
.stat .value.sm { font-size: 21px; }
.stat .note { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.stat.accent { border-left: 3px solid var(--brand); }
.stat.warn-accent { border-left: 3px solid var(--warn); }
.stat.bad-accent { border-left: 3px solid var(--bad); }

/* ---------- Tabellen ---------- */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 650;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: #fbfbfa;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfbfa; }
tr.clickable { cursor: pointer; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
td.tight, th.tight { width: 1%; white-space: nowrap; }
.t-main { font-weight: 550; }
.t-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }

.table-wrap { overflow-x: auto; }

.empty {
  padding: 34px 18px;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
}
.empty .big { font-size: 26px; margin-bottom: 8px; opacity: .5; }

/* ---------- Chips ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.7;
}
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.muted { background: var(--line-2); color: var(--ink-3); }
.chip.brand { background: var(--brand-soft); color: var(--brand-dark); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 8px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  font-weight: 550;
  cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: #f4f5f4; text-decoration: none; border-color: #d2d5d3; }
.btn:active { transform: translateY(.5px); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.btn.danger { color: var(--bad); border-color: #e8cfcd; background: #fff; }
.btn.danger:hover { background: var(--bad-bg); }

.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-2); }

.btn.sm { padding: 5px 11px; font-size: 13px; }
.btn.lg { padding: 11px 22px; font-size: 15px; }
.btn.block { width: 100%; }

.btn-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* ---------- Formulare ---------- */

.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--ink-2);
}
label .opt { font-weight: 400; color: var(--ink-3); }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=tel], input[type=search], select, textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid #d6d9d7;
  border-radius: var(--radius-s);
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 111, 79, .12);
}
input:disabled, select:disabled, textarea:disabled {
  background: #f4f5f4; color: var(--ink-3);
}
textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
select { appearance: none; background-image:
  url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%237b847f' d='M2 4.5l4 4 4-4'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
input[type=color] { width: 52px; height: 34px; padding: 2px; cursor: pointer; }

.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.45; }

.check { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 10px; }
.check input { margin-top: 3px; flex: 0 0 auto; width: 15px; height: 15px; accent-color: var(--brand); }
.check label { margin: 0; font-weight: 500; font-size: 14px; color: var(--ink); }
.check .hint { margin-top: 2px; }

.form-grid { display: grid; gap: 15px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

fieldset { border: 0; padding: 0; margin: 0 0 22px; }
legend {
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 650; padding: 0; margin-bottom: 10px;
}

.inline-form { display: flex; gap: 9px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; }

/* ---------- Meldungen ---------- */

.flashes { margin-bottom: 18px; }
.flash {
  padding: 11px 15px;
  border-radius: var(--radius-s);
  margin-bottom: 9px;
  font-size: 14px;
  border: 1px solid;
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.flash.success { background: var(--ok-bg); border-color: #c3e2ce; color: #1e5a35; }
.flash.error { background: var(--bad-bg); border-color: #f0cdca; color: #8a2727; }
.flash.info { background: var(--info-bg); border-color: #cfe0ef; color: #234c72; }
.flash .ico { flex: 0 0 auto; }

.notice {
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-s);
  padding: 13px 15px;
  font-size: 13.5px;
  color: var(--ink-2);
  margin-bottom: 16px;
}
.notice strong { color: var(--brand-dark); }
.notice.warn { background: var(--warn-bg); border-color: #ecd9ae; }
.notice.bad { background: var(--bad-bg); border-color: #f0cdca; }

/* ---------- Definitionslisten ---------- */

.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 14px; }
.dl dt { color: var(--ink-3); font-size: 13px; }
.dl dd { margin: 0; font-weight: 500; }

.kv { font-size: 14px; }
.kv > div {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 7px 0; border-bottom: 1px solid var(--line-2);
}
.kv > div:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-3); }
.kv .v { font-weight: 550; text-align: right; }
.kv .total { border-top: 1.5px solid var(--ink); margin-top: 4px; padding-top: 10px; }
.kv .total .k, .kv .total .v { font-weight: 650; font-size: 16px; color: var(--ink); }

/* ---------- Filterleiste ---------- */

.filters {
  display: flex; gap: 9px; align-items: center; flex-wrap: wrap;
  margin-bottom: 18px;
}
.filters input, .filters select { width: auto; min-width: 165px; }
.filters .spacer { flex: 1; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs a {
  padding: 9px 15px; font-size: 14px; color: var(--ink-2); font-weight: 550;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }

/* ---------- Zeitleiste ---------- */

.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line);
}
.timeline .item { position: relative; padding-bottom: 16px; font-size: 13.5px; }
.timeline .item:last-child { padding-bottom: 0; }
.timeline .item::before {
  content: ""; position: absolute; left: -21px; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--brand-line);
}
.timeline .item.done::before { background: var(--brand); border-color: var(--brand); }
.timeline .when { color: var(--ink-3); font-size: 12.5px; }

/* ---------- Dateien ---------- */

.file-row { display: flex; align-items: center; gap: 12px; }
.file-ico {
  width: 34px; height: 40px; flex: 0 0 34px;
  border: 1px solid var(--line); border-radius: 4px;
  background: #fbfbfa; display: flex; align-items: center; justify-content: center;
  font-size: 9.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase;
  letter-spacing: .02em;
}
.file-ico.pdf { color: #b3392f; border-color: #f0cdca; background: #fdf4f3; }
.file-ico.img { color: #2b6ca8; border-color: #cfe0ef; background: #f3f7fb; }

.dropzone {
  border: 2px dashed var(--brand-line);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  background: #fbfcfb;
  transition: background .15s, border-color .15s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.over { background: var(--brand-soft); border-color: var(--brand); }
.dropzone input[type=file] { display: none; }
.dropzone .big { font-size: 24px; opacity: .5; margin-bottom: 6px; }
.dropzone .hint { margin-top: 6px; }
.filelist { margin-top: 10px; font-size: 13px; color: var(--ink-2); text-align: left; }
.filelist div { padding: 3px 0; }

/* ---------- Formatauswahl mit Größenvorschau ---------- */

.formats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}

.fmt {
  display: block;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  background: var(--paper);
  transition: border-color .12s, box-shadow .12s, background .12s;
  margin: 0;
  font-weight: 400;
}
.fmt:hover { border-color: var(--brand-line); background: #fbfcfb; }
.fmt.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(47, 111, 79, .1);
}
.fmt input { position: absolute; opacity: 0; pointer-events: none; }

.fmt .page {
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 3px;
  margin-bottom: 10px;
  overflow: hidden;
}
.fmt .page::before { content: ""; display: block; padding-top: 132%; }
.fmt .ad {
  position: absolute;
  top: 4%;
  left: 4%;
  background: var(--brand);
  opacity: .82;
  border-radius: 1px;
  min-height: 2px;
  min-width: 2px;
  transition: width .15s, height .15s;
}
.fmt.selected .ad { opacity: 1; }
.fmt .fmt-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.fmt .fmt-size { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.fmt .fmt-price {
  font-size: 15px; font-weight: 650; color: var(--brand-dark); margin-top: 6px;
}
.fmt .fmt-price small { font-weight: 500; color: var(--ink-3); font-size: 11.5px; }

/* Auswahl von Terminen */
.dates { display: grid; gap: 8px; }
.dates.cols {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  margin-top: 12px;
}

.more-dates {
  margin-top: 14px;
  border-top: 1px solid var(--line-2);
  padding-top: 14px;
}
.more-dates > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--brand-dark);
  list-style: none;
  padding-left: 22px;
  position: relative;
}
.more-dates > summary::-webkit-details-marker { display: none; }
.more-dates > summary::before {
  content: "+";
  position: absolute;
  left: 0;
  top: -1px;
  width: 17px;
  height: 17px;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}
.more-dates[open] > summary::before { content: "−"; }
.more-dates > summary .hint { font-weight: 400; }
.date-opt {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 9px 12px; cursor: pointer; margin: 0; font-weight: 400;
  transition: border-color .12s, background .12s;
}
.date-opt:hover { background: #fbfbfa; }
.date-opt.selected { border-color: var(--brand); background: var(--brand-soft); }
.date-opt input { width: 16px; height: 16px; accent-color: var(--brand); flex: 0 0 auto; }
.date-opt .d-main { font-weight: 550; }
.date-opt .d-sub { font-size: 12.5px; color: var(--ink-3); }
.date-opt .spacer { flex: 1; }
.date-opt.fixed { background: var(--brand-soft); border-color: var(--brand-line); }

/* Weiche: fertige Daten oder Gestaltung */
.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice-opt {
  border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 14px; cursor: pointer; margin: 0; font-weight: 400;
  transition: border-color .12s, background .12s;
}
.choice-opt:hover { border-color: var(--brand-line); }
.choice-opt.selected { border-color: var(--brand); background: var(--brand-soft); }
.choice-opt input { position: absolute; opacity: 0; pointer-events: none; }
.choice-opt .c-title { font-weight: 620; font-size: 14.5px; margin-bottom: 3px; }
.choice-opt .c-sub { font-size: 13px; color: var(--ink-2); line-height: 1.45; }

/* Schrittzähler */
.steps-head { display: flex; align-items: center; gap: 10px; }
.step-no {
  width: 25px; height: 25px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 650; flex: 0 0 25px;
}

@media (max-width: 620px) {
  .choice { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Preisrechner ---------- */

.calc {
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: sticky;
  top: 76px;
}
.calc h3 { margin-bottom: 12px; color: var(--brand-dark); font-size: 14px;
  text-transform: uppercase; letter-spacing: .05em; }
.calc .steps {
  font-size: 12.5px; color: var(--ink-2); border-top: 1px solid var(--brand-line);
  margin-top: 12px; padding-top: 10px; line-height: 1.6;
}
.calc .steps div { padding: 1px 0; }
.calc .big-total { font-size: 25px; font-weight: 660; color: var(--brand-dark);
  letter-spacing: -.02em; }

/* ---------- Anmeldeseiten ---------- */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  background:
    radial-gradient(1100px 520px at 50% -10%, var(--brand-soft), transparent 70%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 32px;
}
.auth-card.wide { max-width: 620px; }
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head img { max-width: 190px; max-height: 60px; margin: 0 auto 14px; display: block; }
.auth-head .title {
  font-family: var(--serif); font-size: 24px; font-weight: 600;
  color: var(--brand-dark); letter-spacing: -.01em;
}
.auth-head .sub { color: var(--ink-3); font-size: 13.5px; margin-top: 4px; }
.auth-foot {
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-2);
  text-align: center; font-size: 13.5px; color: var(--ink-3);
}

/* ---------- Handbuch ---------- */

.manual { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 30px;
          align-items: start; }
.manual-toc {
  position: sticky; top: 76px; font-size: 13.5px;
  border-left: 2px solid var(--line); padding-left: 14px;
}
.manual-toc a { display: block; padding: 4px 0; color: var(--ink-2); }
.manual-toc a:hover { color: var(--brand-dark); text-decoration: none; }
.manual-toc .group {
  font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 650; margin: 14px 0 4px;
}
.manual-toc .group:first-child { margin-top: 0; }

.manual-body { max-width: 720px; }
.manual-body h2 {
  font-size: 20px; margin: 34px 0 12px; padding-top: 8px;
  scroll-margin-top: 76px;
}
.manual-body h2:first-child { margin-top: 0; }
.manual-body h3 { font-size: 15.5px; margin: 22px 0 8px; }
.manual-body p, .manual-body li { font-size: 15px; line-height: 1.65; }
.manual-body ul, .manual-body ol { padding-left: 22px; margin: 0 0 14px; }
.manual-body li { margin-bottom: 6px; }
.manual-body .lead { font-size: 16px; color: var(--ink-2); }

.manual-body ol.walk { counter-reset: step; list-style: none; padding-left: 0; }
.manual-body ol.walk > li {
  position: relative; padding-left: 42px; margin-bottom: 16px;
}
.manual-body ol.walk > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 27px; height: 27px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 650; font-size: 13.5px;
}
.manual-body ol.walk > li strong { display: block; margin-bottom: 2px; }

.manual-body .box {
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  padding: 13px 16px; margin: 16px 0; font-size: 14.5px;
}
.manual-body .box.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.manual-body .box strong { color: var(--ink); }

.manual-body kbd {
  background: var(--paper); border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 4px;
  padding: 1px 6px; font-size: 13px; font-family: var(--sans);
  font-weight: 550; white-space: nowrap;
}

@media (max-width: 900px) {
  .manual { grid-template-columns: minmax(0, 1fr); }
  .manual-toc { position: static; border-left: 0; padding-left: 0;
                border-bottom: 1px solid var(--line); padding-bottom: 14px; }
}

@media print {
  .manual { grid-template-columns: minmax(0, 1fr); }
  .manual-toc { display: none; }
  .manual-body { max-width: none; }
  .manual-body h2 { page-break-after: avoid; }
}

/* ---------- Support-Modus ---------- */

body.support { border-top: 4px solid #9a6b12; }

.supportbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: #fdf3e0;
  border-bottom: 1px solid #e6cf9d;
  color: #7a5410;
  padding: 9px 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13.5px;
  flex-wrap: wrap;
}
.supportbar .who { font-weight: 650; }
.supportbar .spacer { flex: 1; }
.supportbar .btn {
  background: #7a5410;
  border-color: #7a5410;
  color: #fff;
  padding: 5px 13px;
  font-size: 13px;
}
.supportbar .btn:hover { background: #64450d; border-color: #64450d; }

/* Die Kopfzeile rutscht unter das Band */
body.support .topbar { top: 40px; }

/* ---------- Sammelaktionen ---------- */

.bulkbar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  background: var(--paper);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  display: none;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.bulkbar.show { display: flex; }
.bulkbar .count { font-weight: 620; color: var(--brand-dark); }
.bulkbar .spacer { flex: 1; }

td .rowcheck, th .rowcheck {
  width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer;
}

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

@media print {
  .sidebar, .topbar, .btn, .filters, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .content { padding: 0; max-width: none; }
}

/* ---------- Schmale Bildschirme ---------- */

@media (max-width: 1080px) {
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.side { grid-template-columns: minmax(0, 1fr); }
  .calc { position: static; }
}

@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: static;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; }
  .nav-group { margin: 0; display: contents; }
  .nav-title { display: none; }
  .nav a { margin: 0; }
  .sidebar-foot { display: flex; justify-content: space-between; align-items: center; }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid, .form-grid.c3 { grid-template-columns: minmax(0, 1fr); }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .card-head { flex-wrap: wrap; }
}
