/* ------------------------------------------------------------ Farben */
:root {
  --bg: #f3f5f8; --panel: #ffffff; --ink: #18212c; --muted: #5f6b79; --line: #dde2e8; --line-2: #eceff3;
  --brand: #234181; --brand-2: #2f55a6; --brand-soft: #e9eef8; --accent: #dc733a; --accent-2: #c9612a; --accent-soft: #fbeee6;
  --ok: #1f7a45; --ok-soft: #e3f4e9; --warn: #9a5b00; --warn-soft: #fff3d6; --bad: #b3261e; --bad-soft: #fde5e3;
  --soft: #f0f3f7; --radius: 12px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --l-frost: #a9bccf; --l-bestand: #b9895a; --l-austausch: #e2cf9f; --l-sand: #f2dd8c; --l-leer: #e9edf1;
  --head-h: 64px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 14px;
}
:root[data-theme="dark"] {
  --bg: #12161b; --panel: #1b2027; --ink: #e6e9ee; --muted: #9aa4b0; --line: #2d3540; --line-2: #252c35;
  --brand: #7f9ce0; --brand-2: #9db3ea; --brand-soft: #1c2740; --soft: #212831; --accent: #e8874f; --accent-2: #f09a66; --accent-soft: #3a2518;
  --ok: #7fd3a1; --ok-soft: #13301f; --warn: #ffcf7a; --warn-soft: #3a2c10; --bad: #ffb4ab; --bad-soft: #3d1916;
  --shadow: none; --l-leer: #2a323c; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161b; --panel: #1b2027; --ink: #e6e9ee; --muted: #9aa4b0; --line: #2d3540; --line-2: #252c35;
    --brand: #7f9ce0; --brand-2: #9db3ea; --brand-soft: #1c2740; --soft: #212831; --accent: #e8874f; --accent-2: #f09a66; --accent-soft: #3a2518;
    --ok: #7fd3a1; --ok-soft: #13301f; --warn: #ffcf7a; --warn-soft: #3a2c10; --bad: #ffb4ab; --bad-soft: #3d1916;
    --shadow: none; --l-leer: #2a323c; color-scheme: dark;
  }
}

/* ------------------------------------------------------------ Grundgerüst */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { min-height: 100vh; overflow-x: hidden; }
h1 { font-size: 20px; margin: 0; line-height: 1.25; }
h2 { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 .right { margin-left: auto; display: flex; gap: 8px; }
h3 { font-size: 13px; margin: 0; }
.hint { color: var(--muted); font-size: 12.5px; margin: 4px 0 10px; line-height: 1.45; }
.muted { color: var(--muted); }
.sub-line { color: var(--muted); margin-top: 3px; }

.top { position: sticky; top: 0; z-index: 20; height: var(--head-h); display: flex; align-items: center; gap: 14px;
  padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }

.brand .sub { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.ks-pick { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 0; }
.ks-pick label { color: var(--muted); white-space: nowrap; }
.ks-pick select { min-width: 0; width: 260px; max-width: 32vw; font-weight: 600; }
.pill { border: 1px solid var(--line); background: var(--soft); border-radius: 99px; padding: 6px 12px; cursor: pointer;
  font: inherit; color: inherit; white-space: nowrap; }
.pill.ok::before { content: "●"; color: var(--ok); margin-right: 6px; }
.pill.bad::before { content: "●"; color: var(--bad); margin-right: 6px; }
.side-toggle { display: none; }

.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - var(--head-h)); }
.side { border-right: 1px solid var(--line); padding: 14px; background: var(--panel); position: sticky; top: var(--head-h);
  height: calc(100vh - var(--head-h)); overflow-y: auto; }
.side h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 4px 6px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 8px 10px; border-radius: 8px; cursor: pointer; margin-bottom: 2px; line-height: 1.3; }
.list li:hover { background: var(--soft); }
.list li.active { background: var(--brand); color: #fff; }
.list li small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.list li.active small { color: #dbe7f3; }
main { padding: 18px 22px 60px; min-width: 0; }
.page-narrow { max-width: 860px; margin: 0 auto; }

/* ------------------------------------------------------------ Bedienelemente */
select, input, textarea { font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px; min-width: 0; }
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-2); outline-offset: -1px; }
.btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: inherit; padding: 7px 14px;
  border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--brand-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { border-color: var(--line); }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
a.btn { text-decoration: none; display: inline-block; }
.field { min-width: 0; }
.field label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.field input, .field select { width: 100%; }
.with-unit { display: inline-flex; align-items: center; width: 100%; position: relative; }
.with-unit input { width: 100%; padding-right: 30px; }
.with-unit i { position: absolute; right: 9px; font-style: normal; color: var(--muted); font-size: 12px; pointer-events: none; }
input.n { text-align: right; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  margin-bottom: 16px; box-shadow: var(--shadow); min-width: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 14px; }
.grid-auto .span2 { grid-column: span 2; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; }

.msg { padding: 9px 12px; border-radius: 8px; margin: 6px 0; font-size: 13px; line-height: 1.45; }
.msg.warn { background: var(--warn-soft); color: var(--warn); }
.msg.bad { background: var(--bad-soft); color: var(--bad); }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg.info { background: var(--soft); }
.tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 99px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.tag.hoch { background: var(--ok-soft); color: var(--ok); }
.tag.mittel { background: var(--warn-soft); color: var(--warn); }
.tag.niedrig { background: var(--bad-soft); color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip, .chip-check { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 99px;
  padding: 4px 11px; font-size: 12.5px; background: var(--soft); }
.chip-check { background: var(--panel); cursor: pointer; }

/* ------------------------------------------------------------ Neues Aufmaß */
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; margin-top: 16px;
  border: 2px dashed var(--line); border-radius: 16px; padding: 56px 20px; text-align: center; background: var(--panel);
  cursor: pointer; transition: .15s; }
.drop.over, .drop:hover { border-color: var(--brand-2); background: var(--brand-soft); }
.drop .big { font-size: 17px; font-weight: 600; }
.drop-icon { font-size: 34px; }

/* ------------------------------------------------------------ Aufmaß-Ansicht */
.am-head { position: sticky; top: var(--head-h); z-index: 10; margin: -18px -22px 16px; padding: 12px 22px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 20px; align-items: center; }
/* Kopf: oben Titel + Kennzahlen (rechts), darunter die Knöpfe, darunter die erzeugten Dateien – nichts schiebt sich übereinander */
.am-head > .head-actions, .am-head > .head-dateien, .am-head > .head-msg { grid-column: 1 / -1; }
.head-actions { justify-content: flex-start !important; }
.head-dateien { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.head-dateien .hint { margin: 0; }
.am-title { min-width: 0; }
.am-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpis { display: flex; gap: 8px; }
.kpis div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 5px 12px; min-width: 96px; }
.kpis span { display: block; font-size: 11px; color: var(--muted); }
.kpis b { font-size: 15px; white-space: nowrap; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.head-msg { grid-column: 1 / -1; margin: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px; display: flex; flex-direction: column; min-width: 200px; z-index: 30;
  box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.menu-pop .btn { text-align: left; }

.am-grid { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.am-side { position: sticky; top: calc(var(--head-h) + 92px); max-height: calc(100vh - var(--head-h) - 104px); overflow-y: auto;
  padding-right: 2px; }
.am-main { min-width: 0; }
.foto-card { padding: 10px; }
.foto { width: 100%; display: block; border-radius: 8px; cursor: zoom-in; }
.foto-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.thumb-wait { max-width: 240px; border-radius: 8px; margin-bottom: 14px; opacity: .8; }

/* Claude-Bericht */
.bericht h2 { margin-bottom: 8px; }
.bericht-block { border-top: 1px solid var(--line-2); padding: 10px 0 4px; }
.bericht-block:first-of-type { border-top: none; }
.bericht-block > summary { list-style: none; cursor: pointer; }
.bericht-block > summary::-webkit-details-marker { display: none; }
.bericht-block > summary h3::before { content: "▸ "; color: var(--muted); }
.bericht-block[open] > summary h3::before { content: "▾ "; }
.bericht-block h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bericht-block.attn h3 { color: var(--warn); }
.bericht-block.done h3 { color: var(--ok); }
.count { font-size: 11px; font-weight: 600; background: var(--soft); color: var(--muted); border-radius: 99px; padding: 1px 8px; }
.attn .count { background: var(--warn-soft); color: var(--warn); }
.check-list, .hinweise { list-style: none; margin: 0; padding: 0; }
.check-list li { padding: 7px 8px; border-radius: 8px; background: var(--warn-soft); margin-bottom: 6px; font-size: 12.5px; line-height: 1.45; }
.check-list li.ok { background: var(--soft); opacity: .65; }
.check-list li.ok span { text-decoration: line-through; }
.check-list label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.check-list input { margin-top: 2px; flex: none; width: 15px; height: 15px; }
.check-list .art { font-weight: 600; text-decoration: none !important; }
.prot { margin: 0; padding-left: 20px; font-size: 12.5px; line-height: 1.5; }
.prot li { margin-bottom: 3px; }
.hinweise li { font-size: 12.5px; line-height: 1.45; padding: 6px 0 6px 12px; border-left: 3px solid var(--brand-soft); margin-bottom: 4px; }

/* Schritte */
.step > h2 { font-size: 15px; }
.step-nr { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand);
  color: #fff; font-size: 12px; font-weight: 700; }
.allg { display: grid; grid-template-columns: auto repeat(4, minmax(90px, 1fr)); gap: 8px 12px; align-items: end;
  background: var(--soft); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.allg > b { align-self: center; font-size: 12.5px; }

.graben { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 14px; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.graben-title { display: flex; gap: 6px; margin-bottom: 8px; }
.graben-title input.name { font-weight: 700; flex: 1; }
.graben-schnitt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
svg.schnitt { width: 100%; max-width: 380px; height: auto; font-family: inherit; }
.schnitt-sum { font-size: 12px; color: var(--muted); text-align: center; }
.schnitt-sum b { color: var(--ink); }
.ok-t { color: var(--ok); }
svg.schnitt .gel { stroke: var(--muted); stroke-width: 2; }
svg.schnitt .rand { fill: none; stroke: var(--ink); stroke-width: 1.2; }
svg.schnitt .klasse { stroke: var(--brand-2); stroke-dasharray: 4 3; stroke-width: 1; }
svg.schnitt .kt { font-size: 10px; fill: var(--muted); }
svg.schnitt .lt { font-size: 10px; fill: var(--ink); }
.l-frostschutz { fill: var(--l-frost); } .l-bestand { fill: var(--l-bestand); } .l-austausch { fill: var(--l-austausch); }
.l-sand { fill: var(--l-sand); } .l-leer { fill: var(--l-leer); }

.pos-row { border-bottom: 1px solid var(--line-2); padding: 8px 0; }
.pos-row:last-child { border-bottom: none; }
.pos-main { display: grid; grid-template-columns: 86px minmax(0, 1fr) 110px 66px 30px; gap: 10px; align-items: center; }
.pos-text { min-width: 0; line-height: 1.35; }
.pos-text small { display: block; color: var(--muted); }
.pos-annahme { font-size: 12px; color: var(--muted); margin: 4px 0 0 96px; line-height: 1.4; }
.bad-text { color: var(--bad); }
.pos-link { color: var(--brand-2); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }

/* Tabellen */
.tbl-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; padding: 6px 6px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 6px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t td.unit { color: var(--muted); white-space: nowrap; }
table.t tr.group td { background: var(--soft); font-weight: 600; font-size: 12px; }
table.t tfoot td { border-bottom: none; padding-top: 4px; padding-bottom: 4px; }
table.t tfoot td:first-child { text-align: right; color: var(--muted); }
table.t tr.sum td { font-weight: 700; font-size: 14px; color: var(--ink); border-top: 2px solid var(--ink); }
.herkunft { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.zusatz { font-weight: 600; color: var(--brand); }
.sub-h { margin: 18px 0 6px; }
.res td:nth-child(2) { min-width: 180px; }
.res th, .res td { padding-left: 5px; padding-right: 5px; }

/* ------------------------------------------------------------ Dialoge, Lightbox, Sonstiges */
.dlg { border: none; border-radius: 14px; padding: 0; width: min(560px, 94vw); background: var(--panel); color: var(--ink);
  box-shadow: 0 20px 60px rgba(0,0,0,.35); max-height: 90vh; }
.dlg.wide { width: min(900px, 96vw); }
.dlg::backdrop { background: rgba(10,20,30,.45); }
.dlg-in { padding: 20px 22px; }
.dlg-in h2 { margin: 0 0 10px; font-size: 17px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.q { margin-bottom: 14px; }
.q label.l { font-weight: 600; display: block; margin-bottom: 4px; }
pre.lang { white-space: pre-wrap; font: 12.5px/1.45 ui-monospace, Menlo, monospace; background: var(--soft); padding: 12px;
  border-radius: 8px; max-height: 50vh; overflow: auto; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.88); display: flex; flex-direction: column; }
.lb-bar { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 14px; }
.lb-img { flex: 1; overflow: auto; display: flex; padding: 0 14px 14px; }
.lightbox.fit .lb-img img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; cursor: zoom-in; }
.lightbox.full .lb-img img { max-width: none; margin: 0 auto; cursor: zoom-out; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #222; color: #fff;
  padding: 10px 16px; border-radius: 9px; z-index: 70; max-width: 80vw; }
.spinner { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--brand); border-radius: 50%;
  animation: spin 1s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; padding: 40px 10px; }
.lv-list { max-height: 480px; overflow: auto; }
.theme-btn { font-size: 15px; padding: 5px 10px; }

/* Regeln (Kostenstelle) */
.regel-gruppe { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 4px; }
details.regel { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: var(--panel); }
details.regel > summary { list-style: none; cursor: pointer; padding: 9px 12px; display: flex; gap: 10px; align-items: center; }
details.regel > summary::-webkit-details-marker { display: none; }
details.regel > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details.regel[open] > summary::before { transform: rotate(90deg); }
details.regel > summary:hover { background: var(--soft); border-radius: 8px; }
.regel .nr { font-weight: 700; color: var(--brand); min-width: 34px; }
.regel .kurz { flex: 1; }
.regel-body { padding: 4px 14px 12px 46px; }
.regel-body p { white-space: pre-wrap; margin: 0 0 8px; line-height: 1.5; }
.vergleich { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 12.5px; }
.vergleich div { background: var(--soft); border-radius: 6px; padding: 8px; white-space: pre-wrap; }
.vergleich .alt { text-decoration: line-through; opacity: .7; }
.check { display: flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------ Breiten */
@media (max-width: 1280px) {
  .graben { grid-template-columns: 1fr; }
  .graben-schnitt { justify-content: flex-start; }
}
@media (max-width: 1100px) {
  .am-grid { grid-template-columns: 1fr; }
  .am-side { position: static; max-height: none; overflow: visible; display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 16px; align-items: start; }
  .am-side .foto-card, .am-side .bericht { margin-bottom: 0; }
  .am-head { grid-template-columns: minmax(0, 1fr) auto; }
  .head-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 900px) {
  .side-toggle { display: inline-block; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: var(--head-h); bottom: 0; width: 280px; height: auto; z-index: 15;
    transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 20px rgba(0,0,0,.15); }
  body.side-open .side { transform: none; }
  .brand .sub, .ks-pick label { display: none; }
  .ks-pick select { width: 200px; }
  .am-side { grid-template-columns: 1fr; }
  .am-side .foto-card { max-width: 360px; }
  .allg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .allg > b { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  main { padding: 12px 12px 50px; }
  .am-head { margin: -12px -12px 12px; padding: 10px 12px; grid-template-columns: 1fr; position: static; }
  .kpis { flex-wrap: wrap; }
  .top { gap: 8px; padding: 0 10px; }
  .brand-wappen { width: 26px !important; height: 26px !important; }
  .ks-pick select { width: 150px; }
  #claude-status { font-size: 0; padding: 6px 9px; } #claude-status::before { font-size: 14px; margin: 0; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-auto .span2 { grid-column: 1 / -1; }
  .pos-main { grid-template-columns: 76px minmax(0, 1fr) 30px; }
  .pos-main .with-unit { grid-column: 2; } .pos-main .tag { grid-column: 2; justify-self: start; }
  .pos-annahme { margin-left: 0; }
  .vergleich { grid-template-columns: 1fr; }
}

/* Antworten und Nachträge */
.antwort-btn { margin: 6px 0 0 23px; }
.antwort { margin: 6px 0 0 23px; }
.antwort textarea, .nachtrag-box textarea { font-size: 12.5px; margin-bottom: 6px; background: var(--panel); }
.nachtrag-box h3 { color: var(--brand); }
.nachtraege { list-style: none; margin: 0 0 8px; padding: 0; }
.nachtraege > li { border-left: 3px solid var(--brand); padding: 4px 0 6px 10px; margin-bottom: 8px; font-size: 12.5px; }
.nachtraege ul { margin: 4px 0; padding-left: 18px; }
.n-frage { font-style: italic; }
.busy { display: flex; align-items: center; gap: 10px; font-size: 12.5px; padding: 8px 0; color: var(--muted); }
.spinner.small { width: 18px; height: 18px; border-width: 3px; margin: 0; }

/* Archiv und Gedächtnis */
.archiv-btn { border-color: var(--ok); color: var(--ok); font-weight: 600; }
.archiv-btn:hover { background: var(--ok-soft); border-color: var(--ok); }
.archiv-side details { margin-top: 14px; }
.archiv-side summary { cursor: pointer; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  padding: 4px; list-style: none; display: flex; gap: 6px; align-items: center; }
.archiv-side summary::-webkit-details-marker { display: none; }
.archiv-side .list { margin-top: 4px; }
.head-msg code, .ged-info code { font-size: 11px; word-break: break-all; }
a.wl { color: var(--brand-2); cursor: pointer; text-decoration: none; border-bottom: 1px dashed currentColor; }
a.chip.wl { border-bottom: 1px solid var(--line); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.ged-grid { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 16px; align-items: start; }
.ged-list { position: sticky; top: calc(var(--head-h) + 16px); max-height: calc(100vh - var(--head-h) - 32px); overflow-y: auto; }
.ged-list input { width: 100%; margin-bottom: 6px; }
.ged-note { min-height: 300px; }
.note-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.note-kurz { color: var(--muted); font-style: italic; margin: 0 0 10px; }
.md { line-height: 1.55; }
.md .md-h { margin: 16px 0 6px; font-size: 15px; }
.md h2.md-h { font-size: 19px; margin-top: 4px; }
.md p { margin: 0 0 8px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md code { background: var(--soft); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.backlinks { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 10px; font-size: 12.5px; }
.vorschlaege .vorschlag { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0;
  border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.bericht-block.lern h3 { color: var(--brand); }
@media (max-width: 900px) { .ged-grid { grid-template-columns: 1fr; } .ged-list { position: static; max-height: 320px; } }

/* Aufklappbare Abschnitte */
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; min-width: 0; }
details.fold > summary::-webkit-details-marker { display: none; }
.fold-title { font-weight: 700; font-size: 15px; white-space: nowrap; }
.fold-info { color: var(--muted); font-size: 12.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold-arrow { width: 22px; height: 22px; border-radius: 6px; flex: none; display: grid; place-items: center; background: var(--soft); }
.fold-arrow::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
details.fold[open] > summary .fold-arrow::after { transform: rotate(45deg); margin: -3px 0 0; }
details.fold > summary:hover .fold-arrow { background: var(--brand-soft); }
details.card.fold { padding: 0; }
details.card.fold > summary { padding: 14px 18px; border-radius: var(--radius); }
details.card.fold[open] > summary { border-bottom: 1px solid var(--line-2); border-radius: var(--radius) var(--radius) 0 0; }
details.card.fold > .fold-body { padding: 14px 18px 16px; }
details.bericht-block.fold > summary { padding: 2px 0; }
details.bericht-block.fold > summary .fold-title { font-size: 13px; }
details.bericht-block.fold > .fold-body { padding-top: 8px; }
.bericht-block.attn .fold-title { color: var(--warn); } .bericht-block.done .fold-title { color: var(--ok); }
.nachtrag-box .fold-title { color: var(--brand); }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--soft);
  color: var(--muted); vertical-align: 1px; white-space: nowrap; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.fold-tools { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.fold-all { display: flex; justify-content: flex-end; gap: 4px; margin: -6px 0 6px; }
.am-main > details.fold { margin-bottom: 12px; }
/* Foto proportional: nicht höher als ein gutes Drittel des Fensters */
.foto { max-height: 42vh; object-fit: contain; background: var(--soft); }
@media (max-width: 640px) { .fold-info { white-space: normal; } details.fold > summary { flex-wrap: wrap; } .fold-title { white-space: normal; } }

/* Bild hochladen: Dateien oder Apple Fotos */
.drop { cursor: default; }
.drop-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 8px 0 4px; }
.drop-btns .btn { padding: 10px 18px; font-size: 14px; cursor: pointer; }
.foto-wahl { min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--soft); border-radius: 10px; padding: 12px; margin-top: 10px; }
.foto-wahl img { max-width: 100%; max-height: 50vh; border-radius: 8px; }

/* ------------------------------------------------------------ Firmenauftritt Heidel */
.top { border-bottom: 3px solid var(--accent); }
.brand { gap: 10px; }
.brand-wappen { display: none; width: 30px !important; height: 30px !important; }
.brand-logo { height: 46px; width: auto; display: block; }
.marke { font-weight: 700; letter-spacing: -.03em; color: var(--brand); white-space: nowrap; }
.marke-ki { color: var(--accent); border: .09em solid currentColor; border-radius: .26em; padding: 0 .16em; margin: 0 .1em; letter-spacing: 0; }
:root[data-theme="dark"] .marke { color: #fff; }
.brand .marke { font-size: 18px; }
.ich { display: inline-flex; flex-direction: column; text-align: right; font-size: 13px; font-weight: 600; margin-right: 12px; vertical-align: middle; }
.ich small { font-weight: 400; font-size: 11px; color: var(--muted); }
.ich.support { color: var(--accent); }
#brand-firma { display: inline-flex; align-items: center; }
.einmal-pw code { font-size: 20px; user-select: all; }
.b-umbenennen { padding: 0 6px; margin-left: 4px; }
.b-neu { flex-wrap: wrap; margin-top: 10px; }
.nur-dunkel { display: none; }
:root[data-theme="dark"] .nur-hell { display: none; }
:root[data-theme="dark"] .nur-dunkel { display: inline-block; }
.anmelde-wuerfel { width: 96px; height: 96px; margin-bottom: 6px; }
.anmelde-karte h1 .marke { font-size: 34px; }
.top-right .brand-logo { height: 42px; }
.top-right .brand-symbol { vertical-align: middle; margin-right: 6px; }
:root[data-theme="dark"] .brand-logo { background: #fff; border-radius: 6px; padding: 2px 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-logo { background: #fff; border-radius: 6px; padding: 2px 6px; } }
.btn.primary { background: var(--brand); border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
#new-aufmass { background: var(--accent); border-color: var(--accent); }
#new-aufmass:hover { background: var(--accent-2); border-color: var(--accent-2); }
.step-nr { background: var(--accent); }
.list li.active { background: var(--brand); box-shadow: inset 3px 0 0 var(--accent); }
.spinner { border-top-color: var(--accent); }
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-soft); }
details.fold > summary:hover .fold-arrow { background: var(--accent-soft); }
.archiv-btn { border-color: var(--ok); }
.kpis div { border-top: 3px solid var(--brand); }
.drop-icon { display: none; }
.drop-wappen { width: 64px; height: 64px; }
.firmen-fuss { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 11px; line-height: 1.35; }
.firmen-fuss img { width: 22px; height: 22px; flex: none; }
.start-kopf { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; }
.start-kopf img { height: 54px; width: auto; }
:root[data-theme="dark"] .start-kopf img { background: #fff; border-radius: 8px; padding: 4px 8px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .start-kopf img { background: #fff; border-radius: 8px; padding: 4px 8px; } }
@media (max-width: 700px) { .brand .marke { display: none; } }
@media (max-width: 900px) { .top-right .brand-logo { height: 30px; } }
:root[data-theme="dark"] .btn.primary { background: #2f55a6; border-color: #2f55a6; }
:root[data-theme="dark"] .btn.primary:hover { background: #3a64bd; border-color: #3a64bd; }
:root[data-theme="dark"] .list li.active { background: #2f55a6; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn.primary { background: #2f55a6; border-color: #2f55a6; }
  :root:not([data-theme="light"]) .btn.primary:hover { background: #3a64bd; border-color: #3a64bd; }
  :root:not([data-theme="light"]) .list li.active { background: #2f55a6; }
}

/* ------------------------------------------------------------ Navigation ohne Seitenleiste */
main { max-width: 1440px; margin: 0 auto; }
a.brand { color: inherit; text-decoration: none; flex: none; }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; flex: 1; overflow: hidden; white-space: nowrap; }
.crumbs a { color: var(--brand); text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { color: var(--muted); font-style: normal; }
.top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }

/* Startseite */
.start { max-width: 1100px; margin: 10px auto 0; }
.start .start-kopf { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.start .start-kopf img { height: 64px; }
.ks-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ks-kachel { font: inherit; color: inherit; text-align: left; cursor: pointer; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 10px; min-height: 170px; box-shadow: var(--shadow);
  border-top: 4px solid var(--brand); transition: transform .12s, border-color .12s; }
.ks-kachel:hover { transform: translateY(-2px); border-color: var(--accent); border-top-color: var(--accent); }
.ks-kachel-kopf { display: flex; align-items: center; gap: 10px; }
.ks-kachel-kopf img { width: 30px; height: 30px; }
.ks-name { font-size: 17px; font-weight: 700; }
.ks-beschr { color: var(--muted); font-size: 12.5px; line-height: 1.45; flex: 1; }
.ks-zahlen { display: flex; gap: 14px; font-size: 13px; }
.ks-zahlen b { font-size: 18px; color: var(--brand); margin-right: 3px; }
.ks-fuss { font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line-2); padding-top: 8px; }
.ks-kachel.neu { border-style: dashed; border-top: 1px dashed var(--line); align-items: center; justify-content: center; text-align: center; box-shadow: none; background: transparent; }
.ks-kachel.neu:hover { border-color: var(--accent); }
.ks-plus { font-size: 34px; color: var(--accent); line-height: 1; }
.start .firmen-fuss { justify-content: center; margin-top: 36px; }

/* Kostenstellen-Seite */
.ks-seite { max-width: 1240px; margin: 0 auto; }
.ks-titel { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.ks-oben { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.neu-card .drop { margin-top: 0; padding: 26px 16px; }
.neu-card .drop-wappen { width: 44px; height: 44px; }
.neu-card #manual { margin-top: 10px; }
.am-liste { list-style: none; margin: 0; padding: 0; }
.am-liste li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  cursor: pointer; border: 1px solid var(--line-2); margin-bottom: 6px; }
.am-liste li:hover { border-color: var(--accent); background: var(--accent-soft); }
.am-l-haupt { min-width: 0; }
.am-l-haupt b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-l-haupt small { color: var(--muted); }
.am-l-rechts { display: flex; align-items: center; gap: 8px; flex: none; }
.am-netto { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 90px; text-align: right; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--brand-soft); color: var(--brand); }
.archiv-card { margin-top: 16px; }
.archiv-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.archiv-kopf h2 { margin: 0; }
.archiv-kopf input { width: min(360px, 100%); }
.archiv-t tbody tr { cursor: pointer; }
.archiv-t tbody tr:hover td { background: var(--accent-soft); }
.archiv-t .dateien a { color: var(--brand-2); margin-right: 10px; font-weight: 600; text-decoration: none; }
.archiv-t .dateien a:hover { text-decoration: underline; }
@media (max-width: 900px) {
  .ks-oben { grid-template-columns: 1fr; }
  .crumbs { font-size: 12.5px; }
}
@media (max-width: 640px) {
  .crumbs { display: none; }
  .start .start-kopf img { height: 44px; }
  .am-liste li { flex-direction: column; align-items: flex-start; }
}

/* ------------------------------------------------------------ Skizzen-Editor (Stil PDF-XChange) */
body.sk-offen { overflow: hidden; }
.sk-overlay { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: #e6e9ee; color: #18212c; }
:root[data-theme="dark"] .sk-overlay { background: #2a2f36; }
.sk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; padding: 6px 10px; background: #fff; border-bottom: 3px solid var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.sk-gruppe { display: flex; align-items: center; gap: 3px; padding: 0 8px; border-right: 1px solid #e1e5ea; }
.sk-gruppe:last-child { border-right: none; }
.sk-gruppe[hidden] { display: none !important; }
.sk-rechts { margin-left: auto; gap: 8px; }
.sk-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 7px; background: transparent;
  color: #2b3540; cursor: pointer; font-size: 20px; }
.sk-btn.sk-text { width: auto; padding: 0 10px; font-size: 12.5px; font: 12.5px -apple-system, sans-serif; }
.sk-btn:hover { background: #eef2f7; border-color: #d5dbe3; }
.sk-btn.aktiv { background: #e9eef8; border-color: #234181; color: #234181; }
.sk-farbe { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #c7cdd5; background: var(--f); cursor: pointer; padding: 0; }
.sk-farbe.aktiv { box-shadow: 0 0 0 2px #234181; }
#sk-farbe-frei { width: 28px; height: 26px; padding: 0 2px; border: 1px solid #d5dbe3; border-radius: 6px; background: #fff; cursor: pointer; }
.sk-lbl { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #4b5663; }
.sk-lbl select, .sk-gruppe > select { font-size: 12.5px; padding: 4px 6px; background: #fff; color: #18212c; border-color: #d5dbe3; }
.sk-check input { margin: 0; }
.sk-flaeche { flex: 1; overflow: auto; display: block; position: relative; }
.sk-buehne { display: inline-block; line-height: 0; }
.sk-seite { position: relative; margin: 0; box-shadow: 0 4px 18px rgba(0,0,0,.18); background: #fff; line-height: 0; }
#sk-canvas { display: block; position: absolute; left: 0; top: 0; touch-action: none; }
.sk-status { padding: 5px 14px; font-size: 12px; color: #4b5663; background: #fff; border-top: 1px solid #e1e5ea; }
.sk-textfeld { position: absolute; z-index: 2; padding: 1px 3px; margin: 0; border: 1px dashed #2f55a6; border-radius: 2px;
  background: rgba(255,255,255,.92); outline: none; resize: none; font-family: -apple-system, Helvetica, Arial, sans-serif; white-space: pre; overflow: hidden;
  box-sizing: content-box; min-width: 0; }
:root[data-theme="dark"] .sk-bar, :root[data-theme="dark"] .sk-status { background: #1b2027; color: #e6e9ee; }
:root[data-theme="dark"] .sk-btn { color: #e6e9ee; }
:root[data-theme="dark"] .sk-btn:hover { background: #2a323c; }

/* Skizze im Aufmaß */
.skizze-box { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.skizze-vorschau { width: 100%; border: 1px solid var(--line); border-radius: 8px; cursor: zoom-in; background: #fff; }
.skizze-leer { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 26px 16px; border: 2px dashed var(--line);
  border-radius: 10px; color: var(--muted); font-size: 12.5px; }
.skizze-leer svg { color: var(--accent); }
.skizze-knöpfe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.skizze-knöpfe .hint { flex-basis: 100%; }
@media (max-width: 700px) { .skizze-box { grid-template-columns: 1fr; } }

/* Skizze: Symbol-Leiste und Symbol-Modus */
.sk-haupt { flex: 1; display: flex; min-height: 0; }
.sk-haupt .sk-flaeche { flex: 1; min-width: 0; }
.sk-panel { width: var(--sk-panel-b, 190px); flex: none; background: #fff; border-left: 1px solid #e1e5ea; display: flex; flex-direction: column; min-height: 0; }
.sk-panel-kopf { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 6px 12px; border-bottom: 1px solid #eef1f4; color: #18212c; }
#sk-symliste { overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.sk-sym { position: relative; border: 1px solid #dfe4ea; border-radius: 8px; padding: 6px 4px 4px; text-align: center; cursor: pointer; background: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 2px; color: #18212c; }
.sk-sym:hover { border-color: #dc733a; }
.sk-sym.aktiv { border-color: #234181; box-shadow: 0 0 0 2px #e9eef8; }
.sk-sym img { width: 56px; height: 56px; object-fit: contain; pointer-events: none; }
.sk-sym-name { font-size: 11px; line-height: 1.2; word-break: break-word; }
.sk-sym-aktion { position: absolute; top: 2px; right: 2px; display: none; gap: 2px; }
.sk-sym:hover .sk-sym-aktion { display: flex; }
@media (hover: none) { .sk-sym-aktion { display: flex; } }   /* iPad: Bearbeiten/Löschen immer sichtbar */
.sk-mini { width: 20px; height: 20px; border: 1px solid #dfe4ea; border-radius: 5px; background: #fff; cursor: pointer; display: grid; place-items: center;
  padding: 0; font-size: 14px; line-height: 1; color: #4b5663; }
.sk-mini:hover { border-color: #d62828; color: #d62828; }
.sk-hinweis { grid-column: 1 / -1; font-size: 11.5px; color: #66707d; line-height: 1.45; margin: 4px; }
.sk-symbolmodus .sk-bar { border-bottom-color: #234181; }
.sk-symboltitel { gap: 8px; }
.sk-symboltitel b { color: #234181; white-space: nowrap; }
#sk-symname { width: 210px; font-size: 13px; padding: 5px 8px; background: #fff; color: #18212c; border: 1px solid #c7cdd5; border-radius: 6px; }
:root[data-theme="dark"] .sk-panel, :root[data-theme="dark"] .sk-sym { background: #1b2027; color: #e6e9ee; border-color: #2d3540; }
:root[data-theme="dark"] .sk-panel-kopf { color: #e6e9ee; border-color: #2d3540; }
@media (max-width: 900px) { .sk-panel { width: var(--sk-panel-b, 140px); } }

/* Skizze: Linienart-Auswahl, Zahlenfelder, Farben */
.sk-stilwahl { position: relative; }
.sk-stilknopf { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border: 1px solid #d5dbe3; border-radius: 6px; background: #fff;
  color: #18212c; cursor: pointer; }
.sk-stilknopf:hover { border-color: #234181; }
.sk-pfeilchen { font-size: 10px; color: #66707d; }
.sk-stilliste { position: absolute; top: calc(100% + 4px); left: 0; z-index: 5; background: #fff; border: 1px solid #d5dbe3; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 4px; min-width: 270px; }
.sk-stiloption { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: none; border-radius: 6px; background: transparent;
  cursor: pointer; color: #18212c; font: 12.5px -apple-system, sans-serif; text-align: left; white-space: nowrap; }
.sk-stiloption:hover { background: #eef2f7; }
.sk-stiloption.aktiv { background: #e9eef8; color: #234181; }
.sk-lbl input[type=number] { width: 68px; font-size: 12.5px; padding: 4px 6px; background: #fff; color: #18212c; border: 1px solid #d5dbe3; border-radius: 6px; }
.sk-farben { gap: 4px; }
.sk-farbe { width: 20px; height: 20px; }
:root[data-theme="dark"] .sk-stilknopf, :root[data-theme="dark"] .sk-stilliste, :root[data-theme="dark"] .sk-stiloption { background: #1b2027; color: #e6e9ee; }

/* Skizzen-Vorlagen: Verwaltung, Auswahl, Feld-Editor */
.sk-vorlagen { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.sk-vorlage-karte { display: flex; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; align-items: flex-start; }
.sk-vorlage-karte img { width: 90px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.sk-vorlage-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.sk-vorlage-info input { font-weight: 600; }
.vorlagen-wahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.vorlage-kachel { font: inherit; color: inherit; background: var(--panel); border: 2px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vorlage-kachel:hover { border-color: var(--accent); }
.vorlage-kachel img, .karo-vorschau { width: 100%; aspect-ratio: 210/297; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.karo-vorschau { display: block; background-image: linear-gradient(#c9dbea 1px, transparent 1px), linear-gradient(90deg, #c9dbea 1px, transparent 1px); background-size: 8px 8px; }
.dlg.fe-dlg { width: min(1200px, 97vw); }
.fe-raster { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.fe-bild { position: relative; margin: 0 auto; border: 1px solid var(--line); background: #fff; cursor: crosshair; touch-action: none; user-select: none; }
.fe-bild img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fe-kasten { position: absolute; border: 2px dashed #dc733a; background: rgba(220,115,58,.12); cursor: move; }
.fe-kasten.aktiv { border-color: #2f55a6; background: rgba(47,85,166,.12); }
.fe-kasten span { position: absolute; left: 2px; top: -16px; font-size: 11px; background: #dc733a; color: #fff; padding: 0 4px; border-radius: 3px; white-space: nowrap; pointer-events: none; }
.fe-kasten.aktiv span { background: #2f55a6; }
.fe-kasten i { position: absolute; right: -5px; bottom: -5px; width: 10px; height: 10px; background: #fff; border: 2px solid #2f55a6; border-radius: 2px; cursor: nwse-resize; }
.fe-liste { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }
.fe-feld { border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.fe-feld.aktiv { border-color: #2f55a6; }
.fe-feld select { flex: 1; min-width: 0; font-size: 12.5px; }
@media (max-width: 900px) { .fe-raster { grid-template-columns: 1fr; } }

/* ⓘ-Erklärungen hinter Überschriften */
.info-i { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; margin-left: 6px; border-radius: 50%;
  border: 1.5px solid var(--muted); color: var(--muted); font: italic 700 11px/1 Georgia, "Times New Roman", serif; cursor: pointer;
  vertical-align: 2px; user-select: none; flex: none; transition: color .15s, border-color .15s, background .15s; }
.info-i:hover, .info-i.aktiv, .info-i:focus-visible { color: #fff; background: var(--brand); border-color: var(--brand); outline: none; }
.info-pop { position: fixed; z-index: 1000; padding: 10px 13px; border-radius: 10px; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(0,0,0,.18); font-size: 13px; font-weight: 400; font-style: normal;
  line-height: 1.5; text-align: left; white-space: normal; pointer-events: none; }
.info-pop.fest { pointer-events: auto; }
.info-pop code { font-size: 11.5px; word-break: break-all; }

/* Kostenstellen-Seite: KI und manuell nebeneinander, darunter In Bearbeitung und Archiv */
.neu-card { display: flex; flex-direction: column; }
.manuell-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 180px;
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--soft); color: var(--brand); cursor: pointer; font: inherit; padding: 26px 16px; }
.manuell-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.manuell-btn .big { font-size: 16px; font-weight: 700; color: var(--ink); }
.bearb-card { margin-top: 16px; }
.bearb-card tbody tr { cursor: pointer; }

/* Manuelles Aufmaß: ohne Claude-Bericht, Tabelle wie die Excel-Vorlage */
.am-grid.ohne-seite { grid-template-columns: minmax(0, 1fr); }
.aufmass-t td { vertical-align: top; }
.aufmass-t input { width: 100%; min-width: 0; padding: 5px 6px; }
.aufmass-t input.n { width: 58px; text-align: right; }
.aufmass-t td, .aufmass-t th { padding-left: 4px; padding-right: 4px; }
.aufmass-t input.pos-nr { width: 78px; }
.aufmass-t input:disabled { background: transparent; border-color: transparent; }
.aufmass-t .az-text { min-width: 190px; }
.aufmass-t .az-text .pos-link { display: block; margin: 4px 0; }
.aufmass-t .az-zusatz { font-size: 12px; }
.aufmass-t .az-menge { display: inline-block; padding: 5px 0; white-space: nowrap; }

/* LV-Suche im Aufmaß */
#lvd-q { width: 100%; margin-bottom: 10px; }
.lvd-list { max-height: 60vh; overflow-y: auto; }
.lvd-item { border-bottom: 1px solid var(--line-2); }
.lvd-item > summary { display: grid; grid-template-columns: 26px 70px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 4px; cursor: pointer; list-style: none; }
.lvd-item > summary::-webkit-details-marker { display: none; }
.lvd-item > summary:hover { background: var(--accent-soft); }
.lvd-item .lang { margin: 0 4px 10px; }


/* LV-Suche: Gruppen und Favoriten-Stern */
.lvd-h { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 4px 4px; }
.lvd-h:first-child { margin-top: 2px; }
.stern { border: 0; background: none; font-size: 17px; line-height: 1; color: var(--line); cursor: pointer; padding: 0; }
.stern:hover { color: var(--accent); }
.stern.an { color: #e0a100; }

/* Bausteine */
.bs-wahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-bottom: 12px; }
.bs-karte { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; }
.bs-karte:hover { border-color: var(--accent); }
.bs-karte.aktiv { border-color: var(--brand); background: var(--brand-soft); }
.bs-karte .muted { font-size: 12px; }
.bs-karte small { color: var(--muted); }
.bs-t input { padding: 5px 6px; }
.bs-t td { vertical-align: middle; }
.bs-liste { display: grid; gap: 8px; }
.bs-eintrag { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.bs-vorschlag-box { border: 1.5px dashed var(--accent); border-radius: 12px; padding: 12px; margin-bottom: 12px; background: var(--accent-soft); display: grid; gap: 8px; }
.bs-vorschlag-box .bs-eintrag { background: var(--panel); }

/* Prüfung */
.pruef-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pruef-liste li { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 8px; background: var(--soft); }
.pruef-liste .badge { flex: none; min-width: 64px; text-align: center; }
#pruefen-btn .badge { margin-left: 2px; }

/* Testlauf */
.tl-kpis { margin: 4px 0 12px; }
.tl-wahl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.tl-wahl > span { font-size: 13px; color: var(--muted); }
.tl-wahl select { width: auto; }
.tl-vergleich { margin: 4px 0 12px; }
.tl-fall summary .badge + .badge { margin-left: 6px; }
.ki-modelle td:first-child { width: 55%; }
.ki-modelle select { width: 100%; }
.tl-fall { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
.tl-fall > summary { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; cursor: pointer; }
.tl-fall table { margin-top: 8px; }

/* Übersicht je Kostenstelle */
.ue-seite .page-head { align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.ue-filter { display: grid; gap: 8px; justify-items: end; }
.ue-filter select { padding: 5px 8px; }
.ue-kpis { flex-wrap: wrap; margin: 4px 0 14px; }
.ue-kpis small { display: block; color: var(--muted); font-size: 11px; }
.ue-seite > .card { margin-bottom: 14px; }
.ue-balken { height: 9px; background: var(--soft); border-radius: 99px; overflow: hidden; min-width: 60px; }
.ue-balken i { display: block; height: 100%; background: var(--brand-2); border-radius: 99px; }
.ue-aktion { flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ue-aktion select, .ue-aktion input { padding: 5px 8px; }
.ue-seite tbody tr[data-open] { cursor: pointer; }

/* Archiv-Status im Kopf eines archivierten Aufmaßes */
.stufe-wahl { display: inline-flex; gap: 6px; align-items: center; margin-left: 10px; }
.stufe-wahl select, .stufe-wahl input { padding: 3px 6px; }
.archiv-kopf .row select { padding: 5px 8px; }

/* Fotos zum Aufmaß */
.fotos-drop { display: flex; gap: 12px; align-items: center; padding: 12px; border: 2px dashed var(--line); border-radius: 10px; margin-bottom: 12px; }
.fotos-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.foto-k { margin: 0; border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 6px; background: var(--panel); }
.foto-k img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; cursor: zoom-in; }
.foto-k input:not([type]) { padding: 4px 6px; font-size: 12px; }
.foto-k .row { justify-content: space-between; }

/* Skizze: Symbolleiste in der Breite ziehen */
.sk-griff { width: 6px; flex: none; cursor: col-resize; background: #eef1f4; border-left: 1px solid #e1e5ea; position: relative; }
.sk-griff::after { content: ""; position: absolute; left: 1px; top: 50%; width: 2px; height: 36px; margin-top: -18px; border-radius: 2px; background: #b9c2cd; }
.sk-griff:hover, .sk-griff.aktiv { background: #fbeee6; }
.sk-griff:hover::after, .sk-griff.aktiv::after { background: #dc733a; }
:root[data-theme="dark"] .sk-griff { background: #1b2027; border-color: #2d3540; }

/* Symbolgruppen (aufklappbar, „Alle“ oben) */
.sk-symgruppe { border: 1px solid #e6e9ee; border-radius: 8px; background: #fff; }
.sk-symgruppe > summary { display: flex; align-items: center; gap: 6px; padding: 7px 8px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; color: #18212c; border-radius: 8px; }
.sk-symgruppe > summary::-webkit-details-marker { display: none; }
.sk-symgruppe > summary::before { content: "▸"; color: #8a95a3; font-size: 11px; transition: transform .15s; }
.sk-symgruppe[open] > summary::before { transform: rotate(90deg); }
.sk-symgruppe > summary:hover { background: #f4f6f9; }
.sk-symgruppe > summary.ziel { background: #fbeee6; outline: 2px dashed #dc733a; }
.sk-gruppenname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-anzahl { font-size: 11px; font-weight: 600; color: #6b7a8c; background: #eef1f4; border-radius: 99px; padding: 0 7px; }
.sk-gruppe-aktion { display: none; gap: 2px; }
.sk-symgruppe > summary:hover .sk-gruppe-aktion { display: flex; }
.sk-symraster { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; padding: 4px 6px 8px; }
.sk-symraster .sk-hinweis { grid-column: 1 / -1; margin: 2px 0; }
.skg-liste { display: grid; gap: 6px; margin-bottom: 10px; }
:root[data-theme="dark"] .sk-symgruppe { background: #1b2027; border-color: #2d3540; }
:root[data-theme="dark"] .sk-symgruppe > summary { color: #e6e9ee; }
:root[data-theme="dark"] .sk-symgruppe > summary:hover { background: #212831; }

/* KI-Entwurf: Hinweisleiste und Zettel-Fenster */
.sk-ki-banner { display: flex; align-items: center; gap: 10px; padding: 7px 12px; background: #fbeee6; border-bottom: 1px solid #f0d2bd; color: #6a3a17; font-size: 13px; }
.sk-ki-banner > span { flex: 1; }
.sk-zettel { position: fixed; left: 24px; top: 130px; width: 340px; height: 460px; min-width: 200px; min-height: 160px; resize: both; overflow: hidden;
  z-index: 30; background: #fff; border: 1px solid #cfd6de; border-radius: 10px; box-shadow: 0 12px 34px rgba(0,0,0,.22); display: flex; flex-direction: column; }
.sk-zettel-kopf { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid #e6e9ee; cursor: move; user-select: none; background: #f7f8fa; color: #18212c; }
.sk-zettel-kopf .hint { flex: 1; font-size: 11px; }
.sk-zettel img { flex: 1; min-height: 0; width: 100%; object-fit: contain; background: #fff; }
#sk-zettel-btn.aktiv { background: #e9eef8; color: #234181; }

/* Aufmaß vom iPad */
.ipad-box { border: 1.5px solid var(--brand-soft); background: var(--brand-soft); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; display: grid; gap: 8px; }
.ipad-box .row { gap: 10px; flex-wrap: wrap; }
.ipad-freitext { background: var(--panel); border-radius: 8px; padding: 8px 10px; display: grid; gap: 6px; justify-items: start; }
.ipad-freitext p { margin: 0; white-space: pre-wrap; }
.ipad-ergebnis { margin: 0; padding-left: 18px; font-size: 13px; }

/* ------------------------------------------------------------ Firmenkonten: Kopf, Anmeldung, Einstellungen */
body.abgemeldet .crumbs, body.abgemeldet .top-right, body.abgemeldet .brand { visibility: hidden; }
#brand-firma { display: flex; align-items: center; gap: 8px; }
#brand-firma:empty { display: none; }
.brand-symbol { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; }
.brand-name { font-size: 15px; color: var(--ink); }
.start-symbol { width: 56px; height: 56px; object-fit: contain; }

.anmelde-seite { min-height: calc(100vh - 160px); display: grid; place-items: center; padding: 20px; }
.anmelde-karte { width: min(440px, 100%); text-align: center; padding: 28px 30px; }
.anmelde-icon { width: 64px; height: 64px; }
.anmelde-karte h1 { margin-top: 8px; }
.anmelde-form { text-align: left; display: grid; gap: 10px; margin-top: 18px; }
.anmelde-form h2 { margin: 0; font-size: 17px; }
.anmelde-form .btn { justify-self: stretch; padding: 10px; font-size: 15px; }
.anmelde-neu { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.anmelde-neu a { color: var(--brand-2); font-weight: 600; }
.rechtliches { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.rechtliches a { color: var(--muted); }

.einst-seite { max-width: 980px; margin: 0 auto; display: grid; gap: 14px; }
.einst-seite .page-head { align-items: flex-start; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.pw-form > div:last-child { grid-column: 1 / -1; }
.einst-bilder { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.einst-bild { display: flex; gap: 14px; align-items: flex-start; }
.einst-bild-vorschau { flex: none; width: 150px; height: 74px; border: 1px dashed var(--line); border-radius: 10px; display: grid; place-items: center; background: #fff; }
.einst-bild-vorschau.wappen { width: 74px; }
.einst-bild-vorschau img { max-width: 92%; max-height: 92%; object-fit: contain; }
.fach-wahl { display: grid; gap: 8px; }
.fach-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.fach-option.aktiv { border-color: var(--brand); background: var(--brand-soft); }
.fach-option input { margin-top: 3px; }
.fach-option span { display: grid; gap: 3px; }
.fach-option small { color: var(--muted); line-height: 1.45; }
@media (max-width: 760px) { .grid3 { grid-template-columns: 1fr; } }
.grid2 .span2 { grid-column: 1 / -1; }

/* Zurück / Abmelden links oben */
.zurueck-btn { flex: none; font-weight: 600; }
.zurueck-btn.abmelden { color: var(--bad); border-color: var(--line); }
.zurueck-btn.abmelden:hover { border-color: var(--bad); background: var(--bad-soft); }
body.abgemeldet .zurueck-btn { visibility: hidden; }
.b-neu { margin-top: 10px; flex-wrap: wrap; }
.b-neu input { min-width: 200px; }

/* Eingang: neu vom iPad übertragene Aufmaße */
.eingang-card { border: 2px solid var(--accent); background: linear-gradient(var(--accent-soft), var(--panel) 70px); margin-top: 16px; }
.eingang-liste { display: grid; gap: 10px; }
.eingang-eintrag { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.eingang-text { display: grid; gap: 3px; }
.eingang-text b { font-size: 15px; }
.eingang-text small { color: var(--muted); }
.eingang-text .chips { margin-top: 4px; }
.eingang-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.eingang-status { grid-column: 1 / -1; }
.eingang-status:empty { display: none; }
.eingang-hinweis { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.eingang-hinweis > span:first-child { flex: 1; min-width: 260px; }
@media (max-width: 760px) { .eingang-eintrag { grid-template-columns: 1fr; } .eingang-knoepfe { justify-content: flex-start; } }
.archiv-t td.loesch-zelle { width: 1%; text-align: right; white-space: nowrap; }
.archiv-t tr .loesch-zelle .btn { opacity: .55; }
.archiv-t tr:hover .loesch-zelle .btn { opacity: 1; }
.schalter-zeile { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; cursor: pointer; }
.schalter-zeile input { margin-top: 3px; width: 16px; height: 16px; flex: none; }
.schalter-zeile small { display: block; color: var(--muted); margin-top: 2px; }
.maske-seite { max-width: 980px; }
.maske-flaeche { position: relative; user-select: none; touch-action: none; cursor: crosshair; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.maske-flaeche img { display: block; width: 100%; height: auto; pointer-events: none; }
.maske-rechteck { position: absolute; background: rgba(0, 0, 0, .82); outline: 2px solid var(--accent, #dc733a); }
.maske-weg { position: absolute; top: -11px; right: -11px; width: 22px; height: 22px; border-radius: 50%; border: none; background: #fff; color: #333; box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: pointer; font-size: 12px; line-height: 22px; padding: 0; }
.tl-frueher { margin: 16px 0 6px; font-size: 13px; }
.tl-liste { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
/* Touch-Geräte: kein Zoomen per Doppeltipp, Zwei-Finger-Zoom bleibt */
html { touch-action: manipulation; }
/* Skizze offen: Leisten nur wischen (Symbolliste scrollen), nicht zoomen; die Zeichenfläche hat ihre eigene Geste */
body.sk-offen #sk { touch-action: pan-x pan-y; }
/* Abrechnungsteile (öffentlich / privat) */
.teile-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.teil-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 13px; }
.teil-chip.privat { background: var(--accent-soft); color: var(--accent-2); }
.teil-chip input { width: 140px; padding: 3px 6px; font-size: 13px; }
.teil-wahl { font-size: 12.5px; padding: 3px 6px; max-width: 170px; }
.t.res tr.teil-kopf td { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.teil-dateien { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 8px; }
.skizzen-teile { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.skizze-teil { display: grid; gap: 8px; align-content: start; }
.aufteilung-wahl { display: grid; gap: 10px; margin: 14px 0; }
.aufteilung-knopf { display: grid; gap: 4px; text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; }
.aufteilung-knopf:hover { border-color: var(--brand-2); background: var(--brand-soft); }
.aufteilung-knopf b { font-size: 15px; }
.aufteilung-knopf span { font-size: 13px; color: var(--muted); }
.sk-sym.linie img { border-bottom: 2px solid var(--accent); }
.sk-sym-art { font-size: 10px; font-weight: 700; color: var(--accent-2); text-transform: uppercase; letter-spacing: .03em; }
#sk-symart { font-size: 12.5px; padding: 3px 6px; }
#sk-symleistung { min-width: 260px; }
.skizze-leistungen { margin: 10px 0; padding: 10px 14px; border-radius: 10px; background: var(--brand-soft); }
.skizze-leistungen ul { margin: 6px 0 8px; padding-left: 20px; }
.sk-graben-felder { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 10px; margin: 10px 0; }
.sk-graben-felder label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sk-graben-felder input { width: 100%; box-sizing: border-box; font-size: 16px; padding: 8px 10px; }

/* Fenster „Vorgaben für Claude“ */
.vg-zeile { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.vg-zeile .hint { grid-column: 2; margin: 0; }
.vg-titel { font-weight: 600; padding-top: 6px; }
.vg-pflicht .vg-titel::after { content: " *"; color: var(--brand-2); }
.vg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vg-chip input { position: absolute; opacity: 0; pointer-events: none; }
.vg-chip span { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); cursor: pointer; font-size: 14px; }
.vg-chip input:checked + span { background: var(--brand-soft); border-color: var(--brand-2); color: var(--ink); font-weight: 600; }
.vg-chip input:focus-visible + span { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.vg-hinweis { display: grid; gap: 4px; margin-top: 10px; font-weight: 600; }
.vg-hinweis textarea { font: inherit; font-weight: 400; }
@media (max-width: 640px) { .vg-zeile { grid-template-columns: 1fr; } .vg-zeile .hint { grid-column: 1; } }

/* Skizze: Abfragen beim Einsetzen eines Symbols / Länge des Linienbauteils */
.sk-abfrage { display: grid; gap: 12px; margin: 12px 0; }
.sk-abfrage label { display: grid; gap: 4px; font-weight: 600; }
.sk-abfrage select, .sk-abfrage input { font: inherit; font-size: 16px; padding: 8px 10px; }
.sk-frage-zeile { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.sk-frage-zeile label { display: grid; gap: 4px; }
.sk-frage-zeile textarea { font: inherit; }

/* Skizze: Kapitel „Leitungen“ und Leitungstyp-Editor */
.sk-gruppe-aktion.sichtbar { display: inline-flex !important; margin-left: auto; }
.slt-farben { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.slt-farben .sk-farbe.aktiv { outline: 2px solid #dc733a; outline-offset: 2px; }
.slt-muster { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 12px; display: grid; gap: 8px; }
.slt-muster legend { font-weight: 600; padding: 0 4px; }
.slt-reihe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slt-vorschau { width: 100%; max-width: 560px; height: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.slt-muster .chip-check { display: flex; align-items: center; gap: 8px; border: 0; padding: 0; background: none; font-weight: 400; }

/* iPad: Ziffernblock für Längen in der Skizze (statt Tastatur) */
.sk-ziffern { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 10000; display: grid;
  grid-template-columns: repeat(3, 76px); gap: 8px; padding: 12px; background: #eef1f5; border: 1px solid #c7cdd5;
  border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.25); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.sk-ziffern button { height: 58px; border: 1px solid #c7cdd5; border-radius: 10px; background: #fff; color: #18212c; font-size: 26px; font-weight: 500; }
.sk-ziffern button:active { background: #dfe6ef; }
.sk-ziffern button.klein { font-size: 15px; }
.sk-ziffern button.ok { grid-column: span 2; background: #234181; color: #fff; border-color: #234181; font-size: 18px; font-weight: 600; }
.sk-ziffern-anzeige { grid-column: 1 / -1; min-height: 40px; padding: 6px 12px; background: #fff; border: 1px solid #c7cdd5; border-radius: 10px;
  font-size: 24px; text-align: right; color: #18212c; overflow: hidden; white-space: nowrap; }
.ipad-antwort { display: grid; gap: 6px; margin-top: 8px; }
.ipad-antwort textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.ipad-antwort .btn { justify-self: start; }
.ipad-dialog { display: grid; gap: 4px; margin: 6px 0; }
.ipad-box .ipad-antwort textarea { display: block; width: 100% !important; max-width: none; box-sizing: border-box; min-height: 70px; }
.ipad-freitext > .ipad-antwort, .ipad-freitext > .ipad-dialog { justify-self: stretch; width: 100%; }

/* Sperre, solange Claude etwas bearbeitet */
.ki-sperre { border: none; background: transparent; padding: 0; max-width: none; max-height: none; width: 100vw; height: 100vh; margin: 0; }
.ki-sperre::backdrop { background: rgba(10, 20, 30, .55); backdrop-filter: blur(2px); }
.ki-sperre-in { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #fff; text-align: center; }
.ki-sperre-in b { font-size: 20px; }
.ki-sperre-in .hint { color: rgba(255,255,255,.8); margin: 0; }
.ki-sperre-zeit { font-variant-numeric: tabular-nums; color: rgba(255,255,255,.85); }
.spinner.ki-gross { width: 72px; height: 72px; border-width: 7px; }
.ki-sperre-in .spinner.ki-gross { border-color: rgba(255,255,255,.25); border-top-color: #fff; }
.rf-liste { display: grid; gap: 10px; margin-top: 10px; justify-self: stretch; }
.rf-punkt { display: grid; gap: 6px; }
.rf-punkt textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.rf-liste > .btn { justify-self: start; }
.rf-paar { display: grid; gap: 4px; margin-bottom: 6px; }

/* Punkt 6: Excel bearbeiten (Excel-ähnlich) */
.xl-hinweis { margin-bottom: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.xl-tabs { display: flex; gap: 2px; border-bottom: 2px solid #1f7a45; margin-bottom: 8px; }
.xl-tab { border: 1px solid #cfd6de; border-bottom: 0; background: #eef1f5; padding: 6px 14px; border-radius: 6px 6px 0 0; font: inherit; font-size: 13px; cursor: pointer; }
.xl-tab.an { background: #1f7a45; color: #fff; border-color: #1f7a45; font-weight: 600; }
.xl-leiste { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; padding: 6px; background: #f4f6f8; border: 1px solid #dfe4ea; border-radius: 8px; }
.xl-gruppe { display: flex; align-items: center; gap: 3px; padding: 0 8px 0 0; border-right: 1px solid #d5dbe3; }
.xl-gt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: #6b7684; margin-right: 3px; }
.xl-k { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 4px 8px; font: inherit; font-size: 13px; cursor: pointer; color: #18212c; }
.xl-k:hover:not(:disabled) { background: #e3e8ee; border-color: #cfd6de; }
.xl-k:disabled { color: #b0b8c2; cursor: default; }
.xl-k[data-xl="rueck"], .xl-k[data-xl="vor"] { font-size: 17px; padding: 1px 8px; }
.xl-k-haupt { background: #fff; border-color: #cfd6de; font-weight: 600; color: #1f7a45; }
.xl-rechts { margin-left: auto; display: flex; gap: 6px; }
.xl-fx { display: flex; align-items: stretch; border: 1px solid #cfd6de; border-radius: 6px; margin-bottom: 6px; background: #fff; overflow: hidden; }
.xl-fx #xl-name { width: 92px; border: 0; border-right: 1px solid #cfd6de; padding: 4px 8px; font: inherit; font-size: 13px; color: #33475b; background: #f7f9fb; }
.xl-fx-zeichen { padding: 4px 8px; font-style: italic; color: #6b7684; border-right: 1px solid #e6e9ee; font-family: Georgia, serif; }
.xl-fx #xl-fx { flex: 1; border: 0; padding: 4px 8px; font: inherit; font-size: 13px; outline: none; }
.xl-wrap { max-height: 72vh; overflow: auto; border: 1px solid #cfd6de; border-radius: 6px; background: #fff; outline: none; user-select: none; -webkit-user-select: none; }
.xl-wrap:focus { border-color: #1f7a45; }
#excel-box.xl-busy .xl-wrap { opacity: .65; cursor: progress; }
table.xl { border-collapse: collapse; table-layout: fixed; font-size: 12.5px; color: #18212c; }
table.xl th { position: sticky; top: 0; z-index: 2; background: #eef1f5; color: #5b6573; font-weight: 500; font-size: 11px; border: 1px solid #d5dbe3; padding: 2px 4px; cursor: s-resize; }
table.xl tbody th { position: sticky; left: 0; z-index: 1; text-align: right; cursor: e-resize; }
table.xl th.xl-ecke { z-index: 3; left: 0; cursor: default; }
table.xl th.sel { background: #d3e8dc; color: #14532d; font-weight: 600; }
table.xl td { border: 1px solid #e6e9ee; padding: 3px 6px; height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: cell; }
table.xl td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.xl td.f { color: #23415f; }
table.xl td.b { font-weight: 700; }
table.xl td.fehler { color: #b42318; }
table.xl td.sel { background: #e3f1e8; }
table.xl td.akt { outline: 2px solid #1f7a45; outline-offset: -2px; background: #fff; }
table.xl tr.vs td, table.xl tr.vs th, table.xl td.vs, table.xl th.vs { color: #9aa4b1; background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0,0,0,.03) 6px 12px); }
table.xl td:has(> .xl-eingabe) { padding: 0; outline: 2px solid #1f7a45; outline-offset: -2px; overflow: visible; }
.xl-eingabe { width: 100%; min-width: 100%; height: 22px; border: 0; padding: 3px 6px; font: inherit; box-sizing: border-box; background: #fff; outline: none; }
.xl-menue { position: fixed; z-index: 10050; min-width: 240px; background: #fff; border: 1px solid #cfd6de; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 4px; display: grid; }
.xl-menue button { display: flex; justify-content: space-between; gap: 16px; border: 0; background: none; text-align: left; padding: 6px 10px; border-radius: 5px; font: inherit; font-size: 13px; cursor: pointer; color: #18212c; }
.xl-menue button:hover { background: #e3f1e8; }
.xl-menue kbd { font: inherit; font-size: 11px; color: #8a94a1; }
.xl-menue hr { border: 0; border-top: 1px solid #e6e9ee; margin: 3px 4px; }
.xlp-liste { margin-top: 10px; max-height: 55vh; overflow: auto; display: grid; gap: 2px; }
.xlp-zeile { display: grid; grid-template-columns: 64px 1fr auto auto 150px; gap: 10px; align-items: center; text-align: left; border: 1px solid transparent; background: none; padding: 6px 8px; border-radius: 6px; font: inherit; font-size: 13px; cursor: pointer; }
.xlp-zeile:hover { background: #eef6f1; border-color: #cfe3d6; }
.xlp-zeile[hidden] { display: none; }
.xlp-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xlp-ep { color: #5b6573; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xl-protokoll { margin-top: 8px; font-size: 13px; }
.xl-protokoll ul { margin: 6px 0 0; padding-left: 18px; max-height: 200px; overflow: auto; }
.xl-korr { margin-bottom: 8px; padding: 8px 10px; border: 1px solid #f0d58a; background: #fff8e1; border-radius: 8px; font-size: 13px; display: grid; gap: 4px; }
.xl-korr-z { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.xl-korr-z > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Letzter Schritt: Excel + PDF erzeugen */
.fertig-schritt { display: grid; gap: 12px; padding: 16px 18px; border: 2px solid var(--brand, #234181); }
.fertig-kopf { display: flex; gap: 12px; align-items: flex-start; }
.fertig-kopf h2 { margin: 0 0 2px; font-size: 17px; }
.fertig-kopf .hint { margin: 0; }
.fertig-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn.gross { font-size: 16px; padding: 11px 22px; }
/* Startseite: links Einstellungen + Claude, mittig die Werkzeuge */
/* Startseite volle Breite: schmale Spalte ganz links, rechts ein gleich breiter leerer Platz – so stehen die Werkzeuge
   genau in der Mitte des Fensters */
main:has(> .start2) { max-width: none; padding-left: 14px; padding-right: 14px; }
.start2 { display: grid; grid-template-columns: 220px minmax(0, 1fr) 220px; gap: 24px; margin: 4px 0 0; align-items: start; }
.start2::after { content: ""; }
.start-seite { display: grid; gap: 8px; position: sticky; top: 76px; font-size: 13px; }
.start-seite .einst-kachel { padding: 9px 11px; border-radius: 10px; }
.start-seite .einst-kachel span { font-size: 11.5px; }
.start-seite .claude-karte { padding: 10px 11px; }
.start-titel { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 2px; }
.einst-kachel { font: inherit; color: inherit; text-align: left; display: grid; gap: 3px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; cursor: pointer; }
.einst-kachel:hover { border-color: var(--accent); }
.einst-kachel span { font-size: 12.5px; color: var(--muted); }
.claude-karte { display: grid; gap: 10px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.claude-karte > .btn { justify-self: start; }
.claude-status { display: flex; gap: 10px; align-items: flex-start; }
.claude-status > div { display: grid; gap: 2px; min-width: 0; }
.claude-status span:not(.punkt) { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.claude-status .punkt { width: 11px; height: 11px; border-radius: 50%; margin-top: 4px; flex: none; background: #b42318; box-shadow: 0 0 0 3px rgba(180,35,24,.15); }
.claude-status.ok .punkt { background: #1f7a45; box-shadow: 0 0 0 3px rgba(31,122,69,.15); }
.claude-nutzung { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; }
.claude-nutzung .btn { justify-self: start; }
table.t.klein { font-size: 12.5px; }
table.t.klein td, table.t.klein th { padding: 3px 6px; }
.start-mitte { display: flex; flex-direction: column; align-items: center; }
.start-kopf2 { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin: 4px 0 26px; }
.start-kopf2 img { height: 70px; width: auto; }
.start-kopf2 h1 { margin: 6px 0 0; }
.start-kopf2 .sub-line { margin: 0; }
.tool-kacheln { display: grid; gap: 20px; width: 100%; max-width: 520px; }
.tool-kachel { font: inherit; color: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px;
  min-height: 280px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--brand, #234181);
  border-radius: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.05); cursor: pointer; transition: transform .12s, border-color .12s; }
.tool-kachel:hover:not(.bald) { transform: translateY(-2px); border-color: var(--accent); border-top-color: var(--accent); }
.tool-icon { width: 130px; height: 130px; border-radius: 30px; display: grid; place-items: center; background: #234181; color: #fff; margin-bottom: 4px; }
.tool-name { font-size: 26px; font-weight: 700; }
.tool-text { color: var(--muted); max-width: 360px; }
.tool-kachel.bald { cursor: default; border-style: dashed; border-top-style: dashed; border-top-color: var(--line); border-top-width: 1px; opacity: .8; }
.tool-kachel.bald .tool-icon { background: var(--soft, #eef1f5); color: var(--muted); }
.tool-kachel.bald .tool-name { color: var(--muted); font-style: italic; }
.start-mitte .firmen-fuss { width: 100%; text-align: center; justify-content: center; display: flex; }
.claude-nutzung td:first-child { white-space: nowrap; }
@media (max-width: 900px) { .start2 { grid-template-columns: 1fr; } .start2::after { display: none; } .start-seite { position: static; order: 2; } }
