/* albitec Rapport – CI: Navy #163E64, Blau #1F6FEB, Anthrazit #1C1F24
   Layout-Strategie: Mobile first · Container Queries · Safe Areas · eigene Varianten für Phone quer und Tastatur */
:root {
  --navy: #163e64; --navy-2: #0f2d4a; --blue: #1f6feb; --blue-d: #1858c4; --blue-l: #5b9bff; --blue-bg: #e8f0fe;
  --ink: #1c1f24; --grey: #5e6673; --line: #d7dce3; --line-2: #e7eaef; --bg: #f2f4f8; --card: #fff; --paper: #fbfcfe;
  --ok: #157347; --ok-bg: #e3f3ea; --warn: #9a4508; --warn-bg: #fdf0e4; --bad: #b42318; --bad-bg: #fbe9e7; --na: #5e6673; --na-bg: #eceff3;
  --r: 16px; --tap: 52px; --hdr: 64px; --bar-h: 76px; --gut: 20px; --maxw: 1000px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  --pl: max(var(--gut), var(--sl)); --pr: max(var(--gut), var(--sr));
  --shadow: 0 1px 2px rgba(22, 62, 100, .06), 0 4px 16px rgba(22, 62, 100, .05);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--hdr) + var(--safe-t) + 96px); scroll-padding-bottom: calc(var(--bar-h) + 16px); }
html, body { margin: 0; min-height: 100%; }
#app { min-height: 100vh; min-height: 100dvh; }
body {
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0 0 10px; }
svg { flex: none; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--grey); }
.small { font-size: 14px; }
.spacer { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.center { justify-content: center; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
::placeholder { color: #7c8491; opacity: 1; }

/* ---------- Kopfzeile ---------- */
.top {
  position: sticky; top: 0; z-index: 30; color: #fff;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  min-height: calc(var(--hdr) + var(--safe-t));
  padding: var(--safe-t) max(var(--pr), calc((100% - var(--maxw)) / 2)) 0 max(var(--pl), calc((100% - var(--maxw)) / 2));
  display: flex; align-items: center; gap: 12px; box-shadow: inset 0 -3px 0 var(--blue);
}
.top img.logo { height: 32px; display: block; }
.top .title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.top .tt { font-weight: 650; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .ts { font-size: 13px; opacity: .72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .icon-btn { color: #fff; border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .07); width: 44px; height: 44px; }
.net { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; opacity: .92; white-space: nowrap; }
.net::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, .2); }
.net.off::before { background: #ffb020; box-shadow: 0 0 0 3px rgba(255, 176, 32, .25); }

/* ---------- Layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 22px var(--pr) calc(var(--bar-h) + 28px + var(--safe-b)) var(--pl); }
.card { background: var(--card); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; min-width: 0; overflow-wrap: anywhere; }
.card h2 { font-size: 13px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--blue-d); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card h2::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--blue); }
.card.note { color: var(--warn); background: var(--warn-bg); box-shadow: none; }
.count { background: var(--blue-bg); color: var(--blue-d); border-radius: 99px; padding: 1px 9px; font-size: 12px; letter-spacing: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.grid > * { min-width: 0; }
.grid.one { grid-template-columns: 1fr; }
.grid.narrow { max-width: 260px; margin-top: 14px; }
.span2 { grid-column: 1 / -1; }

/* ---------- Formulare ---------- */
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--grey); min-width: 0; }
input:not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%; min-height: var(--tap); padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); font-size: max(16px, 1em); font-weight: 450; outline: 2px solid transparent; -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type=date], input[type=time] { display: block; line-height: 1.2; text-align: left; }
input::-webkit-date-and-time-value { text-align: left; min-height: 1.25em; }
input[type=number] { -moz-appearance: textfield; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=search]::-webkit-search-decoration { -webkit-appearance: none; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--grey) 50%), linear-gradient(135deg, var(--grey) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; text-overflow: ellipsis; }
textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 111, 235, .16); }
input:disabled { background: var(--bg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 20px;
  border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 650; cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: transform .06s ease, background .15s, border-color .15s; text-decoration: none; color: var(--ink); text-align: center; line-height: 1.2; max-width: 100%;
}
.bottom .btn, .tin .btn, .seg button, .chip { white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn svg, .icon-btn svg { width: 22px; height: 22px; }
.btn.primary { background: linear-gradient(180deg, #2b78f0, var(--blue)); border-color: var(--blue); color: #fff; box-shadow: 0 2px 6px rgba(31, 111, 235, .25); }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.light { background: #fff; color: var(--navy); border-color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--blue-d); }
.btn.ghost-b { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.big { min-height: 60px; font-size: 18px; padding: 0 26px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.link, .link { border: 0; background: none; color: var(--blue-d); padding: 4px 0; font-weight: 600; cursor: pointer; text-align: left; min-height: 0; }
.icon-btn { width: var(--tap); height: var(--tap); padding: 0; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; display: inline-grid; place-items: center; cursor: pointer; flex: none; color: var(--ink); }
.icon-btn.ghost { border-color: transparent; background: transparent; color: var(--grey); }
@media (hover: hover) {
  .btn:hover { background: #f4f7fc; } .btn.primary:hover { background: var(--blue-d); } .btn.navy:hover { background: var(--navy-2); }
  .btn.light:hover { background: #eef3fb; } .btn.ghost:hover { background: var(--blue-bg); }
  .item-main:hover, .res:hover { background: #f6f8fc; }
}
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Schrittleiste ---------- */
.steps { position: sticky; top: calc(var(--hdr) + var(--safe-t)); z-index: 25; background: rgba(242, 244, 248, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 10px var(--pr) 6px var(--pl); border-bottom: 1px solid var(--line); }
.steps ol { list-style: none; margin: 0 auto; padding: 0; display: flex; max-width: var(--maxw); position: relative; }
.steps li { flex: 1; min-width: 0; position: relative; }
.steps li + li::before { content: ""; position: absolute; top: 22px; right: calc(50% + 18px); left: calc(-50% + 18px); height: 2px; background: var(--line); }
.steps li.done + li::before, .steps li.done + li.on::before { background: var(--blue); }
.steps button { width: 100%; border: 0; background: none; padding: 6px 2px; cursor: pointer; color: var(--grey); font-size: 13px; font-weight: 650; display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; }
.steps .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--line); font-size: 14px; font-weight: 750; transition: all .2s; }
.steps .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.steps .on button { color: var(--navy); }
.steps .on .dot { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 0 0 4px rgba(22, 62, 100, .14); }
.steps .done .dot { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- Fußleiste ---------- */
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-top: 1px solid var(--line); padding: 12px var(--pr) calc(12px + var(--safe-b)) var(--pl); }
.bottom .in { max-width: var(--maxw); margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.saved { font-size: 14px; color: var(--grey); text-align: center; }
.kb .bottom { display: none; }

/* ---------- Startseite ---------- */
.hero { background: radial-gradient(120% 140% at 100% 0%, #1d5487 0%, var(--navy) 45%, var(--navy-2) 100%); color: #fff; border-radius: 20px; padding: 26px; margin-bottom: 20px; position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1fr auto; gap: 18px 24px; align-items: center; box-shadow: 0 10px 30px rgba(15, 45, 74, .25); }
.hero::after { content: ""; position: absolute; right: -36px; top: -40px; width: 230px; height: 230px; background: url(icons/icon.svg) center/contain no-repeat; opacity: .06; filter: brightness(10); pointer-events: none; }
.hero h1 { font-size: 28px; letter-spacing: -.01em; margin-bottom: 6px; }
.hero p { margin: 0; opacity: .8; max-width: 46ch; }
.kpis { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpis div { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; }
.kpis b { font-size: 22px; font-variant-numeric: tabular-nums; }
.kpis span { font-size: 13px; opacity: .75; }
.search-home, .search-wrap { position: relative; }
.search-home { margin-bottom: 18px; }
.si { position: absolute; left: 14px; top: 15px; width: 22px; height: 22px; color: var(--grey); pointer-events: none; z-index: 1; }
.si svg { width: 22px; height: 22px; }
.search-home input, .search-wrap > input { padding-left: 46px !important; }

/* ---------- Listen ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; align-items: center; gap: 4px; background: #fff; border: 1.5px solid var(--line-2); border-radius: 14px; padding-right: 4px; }
.item-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px; border: 0; background: none; text-align: left; cursor: pointer; border-radius: 13px; }
.item-main:active { background: var(--bg); }
.item .main, .res .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item .t, .res .t { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s, .res .s { color: var(--grey); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: 12.5px; font-weight: 750; padding: 4px 10px; border-radius: 99px; white-space: nowrap; background: var(--na-bg); color: var(--na); }
.badge.draft { background: var(--blue-bg); color: var(--blue-d); }
.badge.wait { background: var(--warn-bg); color: var(--warn); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.err { background: var(--bad-bg); color: var(--bad); }
.empty { text-align: center; color: var(--grey); padding: 26px 10px; }
.menu { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Suche / Auswahl ---------- */
.results { margin-top: 10px; max-height: min(420px, 42dvh); overflow-y: auto; overscroll-behavior: contain; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
.results:empty { display: none; }
.res { display: flex; width: 100%; gap: 12px; align-items: center; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line-2); background: #fff; cursor: pointer; text-align: left; min-height: 56px; }
.res:last-child { border-bottom: 0; }
.res:active { background: var(--bg); }
.res .t { white-space: normal; }
.res .p { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.res-empty { padding: 14px; color: var(--grey); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; min-height: 44px; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; font-size: 15px; cursor: pointer; text-align: left; }
.chip.sm { min-height: 40px; font-size: 14px; padding: 6px 12px; font-weight: 550; white-space: normal; max-width: 100%; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.recent { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.snippets { margin: -4px 0 6px; }
.snippets .chip { background: var(--paper); }
.picked { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 12px; background: var(--blue-bg); border: 1.5px solid #c9dafc; margin-bottom: 14px; flex-wrap: wrap; }
.picked .main { flex: 1; min-width: 0; }
.hint-line { display: flex; gap: 8px; align-items: flex-start; }
.hint-line svg { width: 18px; height: 18px; margin-top: 2px; }

/* ---------- Positionen ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; padding: 14px 0; border-bottom: 1px solid var(--line-2); align-items: center; }
.pos:last-of-type { border-bottom: 0; }
.pos .t { font-weight: 600; overflow-wrap: anywhere; }
.pos .s { font-size: 14px; color: var(--grey); }
.pos-desc { margin-top: 8px; min-height: 44px !important; padding: 8px 12px !important; }
.pos .ctl { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.price { position: relative; display: inline-flex; }
.price-in { width: 118px !important; text-align: right; padding-right: 30px !important; font-variant-numeric: tabular-nums; }
.price .cur { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--grey); pointer-events: none; }
.qty-ro { white-space: nowrap; min-width: 96px; text-align: right; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.qty button { width: 48px; height: 50px; border: 0; background: var(--bg); font-size: 22px; cursor: pointer; }
.qty input { width: 64px !important; min-height: 50px !important; border: 0 !important; border-radius: 0 !important; text-align: center; padding: 0 4px !important; box-shadow: none !important; font-variant-numeric: tabular-nums; }
.auto-tag { font-size: 11.5px; font-weight: 750; color: var(--blue-d); background: var(--blue-bg); border-radius: 6px; padding: 2px 7px; margin-left: 6px; vertical-align: 2px; white-space: nowrap; }
.sum { display: flex; justify-content: space-between; padding-top: 14px; border-top: 2px solid var(--ink); margin-top: 6px; font-weight: 750; font-size: 18px; font-variant-numeric: tabular-nums; }

/* ---------- Zeiten ---------- */
.time { border: 1.5px solid var(--line-2); border-radius: 14px; padding: 16px; margin-bottom: 14px; background: var(--paper); container-type: inline-size; }
.time .grid { grid-template-columns: 1.1fr 1.35fr 1.35fr .8fr; }
.time .w2 { grid-column: span 2; }
.time .w4 { grid-column: 1 / -1; }
@container (max-width: 640px) { .time .grid { grid-template-columns: 1fr 1fr; } .time .w2 { grid-column: 1 / -1; } }
@container (max-width: 360px) { .time .grid { grid-template-columns: 1fr; } }
.tin { display: flex; gap: 6px; }
.tin input { min-width: 0; flex: 1; }
.tin .btn { padding: 0 12px; font-size: 15px; }
.time-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.dur { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.dur svg { width: 20px; height: 20px; color: var(--blue); }
.warn { color: var(--warn); background: var(--warn-bg); border-radius: 8px; padding: 3px 10px; font-size: 14px; font-weight: 650; }

/* ---------- Prüfprotokolle ---------- */
.ck-title { margin-bottom: 4px; }
.ck-title h2 { margin: 0; }
.ck-item { padding: 12px 0 12px 14px; border-bottom: 1px solid var(--line-2); border-left: 4px solid var(--line); margin-left: -4px; }
.ck-item:last-child { border-bottom: 0; }
.ck-item.st-ok { border-left-color: var(--ok); }
.ck-item.st-bad { border-left-color: var(--bad); background: linear-gradient(90deg, var(--bad-bg), transparent 60%); }
.ck-item.st-na { border-left-color: #aab1bb; }
.ck-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ck-head .t { flex: 1 1 220px; font-weight: 550; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.seg button { min-height: 48px; min-width: 76px; padding: 0 12px; border: 0; background: #fff; font-weight: 700; font-size: 15px; cursor: pointer; border-right: 1.5px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg .ok.on { background: var(--ok); color: #fff; }
.seg .bad.on { background: var(--bad); color: #fff; }
.seg .na.on { background: var(--na); color: #fff; }
.ck-extra { margin-top: 10px; display: grid; gap: 10px; grid-template-columns: 1fr auto; }
.ck-extra.with-val { grid-template-columns: 180px 1fr auto; }
.ck-photo { padding: 0 14px; }
.ck-progress { height: 6px; background: var(--bg); border-radius: 9px; overflow: hidden; margin: 8px 0 6px; }
.ck-progress i { display: block; height: 100%; background: var(--blue); border-radius: 9px; transition: width .25s; }

/* ---------- Fotos ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 14px; }
.photo { margin: 0; border-radius: 14px; overflow: hidden; background: #fff; border: 1.5px solid var(--line-2); }
.photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--bg); }
.photo .pc { padding: 8px; display: flex; gap: 6px; }
.photo .pc input { min-height: 44px; padding: 8px 10px; }
.photo .pc .icon-btn { width: 44px; height: 44px; }
.add-photo { border: 2px dashed #b9c3d2; border-radius: 14px; display: grid; place-items: center; align-content: center; min-height: 180px; color: var(--blue-d); font-weight: 650; cursor: pointer; background: var(--paper); gap: 8px; text-align: center; padding: 16px; }
.add-photo svg { width: 36px; height: 36px; }

/* ---------- Zusammenfassung / Abschluss ---------- */
.sumgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.sumgrid > div { background: var(--paper); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; min-width: 0; }
.sumgrid span, .sumnote span { font-size: 13px; color: var(--grey); font-weight: 600; }
.sumgrid b { font-size: 19px; }
.sumgrid small { color: var(--grey); font-size: 14px; }
.sumtable { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 16px; }
.sumtable th { text-align: left; font-size: 13px; color: var(--grey); padding: 8px 6px; border-bottom: 2px solid var(--ink); }
.sumtable td { padding: 9px 6px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.sumtable .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sumnote { margin-top: 12px; padding: 12px 14px; background: var(--paper); border-radius: 12px; border-left: 4px solid var(--blue); }
.sumnote.bad { border-left-color: var(--bad); }
.sumnote p { margin: 4px 0 0; white-space: pre-line; }
.legal { font-size: 15px; color: #3d4450; background: var(--bg); border-radius: 12px; padding: 14px 16px; line-height: 1.5; }
.privacy { margin-top: 14px; font-size: 14px; color: var(--grey); }
.privacy summary { cursor: pointer; font-weight: 600; color: var(--blue-d); padding: 8px 0; min-height: 44px; display: flex; align-items: center; }
.privacy p { line-height: 1.5; }
.check { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; cursor: pointer; }
.check input { width: 26px; height: 26px; margin: 1px 0 0; accent-color: var(--blue); flex: none; }
.check b { display: flex; align-items: center; gap: 8px; }
.check b svg { width: 20px; height: 20px; color: var(--blue); }
.check .muted { display: block; }
.techsig { max-height: 80px; max-width: 60%; }
.errs { margin: 0; padding-left: 20px; line-height: 1.6; }
.errs small { color: var(--grey); }

/* ---------- Unterschrift ---------- */
.sig-box { position: relative; border: 2px solid var(--line); border-radius: 16px; background: var(--paper); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overflow: hidden; }
.sig-box canvas { display: block; width: 100%; aspect-ratio: 5 / 2; max-height: 280px; cursor: crosshair; touch-action: none; }
.sig-box.signed { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 111, 235, .1); }
.sig-tools { position: absolute; right: 8px; top: 8px; display: flex; gap: 4px; }
.sig-tools .btn { min-height: 40px; padding: 0 12px; font-size: 15px; background: rgba(255, 255, 255, .9); }
.sig-tap { display: none; }
/* kleine Felder (Smartphone): Tippen öffnet die Vollbild-Unterschrift */
.sig-box.compact canvas { pointer-events: none; }
.sig-box.compact .sig-tap { display: grid; place-items: center; position: absolute; inset: 0; cursor: pointer; }
.sig-box.compact .sig-tap span { background: var(--navy); color: #fff; font-weight: 650; padding: 10px 18px; border-radius: 99px; box-shadow: 0 6px 18px rgba(22, 62, 100, .3); }
.sig-box.compact.signed .sig-tap span { background: rgba(22, 62, 100, .75); font-size: 14px; }
.sig-box.compact .sig-tools [data-a="full"], .sig-box.compact .sig-tools [data-a="undo"] { display: none; }
html.sig-open, html.sig-open body { overflow: hidden; height: 100%; }
.sig-full { position: fixed; inset: 0; z-index: 100; background: #0b1e33; touch-action: none; }
.sig-stage { position: fixed; top: 0; left: 0; transform-origin: top left; display: flex; flex-direction: column; background: var(--paper); }
.sig-bar { display: flex; align-items: center; gap: 8px; padding: max(8px, var(--safe-t)) max(12px, var(--sr)) 8px max(12px, var(--sl)); background: var(--navy); color: #fff; }
.sig-stage.rot .sig-bar { padding: 8px 12px; }
.sig-tt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.sig-tt b { font-size: 17px; }
.sig-tt span { font-size: 13px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sig-bar .btn { min-height: 44px; padding: 0 14px; font-size: 15px; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }
.sig-bar .btn.primary { background: var(--blue); border-color: var(--blue); }
.sig-area { flex: 1; min-height: 0; padding: 10px; }
.sig-area canvas { width: 100%; height: 100%; display: block; background: #fff; border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--line); touch-action: none; }
.sig-foot { text-align: center; font-size: 13px; color: var(--grey); padding: 0 0 max(8px, var(--safe-b)); }
.sig-stage.rot .sig-foot { padding-bottom: 8px; }

/* ---------- Abschluss ---------- */
.done-hero { text-align: center; padding: 34px 20px; }
.done-hero h1 { font-size: 24px; margin-bottom: 6px; }
.done-hero .ico { width: 76px; height: 76px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: inline-grid; place-items: center; margin-bottom: 14px; }
.done-hero .ico svg { width: 40px; height: 40px; }
.done-hero .row { margin-top: 16px; }
.status-list { display: flex; flex-direction: column; gap: 10px; }
.status-list .st { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--bg); flex-wrap: wrap; }
.st-txt { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; }
.st.is-err { background: var(--bad-bg); }

/* ---------- Anmeldung ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; background: radial-gradient(120% 120% at 100% 0%, #1d5487 0%, var(--navy) 45%, var(--navy-2) 100%); padding: max(24px, var(--safe-t)) 24px max(24px, var(--safe-b)); }
.login .box { margin: auto; width: min(420px, 100%); background: #fff; border-radius: 22px; padding: 34px 30px; box-shadow: 0 30px 60px rgba(0, 0, 0, .25); text-align: center; }
.login img { width: 220px; margin-bottom: 8px; }
.login p, .relogin p { color: var(--grey); margin: 0 0 22px; }
.login input, .relogin input { text-align: center; letter-spacing: .3em; font-size: 24px !important; margin-bottom: 14px; }
.err { color: var(--bad); font-size: 15px; min-height: 22px; margin-top: 10px; }
.relogin .box { padding: 24px; text-align: center; }

/* ---------- Dialog / Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--bar-h) + 14px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 600; z-index: 120; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); max-width: calc(100vw - 32px); text-align: center; }
.kb .toast { bottom: 16px; }
dialog { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px - var(--safe-t) - var(--safe-b)); box-shadow: 0 30px 60px rgba(0, 0, 0, .3); color: var(--ink); }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: rgba(16, 24, 40, .5); }
body:has(dialog[open]) { overflow: hidden; }
.dlg-title { font-size: 20px; }
dialog .dh { padding: 20px 22px 0; }
dialog .db { padding: 16px 22px; flex: 1; overflow: auto; overscroll-behavior: contain; }
dialog .df { padding: 0 22px max(20px, var(--safe-b)); display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- Tablet quer / Desktop: zweispaltig ---------- */
@media (min-width: 1100px) {
  :root { --maxw: 1180px; }
  #body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; align-items: start; }
  #body > .card.wide { grid-column: 1 / -1; }
  .step-0 > .card, .step-5 > .card { grid-column: auto; }
  main.home { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; align-items: start; }
  main.home > .hero, main.home > .search-home, main.home > .card.wide, main.home > .note { grid-column: 1 / -1; }
}
@media (min-width: 1900px) { :root { --maxw: 1320px; } body { font-size: 18px; } }

/* ---------- Smartphone hochkant ---------- */
@media (max-width: 640px) {
  :root { --gut: 14px; --tap: 50px; }
  .card { padding: 16px; border-radius: 14px; }
  .steps { padding-top: 8px; }
  .steps .lbl { display: none; }
  .steps .dot { width: 30px; height: 30px; }
  .steps li + li::before { top: 20px; }
  .hero { grid-template-columns: 1fr; padding: 22px; }
  .hero .btn { width: 100%; }
  .kpis b { font-size: 19px; }
  .pos { grid-template-columns: 1fr; }
  .pos .ctl { flex-wrap: wrap; }
  .ck-extra.with-val { grid-template-columns: 1fr auto; }
  .ck-extra.with-val > input:first-child { grid-column: 1 / -1; }
  .seg { width: 100%; }
  .seg button { flex: 1; }
  .bottom .btn { padding: 0 16px; }
  .saved { visibility: hidden; }
  .top .ts { font-size: 12px; }
}
@media (max-width: 400px) {
  :root { --gut: 12px; }
  .card { padding: 14px; }
  .net span { display: none; }
  .net { gap: 0; }
  .bottom #prev span { display: none; }
  .bottom #prev { padding: 0 14px; }
  .kpis { gap: 6px; }
  .kpis div { padding: 8px 10px; }
  .hero h1 { font-size: 24px; }
  .price-in { width: 104px !important; }
}

/* ---------- Smartphone quer (wenig Höhe) ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --hdr: 52px; --bar-h: 62px; --tap: 46px; }
  .top img.logo { height: 24px; }
  .top .icon-btn { width: 40px; height: 40px; }
  .steps { position: static; padding-block: 4px; }
  .steps button { flex-direction: row; justify-content: center; gap: 6px; padding: 4px; }
  .steps .dot { width: 26px; height: 26px; font-size: 12px; }
  .steps li + li::before { display: none; }
  .bottom { padding-block: 8px calc(8px + var(--safe-b)); }
  .hero { padding: 16px 20px; grid-template-columns: 1fr auto; }
  .hero p { display: none; }
  .hero .btn { width: auto; }
  .login .box { padding: 18px 24px; }
  .login img { width: 140px; }
  .done-hero { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (prefers-reduced-motion: no-preference) { #body > * { animation: rise .18s ease-out both; } @keyframes rise { from { opacity: 0; transform: translateY(6px); } } }

/* ---------- v2.1: Unterschrift per Link, Historie, Fälligkeiten ---------- */
.badge.remote { background: var(--blue-bg); color: var(--blue-d); }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.mode { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; padding: 14px 16px; min-height: 72px; border: 2px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; }
.mode svg { grid-row: 1 / 3; width: 28px; height: 28px; color: var(--grey); }
.mode b { font-size: 16px; }
.mode span { font-size: 14px; color: var(--grey); }
.mode.on { border-color: var(--blue); background: var(--blue-bg); box-shadow: 0 0 0 4px rgba(31, 111, 235, .12); }
.mode.on svg { color: var(--blue); }
.linkbox { display: flex; gap: 8px; margin: 18px auto 12px; max-width: 640px; }
.linkbox input { flex: 1; min-width: 0; font-size: 15px !important; background: var(--paper); }
.hist { display: flex; flex-direction: column; gap: 12px; }
.hist-item { border: 1.5px solid var(--line-2); border-radius: 12px; padding: 12px 14px; background: var(--paper); display: flex; flex-direction: column; gap: 6px; }
.hist-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hist-head .btn { min-height: 40px; padding: 0 10px; }
.hist-sys { font-size: 15px; }
.hist-def { color: var(--bad); margin-top: 2px; }
.due .badge { white-space: nowrap; }
.sign-page main { padding-bottom: calc(40px + var(--safe-b)); }
@media (max-width: 400px) { .bottom .in { gap: 8px; } .bottom .btn { padding: 0 12px; font-size: 16px; } .bottom .btn.primary { white-space: normal; flex-shrink: 1; min-width: 0; } }
