/* =========================================================================
   CP Pro Office – Design System
   ========================================================================= */
:root {
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --surface-3: #eceff5;
  --border: #e1e5ee;
  --border-strong: #c9d0dd;
  --text: #141a26;
  --text-2: #4a5468;
  --text-3: #7a8497;
  --primary: #1d5bdc;
  --primary-hover: #174bb8;
  --primary-soft: #e6eefc;
  --primary-text: #ffffff;
  --rail: #0f1b33;
  --rail-2: #16244a;
  --rail-text: #aab6d1;
  --rail-active: #2f6cf0;
  --brand: #1d5bdc;
  --brand-soft: #e6eefc;
  --success: #15803d;
  --success-soft: #e5f5ea;
  --warning: #b45309;
  --warning-soft: #fdf2df;
  --danger: #c62828;
  --danger-soft: #fdeaea;
  --info: #0e7490;
  --info-soft: #e1f3f7;
  --violet: #6d28d9;
  --violet-soft: #efe8fc;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 4px 12px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar-w: 84px;
  --topbar-h: 60px;
  --font: "Manrope", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1116;
  --surface: #171a21;
  --surface-2: #1c2029;
  --surface-3: #242935;
  --border: #2a303c;
  --border-strong: #3a4150;
  --text: #e8eaf0;
  --text-2: #b3b9c6;
  --text-3: #858c9b;
  --primary: #5b8cff;
  --primary-hover: #7aa2ff;
  --primary-soft: #1d2a4a;
  --primary-text: #0b1020;
  --rail: #0b0f18;
  --rail-2: #141b2b;
  --rail-text: #8f9bb5;
  --rail-active: #2f6cf0;
  --brand: #5b8cff;
  --brand-soft: #1d2a4a;
  --success: #4ade80;
  --success-soft: #16301f;
  --warning: #fbbf24;
  --warning-soft: #36290f;
  --danger: #f87171;
  --danger-soft: #3a1a1a;
  --info: #22d3ee;
  --info-soft: #0f2e36;
  --violet: #a78bfa;
  --violet-soft: #2a2140;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 3px rgba(0, 0, 0, .5);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
h4 { font-size: 13px; }
p { margin: 0 0 8px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; }
.small { font-size: 12px; }
.danger-text { color: var(--danger); }
.success-text { color: var(--success); }
.warning-text { color: var(--warning); }
::selection { background: var(--primary-soft); }

/* ---------- Layout: Icon-Leiste (Rail) + Kommandozeile ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar {
  background: var(--rail); color: var(--rail-text);
  display: flex; flex-direction: column; min-height: 0; align-items: stretch;
}
.sidebar-brand { height: var(--topbar-h); display: flex; align-items: center; justify-content: center; flex: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: var(--rail-active); color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; letter-spacing: -.02em; box-shadow: 0 6px 16px rgba(47, 108, 240, .35);
}
.brand-text { display: none; }
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 8px 10px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: none; }
.sidebar-nav::-webkit-scrollbar { display: none; }
.nav-group { margin: 0; }
.nav-group + .nav-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .08); }
.nav-group-title { display: none; }
.nav-items { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 56px; padding: 6px 2px; border-radius: 12px;
  color: var(--rail-text); font-weight: 600; font-size: 10.5px; line-height: 1.1; text-align: center;
  cursor: pointer; text-decoration: none !important; position: relative; transition: background .12s, color .12s;
}
.nav-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item svg { width: 22px; height: 22px; flex: none; color: currentColor; }
.nav-item:hover { background: var(--rail-2); color: #fff; }
.nav-item.active { background: var(--rail-active); color: #fff; box-shadow: 0 4px 12px rgba(47, 108, 240, .35); }
.nav-item .nav-count { position: absolute; top: 4px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 10.5px; font-weight: 700; background: #fff; color: var(--rail); display: grid; place-items: center; }
.nav-item .nav-count.danger { background: #ff6b6b; color: #fff; }
.sidebar-foot { padding: 10px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-foot-text { display: none; }
.sidebar .avatar { width: 38px; height: 38px; background: var(--rail-2); color: #fff; cursor: pointer; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--primary-soft); color: var(--primary); flex: none; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 10px;
  padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar .search-trigger {
  display: flex; align-items: center; gap: 10px; flex: 1; max-width: 640px; height: 42px; padding: 0 14px;
  border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text-3); cursor: pointer; font: inherit; font-size: 14px; text-align: left;
}
.topbar .search-trigger:hover { border-color: var(--border-strong); background: var(--surface); }
.topbar .search-trigger svg { width: 18px; height: 18px; color: var(--primary); flex: none; }
.topbar .search-trigger span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .search-trigger kbd { margin-left: auto; }
.topbar-spacer { flex: 1; }
.topbar .btn-icon { width: 40px; height: 40px; border-radius: 10px; }
.topbar .page-context { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
#navToggle { display: none; }
.topbar-alerts { display: flex; gap: 6px; }
.topbar-alerts .badge { height: 26px; cursor: pointer; }
kbd { font-family: var(--font); font-size: 11px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--text-3); }
.content { flex: 1; overflow: auto; }
.page { padding: 20px 24px 40px; max-width: 1600px; margin: 0 auto; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { display: flex; flex-direction: column; gap: 2px; }
.page-title .crumbs { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: center; }
.page-title .crumbs a { color: var(--text-3); }
.page-subtitle { color: var(--text-3); font-size: 13px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Grid helpers ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { 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)); }
.grid-sidebar { grid-template-columns: minmax(0, 1fr) 340px; }
.grid-list-detail { grid-template-columns: 340px minmax(0, 1fr); }
.row { display: flex; gap: 8px; align-items: center; }
.row-wrap { flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .mt-sm { margin-top: 8px; } .mb-sm { margin-bottom: 8px; }
.grid-editor { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.grid-editor > .stack:last-child { position: sticky; top: 0; }
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-sidebar, .grid-list-detail { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .grid-editor { grid-template-columns: 1fr; } .grid-editor > .stack:last-child { position: static; } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .page { padding: 14px 14px 40px; } .topbar { padding: 0 12px; } .topbar .page-context, .topbar .gj-wrap { display: none; } }
/* Tablet / Touch: größere Ziele, mehr Luft */
@media (pointer: coarse) {
  .btn { min-height: 44px; padding: 0 16px; border-radius: 10px; }
  .btn-sm { min-height: 40px; padding: 0 12px; font-size: 14px; }
  .btn-icon { min-width: 44px; } .btn-icon.btn-sm { min-width: 40px; }
  .input, .select { height: 44px; font-size: 15px; } .input-sm { height: 40px; font-size: 14px; }
  .textarea { min-height: 96px; font-size: 15px; }
  .checkbox input { width: 22px; height: 22px; }
  .table td { padding: 12px 12px; } .table.compact td { padding: 9px 10px; }
  .tab { padding: 14px 14px; font-size: 14px; }
  .chip { height: 40px; padding: 0 14px; font-size: 14px; }
  .dropdown-item { padding: 12px 12px; font-size: 15px; }
  .nav-item { min-height: 62px; }
  .cp-grid td { height: 34px; } .cp-grid .input-sm, .cp-grid .select.input-sm { height: 32px; font-size: 13px; }
  .pill-tabs button { padding: 9px 14px; font-size: 14px; }
}
@media (max-width: 1024px) and (orientation: portrait) { .grid-sidebar { grid-template-columns: 1fr; } .grid-am-head { grid-template-columns: 1fr 1fr; } }

/* ---------- Card ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); min-height: 48px; }
.card-header h3 { display: flex; align-items: center; gap: 8px; }
.card-header h3 svg { width: 16px; height: 16px; color: var(--text-3); }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }
.card-footer { padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Stat tiles ---------- */
.stat { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: 12px; color: var(--text-3); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.stat-label svg { width: 14px; height: 14px; }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--text-3); }
.stat.clickable { cursor: pointer; }
.stat.clickable:hover { background: var(--surface-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .12s, border-color .12s, color .12s;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn-sm { height: 28px; padding: 0 9px; font-size: 13px; border-radius: 6px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
.btn-group .btn.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); z-index: 1; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 7px;
  background: var(--surface); color: var(--text); font: inherit; outline: none; min-width: 0;
}
.textarea { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input[readonly], .input:disabled, .select:disabled, .textarea[readonly] { background: var(--surface-2); color: var(--text-2); }
.input.num { text-align: right; }
.input-sm { height: 28px; font-size: 13px; padding: 0 8px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap svg { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.input-wrap .input { padding-left: 32px; }
.input-affix { display: flex; }
.input-affix .input { border-radius: 7px 0 0 7px; }
.input-affix .affix { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 7px 7px 0; background: var(--surface-2); color: var(--text-3); font-size: 13px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13.5px; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .span-12 { grid-column: span 12; } .form-grid .span-9 { grid-column: span 9; } .form-grid .span-8 { grid-column: span 8; }
.form-grid .span-6 { grid-column: span 6; } .form-grid .span-4 { grid-column: span 4; } .form-grid .span-3 { grid-column: span 3; }
.form-grid .span-2 { grid-column: span 2; } .form-grid .span-1 { grid-column: span 1; } .form-grid .span-5 { grid-column: span 5; } .form-grid .span-7 { grid-column: span 7; }
.form-grid .span-10 { grid-column: span 10; } .form-grid .span-11 { grid-column: span 11; }
.form-section-title { grid-column: span 12; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding-top: 6px; border-top: 1px solid var(--border); margin-top: 4px; }
.form-section-title:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
@media (max-width: 900px) { .form-grid [class*="span-"] { grid-column: span 12; } }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
/* Projektstatus: Laufend rot · Fertig schwarz · Anfrage orange */
.badge.proj-laufend { background: #d92d20; color: #fff; }
.badge.proj-fertig { background: #16191f; color: #fff; }
.badge.proj-anfrage { background: #f5820a; color: #fff; }
:root[data-theme="dark"] .badge.proj-fertig { background: #e8eaf0; color: #0f1116; }
.tile.laufend { border-left-color: #d92d20; } .tile.fertig { border-left-color: #16191f; } .tile.anfrage, .tile.angebot { border-left-color: #f5820a; }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  position: sticky; top: 0; z-index: 1; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3);
  background: var(--surface-2); padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none;
}
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--text); }
.table th .sort-ind { opacity: .7; margin-left: 3px; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr.selected td { background: var(--primary-soft); }
.table tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--border); padding: 9px 12px; }
.table.compact td { padding: 5px 10px; }
.table.compact th { padding: 6px 10px; }
.table td.actions { width: 1%; white-space: nowrap; text-align: right; }
.table .cell-title { font-weight: 600; color: var(--text); }
.table .cell-sub { font-size: 12px; color: var(--text-3); }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.toolbar .input-wrap { width: 280px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 28px; padding: 0 11px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip .chip-count { font-size: 11px; opacity: .7; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 12px; overflow-x: auto; }
.tab { padding: 10px 12px; border: 0; background: none; font: inherit; font-weight: 550; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab svg { width: 15px; height: 15px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 14, 22, .45); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .12s ease-out; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .14s ease-out; }
.modal.lg { width: min(860px, 100%); }
.modal.xl { width: min(1180px, 100%); }
.modal.sm { width: min(420px, 100%); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px; overflow: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal-footer .left { margin-right: auto; display: flex; gap: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }

/* ---------- Drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(10, 14, 22, .3); z-index: 90; animation: fade .12s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); box-shadow: var(--shadow-lg); z-index: 91; display: flex; flex-direction: column; animation: slide .16s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }

/* ---------- Toast ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px; padding: 10px 14px; border-radius: 10px; background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-weight: 500; animation: pop .15s; }
.toast svg { width: 18px; height: 18px; flex: none; }
.toast.success svg { color: #4ade80; } .toast.error svg { color: #f87171; } .toast.warning svg { color: #fbbf24; }

/* ---------- Dropdown ---------- */
.dropdown { position: fixed; z-index: 150; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 5px; animation: pop .1s; }
.dropdown-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 6px; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.dropdown-item svg { width: 16px; height: 16px; color: var(--text-3); }
.dropdown-item:hover { background: var(--surface-3); }
.dropdown-item.danger { color: var(--danger); } .dropdown-item.danger svg { color: var(--danger); }
.dropdown-sep { height: 1px; background: var(--border); margin: 4px 0; }
.dropdown-label { padding: 6px 10px 2px; font-size: 11px; font-weight: 650; text-transform: uppercase; color: var(--text-3); letter-spacing: .05em; }

/* ---------- Command palette ---------- */
.palette { width: min(640px, 100%); align-self: start; margin-top: 10vh; }
.palette-input { border: 0; border-bottom: 1px solid var(--border); height: 52px; font-size: 16px; padding: 0 18px; width: 100%; background: transparent; color: var(--text); outline: none; font-family: inherit; }
.palette-list { max-height: 60vh; overflow: auto; padding: 6px; }
.palette-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.palette-item svg { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.palette-item.active { background: var(--primary-soft); }
.palette-item .pi-sub { margin-left: auto; font-size: 12px; color: var(--text-3); }

/* ---------- Empty state ---------- */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 40px 20px; text-align: center; color: var(--text-3); }
.empty svg { width: 36px; height: 36px; color: var(--border-strong); }
.empty .empty-title { font-weight: 600; color: var(--text-2); }
.empty .btn svg { width: 14px; height: 14px; color: inherit; }

/* ---------- Tree ---------- */
.tree { font-size: 13.5px; }
.tree-node { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; cursor: pointer; user-select: none; }
.tree-node:hover { background: var(--surface-3); }
.tree-node.active { background: var(--primary-soft); color: var(--primary); }
.tree-node svg { width: 15px; height: 15px; flex: none; color: var(--text-3); }
.tree-toggle { width: 16px; height: 16px; display: grid; place-items: center; flex: none; }
.tree-children { padding-left: 18px; }
.tree-count { margin-left: auto; font-size: 11px; color: var(--text-3); }

/* ---------- OneDrive-Abgleich ---------- */
.sync-btn { gap: 6px; font-size: 12px; font-weight: 600; padding: 0 10px; border: 1px solid transparent; }
.sync-btn.sync-none { color: var(--text-3); }
.sync-btn.sync-ok { color: var(--success); background: var(--success-soft); border-color: transparent; }
.sync-btn.sync-dirty { color: var(--warning); background: var(--warning-soft); }
.sync-btn.sync-wait { color: var(--primary); background: var(--primary-soft); }
.sync-btn.sync-wait svg { animation: sync-pulse 1.6s ease-in-out infinite; }
@keyframes sync-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .sync-btn.sync-wait svg { animation: none; } }

/* ---------- Kompakte Kopfbereiche (Aufmaß) ---------- */
.compact { font-size: 12.5px; }
.compact .card-header { padding: 6px 12px; min-height: 34px; }
.compact .card-header h3 { font-size: 12.5px; }
.compact .card-body { padding: 10px 12px; }
.compact .field > label { font-size: 11px; }
.compact .input, .compact .select { height: 27px; font-size: 12.5px; padding: 0 7px; }
.compact .form-grid { gap: 6px 10px; }
.compact .kv { font-size: 12.5px; gap: 3px 12px; }
.compact .sumbox { gap: 3px; font-size: 12.5px; }
.compact .sumbox .sum-row.total { font-size: 13.5px; padding-top: 4px; }
.grid-am-head { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr 1fr; gap: 12px; }
@media (max-width: 1300px) { .grid-am-head { grid-template-columns: 1fr 1fr; } }
tr.pos-selected td { background: var(--primary-soft) !important; }
/* Positionsraster im CP-Pro-Stil: dichte Zeilen, Gitterlinien, Zebra */
.pos-grid, .am-grid { font-size: 12.5px; }
.pos-grid th, .am-grid th { font-size: 11px; padding: 5px 6px; border-right: 1px solid var(--border); background: var(--surface-3); color: var(--text-2); }
.pos-grid td, .am-grid td { padding: 2px 5px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.pos-grid tbody tr:nth-child(even) td, .am-grid tbody tr:nth-child(even) td { background: var(--surface-2); }
.pos-grid tbody tr:hover td, .am-grid tbody tr:hover td { background: var(--primary-soft); }
.pos-grid .input-sm, .am-grid .input-sm, .pos-grid .select.input-sm, .am-grid .select.input-sm { height: 25px; font-size: 12.5px; border-color: transparent; background: transparent; border-radius: 4px; padding: 0 5px; }
.pos-grid .input-sm:hover, .am-grid .input-sm:hover { border-color: var(--border-strong); background: var(--surface); }
.pos-grid .input-sm:focus, .am-grid .input-sm:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 2px var(--primary-soft); }
.pos-grid tr.miet td { color: var(--text-2); }
.pos-grid tfoot td, .am-grid tfoot td { border-right: 0; }
/* CP-Pro-Raster im Aufmaß: noch dichter, kleinere Schrift */
.cp-grid { font-size: 11px; }
.cp-grid th { font-size: 10px; padding: 3px 4px; white-space: nowrap; }
.cp-grid td { padding: 0 3px; height: 22px; }
.cp-grid .input-sm, .cp-grid .select.input-sm { height: 20px; font-size: 11px; padding: 0 3px; }
.cp-grid .btn-sm { height: 20px !important; font-size: 11px; }
.cp-grid .btn-icon.btn-sm { width: 22px; }
.cp-grid tfoot td { height: 24px; font-size: 11px; }
.drag-handle { cursor: grab; color: var(--text-3); width: 14px; text-align: center; user-select: none; }
.drag-handle:active { cursor: grabbing; }
tr.dragging td { opacity: .45; }
tr.drop-above td { box-shadow: inset 0 2px 0 var(--primary) !important; }
tr.drop-below td { box-shadow: inset 0 -2px 0 var(--primary) !important; }
.am-page .compact { font-size: 11.5px; }
.am-page .compact .card-header { padding: 4px 10px; min-height: 28px; }
.am-page .compact .card-header h3 { font-size: 11.5px; }
.am-page .compact .input, .am-page .compact .select { height: 24px; font-size: 11.5px; }
.am-page .compact .field > label { font-size: 10.5px; }
.am-page .compact .kv { font-size: 11.5px; gap: 2px 10px; }
.am-page .compact .sumbox { font-size: 11.5px; gap: 2px; }
.am-page .compact .sumbox .sum-row.total { font-size: 12.5px; }
.am-page .toolbar { padding: 4px 8px !important; }
.am-page .toolbar .btn-sm { height: 24px; font-size: 11.5px; padding: 0 7px; }
.am-page .tabs .tab { padding: 6px 10px; font-size: 12px; }
.am-page .page-header .btn-sm { height: 26px; }
.am-page .page-title .crumbs { font-size: 11px; }
.am-page .page-subtitle { font-size: 12px; }
.cp-grid input[type="date"].input-sm { padding: 0 2px; }
.cp-grid input[type="checkbox"] { width: 13px; height: 13px; margin: 0; }
.cp-grid tr.row-fertig td { background: var(--danger-soft) !important; }
.cp-grid tr.row-tk td { background: var(--warning-soft) !important; font-weight: 600; }
.cp-grid tr.row-txt td, .cp-grid td.txt, .cp-grid tr.row-txt .input-sm { color: var(--primary); }
.cp-grid tr.row-frei td { opacity: .6; }
.cp-grid tr.row-marked td { background: var(--warning-soft) !important; }
.cp-grid tr.pos-selected td { background: var(--primary-soft) !important; box-shadow: inset 2px 0 0 var(--primary); }
.am-page .compact .card-body { padding: 6px 10px; }
.am-page .compact .form-grid { gap: 3px 8px; }
.am-page .page-header { margin-bottom: 8px; }
.am-page h1 { font-size: 17px; }
.am-page .mb { margin-bottom: 10px; }

/* ---------- A–Z Kundenliste ---------- */
.az-wrap { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; }
.az-bar { display: flex; flex-direction: column; gap: 1px; position: sticky; top: 8px; }
.az-letter { border: 0; background: var(--surface-3); color: var(--text-2); font: inherit; font-size: 11.5px; font-weight: 650; width: 34px; height: 21px; border-radius: 4px; cursor: pointer; }
.az-letter:hover { background: var(--primary-soft); color: var(--primary); }
.az-letter.off { opacity: .3; cursor: default; }
.az-letter.has { background: var(--primary); color: var(--primary-text); }
.az-list { border: 1px solid var(--border); border-radius: 8px; max-height: 60vh; overflow: auto; scroll-padding-top: 34px; }
.az-group { scroll-margin-top: 0; }
.az-head { position: sticky; top: 0; z-index: 2; background: var(--surface-2); border-bottom: 1px solid var(--border); border-top: 1px solid var(--border); padding: 5px 12px; font-size: 13px; font-weight: 750; color: var(--primary); letter-spacing: .04em; }
.az-group:first-child .az-head { border-top: 0; }
.az-group .table th { display: none; }

/* ---------- Progress ---------- */
.progress { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); border-radius: 3px; }
.progress.success > div { background: var(--success); }
.progress.warning > div { background: var(--warning); }

/* ---------- Key/value list ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Summary box ---------- */
.sumbox { display: flex; flex-direction: column; gap: 6px; font-variant-numeric: tabular-nums; }
.sumbox .sum-row { display: flex; justify-content: space-between; gap: 16px; }
.sumbox .sum-row.total { font-size: 16px; font-weight: 700; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 2px; }
.sumbox .sum-row.sub { color: var(--text-3); font-size: 13px; }

/* ---------- Timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: grid; grid-template-columns: 20px 1fr; gap: 10px; position: relative; padding-bottom: 14px; }
.tl-item::before { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; }
.tl-dot svg { width: 12px; height: 12px; color: var(--text-2); }

/* ---------- Scrollbars ---------- */
.content::-webkit-scrollbar, .table-wrap::-webkit-scrollbar, .sidebar-nav::-webkit-scrollbar, .modal-body::-webkit-scrollbar { width: 10px; height: 10px; }
.content::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb, .sidebar-nav::-webkit-scrollbar-thumb, .modal-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.divider-v { width: 1px; align-self: stretch; background: var(--border); }
.color-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.pill-tabs { display: inline-flex; background: var(--surface-3); border-radius: 8px; padding: 3px; gap: 2px; }
.pill-tabs button { border: 0; background: none; padding: 5px 11px; border-radius: 6px; font: inherit; font-size: 13px; font-weight: 550; color: var(--text-2); cursor: pointer; }
.pill-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Cockpit: Projektkacheln mit Ablaufkette ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; position: relative; border-left: 4px solid var(--border-strong); min-width: 0; }
.tile.laufend { border-left-color: var(--primary); }
.tile.fertig { border-left-color: var(--success); opacity: .92; }
.tile.miete-kritisch { border-left-color: var(--danger); }
.tile.anfrage, .tile.angebot { border-left-color: var(--warning); }
.tile-head { display: flex; align-items: flex-start; gap: 10px; }
.tile-ktr { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); font-weight: 600; letter-spacing: .02em; }
.tile-title { font-size: 15.5px; font-weight: 750; letter-spacing: -.01em; line-height: 1.25; }
.tile-sub { font-size: 12.5px; color: var(--text-3); }
.tile-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; font-size: 12.5px; color: var(--text-3); }
.tile-kpis b { display: block; color: var(--text); font-variant-numeric: tabular-nums; font-size: 13.5px; }
.tile-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.tile-add { border: 2px dashed var(--border-strong); border-radius: var(--radius); display: grid; place-items: center; color: var(--text-3); font-weight: 650; min-height: 120px; cursor: pointer; background: transparent; font: inherit; }
.tile-add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.chain { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.chain span { font-size: 10.5px; font-weight: 700; text-align: center; padding: 5px 2px; border-radius: 6px; background: var(--surface-3); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chain span.done { background: var(--success); color: #fff; }
.chain span.now { background: var(--primary); color: #fff; box-shadow: 0 0 0 2px var(--primary-soft); }
.chain span.warn { background: var(--danger); color: #fff; }

/* ---------- Dashboard-Raster: oben Todos | Zahlungseingänge · unten Rechnung schreiben | Überfällige ---------- */
.dash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash > .stack { display: contents; }
.dash .d-todos { order: 1; } .dash .d-zahlung { order: 2; } .dash .d-mail { order: 3; } .dash .d-ueber { order: 4; } .dash .d-rechnung { order: 5; }
@media (max-width: 900px) { .dash { grid-template-columns: 1fr; } }

/* ---------- Dashboard: Todos & Heute ---------- */
.todo { display: flex; align-items: flex-start; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--border); }
.todo:last-child { border-bottom: 0; }
.todo input[type="checkbox"] { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--primary); flex: none; cursor: pointer; }
.todo .todo-text { font-weight: 550; line-height: 1.3; }
.todo .todo-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.todo.auto .todo-text::before { content: "auto"; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); background: var(--primary-soft); padding: 1px 5px; border-radius: 4px; margin-right: 6px; vertical-align: 1px; }
.todo.ueber .todo-text { color: var(--danger); }
.todo.done .todo-text { text-decoration: line-through; color: var(--text-3); }
.todo .todo-go { margin-left: auto; flex: none; color: var(--text-3); }
.heute-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; }
.heute-item .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.kpi-hero { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; cursor: pointer; box-shadow: var(--shadow-sm); }
.kpi:hover { border-color: var(--border-strong); }
.kpi-label { font-size: 12px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 6px; }
.kpi-label svg { width: 14px; height: 14px; }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-sub { font-size: 12.5px; color: var(--text-3); }
.kpi.danger .kpi-value { color: var(--danger); }
@media (max-width: 1100px) { .kpi-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpi-hero { grid-template-columns: 1fr; } .tiles { grid-template-columns: 1fr; } }

/* ---------- Aufmaß-Schnellmodus (Tablet) ---------- */
.quick { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.quick .field > label { font-size: 13px; }
.quick .input, .quick .select { height: 54px; font-size: 20px; font-weight: 600; border-radius: 12px; }
.quick .input.num { font-variant-numeric: tabular-nums; }
.quick .btn-xl { min-height: 56px; font-size: 17px; font-weight: 750; border-radius: 12px; padding: 0 22px; }
.quick .btn-xl svg { width: 20px; height: 20px; }
.quick .pos-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.quick .pos-pick button { min-height: 60px; border: 1.5px solid var(--border-strong); border-radius: 12px; background: var(--surface); font: inherit; font-weight: 650; text-align: left; padding: 8px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.quick .pos-pick button.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.quick .pos-pick small { font-weight: 500; color: var(--text-3); }
.quick .qline { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.quick .qline.abgebaut { opacity: .6; }
.quick .qline .btn { min-height: 44px; }
.quick .massen-big { font-size: 34px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------- Dateien ablegen (Drag & Drop) / E-Mail ---------- */
.drop-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(29, 91, 220, .14); backdrop-filter: blur(2px); display: grid; place-items: center; pointer-events: none; animation: fade .1s; }
.drop-box { background: var(--surface); border: 3px dashed var(--primary); border-radius: 20px; padding: 36px 48px; text-align: center; color: var(--primary); box-shadow: var(--shadow-lg); max-width: min(560px, 90vw); }
.drop-title { font-size: 20px; font-weight: 800; margin-top: 8px; color: var(--text); }
.drop-sub { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.drop-hint { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 2px dashed var(--border-strong); border-radius: var(--radius); color: var(--primary); background: var(--surface-2); }
.foto-card:hover { border-color: var(--primary); }
.mail-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; }
.mail-opt:hover { border-color: var(--border-strong); }
.mail-opt.active { border-color: var(--primary); background: var(--primary-soft); }
.mail-opt input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex: none; }

/* ---------- Print ---------- */
.print-root { display: none; }
@media print {
  body { background: #fff; }
  .app, .toasts, .modal-backdrop, .drawer, .drawer-backdrop, .dropdown { display: none !important; }
  .print-root { display: block !important; color: #000; }
  @page { size: A4; margin: 18mm 16mm 20mm 20mm; }
}

/* ---- Positionen als Karten (Angebot / Auftrag / Rechnung) – mit dem Finger bedienbar ---- */
.pcards { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.pcard { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.pcard.miet { margin-left: 28px; border-left: 4px solid var(--primary); background: var(--primary-soft); }
.pcard.titel { background: var(--bg); }
.pcard.dragging { opacity: .55; box-shadow: var(--shadow-lg); }
.pcard.drop-above { box-shadow: 0 -3px 0 var(--primary); }
.pcard.drop-below { box-shadow: 0 3px 0 var(--primary); }
.pc-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; }
.pc-grip { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 40px; flex: none; color: var(--border-strong); cursor: grab; touch-action: none; border-radius: 8px; }
.pc-grip:hover { background: var(--bg); color: var(--text); }
.pc-kp { width: 62px; flex: none; text-align: center; font-family: var(--mono); font-weight: 700; }
.pc-title { flex: 1; min-width: 0; font-weight: 650; }
.pc-sum { flex: none; min-width: 104px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.pc-tag { flex: none; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--primary); }
.pc-main { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 2px 12px 8px 56px; }
.pc-main.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pc-more { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 10px 12px 10px 56px; border-top: 1px dashed var(--border); }
.pc-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pc-f > span { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-f .input, .pc-f .select, .pc-head .input { height: 40px; font-size: 15px; }
.pc-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 0 12px 10px 56px; }
.pc-foot .btn { height: 38px; }
.pc-foot .btn-icon { width: 42px; }
@media (max-width: 760px) {
  .pc-main, .pc-main.three, .pc-more { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-left: 12px; }
  .pc-foot { padding-left: 12px; }
  .pc-head { flex-wrap: wrap; }
  .pc-title { flex-basis: calc(100% - 120px); }
  .pc-sum { margin-left: auto; }
  .pcard.miet { margin-left: 14px; }
}
/* LV-Auswahl als große Kacheln */
.lv-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; max-height: 56vh; overflow: auto; padding: 2px; }
.lv-tile { text-align: left; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 12px; cursor: pointer; font: inherit; color: inherit; min-height: 92px; display: flex; flex-direction: column; gap: 4px; }
.lv-tile:hover { border-color: var(--border-strong); }
.lv-tile.on { border-color: var(--primary); background: var(--primary-soft); }
.lv-tile .t { font-weight: 700; line-height: 1.25; }
.lv-tile .m { font-size: 12.5px; color: var(--text-3); }
.lv-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.lv-chips .btn { height: 38px; }

.btn-primary-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); font-weight: 700; }
.btn-primary-soft:hover { border-color: var(--primary); }

/* ---- Aufmaß Tablet-Ansicht ---- */
.amk-kopf { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 12px; }
.amk-kopf .input { height: 44px; font-size: 15px; }
.amk-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.amk-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; min-width: 0; }
.amk-tile i, .amk-stat i { font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-3); }
.amk-tile b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.amk-tile small { color: var(--text-3); font-size: 12px; }
.amk-tile.go { border-color: var(--success); background: var(--success-soft); }
.amk-tile.go b { color: var(--success); }
.pcard.amk.auf { border-color: var(--primary); box-shadow: var(--shadow); }
.pcard.amk.fertig { background: var(--bg); }
.amk-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 2px 12px 12px 56px; cursor: pointer; }
.amk-stat { display: flex; flex-direction: column; font-size: 13px; }
.amk-stat b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; display: inline; }
.amk-stat.sum { margin-left: auto; text-align: right; }
.amk-stat.sum b { color: var(--primary); }
.amk-lines { border-top: 1px solid var(--border); }
.amk-line { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; padding: 12px; border-bottom: 1px solid var(--border); }
.amk-line.marked { background: var(--primary-soft); }
.amk-line.abgebaut { background: var(--bg); }
.amk-line.tk { background: var(--bg); }
.amk-check { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 18px; font-size: 11px; color: var(--text-3); cursor: pointer; }
.amk-check input { width: 26px; height: 26px; accent-color: var(--primary); }
.amk-fields { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.amk-r { display: grid; gap: 10px; }
.amk-r.a { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.amk-r.b { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.3fr); }
.amk-r.c { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) auto; }
.amk-info { display: flex; flex-direction: column; justify-content: end; font-size: 12.5px; color: var(--text-2); line-height: 1.35; }
@media (max-width: 900px) {
  .amk-kopf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .amk-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .amk-r.c { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .amk-stats { padding-left: 12px; }
}
@media (max-width: 600px) {
  .amk-r.a { grid-template-columns: 1fr; }
  .amk-r.b { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .amk-line { grid-template-columns: 40px minmax(0, 1fr); }
}
/* LV-Auswahl als einfache Liste */
.lv-tiles.list { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); padding: 0; }
.lv-tiles.list .lv-tile { flex-direction: row; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; flex: none; }
.lv-tiles.list .lv-tile:last-child { border-bottom: 0; }
.lv-tiles.list .lv-tile:hover { background: var(--bg); }
.lv-tiles.list .lv-tile.on { background: var(--primary-soft); }
.lv-tiles.list .t { flex: 1; min-width: 0; font-size: 15px; }
.lv-box { width: 26px; height: 26px; flex: none; border: 2px solid var(--border-strong); border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); }
.lv-tile.on .lv-box { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.lv-price { flex: none; color: var(--text-2); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pc-main.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 760px) { .pc-main.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.ca-btn { height: 40px; padding: 0 10px; flex: none; font-weight: 700; color: var(--text-3); }
.ca-btn.on { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.pc-f .row .input { min-width: 0; flex: 1; }

.pc-lv { width: 104px; flex: none; text-align: center; }
@media (max-width: 760px) { .pc-lv { width: 92px; } }

/* Angebot/Auftrag/Rechnung: Positionen über die volle Breite, Summen/Nachlässe/Funktionen darunter */
.grid-editor.doc-wide { grid-template-columns: minmax(0, 1fr); }
.grid-editor.doc-wide > .stack:last-child { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }

/* Positionskarte: Reihe 1 = Kd.-Pos. | LV-Pos. | Teil | ca. | Menge | Einheit · Reihe 2 = Preis | Satz | Standzeit | Gesamt | Knöpfe */
.pc-row1 { display: grid; grid-template-columns: 36px 64px 104px minmax(120px, 1fr) 52px 110px 96px; gap: 8px; padding: 10px 12px 6px; align-items: end; }
.pc-row2 { display: grid; grid-template-columns: 120px 84px 96px 120px minmax(0, 1fr); gap: 8px; padding: 0 12px 10px 56px; align-items: end; }
.pc-btns { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.pc-btns .btn { height: 40px; } .pc-btns .btn-icon { width: 42px; }
.pc-row1 .ca-btn { width: 100%; padding: 0; justify-content: center; }
@media (max-width: 760px) {
  .pc-row1 { grid-template-columns: 36px 64px 1fr 1fr; }
  .pc-row1 > :nth-child(4) { grid-column: 1 / -1; }
  .pc-row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-left: 12px; }
  .pc-btns { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (min-width: 761px) { .pc-btns { flex-wrap: nowrap; } }

/* Reihe 1 mit Einzelpreis + Gesamt, Reihe 2 nur noch Satz, Standzeit und Knöpfe */
.pc-row1 { grid-template-columns: 30px 54px 84px minmax(120px, 1fr) 44px 80px 92px 88px 98px; gap: 6px; }
.pc-row1 .input, .pc-row1 .select { padding-left: 8px; padding-right: 8px; }
.pc-row1 .select { padding-right: 22px; }
.pc-row2 { grid-template-columns: 84px 96px minmax(0, 1fr); }
@media (max-width: 760px) {
  .pc-row1 { grid-template-columns: 36px 64px 1fr 1fr; }
  .pc-row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.pc-combo { display: flex; min-width: 0; }
.pc-combo .input { flex: 1; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.pc-combo .btn { flex: none; width: 40px; height: 40px; border-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; color: var(--primary); }

/* Reihenfolge im Beleg: Kopfdaten, Positionen, Summen/Nachlässe/Funktionen, ganz unten Vortext/Nachtext/Interne Info */
.grid-editor.doc-wide > .stack:first-child { display: contents; }
.grid-editor.doc-wide > .stack:first-child > * { order: 1; }
.grid-editor.doc-wide > .stack:first-child > :nth-child(n+3) { order: 3; }
.grid-editor.doc-wide > .stack:last-child { order: 2; }

/* Beschreibung: nur so breit wie der laengste Text (passt sich beim Tippen an) */
@media (min-width: 761px) { .pc-row1 { grid-template-columns: 30px 54px 84px minmax(120px, var(--bw, 30ch)) 44px 80px 92px 88px 98px; justify-content: start; } }

/* Reihe 2: Leistung | Satz | Standzeit | Knoepfe */
@media (min-width: 761px) { .pc-row2 { grid-template-columns: 170px 84px 96px minmax(0, 1fr); } }

.back-kunde { margin-bottom: 8px; height: 34px; font-weight: 650; align-self: flex-start; width: auto; }
@media (pointer: coarse) { .back-kunde { height: 42px; } }

/* Aufmass: Seiten-Kopf (wie TK / Achse in CP Pro) */
.amk-seite { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); border-top: 2px solid var(--border-strong); position: sticky; top: 0; z-index: 2; }
.amk-seite.zu { border-bottom: 0; }
.amk-seite-sum { font-size: 13px; color: var(--text-2); cursor: pointer; }
.amk-seite-sum b { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.amk-seite.zu [data-sabbau], .amk-seite.zu [data-sdel] { display: none; }
.amk-seite [data-tkname] { width: 96px !important; }
.amk-seite.zu { padding-block: 5px; }

/* Aufmass-Position: gleiche Kopfzeile wie im Angebot */
.amk-row1 { display: grid; grid-template-columns: 30px 60px 96px minmax(160px, 1fr) 160px 84px 104px 92px auto; gap: 8px; padding: 10px 12px 6px; align-items: end; }
@media (max-width: 1100px) { .amk-row1 { grid-template-columns: 30px 60px 96px minmax(0, 1fr) 150px; } .amk-row1 > :nth-child(6) { grid-column: 2 / span 2; } .amk-row1 > :nth-child(9) { grid-column: 1 / -1; justify-self: end; } }
@media (max-width: 760px) { .amk-row1 { grid-template-columns: 30px 1fr 1fr; } .amk-row1 > :nth-child(4) { grid-column: 1 / -1; } }
/* Aufmass-Position: Kopfzeile mit Satz, Beschreibung nur so breit wie noetig; Miete als eigene Zeile darunter */
.amk-row1 { grid-template-columns: 30px 60px 96px minmax(160px, var(--bw, 32ch)) 160px 84px 104px 76px 92px minmax(max-content, 1fr); }
.amk-miete { display: grid; grid-template-columns: 30px 60px 96px minmax(160px, var(--bw, 32ch)) 160px 104px 76px auto; gap: 8px; padding: 8px 12px 10px; margin: 0 12px 8px 28px; border-left: 4px solid var(--primary); background: var(--primary-soft); border-radius: 0 10px 10px 0; align-items: end; justify-content: start; }
@media (max-width: 1100px) { .amk-miete { grid-template-columns: 30px 60px 96px minmax(0, 1fr) 140px; margin-left: 12px; } .amk-miete > :nth-child(6) { grid-column: 2 / span 2; } }
@media (max-width: 760px) { .amk-miete { grid-template-columns: 30px 1fr 1fr; } .amk-miete > :nth-child(4) { grid-column: 1 / -1; } }@media (max-width: 1100px) { .amk-row1 { grid-template-columns: 30px 60px 96px minmax(0, 1fr) 150px; } .amk-row1 > :nth-child(6) { grid-column: 2 / span 2; } .amk-row1 > :nth-child(9) { grid-column: auto; justify-self: stretch; } .amk-row1 > :nth-child(10) { grid-column: 1 / -1; justify-self: end; } }
@media (max-width: 760px) { .amk-row1 { grid-template-columns: 30px 1fr 1fr; } .amk-row1 > :nth-child(4) { grid-column: 1 / -1; } .amk-row1 > :nth-child(6) { grid-column: auto; } }
/* Messung in EINER Zeile (breiter Bildschirm): Baufortschritt | Bauteil | Text | Stueck | Laenge | Tiefe | Hoehe | Massen | Aufbau | Abbau | Knoepfe; die Miet-Info klein darunter */
@media (min-width: 1300px) {
  .amk-fields { display: grid; grid-template-columns: minmax(110px, 1.1fr) minmax(90px, 1fr) minmax(90px, 1fr) 64px 84px 70px 84px 104px 148px 148px auto; gap: 6px 8px; align-items: end; }
  .amk-fields > .amk-r { display: contents; }
  .amk-fields .amk-info { grid-column: 1 / -1; order: 99; flex-direction: row; flex-wrap: wrap; gap: 4px 18px; font-size: 12px; }
  .amk-fields .input { padding-left: 8px; padding-right: 8px; }
  .amk-line { padding-block: 8px; }
  .amk-check { padding-top: 20px; }
}
.amk-seite.zu [data-skop1] { display: none; }

/* ---- Begehung (iPad): Seite -> Teile -> jetziger Stand ---- */
.beg .pos-pick button small { display: block; font-weight: 500; opacity: .75; }
.beg-teil { display: grid; grid-template-columns: minmax(180px, 1.4fr) 130px 20px 150px minmax(200px, 1.2fr); gap: 10px; align-items: end; padding: 14px 16px; border-top: 1px solid var(--border); }
.beg-name { display: flex; flex-direction: column; gap: 2px; align-self: center; min-width: 0; }
.beg-name b { font-size: 16px; }
.beg-f { display: flex; flex-direction: column; gap: 3px; }
.beg-f > span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-3); }
.beg-f .input { height: 56px; font-size: 22px; font-weight: 800; }
.beg-f .input[readonly] { background: var(--surface-2); color: var(--text-2); }
.beg-f .beg-big { border-color: var(--primary); background: var(--primary-soft); }
.beg-x { align-self: end; line-height: 56px; font-size: 20px; font-weight: 800; color: var(--text-3); text-align: center; }
.beg-diff { align-self: end; min-height: 56px; display: flex; flex-direction: column; justify-content: center; padding: 6px 12px; border-radius: 12px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.beg-diff small { color: var(--text-2); font-size: 12px; }
.beg-diff.auf { background: var(--success-soft); color: var(--success); }
.beg-diff.ab { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 900px) { .beg-teil { grid-template-columns: 1fr 20px 1fr; } .beg-name, .beg-diff { grid-column: 1 / -1; } }
/* Grundriss */
.gr-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gr-farbe { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--border-strong); cursor: pointer; }
.gr-farbe.on { box-shadow: 0 0 0 3px var(--primary); }
.gr-wrap { padding: 0 16px; }
.gr-svg { width: 100%; height: auto; max-height: 68vh; border: 1.5px solid var(--border-strong); border-radius: 12px; touch-action: none; cursor: crosshair; background: #fff; display: block; }
/* Buero: Datum noch nicht bestaetigt */
.input.dat-pruefen { border-color: var(--warning) !important; background: var(--warning-soft) !important; font-weight: 700; }
.amk-pruef { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border: 1.5px solid var(--warning); background: var(--warning-soft); border-radius: 12px; margin-bottom: 12px; }
/* Vorfuehrung (selbstablaufend) */
.demo-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5000; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); background: #0f1b33; color: #fff; box-shadow: 0 -8px 30px rgba(0, 0, 0, .3); }
.demo-step { flex: none; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #9dbff5; min-width: 170px; }
.demo-text { flex: 1 1 320px; font-size: 16px; line-height: 1.4; }
.demo-text b { color: #ffd37a; }
.demo-finger { position: fixed; z-index: 5001; width: 34px; height: 34px; border-radius: 50%; background: rgba(29, 91, 220, .55); border: 3px solid #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .4); pointer-events: none; opacity: 0; transition: left .6s ease, top .6s ease, transform .15s ease, opacity .3s; left: 50%; top: 50%; }
.demo-finger.tipp { transform: scale(.65); background: rgba(29, 91, 220, .95); }
/* ---- Positionen im Beleg – Zeilen wie in CP-Pro ---- */
.cp-table { padding: 8px 12px 4px; }
.cp-head, .cp-grid { display: grid; grid-template-columns: 58px 62px 96px minmax(200px, 1fr) 86px 72px 104px 110px 60px 88px 46px 36px; gap: 6px; align-items: center; }
.cp-head { padding: 0 11px 6px; font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.cp-head .r { text-align: right; }
.cp-row { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 6px 10px; margin-bottom: 6px; box-shadow: var(--shadow-sm); }
.cp-row.miete { margin-left: 30px; border-left: 4px solid var(--primary); background: var(--primary-soft); }
.cp-row.txt { background: var(--bg); }
.cp-row.dragging { opacity: .55; box-shadow: var(--shadow-lg); }
.cp-row.drop-above { box-shadow: 0 -3px 0 var(--primary); }
.cp-row.drop-below { box-shadow: 0 3px 0 var(--primary); }
.cp-grid .input, .cp-grid .select, .cp-txt .input { height: 38px; font-size: 14px; padding-left: 8px; padding-right: 8px; min-width: 0; width: 100%; }
.cp-grid .select { padding-right: 20px; }
.cp-grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.cp-posc { display: flex; align-items: center; gap: 2px; min-width: 0; }
.cp-posc .pc-grip { width: 22px; height: 38px; }
.cp-kp { text-align: center; font-family: var(--mono); font-weight: 700; padding: 0 4px !important; }
.cp-nr { display: inline-block; min-width: 30px; text-align: center; font-family: var(--mono); font-weight: 800; color: var(--text-2); }
.cp-sub-mark { width: 22px; text-align: center; color: var(--primary); font-weight: 800; flex: none; }
.cp-mplus { height: 38px; padding: 0 6px; font-weight: 800; color: var(--primary); border-color: var(--primary); background: var(--primary-soft); width: 100%; }
.cp-mplus:hover { background: var(--primary); color: var(--primary-text); }
.cp-f { display: flex; flex-direction: column; min-width: 0; }
.cp-lbl { display: none; font-size: 10.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-check { display: flex; align-items: center; justify-content: center; height: 38px; cursor: pointer; }
.cp-check input { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }
.cp-kurzc { flex-direction: row; align-items: center; gap: 4px; }
.cp-kurz { font-weight: 650; flex: 1; }
.cp-aa { flex: none; height: 38px; width: 38px; padding: 0; color: var(--text-3); }
.cp-aa.on { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.cp-ac { position: relative; min-width: 0; }
.cp-ac-list { position: absolute; left: 0; top: calc(100% + 4px); width: 460px; max-width: calc(100vw - 40px); max-height: 320px; overflow: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 60; padding: 4px; }
.cp-ac-item { display: grid; grid-template-columns: 78px 1fr auto; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.cp-ac-item:hover, .cp-ac-item.active { background: var(--primary-soft); }
.cp-ac-item .n { font-family: var(--mono); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-ac-item .t { font-weight: 600; min-width: 0; }
.cp-ac-item .m { color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.cp-sum { text-align: right; min-width: 0; }
.cp-sum b { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 15px; }
.cp-row.ep .cp-sum b { color: var(--text-3); font-weight: 700; }
.cp-opt, .cp-del { width: 36px; height: 38px; flex: none; }
.cp-del { color: var(--text-3); }
.cp-del:hover { color: var(--danger); }
.cp-dash { display: block; text-align: center; color: var(--text-3); }
.cp-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; padding: 8px 0 4px 82px; border-top: 1px dashed var(--border); margin-top: 6px; }
.cp-more .cp-lbl { display: block; }
.cp-more .input, .cp-more .select { height: 36px; }
.cp-desc { margin: 4px 0 2px 82px; font-size: 12.5px; color: var(--text-2); white-space: pre-wrap; max-height: 3.3em; overflow: hidden; cursor: pointer; line-height: 1.35; }
.cp-txt { display: flex; align-items: center; gap: 6px; }
.cp-txt .input { flex: 1; }
.cp-txt .btn-icon { width: 36px; height: 38px; flex: none; }
.cp-tag { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--primary); width: 48px; flex: none; }
.cp-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 12px 12px; }
.cp-foot .btn { height: 44px; }
@media (max-width: 1280px) {
  .cp-head { display: none; }
  .cp-lbl { display: block; }
  .cp-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; }
  .cp-grid > .cp-posc, .cp-grid > .cp-opt { align-self: end; }
  .cp-grid > .cp-kurzc { grid-column: 1 / -1; order: -1; }
  .cp-grid > .cp-sum { grid-column: span 2; }
  .cp-more, .cp-desc { padding-left: 0; margin-left: 0; }
}
@media (max-width: 640px) {
  .cp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cp-grid > .cp-sum { grid-column: span 2; }
  .cp-row.miete { margin-left: 12px; }
}