:root {
  --ink: #18202e;
  --muted: #5f6b7e;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e3e7ee;
  --brand: #e8590c;
  --brand-dark: #c74706;
  --brand-soft: #fff0e6;
  --blue: #2f6fed;
  --blue-soft: #e8efff;
  --green: #1f9d55;
  --green-soft: #e3f6ea;
  --red: #c4320a;
  --red-soft: #fdece6;
  --gray-soft: #eef1f5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
h1 { font-size: 1.7rem; margin: 0 0 4px; letter-spacing: -.02em; line-height: 1.2; }
h2 { font-size: 1.15rem; margin: 0 0 12px; letter-spacing: -.01em; }
h3 { font-size: 1rem; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pre { white-space: pre-wrap; }
:focus-visible { outline: 3px solid #ffc7a3; outline-offset: 2px; }

/* Kopfzeile */
.topbar {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap; position: sticky; top: 0; z-index: 5;
  padding: 12px 24px; background: rgba(24, 32, 46, .97); color: #fff; backdrop-filter: blur(6px);
}
.brand { color: #fff; font-weight: 800; font-size: 1.35rem; text-decoration: none; letter-spacing: -.03em; }
.brand span { color: #ff8a4c; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.topbar nav a { color: #cfd6e4; text-decoration: none; padding: 6px 10px; border-radius: 8px; }
.topbar nav a:hover, .topbar nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.who { display: flex; gap: 12px; align-items: center; font-size: .9rem; color: #cfd6e4; }
.who a:not(.btn) { color: #fff; text-decoration: none; }
.who .link { color: #fff; }

main { max-width: 1080px; margin: 0 auto; padding: 24px 16px 64px; }
main.home { max-width: 1160px; padding-top: 0; }
footer {
  display: grid; gap: 6px; justify-items: center; text-align: center; color: var(--muted); font-size: .85rem;
  padding: 32px 16px; border-top: 1px solid var(--line); background: #fff;
}
footer a { color: inherit; }
.foot-brand { font-weight: 800; font-size: 1.1rem; color: var(--ink); }
.foot-brand span { color: var(--brand); }

/* Bausteine */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.back { display: inline-block; font-size: .9rem; margin-bottom: 6px; text-decoration: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stack { display: grid; gap: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.actions.sticky { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); }
.right { text-align: right; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font: inherit; font-weight: 600; text-decoration: none; color: var(--ink);
  background: #fff; border: 1px solid #cdd2da; border-radius: 8px; padding: 8px 14px;
}
.btn:hover { background: var(--gray-soft); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(.94); }
.btn.danger { color: var(--red); }
.btn.small { padding: 4px 10px; font-size: .85rem; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; text-decoration: underline; }
.icon { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 1rem; padding: 6px; }
.icon:hover { color: var(--red); }

label { display: grid; gap: 4px; font-size: .88rem; font-weight: 600; margin-bottom: 12px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); width: 100%;
  border: 1px solid #cdd2da; border-radius: 8px; padding: 8px 10px; background: #fff;
}
input[type=checkbox] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid #ffc9a8; border-color: var(--brand); }

.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.gray { background: var(--gray-soft); color: var(--muted); }
.badge.orange { background: var(--brand-soft); color: var(--brand); }

.note { background: var(--blue-soft); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.note.warn { background: var(--brand-soft); }
.empty { text-align: center; padding: 40px 20px; }
.narrow { max-width: 640px; }
.legal { max-width: 820px; }
.legal h2 { margin-top: 24px; }
.legal li { margin-bottom: 8px; }
footer a { color: inherit; }

/* Listen */
.list { display: grid; gap: 8px; }
.item {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; color: inherit; text-decoration: none;
}
a.item:hover { border-color: #b8c0cc; }
.item .right { display: grid; gap: 4px; justify-items: end; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: inherit; }
.stat b { display: block; font-size: 1.5rem; }
.stat span { color: var(--muted); font-size: .88rem; }

/* Startseite */
.hero { background: var(--ink); color: #fff; border-radius: 14px; padding: 36px 32px; margin-bottom: 20px; }
.hero h1 { font-size: 2rem; }
.hero p { color: #d6dbe5; max-width: 680px; font-size: 1.05rem; }
.usp { display: flex; gap: 10px; flex-wrap: wrap; list-style: none; padding: 0; margin: 16px 0 0; }
.usp li { background: rgba(255,255,255,.1); border-radius: 99px; padding: 6px 14px; font-size: .9rem; }
.card-btn {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  font: inherit; text-align: left; cursor: pointer; padding: 12px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
.card-btn:hover { border-color: var(--brand); }
.card-btn span { color: var(--muted); font-size: .85rem; }

/* Angebote beim Kunden */
.offers { display: grid; gap: 12px; }
.offer { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.offer.angenommen { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.offer.abgelehnt { opacity: .6; }
.offer-head { display: flex; justify-content: space-between; gap: 12px; }
.offer-head > div:first-child { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
.offer-head .avatar { grid-row: span 2; }
.price { font-size: 1.3rem; font-weight: 800; }
details { margin-top: 12px; }
summary { cursor: pointer; font-weight: 600; color: var(--blue); }

.avatar {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 8px;
  background: var(--brand-soft); color: var(--brand); font-weight: 800; object-fit: contain; border: 1px solid var(--line);
}
.avatar.large { width: 88px; height: 88px; font-size: 2rem; }

/* Nachrichten */
.thread { display: grid; gap: 8px; margin-top: 10px; }
.msg { background: var(--gray-soft); border-radius: 10px; padding: 8px 12px; max-width: 80%; }
.msg.mine { background: var(--brand-soft); justify-self: end; }
.msg b { display: block; font-size: .8rem; }
.msg small { display: block; color: var(--muted); font-size: .75rem; }
.msg-form { display: flex; gap: 8px; }

/* Angebots-Editor */
.item-row {
  display: grid; grid-template-columns: 1fr 80px 100px 210px 120px 100px 64px; gap: 8px; align-items: end;
  padding: 12px 0; border-bottom: 1px dashed var(--line);
}
.item-row label { margin: 0; }
.item-row textarea { grid-column: 1 / -1; }
.line-total { font-weight: 700; text-align: right; padding-bottom: 9px; }
.row-tools { display: flex; justify-content: flex-end; padding-bottom: 4px; }
.icon.save:hover { color: var(--brand); }
.btn.ai { border-color: #c4b5fd; color: #5b21b6; }
.btn.ai:hover { background: #f3efff; }

/* Katalog und KI im Angebots-Editor */
.tool-panel { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: #fbfbfc; }
.tool-head { display: flex; justify-content: space-between; align-items: center; }
.tool-head h3 { margin: 0 0 10px; }
.pick-list { max-height: 320px; overflow-y: auto; display: grid; gap: 4px; margin-top: 8px; }
.pick {
  display: flex; justify-content: space-between; gap: 12px; text-align: left; cursor: pointer;
  font: inherit; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
}
.pick:hover { border-color: var(--brand); }
.pick b { white-space: nowrap; }
.ai-item { align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; }
.ai-item input { margin-top: 4px; }
.grow { flex: 1; }

/* Blauer Haken */
.verified {
  display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 6px; vertical-align: middle;
  border-radius: 50%; background: #1d9bf0; color: #fff; font-size: 11px; font-weight: 800; line-height: 1;
}
h1 .verified { width: 24px; height: 24px; font-size: 14px; }
.verified-text { color: #1d74b8; font-weight: 600; }

/* Baustellen-Tagebuch */
.diary-form { border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 16px; }
.diary { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.diary-entry { position: relative; padding: 0 0 18px 20px; }
.diary-entry::before { content: ''; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); }
.diary-date { font-size: .82rem; color: var(--muted); font-weight: 600; }

/* Besichtigungstermine */
.appt { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot { flex-direction: column; align-items: flex-start; gap: 2px; }
.slot span { font-weight: 400; font-size: .8rem; color: var(--green); }
.appt-when { background: var(--green-soft); border-radius: 8px; padding: 10px 14px; }

/* Startseite */
.ico { width: 22px; height: 22px; flex: none; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); margin-bottom: 8px; }
.landing-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 32px; align-items: center; padding: 48px 8px 32px; }
.landing-hero h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.08; letter-spacing: -.035em; margin-bottom: 16px; }
.hl { color: var(--brand); }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 560px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 18px; }
.cta-row.center { justify-content: center; }
.btn.big { padding: 13px 22px; font-size: 1.02rem; border-radius: 12px; }
.btn.ghost { background: transparent; border-color: var(--ink); }
.btn.ghost.light { color: #fff; border-color: rgba(255,255,255,.6); }
.btn.ghost.light:hover { background: rgba(255,255,255,.1); }
.trust { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: var(--muted); font-size: .95rem; }
.trust li { display: flex; gap: 8px; align-items: center; }
.trust .ico { color: var(--green); }
.hero-art svg, .split-art svg { width: 100%; height: auto; display: block; }
.block { padding: 40px 8px; }
.block h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); letter-spacing: -.02em; }
.center { text-align: center; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.step .ico, .feature .ico { width: 40px; height: 40px; padding: 8px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.step h3 { margin: 14px 0 6px; }
.step p { margin: 0; color: var(--muted); }
.split { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center; }
.split.reverse .split-art { order: 2; }
.features { display: grid; gap: 14px; margin: 18px 0 22px; }
.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature p { margin: 2px 0 0; color: var(--muted); }
.pricing .price-grid { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 18px; margin-top: 20px; align-items: stretch; }
.price-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.price-card.main { border: 2px solid var(--brand); position: relative; }
.price-card h3 { margin-top: 0; }
.price-card .price { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.price-card .price.small { font-size: 2rem; color: var(--green); }
.price-card ul { padding-left: 18px; margin: 10px 0 0; }
.faqs { max-width: 760px; margin: 18px auto 0; display: grid; gap: 10px; }
.faq { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin: 0; }
.faq summary { color: var(--ink); }
.faq p { color: var(--muted); margin: 10px 0 0; }
.final-cta { background: var(--ink); color: #fff; border-radius: 22px; text-align: center; padding: 48px 20px; margin: 24px 0; }
.final-cta h2 { color: #fff; }
.final-cta p a { color: #ffb48a; }
.auth { max-width: 920px; margin: 24px auto 0; }

/* Angebotsvergleich */
.compare { margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.compare table { margin-top: 8px; }
.num.up { color: var(--red); }
.num.down { color: var(--green); }
.overdue { color: var(--red); font-weight: 600; }

/* Fotos */
.photos { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; align-items: center; }
.photo { position: relative; margin: 0; }
.photo img { width: 140px; height: 105px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.photo-del {
  position: absolute; top: 4px; right: 4px; border: 0; border-radius: 99px; width: 24px; height: 24px;
  background: rgba(0,0,0,.6); color: #fff; cursor: pointer;
}
.photo-add { cursor: pointer; }

/* Reiter */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }

/* Leistungskatalog */
.cat-row, .cat-head { display: grid; grid-template-columns: 1fr 100px 210px 120px auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.cat-row label.bare { margin: 0; }
.kind-field { display: flex; gap: 6px; align-items: center; }
.kind-field input { width: 56px; text-align: right; }
.kind-field span { font-weight: 400; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.labor-note { font-size: 12px; background: #f4f7f4; border-left: 3px solid var(--green); padding: 8px 12px; margin: 12px 0; }
.cat-head { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.totals { margin-top: 16px; margin-left: auto; max-width: 320px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .strong { font-weight: 800; font-size: 1.1rem; border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 6px; }

.logo-box { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.logo-box img { max-width: 200px; max-height: 90px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; }

table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
table.data .num { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

/* Dokument (Angebot / Rechnung) */
.doc-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.doc {
  background: #fff; color: #111; max-width: 794px; margin: 0 auto; padding: 56px 64px;
  box-shadow: 0 2px 16px rgba(0,0,0,.08); font-size: 13px; line-height: 1.45;
}
.doc-head { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 36px; }
.doc-logo img { max-width: 220px; max-height: 90px; }
.doc-firm { font-size: 22px; font-weight: 800; }
.doc-from { text-align: right; font-size: 12px; color: #444; }
.doc-addr { min-height: 110px; margin-bottom: 18px; }
.sender-line { font-size: 10px; color: #666; text-decoration: underline; margin-bottom: 6px; }
.doc-meta { margin-left: auto; margin-bottom: 24px; border-collapse: collapse; }
.doc-meta td { padding: 1px 0 1px 18px; }
.doc-meta td:first-child { color: #555; }
.doc-title { font-size: 18px; margin: 0 0 14px; }
.doc-items { width: 100%; border-collapse: collapse; margin: 14px 0; }
.doc-items th { text-align: left; border-bottom: 2px solid #111; padding: 6px 4px; font-size: 12px; }
.doc-items td { border-bottom: 1px solid #ddd; padding: 7px 4px; vertical-align: top; }
.doc-items .num, .doc-totals .num { text-align: right; white-space: nowrap; }
.doc-totals { margin-left: auto; border-collapse: collapse; min-width: 300px; }
.doc-totals td { padding: 3px 4px; }
.doc-totals tr.strong td { font-weight: 800; border-top: 1px solid #111; }
.doc-totals tr.total td { font-size: 15px; border-top: 2px solid #111; }
.doc-totals small { color: #666; }
.doc-foot { margin-top: 48px; padding-top: 10px; border-top: 1px solid #ccc; font-size: 10.5px; color: #555; display: flex; flex-wrap: wrap; gap: 4px 18px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 10;
}

@media (max-width: 860px) {
  .landing-hero, .split, .pricing .price-grid, .steps { grid-template-columns: 1fr; }
  .split.reverse .split-art { order: 0; }
  .hero-art { max-width: 460px; margin: 0 auto; }
  .landing-hero { padding-top: 28px; }
}

@media (max-width: 760px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .topbar { position: static; }
  .topbar { padding: 12px 16px; }
  .hero { padding: 24px 20px; }
  .item-row { grid-template-columns: 1fr 1fr; }
  .cat-row { grid-template-columns: 1fr 1fr; }
  .cat-row > :first-child { grid-column: 1 / -1; }
  .cat-head { display: none; }
  .line-total { text-align: left; }
  .doc { padding: 24px 18px; }
  .doc-head { flex-direction: column; }
  .doc-from { text-align: left; }
}

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .no-print, .topbar, footer, .doc-toolbar { display: none !important; }
  main { padding: 0; max-width: none; }
  .doc { box-shadow: none; padding: 0; max-width: none; }
}
