
/* Layout: App-Hülle wie die echte App – Kopfzeile, eine scrollende Seite, Tableiste unten; auf breiten Bildschirmen als zentriertes Gerät. */
:root {
  --canvas: #f6f9f5;
  --surface: #ffffff;
  --ink: #1a2e29;
  --muted: #4e5d57;
  --accent: #10614f;
  --accent-ink: #ffffff;
  --mint: #ddf0e6;
  --line: #d4dbd5;
  --warn: #8c470e;
  --warn-soft: #fcedd6;
  --shadow: 0 1px 2px rgba(16, 50, 40, .06), 0 6px 20px rgba(16, 50, 40, .06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #131817; --surface: #1e2422; --ink: #e6f0eb; --muted: #a1b0a8;
    --accent: #339478; --accent-ink: #ffffff; --mint: #1f3f34; --line: #3f4a45;
    --warn: #fab361; --warn-soft: #4a3317; --shadow: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #131817; --surface: #1e2422; --ink: #e6f0eb; --muted: #a1b0a8;
  --accent: #339478; --accent-ink: #ffffff; --mint: #1f3f34; --line: #3f4a45;
  --warn: #fab361; --warn-soft: #4a3317; --shadow: 0 1px 2px rgba(0,0,0,.4);
  color-scheme: dark;
}
html, body { height: 100%; }
body { background: var(--canvas); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; }
* { box-sizing: border-box; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { display: flex; flex-direction: column; height: 100%; max-width: 560px; margin: 0 auto; background: var(--canvas); }
@media (min-width: 700px) {
  body { background: var(--line); }
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
.top { display: flex; align-items: center; gap: 8px; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--surface); border-bottom: 1px solid var(--line); }
.mark { font-style: italic; font-weight: 900; font-size: 19px; color: #fff; background: var(--accent); border-radius: 6px; padding: 2px 7px; letter-spacing: -.02em; }
.brand { font-family: var(--font-round); font-weight: 700; font-size: 18px; }
.who { margin-left: auto; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--warn); background: var(--warn-soft); padding: 3px 8px; border-radius: 99px; }
.main { flex: 1; overflow-y: auto; padding-block: 16px 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 14px; }
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-block: 6px calc(6px + env(safe-area-inset-bottom, 0px)); padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; padding: 6px 2px; border-radius: 12px; color: var(--muted); font-size: 11px; cursor: pointer; }
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--accent); background: var(--mint); font-weight: 600; }

.panel { background: var(--surface); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); min-width: 0; }
.panel h2 { margin: 0; font-size: 16px; font-weight: 650; }
.sub { color: var(--muted); font-size: 13px; }
.cap { font-size: 12.5px; color: var(--muted); }
.acc { color: var(--accent); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 12px; cursor: pointer; font-weight: 550; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.big { padding: 12px 16px; font-size: 16px; width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 12px; cursor: pointer; font-size: 13.5px; }
.chip[aria-pressed="true"] { background: var(--mint); border-color: transparent; color: var(--accent); font-weight: 600; }
input[type="search"], input[type="text"], select { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
select { padding-right: 28px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }

.status { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 14px; border-radius: 12px; background: var(--mint); border: 0; text-align: left; cursor: pointer; width: 100%; }
.status.problem { background: var(--warn-soft); }
.status span { display: inline-flex; gap: 5px; align-items: center; font-size: 13.5px; color: var(--accent); }
.status span.bad { color: var(--warn); }
.status svg { width: 15px; height: 15px; flex: none; }

.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; width: 100%; }
.item:last-child { border-bottom: 0; }
.item .t { font-weight: 650; }
.item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item .chev { color: var(--muted); flex: none; }
.new-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); background: var(--mint); padding: 1px 6px; border-radius: 6px; margin-left: 6px; vertical-align: 2px; }
.grade { display: inline-block; min-width: 30px; text-align: center; font-weight: 700; font-size: 12px; border-radius: 6px; padding: 1px 5px; background: var(--mint); color: var(--accent); }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--mint); color: var(--accent); }
.banner .grow { flex: 1; min-width: 0; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.steps i { height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--accent); }
.mail { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.money { font-variant-numeric: tabular-nums; }
.stage { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--mint); color: var(--accent); white-space: nowrap; }
.stage.won { background: var(--accent); color: var(--accent-ink); }
.log { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.log .skip { color: var(--muted); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 8px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch button { width: 50px; height: 30px; border-radius: 99px; border: 0; background: var(--line); position: relative; cursor: pointer; flex: none; }
.switch button::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .18s; }
.switch button[aria-checked="true"] { background: var(--accent); }
.switch button[aria-checked="true"]::after { left: 23px; }

.sheet-wrap { position: fixed; inset: 0; background: rgba(10, 25, 20, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 30; }
.sheet { background: var(--canvas); width: 100%; max-width: 560px; max-height: 88%; overflow-y: auto; border-radius: 18px 18px 0 0; padding-block: 8px calc(20px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 12px; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 2px; }
.sheet-head { display: flex; align-items: center; gap: 10px; }
.sheet-head h3 { margin: 0; font-size: 18px; flex: 1; min-width: 0; }

.toast { position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); width: min(92%, 420px); z-index: 40; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; text-align: left; cursor: pointer; animation: drop .25s ease-out; }
.toast .ic { flex: none; }
.toast b { display: block; font-size: 13px; }
.toast small { color: var(--muted); font-size: 11.5px; }
@keyframes drop { from { transform: translate(-50%, -16px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } .switch button::after { transition: none; } }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: sp .8s linear infinite; vertical-align: -3px; }
@keyframes sp { to { transform: rotate(360deg); } }
.note { font-size: 12.5px; color: var(--muted); border-left: 3px solid var(--line); padding-left: 10px; }
/* ObjektCheck AI */
.tabs { grid-template-columns: repeat(6, 1fr); }
.tab { font-size: 10.5px; }
.oc-start { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; border-radius: 16px; padding: 16px 18px; background: var(--accent); color: var(--accent-ink); text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.oc-start svg { width: 32px; height: 32px; flex: none; }
.oc-start b { display: block; font-size: 18px; }
.oc-start .grow { flex: 1; min-width: 0; }
.sheet.full { max-height: 100%; height: 100%; border-radius: 0; padding-top: 0; gap: 12px; }
.flow-head { position: sticky; top: 0; z-index: 2; background: var(--canvas); padding-top: calc(10px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.stepper { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.stepper button { flex: none; border: 0; border-radius: 99px; padding: 7px 11px; background: var(--mint); color: var(--ink); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.stepper button[aria-current="step"] { background: var(--accent); color: var(--accent-ink); }
.ph-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ph { background: var(--surface); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); min-width: 0; }
.ph .img { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--mint); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .no { position: absolute; top: 6px; left: 6px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.ph .tools { display: flex; gap: 4px; }
.ph .tools button { flex: 1; padding: 5px 0; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; cursor: pointer; font-size: 13px; }
.ph input { font-size: 13px; padding: 6px 8px; }
label.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
label.btn input { display: none; }
.btn.disabled { opacity: .45; pointer-events: none; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.field input, .field select, .field textarea, .ph input, .lines input { width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.field textarea { min-height: 84px; resize: vertical; line-height: 1.4; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.two.zip { grid-template-columns: 96px 1fr; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.issue { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--warn); }
.issue svg, .okline svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.okline { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--accent); }
.warnbox { background: var(--warn-soft); color: var(--ink); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.warnbox b { color: var(--warn); }
.st { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--mint); color: var(--accent); white-space: nowrap; }
.st.bad { background: var(--warn-soft); color: var(--warn); }
.lines { display: flex; flex-direction: column; gap: 8px; }
.line { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.line .nums { display: grid; grid-template-columns: 72px 70px 1fr auto; gap: 6px; align-items: center; }
.line .nums input { padding: 7px 8px; font-size: 14px; }
.line .sum { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; min-width: 78px; }
.line .hint { font-size: 12px; color: var(--warn); }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.totals .g { font-weight: 700; color: var(--accent); }
.paper-wrap { background: #c9ced6; border-radius: 12px; padding: 10px; max-height: 70vh; overflow-y: auto; }
.paper { background: #fff; color: #222630; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 11px; line-height: 1.45; padding: 22px 20px 16px; border-top: 5px solid #13284f; box-shadow: 0 2px 8px rgba(0,0,0,.2); display: flex; flex-direction: column; gap: 9px; }
.paper .lh { display: flex; gap: 10px; align-items: center; border-bottom: 1px solid #dde1e8; padding-bottom: 10px; }
.paper .lg { background: #13284f; color: #fff; font-weight: 800; font-size: 15px; border-radius: 6px; width: 38px; height: 38px; display: grid; place-items: center; flex: none; }
.paper .fn { font-weight: 800; color: #13284f; font-size: 14px; }
.paper .ad { margin-left: auto; text-align: right; color: #6b7280; font-size: 9.5px; }
.paper h4 { margin: 4px 0 0; color: #13284f; font-size: 16px; line-height: 1.2; }
.paper h5 { margin: 6px 0 0; color: #13284f; font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1.5px solid #13284f; display: inline-block; padding-bottom: 2px; align-self: flex-start; }
.paper .facts { background: #f1f3f7; padding: 8px 10px; display: grid; grid-template-columns: 96px 1fr; gap: 3px 8px; }
.paper .facts span:nth-child(odd) { color: #6b7280; font-weight: 700; font-size: 9.5px; }
.paper .gal { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.paper .gal img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid #dde1e8; display: block; }
.paper .gal div { color: #6b7280; font-size: 9px; }
.paper ul { margin: 0; padding-left: 16px; }
.paper .grey { color: #6b7280; font-size: 9.5px; }
.paper .nb { background: #fcf2de; padding: 7px 9px; }
.paper table { width: 100%; border-collapse: collapse; font-size: 9.5px; }
.paper th { background: #f1f3f7; color: #13284f; text-align: left; padding: 4px; }
.paper td { border-bottom: 1px solid #dde1e8; padding: 4px; vertical-align: top; }
.paper .r { text-align: right; white-space: nowrap; }
.paper .tot { display: grid; grid-template-columns: 1fr auto; gap: 1px 12px; margin-left: 40%; }
.paper .tot .g { font-weight: 800; color: #13284f; font-size: 11.5px; }
.paper .foot { border-top: 1px solid #dde1e8; padding-top: 6px; color: #6b7280; font-size: 8.5px; display: flex; justify-content: space-between; gap: 8px; }
.paper .addr { display: flex; justify-content: space-between; gap: 10px; }
.paper .meta { display: grid; grid-template-columns: auto auto; gap: 1px 10px; font-size: 9.5px; }
.paper .meta b { text-align: right; white-space: nowrap; }
.paper .addr { flex-wrap: wrap; }
.confirm { border: 2px solid var(--accent); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }

/* Web-App */
.who { margin-left: auto; font-size: 12px; color: var(--muted); background: none; text-transform: none; letter-spacing: 0; font-weight: 500; }
.login { max-width: 380px; margin: 10vh auto 0; display: flex; flex-direction: column; gap: 12px; padding: 0 16px; }
.login h1 { font-family: var(--font-round); font-size: 26px; margin: 0; }
.field input[type=password], .field input[type=date], .field input[type=number] { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.err { color: var(--warn); font-size: 13.5px; }
.toast-area { position: fixed; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; width: min(92%, 440px); }
.toast-area div { background: var(--ink); color: var(--canvas); padding: 10px 14px; border-radius: 12px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast-area div.bad { background: var(--warn); color: #fff; }
.pdf-frame { width: 100%; height: 70vh; border: 0; border-radius: 10px; background: #c9ced6; }
.marker { position: relative; touch-action: none; user-select: none; }
.marker img { width: 100%; display: block; border-radius: 8px; }
.marker canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.facts dt { font-weight: 600; }
.small { font-size: 12px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.metric b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--mint); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
table.simple { width: 100%; border-collapse: collapse; font-size: 13px; }
table.simple td, table.simple th { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
@media (min-width: 900px) { .app { max-width: 820px; } }
