/* Farben: --accent einmal ändern, alles passt sich an. Hell/Dunkel folgt dem Gerät. */
:root {
  --bg: #f5f5f7; --surface: #ffffff; --surface-2: #fbfbfd; --fg: #1d1d1f; --muted: #6e6e73; --line: #e3e3e8;
  --glass: rgba(251, 251, 253, 0.8); --ok: #1f8f4e; --ok-soft: #e4f4ea; --err: #c4321c; --err-soft: #fdebe7;
  --accent: #0071e3; --accent-soft: #e8f1fc; --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r-lg: 22px; --r-md: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --surface: #1c1c1e; --surface-2: #151517; --fg: #f5f5f7; --muted: #a1a1a6; --line: #2c2c30;
    --glass: rgba(22, 22, 24, 0.75); --ok: #3ccf7a; --ok-soft: #10301d; --err: #ff7a66; --err-soft: #3a1710;
    --accent: #2997ff; --accent-soft: #0b2540;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.nav { position: sticky; top: 0; z-index: 20; background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 52px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.logo:hover { text-decoration: none; }
.logo-svg { width: 30px; height: 30px; flex: none; }
.logo-wm { font-weight: 600; }
.logo-wm b { font-weight: 800; color: var(--accent); }
.nav-links { display: flex; gap: 22px; margin-left: auto; font-size: 14px; }
.nav-links a { color: var(--fg); opacity: .8; }
@media (max-width: 520px) { .nav-links .hide-m { display: none; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 980px; cursor: pointer; padding: 10px 20px; font-weight: 600; font-size: 15px; background: var(--accent); color: var(--on-accent); transition: transform .15s ease, filter .15s ease; text-decoration: none !important; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn.ghost { background: var(--accent-soft); color: var(--accent); }
.btn.big { padding: 15px 32px; font-size: 17px; }
.btn[disabled] { opacity: .45; cursor: default; filter: none; transform: none; }

.hero { text-align: center; padding-block: 56px 28px; }
.hero h1 { font-family: var(--font-display); font-size: clamp(34px, 6.4vw, 62px); line-height: 1.06; letter-spacing: -0.035em; font-weight: 700; margin: 0 auto 16px; max-width: 15ch; text-wrap: balance; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--muted); font-size: clamp(17px, 2vw, 21px); max-width: 40ch; margin: 0 auto 28px; text-wrap: balance; }
.search { display: flex; align-items: center; gap: 10px; max-width: 520px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 980px; padding: 12px 20px; box-shadow: var(--shadow); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { border: 0; outline: 0; background: transparent; font-size: 17px; width: 100%; min-width: 0; }

.chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 24px 0; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 980px; padding: 7px 16px; font-size: 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tool { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; color: var(--fg); min-width: 0; transition: transform .2s ease, box-shadow .2s ease; }
.tool:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.tool-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.tool-icon svg { width: 24px; height: 24px; }
.tool h3 { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
.tool p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.empty { text-align: center; color: var(--muted); padding: 32px 0; grid-column: 1 / -1; }
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tool { padding: 14px; gap: 8px; border-radius: 18px; }
  .tool h3 { font-size: 15px; } .tool p { font-size: 13px; }
  .tool-icon { width: 38px; height: 38px; }
}

/* Werbeplätze: unsichtbar, solange kein Werbecode eingesetzt ist */
.ad-slot:empty { display: none; }
.ad-slot { margin: 32px 0; min-height: 100px; }

.why { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; padding-block: 48px 24px; }
.why h2 { margin: 12px 0 6px; font-size: 19px; letter-spacing: -0.01em; }
.why p { margin: 0; color: var(--muted); font-size: 15px; }
.why svg { width: 30px; height: 30px; color: var(--accent); }
.why > div { text-align: center; }
.why svg.ai { width: 104px; height: 104px; display: block; margin: 0 auto -4px; }
@media (max-width: 720px) { .why svg.ai { width: 92px; height: 92px; } }
@media (max-width: 720px) { .why { grid-template-columns: 1fr; gap: 24px; } }

footer { border-top: 1px solid var(--line); margin-top: 56px; padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); font-size: 13px; color: var(--muted); }
footer .wrap { display: flex; gap: 16px 20px; flex-wrap: wrap; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
footer a { color: var(--muted); }

/* Tool-Seite */
.crumb { padding-top: 24px; font-size: 14px; }
.tool-head { display: flex; align-items: center; gap: 16px; margin: 18px 0 6px; }
.tool-head .tool-icon { width: 56px; height: 56px; border-radius: 15px; }
.tool-head .tool-icon svg { width: 30px; height: 30px; }
.tool-head h1 { font-family: var(--font-display); font-size: clamp(30px, 4.6vw, 44px); letter-spacing: -0.03em; margin: 0; line-height: 1.1; }
.tool-sub { color: var(--muted); font-size: 18px; margin: 0 0 24px; max-width: 60ch; }
.work { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .work { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; min-width: 0; }
.panel h2 { margin: 0 0 8px; font-size: 16px; }
.panel p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.side { display: flex; flex-direction: column; gap: 16px; }
.side .ad-slot { margin: 0; min-height: 250px; }
.drop { border: 2px dashed var(--line); border-radius: 18px; padding: 32px 16px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop svg { width: 38px; height: 38px; color: var(--accent); }
.drop strong { display: block; font-size: 17px; margin: 8px 0 2px; }
.drop span { color: var(--muted); font-size: 14px; }
.files { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.files:empty { display: none; }
.file { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.thumb { width: 30px; height: 38px; border-radius: 4px; background: var(--surface); border: 1px solid var(--line); flex: none; display: grid; place-items: end center; font-size: 7.5px; font-weight: 700; color: var(--accent); padding-bottom: 2px; text-transform: uppercase; }
.file .info { min-width: 0; flex: 1; }
.file .name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .size { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.icon-btn { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--accent-soft); color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn[disabled] { opacity: .25; cursor: default; background: none; }
@media (max-width: 520px) { .panel { padding: 14px; } .file { gap: 8px; padding: 8px; } .icon-btn { width: 28px; height: 28px; } }

.opts { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.opt { display: flex; flex-direction: column; gap: 6px; }
.lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; text-align: center; border-radius: 9px; padding: 8px 6px; font-size: 14px; }
.seg input:checked + span { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
.seg input:focus-visible + span { outline: 3px solid var(--accent); }
.field { border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: 16px; width: 100%; }
.field:focus { outline: 2px solid var(--accent); border-color: transparent; }

.action, .busy { margin-top: 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.action .btn { width: 100%; max-width: 360px; }
.note { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; justify-content: center; text-align: center; margin: 0; }
.note svg { width: 14px; height: 14px; color: var(--ok); flex: none; }
.progress { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; width: 100%; max-width: 360px; }
.progress div { height: 100%; width: 0; background: var(--accent); border-radius: 6px; transition: width .2s linear; }
.progress.indeterminate div { width: 35% !important; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.error { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--err-soft); color: var(--err); font-size: 14px; }
.done { text-align: center; padding: 16px 0 4px; }
.done .check { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 14px; }
.done .check svg { width: 32px; height: 32px; }
.done h2 { margin: 0 0 4px; font-size: 26px; letter-spacing: -0.02em; }
.done p { color: var(--muted); margin: 0 0 18px; font-variant-numeric: tabular-nums; }
.done .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.done .row.small { margin-top: 14px; }
.done #del-note { margin-top: 12px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 48px 0 8px; padding: 0; }
.steps li { list-style: none; }
.steps b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 14px; margin-bottom: 10px; }
.steps h3 { margin: 0 0 4px; font-size: 16px; }
.steps p { margin: 0; color: var(--muted); font-size: 14px; }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }
h2.sec { font-family: var(--font-display); font-size: 26px; letter-spacing: -0.02em; margin: 40px 0 12px; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 18px; margin-bottom: 8px; }
summary { cursor: pointer; font-weight: 600; }
details p { color: var(--muted); margin: 10px 0 0; }

/* Preise */
.price-head { text-align: center; padding-block: 56px 28px; }
.price-head h1 { font-family: var(--font-display); font-size: clamp(34px, 5vw, 52px); letter-spacing: -0.035em; margin: 0 0 10px; line-height: 1.08; }
.price-head p { color: var(--muted); font-size: 19px; margin: 0 auto; max-width: 52ch; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 330px)); gap: 18px; justify-content: center; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.plan.pro { border: 2px solid var(--accent); }
.plan h2 { margin: 0; font-size: 21px; }
.plan .amount { font-family: var(--font-display); font-size: 42px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.plan .amount small { font-size: 16px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.plan .sub { color: var(--muted); font-size: 14px; margin: -6px 0 0; }
.plan ul { padding-left: 20px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.plan .btn { margin-top: auto; }
.badge { align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--on-accent); background: var(--accent); padding: 3px 10px; border-radius: 980px; }
.badge.muted { background: var(--line); color: var(--muted); }

.legal { max-width: 760px; padding-block: 40px; }
.legal h1 { font-family: var(--font-display); letter-spacing: -0.02em; }
.legal h2 { font-size: 18px; margin-top: 28px; }
.legal p { color: var(--muted); }
.todo { background: var(--err-soft); color: var(--err) !important; padding: 10px 14px; border-radius: 10px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Seiten-Editor (Unterschreiben, Bearbeiten) ---------- */
.ed { padding: 16px; }
.ed-bar { position: sticky; top: calc(52px + env(safe-area-inset-top, 0px)); z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; margin: -4px -4px 8px; background: var(--surface); border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; }
.ed-bar .btn { padding: 8px 14px; font-size: 14px; }
.ed-sel { display: inline-flex; align-items: center; gap: 6px; }
.ed-sel .lbl { margin-left: 4px; }
.field.small { width: auto; padding: 6px 8px; font-size: 14px; }
.ed-spacer { flex: 1; }
.ed-hint { justify-content: flex-start; text-align: left; margin: 4px 4px 12px; }
.pages { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 8px 0 16px; background: var(--surface-2); border-radius: 12px; }
.pgw { margin: 0; width: min(100%, 820px); display: flex; flex-direction: column; gap: 6px; padding-inline: 8px; }
.pgw figcaption { font-size: 12px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.pg { position: relative; width: 100%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 6px 20px rgba(0,0,0,.08); user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.pg > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.item { position: absolute; touch-action: none; cursor: move; outline: 1.5px dashed transparent; outline-offset: 2px; border-radius: 2px; }
.item.sel { outline-color: var(--accent); }
.item.image img { width: 100%; height: 100%; display: block; pointer-events: none; }
.item.text { min-height: 1em; }
.item.rect { background: #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.item .ti { font-family: Helvetica, Arial, "Liberation Sans", sans-serif; line-height: 1.2; white-space: pre-wrap; word-break: break-word; outline: none; cursor: text; min-width: 2ch; user-select: text; -webkit-user-select: text; }
.item .grip, .item .rs { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); display: none; }
.item.sel .grip, .item.sel .rs { display: block; }
.item .grip { left: -11px; top: -11px; cursor: move; }
.item .rs { right: -11px; bottom: -11px; cursor: nwse-resize; }
@media (pointer: coarse) { .item .grip, .item .rs { width: 26px; height: 26px; } .item .grip { left: -15px; top: -15px; } .item .rs { right: -15px; bottom: -15px; } }

.sigpad { border: 0; border-radius: 18px; padding: 0; width: min(640px, calc(100vw - 24px)); background: var(--surface); color: var(--fg); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.sigpad::backdrop { background: rgba(0,0,0,.4); }
.sigpad-in { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.sigpad h2 { margin: 0; font-size: 20px; }
.sig-tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.sig-tabs button { flex: 1; border: 0; background: transparent; border-radius: 8px; padding: 8px; cursor: pointer; font-size: 14px; }
.sig-tabs button[aria-selected="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
#pane-draw { position: relative; }
#sigcanvas { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 420; background: #fff; border: 1px solid var(--line); border-radius: 12px; touch-action: none; cursor: crosshair; }
.sig-line { position: absolute; left: 8%; right: 8%; top: 72%; border-top: 1.5px dashed #c9c9c2; pointer-events: none; }
#pane-draw .note { margin-top: 8px; }
.small-drop { padding: 20px 12px; }
.small-drop strong { margin-top: 0; }
#sig-preview { max-height: 160px; margin: 8px auto 0; display: block; background: #fff; border-radius: 8px; }
.sig-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 520px) {
  .ed { padding: 8px; }
  .ed-bar { gap: 6px; padding: 8px; }
  .ed-bar .btn { padding: 7px 11px; font-size: 13px; }
  .ed-sel .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pgw { padding-inline: 4px; }
}

/* ---------- E-Rechnung ---------- */
.inv { padding: 24px; }
.grp-f { border: 0; padding: 0; margin: 0 0 28px; min-width: 0; }
.grp-f legend { font-size: 17px; font-weight: 600; margin-bottom: 12px; padding: 0; }
.cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
.cols .w2 { grid-column: span 2; }
@media (max-width: 760px) { .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .cols { grid-template-columns: minmax(0, 1fr); } .cols .w2 { grid-column: auto; } }
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fld label { font-size: 13px; font-weight: 600; color: var(--muted); }
.req { color: var(--err); }
.xr-on .fld.xr label::after { content: " *"; color: var(--err); }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.chk { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-size: 14px; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--accent); }
.lines-wrap { overflow-x: auto; margin-bottom: 10px; position: relative; }
.lines { width: 100%; border-collapse: collapse; min-width: 640px; }
.lines th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 6px 6px; }
.lines td { padding: 4px 6px 4px 0; vertical-align: middle; }
.lines td:first-child { width: 40%; }
.lines .num { text-align: right; }
.lines .num .field { text-align: right; }
.lines td.num .field { max-width: 110px; margin-left: auto; }
.lines .tot { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lines .field { padding: 8px 10px; font-size: 15px; }
.ku .vatc { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sums { display: grid; grid-template-columns: auto auto; justify-content: end; gap: 6px 24px; margin: 16px 0 0; font-variant-numeric: tabular-nums; }
.sums dt { color: var(--muted); } .sums dd { margin: 0; text-align: right; }
.sums .tot { color: var(--fg); font-weight: 700; font-size: 17px; }
.chk-title { font-size: 22px; margin: 0 0 4px; }
.chk-grp { margin-top: 20px; }
.chk-grp h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 0 6px; }
.chk-row { display: grid; grid-template-columns: 22px minmax(140px, 0.9fr) minmax(0, 1.6fr); gap: 12px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; background: var(--surface); }
.chk-row input { width: 20px; height: 20px; margin: 0; accent-color: var(--ok); }
.chk-row .k { color: var(--muted); font-size: 14px; }
.chk-row .v { font-weight: 600; font-variant-numeric: tabular-nums; word-break: break-word; }
.chk-row.ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-soft); }
@media (max-width: 560px) { .chk-row { grid-template-columns: 22px minmax(0, 1fr); } .chk-row .v { grid-column: 2; } }
.progress-txt { margin: 16px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.row-actions { flex-direction: row; justify-content: space-between; flex-wrap: wrap; }
.row-actions .btn.big { width: auto; }

/* QR-Code zum Herunterladen auf dem Handy */
.qr { display: flex; gap: 16px; align-items: center; text-align: left; max-width: 440px; margin: 20px auto 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.qr img { width: 148px; height: 148px; flex: none; border-radius: 8px; background: #fff; }
.qr strong { display: block; margin-bottom: 4px; }
.qr p { margin: 0 0 6px !important; font-size: 14px; color: var(--muted); }
.qr .qr-until { font-size: 13px; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .qr { display: none !important; } }

/* PDF in E-Rechnung */
.conv-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .conv-grid { grid-template-columns: minmax(0, 1fr); } .pdfpane { position: static !important; max-height: 60vh !important; } }
.conv .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pdfpane { position: sticky; top: calc(64px + env(safe-area-inset-top, 0px)); max-height: calc(100vh - 88px); overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 8px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--line); }
.src-pg { position: relative; width: 100%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); cursor: crosshair; user-select: none; -webkit-user-select: none; touch-action: none; }
.src-pg img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.src-hl { position: absolute; border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 3px; pointer-events: none; }
.src-sel { position: absolute; border: 1.5px dashed var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); pointer-events: none; }
.show-src { align-self: flex-start; border: 0; background: none; padding: 0; color: var(--accent); font-size: 12px; cursor: pointer; margin-top: -2px; }
.show-src:hover { text-decoration: underline; }
.fld { position: relative; }
.warns { background: var(--err-soft); color: var(--err); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 14px; }
.warns p { margin: 0 0 4px; } .warns p:last-child { margin: 0; }
.conv-hint { margin: 0 0 12px; }
.chk-row.has-snip { grid-template-columns: 22px minmax(140px, 0.8fr) minmax(0, 1.2fr) minmax(0, 1.4fr); }
.snip { max-width: 100%; max-height: 64px; border: 1px solid var(--line); border-radius: 6px; background: #fff; justify-self: start; }
.snip.none { font-size: 12px; color: var(--muted); border: 1px dashed var(--line); padding: 6px 8px; background: none; }
@media (max-width: 760px) { .chk-row.has-snip { grid-template-columns: 22px minmax(0, 1fr); } .chk-row.has-snip .snip { grid-column: 2; } }
.ocr-note { margin-top: 10px; font-size: 13px; text-align: center; }

/* Anonymisieren */
.an-box { position: absolute; padding: 0; border: 1.5px dashed var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 2px; cursor: pointer; }
.an-box.on { border: 0; background: rgba(0, 0, 0, .78); }
.an-box.own.on { background: rgba(0, 0, 0, .78); outline: 1.5px solid var(--accent); }
.an-box:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.an-box.flash { animation: an-flash 1.2s ease; }
@keyframes an-flash { 0%, 60% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .an-box.flash { animation: none; outline: 3px solid var(--accent); } }
.an-list { display: flex; flex-direction: column; gap: 14px; }
.an-sum { font-weight: 600; }
.an-grp { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 8px; background: var(--surface); }
.an-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 4px; }
.an-head h3 { font-size: 15px; margin: 0; }
.an-item { margin-top: 0; display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.an-item:first-of-type { border-top: 0; }
.an-item span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.an-item small { color: var(--muted); }

/* Seiten organisieren */
.org-count { font-weight: 600; }
.org-grid { list-style: none; margin: 12px 0 0; padding: 0; display: grid; align-items: start; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.org-pg { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; cursor: grab; }
.org-pg.dragging { opacity: .4; }
.org-pg.over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.org-thumb { position: relative; width: 100%; max-height: 220px; margin: 0 auto; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.org-thumb img { max-width: 100%; max-height: 220px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: transform .2s ease; }
@media (prefers-reduced-motion: reduce) { .org-thumb img { transition: none; } }
.org-cap { display: flex; align-items: center; justify-content: space-between; gap: 2px; font-size: 14px; font-variant-numeric: tabular-nums; }
.org-cap span { font-weight: 600; min-width: 1.5em; text-align: center; }
.org-btn { border: 0; background: transparent; color: var(--accent); font-size: 16px; min-width: 30px; min-height: 30px; border-radius: 8px; cursor: pointer; }
.org-btn:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.org-btn.rm { color: var(--muted); }
.org-btn:focus-visible { outline: 2px solid var(--accent); }

/* Formular ausfüllen */
.fm-page { position: relative; }
.fm-field { position: absolute; box-sizing: border-box; margin: 0; padding: 0 3px; border: 1.5px solid color-mix(in srgb, var(--accent) 70%, transparent); background: color-mix(in srgb, var(--accent) 7%, #fff); color: #111; border-radius: 3px; font: inherit; font-size: 12px; }
.fm-field:focus { outline: 2px solid var(--accent); background: #fff; }
textarea.fm-field { resize: none; line-height: 1.25; padding: 2px 3px; }
.fm-checkbox, .fm-radio { accent-color: var(--accent); padding: 0; background: transparent; border: 0; }
.fm-field:disabled { opacity: .55; }
.fm-flat { margin: 0 8px 0 0; }

/* PDF ansehen */
.rd-bar { position: sticky; top: calc(56px + env(safe-area-inset-top, 0px)); z-index: 5; background: var(--surface); flex-wrap: wrap; }
.rd-page { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.rd-page input { width: 4.5em; }
.rd-zoom { min-width: 4ch; text-align: center; font-variant-numeric: tabular-nums; font-size: 14px; }
.rd-pages { --z: 1; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 12px 0; background: var(--surface-2); border-radius: 12px; overflow-x: auto; }
.rd-pg { margin: 0; width: min(calc(820px * var(--z)), calc(100% * var(--z))); max-width: none; flex: none; }
.rd-pg img { display: block; width: 100%; height: auto; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 6px 20px rgba(0,0,0,.08); }
.rd-pg figcaption { text-align: center; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* E-Rechnung prüfen */
.xc-verdict { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 12px; border: 1.5px solid; margin-bottom: 16px; }
.xc-verdict strong { font-size: 20px; }
.xc-verdict.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 60%, transparent); }
.xc-verdict.bad { background: color-mix(in srgb, #d93025 9%, var(--surface)); border-color: color-mix(in srgb, #d93025 55%, transparent); }
.xc-facts { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 6px 16px; margin: 0 0 16px; }
.xc-facts dt { color: var(--muted); } .xc-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.xc-grp { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.xc-grp h3 { margin: 0 0 6px; font-size: 15px; }
.xc-grp ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.xc-grp code { font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.xc-fehler h3 { color: #c5221f; }
.xc-scope { text-align: left; }

/* Vom Handy scannen */
.sc-steps { margin: 0 0 16px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.sc-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 760px) { .sc-grid { grid-template-columns: 1fr; } }
.sc-qr { text-align: center; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.sc-qr img { width: 220px; height: 220px; display: block; margin: 0 auto; }
.sc-status { font-weight: 600; margin: 0 0 10px; }
.sc-thumbs { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.sc-th { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.sc-th img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; background: #ddd; }
.sc-th.sending { opacity: .5; }
.ph { max-width: 560px; }
.ph h1 { font-size: 28px; margin: 18px 0 6px; }
.ph-shoot { display: flex; width: 100%; justify-content: center; gap: 10px; margin: 16px 0 10px; }
.ph-pick { display: flex; width: 100%; justify-content: center; }
.ph-status { font-weight: 600; min-height: 1.4em; }

/* Lizenzen */
.lic-wrap { overflow-x: auto; margin: 8px 0 20px; position: relative; }
.lic-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.lic-t th, .lic-t td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.lic-t th { font-weight: 600; color: var(--muted); white-space: nowrap; }
.lic-t td:nth-child(2) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lic-t small { color: var(--muted); }
@media (max-width: 640px) { .lic-t td:nth-child(2) { white-space: normal; overflow-wrap: anywhere; } }

/* Kontakt */
.kt textarea.field { resize: vertical; min-height: 140px; font: inherit; }
.kt-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* KI-Hinweis */
.ki-dlg { max-width: 460px; width: calc(100% - 32px); border: 0; border-radius: var(--r-lg); padding: 26px 24px 20px; background: var(--surface); color: var(--fg); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.ki-dlg::backdrop { background: rgba(0,0,0,.45); }
.ki-dlg h2 { margin: 6px 0 10px; font-size: 20px; text-align: center; }
.ki-dlg p, .ki-dlg li { font-size: 15px; line-height: 1.5; }
.ki-dlg ul { margin: 8px 0 10px; padding-left: 20px; }
.ki-pic { display: grid; place-items: center; }
.ki-pic svg { width: 72px; height: 72px; }
.ki-more { color: var(--muted); font-size: 14px !important; }
.ki-chk { display: flex; gap: 10px; align-items: flex-start; background: var(--accent-soft); border-radius: var(--r-md); padding: 12px 14px; margin: 12px 0 16px; font-size: 15px; cursor: pointer; }
.ki-chk input { width: 20px; height: 20px; margin-top: 1px; flex: none; }
.ki-btns { display: flex; gap: 10px; justify-content: flex-end; }
.ki-btns .btn[disabled] { opacity: .45; cursor: not-allowed; }
.ki-badge { display: inline-flex; align-items: center; gap: 8px; margin: -4px 0 18px; padding: 6px 12px; border-radius: 980px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 500; }
.ki-badge svg { width: 16px; height: 16px; fill: currentColor; flex: none; }

/* Animierte Tool-Icons (Stil und Animation in aicons.css) */
.tool-icon.ai-wrap { width: 95px; height: 95px; background: none; border-radius: 0; margin: -6px auto -2px; }
.tool-icon.ai-wrap svg.ai { width: 100%; height: 100%; }
.tool-head .tool-icon.ai-wrap { width: 92px; height: 92px; margin: -6px 0 -6px -8px; }
.tool-head .tool-icon.ai-wrap svg.ai { width: 100%; height: 100%; }
@media (max-width: 520px) { .tool-icon.ai-wrap { width: 79px; height: 79px; } .tool-head .tool-icon.ai-wrap { width: 74px; height: 74px; margin-bottom: 4px; } }

/* Konto */
.konto { max-width: 640px; }
.konto .panel { margin-bottom: 16px; }
.k-codein { font-size: 26px; letter-spacing: .25em; text-align: center; max-width: 220px; }
.k-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.k-dl dt { color: var(--muted); } .k-dl dd { margin: 0; font-weight: 600; word-break: break-all; }
.k-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn.danger { background: var(--err-soft); color: var(--err); }

/* Admin */
.adm .panel { margin-bottom: 16px; }
.adm-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.adm-kpi { display: flex; flex-direction: column; gap: 4px; margin: 0 !important; }
.adm-kpi b { font-size: 30px; letter-spacing: -.02em; } .adm-kpi span { color: var(--muted); font-size: 14px; }
.adm-bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; margin: 10px 0 14px; }
.adm-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.adm-bar i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.adm-bar span { font-size: 11px; color: var(--muted); }
.adm-tools { font-size: 14px; color: var(--muted); }
.adm-table-wrap { overflow-x: auto; margin-top: 12px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th, .adm-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.adm-table th { color: var(--muted); font-weight: 600; }
.adm-act { display: flex; gap: 6px; align-items: center; }
.adm-act select { font: inherit; font-size: 13px; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); }
.adm-audit { list-style: none; padding: 0; margin: 0; font-size: 14px; } .adm-audit li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.adm-audit span { color: var(--muted); margin-right: 8px; }
.konto .note, .adm .note { text-align: left; }
.konto .note, .adm .note { display: block; text-align: left; }

/* E-Rechnung: Speichern im Konto */
.kbar { padding: 12px 14px; border-radius: var(--r-md); background: var(--accent-soft); font-size: 14px; margin-bottom: 18px; }
.kbar .kerr { color: var(--err); }
.kpick { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.kpick select.field { width: auto; min-width: 220px; max-width: 100%; }
.kact { margin: 10px 0 0; }
.limits { padding-bottom: 32px; } .limits h2 { font-size: 22px; margin: 32px 0 12px; } .limits td small { color: var(--muted); } .limits .note { display: block; text-align: left; margin-top: 10px; } .limits .lic-t td { white-space: normal; vertical-align: top; }
.k-ok { padding: 12px 14px; border-radius: var(--r-md); background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.k-offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.k-offer { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface-2); color: var(--fg); font: inherit; cursor: pointer; }
.k-offer:hover, .k-offer.sel { border-color: var(--accent); }
.k-offer b { font-size: 16px; } .k-offer span { font-weight: 600; color: var(--accent); } .k-offer small { color: var(--muted); font-size: 13px; }
.plan .btn { display: flex; }
.k-summary { margin: 14px 0 4px; padding: 14px 16px; border-radius: var(--r-md); border: 1.5px solid var(--accent); }
.k-summary h3 { margin: 0 0 8px; font-size: 16px; }
.k-summary .k-dl dd { font-weight: 500; word-break: normal; }

.plan-2nd { margin-top: 8px; }
.home-faq { padding-bottom: 32px; } .home-faq h2 { font-size: 24px; margin: 24px 0 14px; } .home-faq .more { margin-top: 14px; color: var(--muted); }
.ratgeber .kurz ul { margin: 0; padding-left: 20px; } .ratgeber .kurz li { margin: 6px 0; } .ratgeber ol li { margin: 8px 0; }
.ratgeber .lic-t td, .ratgeber .lic-t th { white-space: normal; } .ratgeber .lic-t td:first-child { white-space: nowrap; } .ratgeber .note, .legal .note { display: block; text-align: left; }
.faq-page { padding-bottom: 40px; } .faq-page h2 { font-size: 22px; margin: 28px 0 12px; } .faq-page .more { margin-top: 20px; color: var(--muted); }
.guide { max-width: 760px; } .guide p, .guide li { line-height: 1.6; } .guide ol { padding-left: 22px; } .guide li { margin: 6px 0; }
.see { margin: 18px 0 8px; color: var(--muted); }
.ratgeber .cta { margin: 28px 0; } .ratgeber .cta .btn { margin: 4px 8px 4px 0; } .ratgeber .more { margin-top: 20px; color: var(--muted); }
.rg-list { list-style: none; padding: 0; } .rg-list li { padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--muted); } .rg-list b { color: var(--fg); }
.ratgeber .lic-wrap { max-width: 100%; } .ratgeber .lic-t { hyphens: auto; -webkit-hyphens: auto; }
@media (max-width: 640px) { .ratgeber .lic-t td:first-child { white-space: normal; } .ratgeber .lic-t th, .ratgeber .lic-t td { padding: 8px 6px; font-size: 13px; } }
.k-ref-row { display: flex; gap: 10px; flex-wrap: wrap; } .k-ref-row .field { flex: 1 1 240px; min-width: 0; }
