/* Faktur unterwegs – Gestaltung nach parea.coffee: Papier-Beige, helle Flächen, Violett als Akzent,
   runde Buttons und Chips. Schrift Figtree, nie fetter als Bold. */

@font-face { font-family: Figtree; src: url(/fonts/Figtree-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Figtree; src: url(/fonts/Figtree-SemiBold.ttf) format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: Figtree; src: url(/fonts/Figtree-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --violet: #794168; --violet-dark: #5A2F4D; --paper: #F7F3EE; --surface: #FFFFFF;
  --area-light: #F5EFF3; --area-mid: #ECE0E8; --sage: #C5D6C5; --ink: #3A2C36; --neben: #6E6169;
  --line: #D9D2CF; --green: #3E7A57; --orange: #C46A2B; --red: #B23440; --blue: #30466B;
  --shadow: 0 1px 2px rgba(58, 44, 54, .06), 0 4px 16px rgba(58, 44, 54, .06);
  --radius: 16px; --tabs: 58px;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --violet: #B47AA3; --violet-dark: #E8CFE0; --paper: #1D191C; --surface: #262125;
    --area-light: #332A31; --area-mid: #43353F; --sage: #4A5E4A; --ink: #EEE7EB; --neben: #A99CA4;
    --line: #3D3539; --green: #62B184; --orange: #E48F50; --red: #E46672; --blue: #8FA6CF;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --violet: #B47AA3; --violet-dark: #E8CFE0; --paper: #1D191C; --surface: #262125;
  --area-light: #332A31; --area-mid: #43353F; --sage: #4A5E4A; --ink: #EEE7EB; --neben: #A99CA4;
  --line: #3D3539; --green: #62B184; --orange: #E48F50; --red: #E46672; --blue: #8FA6CF;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body {
  font: 400 16px/1.4 Figtree, -apple-system, system-ui, sans-serif;
  min-height: 100dvh; overscroll-behavior-y: none;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--violet); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
.muted { color: var(--neben); }
.small { font-size: 13px; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Start */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--area-mid); border-top-color: var(--violet);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Kopfleiste */
.bar {
  position: sticky; top: 0; z-index: 20;
  padding: calc(var(--safe-top) + 6px) 12px 6px;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  border-bottom: .5px solid transparent; transition: border-color .2s;
}
.bar.scrolled { border-bottom-color: var(--line); }
.bar-row { display: flex; align-items: center; gap: 6px; min-height: 40px; }
.bar-title { font-weight: 700; font-size: 17px; flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0; transition: opacity .15s; }
.bar.scrolled .bar-title, .bar.compact .bar-title { opacity: 1; }
.bar-side { min-width: 72px; display: flex; gap: 2px; align-items: center; }
.bar-side.end { justify-content: flex-end; }
.icon-btn {
  border: 0; background: none; color: var(--violet); height: 40px; min-width: 40px; padding: 0 8px;
  border-radius: 20px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; font-weight: 600;
}
.icon-btn:active { background: var(--area-light); }
.icon-btn svg { width: 22px; height: 22px; }
.company-chip {
  border: 0; background: var(--area-light); color: var(--violet); font-weight: 700; font-size: 13px;
  padding: 7px 12px; border-radius: 99px; display: inline-flex; align-items: center; gap: 4px; max-width: 46vw;
}
.company-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Seite */
.page { padding: 4px 16px calc(var(--tabs) + var(--safe-bottom) + 96px); max-width: 720px; margin: 0 auto; }
.page.no-tabs { padding-bottom: calc(var(--safe-bottom) + 40px); }
.large-title { font-size: 32px; line-height: 1.1; margin: 2px 2px 14px; }
.subtitle { margin: -10px 2px 16px; color: var(--neben); }
.section-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin: 22px 4px 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--neben);
}
.section-title .count { font-weight: 600; letter-spacing: 0; text-transform: none; }

/* Karten und Listen */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 14px 16px; }
.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px; position: relative;
  background: var(--surface); width: 100%; border: 0; text-align: left; color: inherit;
}
.item + .item::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--line); }
button.item:active, a.item:active { background: var(--area-light); }
.item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { font-size: 13px; color: var(--neben); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .amount { font-weight: 600; white-space: nowrap; }
.item .end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.chev { color: var(--line); flex-shrink: 0; width: 8px; }
.empty { padding: 36px 16px; text-align: center; color: var(--neben); }
.empty strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.group-head { position: sticky; top: calc(var(--safe-top) + 52px); z-index: 5; padding: 14px 4px 6px; font-size: 13px; font-weight: 700; color: var(--neben); background: var(--paper); }

/* Zustands-Chips */
.chip {
  --tone: var(--neben);
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px;
  font-size: 12px; font-weight: 700; color: var(--tone); background: color-mix(in srgb, var(--tone) 13%, transparent); white-space: nowrap;
}
.tone-accent { --tone: var(--violet); } .tone-info { --tone: var(--blue); } .tone-success { --tone: var(--green); }
.tone-warning { --tone: var(--orange); } .tone-danger { --tone: var(--red); } .tone-neutral { --tone: var(--neben); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); display: inline-block; }

/* Buttons */
.btn {
  border: 1.5px solid var(--violet); background: var(--violet); color: #fff; font-weight: 700; font-size: 15px;
  padding: 10px 18px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; transition: transform .1s, opacity .1s; white-space: nowrap;
}
:root[data-theme="dark"] .btn:not(.outline):not(.plain), .dark-auto .btn:not(.outline):not(.plain) { color: #1D191C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:not(.outline):not(.plain) { color: #1D191C; } }
.btn:active { transform: scale(.97); opacity: .85; }
.btn.outline { background: transparent; color: var(--violet); }
.btn.plain { background: transparent; border-color: transparent; color: var(--violet); }
.btn.danger { --violet: var(--red); }
.btn.small { min-height: 34px; padding: 6px 13px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; border-color: currentColor; border-top-color: transparent; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.actions .btn { flex: 1 1 auto; }

/* Auswahl-Chips */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding-left: 0; padding-right: 0; }
.pick {
  border: 1.5px solid var(--violet); background: transparent; color: var(--violet); font-weight: 700; font-size: 13px;
  padding: 6px 13px; border-radius: 99px; white-space: nowrap; flex-shrink: 0;
}
.pick.on { background: var(--violet); color: var(--surface); }
.seg { display: flex; background: var(--area-mid); border-radius: 12px; padding: 3px; gap: 2px; margin-bottom: 10px; }
.seg button { flex: 1; border: 0; background: none; padding: 7px 4px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--ink); }
.seg button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 700; }

/* Suche */
.search {
  display: flex; align-items: center; gap: 8px; background: var(--area-mid); border-radius: 12px; padding: 0 12px; height: 40px; margin-bottom: 10px;
}
.search svg { width: 17px; height: 17px; color: var(--neben); flex-shrink: 0; }
.search input { border: 0; background: none; outline: none; flex: 1; min-width: 0; font-size: 16px; height: 100%; }
.search input::placeholder { color: var(--neben); }

/* Untere Leiste */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around; padding: 4px 4px calc(var(--safe-bottom) + 2px);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  border-top: .5px solid var(--line);
}
.tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0 3px;
  color: var(--neben); font-size: 11px; font-weight: 600; position: relative;
}
.tabs a svg { width: 25px; height: 25px; }
.tabs a.on { color: var(--violet); }
.tabs .badge {
  position: absolute; top: 1px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.fab {
  position: fixed; right: 18px; bottom: calc(var(--tabs) + var(--safe-bottom) + 16px); z-index: 25;
  width: 56px; height: 56px; border-radius: 28px; border: 0; background: var(--violet); color: var(--surface);
  box-shadow: 0 6px 20px rgba(121, 65, 104, .35); display: grid; place-items: center;
}
.fab svg { width: 26px; height: 26px; }
.fab:active { transform: scale(.95); }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; min-width: 0; }
.kpi .k-title { font-size: 12px; font-weight: 600; color: var(--neben); }
.kpi .k-value { font-size: 20px; font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-sub { font-size: 12px; color: var(--neben); margin-top: 1px; }
.kpi.tone-danger .k-value { color: var(--red); } .kpi.tone-warning .k-value { color: var(--orange); }

/* Zahlungsprognose */
.forecast { padding: 14px 12px 10px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; height: 100%; gap: 2px; }
.bars .b i { display: block; border-radius: 5px 5px 2px 2px; background: var(--violet); min-height: 2px; }
.bars .b i.rec { background: var(--sage); border-radius: 2px; }
.bars .b i.rec:first-child { border-radius: 5px 5px 2px 2px; }
.bar-labels { display: flex; gap: 6px; margin-top: 6px; }
.bar-labels span { flex: 1; text-align: center; font-size: 10px; color: var(--neben); white-space: nowrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--neben); margin-top: 10px; padding: 0 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* Beleg */
.doc-head { padding: 16px; border-left: 5px solid var(--world, var(--violet)); }
.doc-head .kind { font-size: 13px; font-weight: 700; color: var(--world, var(--violet)); letter-spacing: .04em; text-transform: uppercase; }
.doc-head .big { font-size: 30px; font-weight: 700; margin: 4px 0 2px; letter-spacing: -.01em; }
.doc-head .client { font-weight: 600; font-size: 17px; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; font-size: 14px; margin-top: 10px; }
.meta dt { color: var(--neben); } .meta dd { margin: 0; text-align: right; }
.issues { background: color-mix(in srgb, var(--orange) 12%, var(--surface)); color: var(--ink); border-radius: var(--radius); padding: 12px 14px; font-size: 14px; }
.issues strong { color: var(--orange); display: block; margin-bottom: 4px; }
.issues ul { margin: 0; padding-left: 18px; }
.pdf-pages { display: flex; flex-direction: column; gap: 10px; }
.pdf-pages img { width: 100%; display: block; border-radius: 10px; box-shadow: var(--shadow); background: #fff; aspect-ratio: 210 / 297; }
.lines .item { align-items: flex-start; }
.lines .line-title { font-weight: 700; padding-top: 16px; }
.lines .line-text { white-space: pre-wrap; font-size: 14px; color: var(--neben); }
.totals { padding: 10px 16px 14px; font-size: 15px; }
.totals .t { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.totals .t.sum { font-weight: 700; font-size: 17px; border-top: .5px solid var(--line); margin-top: 6px; padding-top: 9px; }

/* Blätter (Formulare und Auswahl) */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet-back { position: absolute; inset: 0; background: rgba(20, 12, 18, .38); animation: fade .2s ease-out; }
.sheet {
  position: relative; background: var(--paper); border-radius: 18px 18px 0 0; max-height: calc(100dvh - var(--safe-top) - 10px);
  display: flex; flex-direction: column; animation: up .26s cubic-bezier(.2, .9, .3, 1); box-shadow: 0 -8px 30px rgba(0,0,0,.18);
}
.sheet.full { height: calc(100dvh - var(--safe-top) - 10px); }
.sheet.closing { animation: down .2s ease-in forwards; }
.sheet-back.closing { animation: fadeout .2s ease-in forwards; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes down { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
.sheet-head { display: flex; align-items: center; gap: 6px; padding: 10px 8px 8px; border-bottom: .5px solid var(--line); }
.sheet-head .t { flex: 1; text-align: center; font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-head .icon-btn { min-width: 84px; }
.sheet-head .icon-btn.end { justify-content: flex-end; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px calc(var(--safe-bottom) + 24px); overscroll-behavior: contain; }
.sheet-foot { padding: 10px 16px calc(var(--safe-bottom) + 10px); border-top: .5px solid var(--line); background: var(--paper); display: flex; gap: 8px; }
.sheet-foot .btn { flex: 1; }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--line); margin: 6px auto 0; }

/* Formulare */
.form { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.field { display: flex; align-items: center; gap: 10px; padding: 0 16px; min-height: 48px; position: relative; }
.field + .field::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--line); }
.field > label { color: var(--neben); font-size: 15px; flex-shrink: 0; min-width: 96px; }
.field input, .field select, .field textarea {
  flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; padding: 12px 0; text-align: right;
}
.field select { -webkit-appearance: none; appearance: none; text-align-last: right; color: var(--violet); font-weight: 600; }
.field.vertical { flex-direction: column; align-items: stretch; gap: 0; padding-top: 10px; }
.field.vertical > label { font-size: 13px; }
.field.vertical input, .field.vertical textarea { text-align: left; padding: 4px 0 12px; }
.field textarea { resize: none; line-height: 1.4; min-height: 72px; field-sizing: content; }
.field .unit { color: var(--neben); }
.field.toggle { justify-content: space-between; }
.form-note { font-size: 13px; color: var(--neben); margin: -6px 6px 14px; }
input[type="date"], input[type="time"] { -webkit-appearance: none; appearance: none; min-height: 24px; color: var(--violet); font-weight: 600; }
input::-webkit-date-and-time-value { text-align: right; }
.switch { position: relative; width: 51px; height: 31px; flex-shrink: 0; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--area-mid); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }

/* Positionen im Editor */
.line-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 12px 12px; margin-bottom: 10px; }
.line-card .lc-top { display: flex; gap: 6px; align-items: flex-start; }
.line-card input, .line-card textarea {
  width: 100%; border: 0; background: var(--area-light); border-radius: 9px; padding: 9px 10px; font-size: 16px; outline: none;
}
.line-card input:focus, .line-card textarea:focus { box-shadow: 0 0 0 2px var(--violet) inset; }
.line-card .name { font-weight: 600; }
.line-card textarea { resize: none; min-height: 40px; margin-top: 6px; field-sizing: content; font-size: 15px; }
.line-card .nums { display: grid; grid-template-columns: 1fr 1fr 1.4fr 1fr; gap: 6px; margin-top: 6px; }
.line-card .nums label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; font-weight: 600; color: var(--neben); }
.line-card .nums input, .line-card .nums select { text-align: right; padding: 8px; }
.line-card select { border: 0; background: var(--area-light); border-radius: 9px; font-size: 16px; padding: 8px; width: 100%; -webkit-appearance: none; appearance: none; text-align-last: right; }
.line-card .lc-sum { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; font-size: 14px; color: var(--neben); }
.line-card textarea.name { font-weight: 600; min-height: 40px; }
.line-card .lc-sum b { color: var(--ink); }
.line-card.kind-title .name { font-size: 17px; }
.line-card .kind-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--neben); margin-bottom: 4px; }
.mini { border: 0; background: var(--area-light); color: var(--violet); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.mini svg { width: 18px; height: 18px; }
.mini[disabled] { opacity: .35; }
.save-state { font-size: 12px; color: var(--neben); text-align: center; padding: 4px 0 0; min-height: 20px; }
.totals-bar { position: sticky; bottom: 0; }

/* Kunde */
.avatar {
  width: 40px; height: 40px; border-radius: 20px; flex-shrink: 0; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; color: #fff; background: var(--av, var(--violet));
}
.avatar.big { width: 64px; height: 64px; border-radius: 32px; font-size: 24px; }
.client-head { display: flex; gap: 14px; align-items: center; padding: 16px; }
.client-head h2 { font-size: 22px; line-height: 1.15; }
.contact-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stats .s { background: var(--area-light); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.stats .s b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats .s span { font-size: 11px; color: var(--neben); }

/* Termine */
.date-block {
  width: 46px; flex-shrink: 0; text-align: center; border-radius: 12px; background: var(--area-light); padding: 5px 0 6px; line-height: 1.05;
}
.date-block b { display: block; font-size: 19px; }
.date-block span { font-size: 11px; font-weight: 700; color: var(--violet); text-transform: uppercase; }
.stages { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 8px; scrollbar-width: none; }
.stages::-webkit-scrollbar { display: none; }
.stage { flex: 0 0 auto; min-width: 118px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 12px; }
.stage .n { font-size: 22px; font-weight: 700; }
.stage .l { font-size: 12px; font-weight: 600; color: var(--neben); }
.module { padding: 12px 16px; position: relative; }
.module + .module::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--line); }
.module .m-head { display: flex; align-items: center; gap: 10px; }
.module .m-opts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.module .m-price { margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.module .m-price input { width: 120px; border: 0; background: var(--area-light); border-radius: 9px; padding: 8px 10px; text-align: right; font-size: 16px; }
.hint { font-size: 13px; color: var(--orange); }

/* Hinweise */
.toast-host { position: fixed; left: 0; right: 0; top: calc(var(--safe-top) + 8px); z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast {
  background: var(--ink); color: var(--paper); border-radius: 14px; padding: 10px 16px; font-weight: 600; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: calc(100vw - 32px); animation: drop .25s ease-out; pointer-events: auto;
}
.toast.error { background: var(--red); color: #fff; }
@keyframes drop { from { transform: translateY(-20px); opacity: 0; } }
.offline {
  margin: 10px 0 0; padding: 14px 16px; border-radius: var(--radius); background: color-mix(in srgb, var(--red) 10%, var(--surface));
  font-size: 14px;
}
.offline strong { color: var(--red); display: block; margin-bottom: 2px; }

/* Koppeln */
.pair { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--safe-top) + 24px) 28px calc(var(--safe-bottom) + 24px); max-width: 440px; margin: 0 auto; }
.pair .app-icon { width: 76px; height: 76px; border-radius: 18px; box-shadow: var(--shadow); }
.pair h1 { font-size: 30px; margin: 18px 0 6px; }
.pair p { color: var(--neben); margin: 0 0 18px; }
.pin { width: 100%; font-size: 34px; letter-spacing: .35em; text-align: center; padding: 14px 10px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); outline: none; font-weight: 700; }
.pin:focus { border-color: var(--violet); }
.steps { margin: 22px 0 0; padding-left: 20px; color: var(--neben); font-size: 14px; }
.steps li { margin-bottom: 6px; }

/* Bilder */
.logo { height: 28px; width: auto; display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo { filter: brightness(0) invert(.92); } }
:root[data-theme="dark"] .logo { filter: brightness(0) invert(.92); }

@media (min-width: 700px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
}
