/* SEPA-Lastschriftdatei */

:root {
  --bg: #f5f3ee;
  --surface: #fbfaf7;
  --sunken: #ece9e1;
  --ink: #15171b;
  --ink-2: #3b3f47;
  --ink-soft: #6b6f78;
  --line: rgba(21, 23, 27, 0.12);
  --accent: #2f45d6;
  --accent-soft: rgba(47, 69, 214, 0.09);
  --accent-ink: #ffffff;
  --bad: #b42318;
  --bad-soft: rgba(180, 35, 24, 0.08);
  --warn: #8a5a00;
  --warn-soft: rgba(181, 120, 0, 0.1);
  --ok: #157a5c;
  --shadow-sm: 0 0 0 1px rgba(21, 23, 27, 0.09), 0 1px 2px rgba(21, 23, 27, 0.06);
  --shadow: 0 0 0 1px rgba(21, 23, 27, 0.07), 0 12px 32px -22px rgba(20, 24, 40, 0.35);

  --f-sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: max(16px, env(safe-area-inset-left));
  --radius: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f12;
    --surface: #14171c;
    --sunken: #0a0c0f;
    --ink: #eceae4;
    --ink-2: #c4c3be;
    --ink-soft: #8d9099;
    --line: rgba(236, 234, 228, 0.11);
    --accent: #8b9bff;
    --accent-soft: rgba(139, 155, 255, 0.12);
    --accent-ink: #0d0f12;
    --bad: #ff8a7a;
    --bad-soft: rgba(255, 138, 122, 0.1);
    --warn: #f2c063;
    --warn-soft: rgba(242, 192, 99, 0.1);
    --ok: #5fd0a8;
    --shadow-sm: 0 0 0 1px rgba(236, 234, 228, 0.1), 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 0 0 1px rgba(236, 234, 228, 0.08), 0 12px 32px -22px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f12;
  --surface: #14171c;
  --sunken: #0a0c0f;
  --ink: #eceae4;
  --ink-2: #c4c3be;
  --ink-soft: #8d9099;
  --line: rgba(236, 234, 228, 0.11);
  --accent: #8b9bff;
  --accent-soft: rgba(139, 155, 255, 0.12);
  --accent-ink: #0d0f12;
  --bad: #ff8a7a;
  --bad-soft: rgba(255, 138, 122, 0.1);
  --warn: #f2c063;
  --warn-soft: rgba(242, 192, 99, 0.1);
  --ok: #5fd0a8;
  --shadow-sm: 0 0 0 1px rgba(236, 234, 228, 0.1), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 0 0 1px rgba(236, 234, 228, 0.08), 0 12px 32px -22px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-underline-offset: 2px; }
code, .mono { font-family: var(--f-mono); font-size: 0.88em; }
code { background: var(--sunken); padding: 0.05em 0.35em; border-radius: 4px; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
[hidden] { display: none !important; }

.wrap {
  max-width: 64rem;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 64px) var(--gutter) 80px;
}

/* ---------------------------------------------------------------- intro */

.intro { max-width: 44rem; margin-bottom: 28px; }
h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.4rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 12px; font-weight: 650; }
.lede { font-size: 1.1rem; color: var(--ink-2); margin: 0 0 14px; }
.private { display: flex; gap: 8px; align-items: center; margin: 0; color: var(--ok); font-size: 0.95rem; }
.private svg { width: 18px; height: 18px; flex: none; }

/* ---------------------------------------------------------------- steps */

.step {
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 28px);
  margin-bottom: 16px;
}
.needs-file { display: none; }
.has-file .needs-file { display: block; }
h2 { font-size: 1.2rem; margin: 0 0 6px; font-weight: 620; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.num {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 0.85rem; font-weight: 650; flex: none;
}
.hint { color: var(--ink-soft); font-size: 0.875rem; margin: 0 0 14px; display: block; }
.field .hint { margin: 4px 0 0; }
.opt { color: var(--ink-soft); font-weight: 400; font-size: 0.85em; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin-top: 8px; }
.grid .wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid { grid-template-columns: minmax(0, 1fr); } }

.field { display: flex; flex-direction: column; min-width: 0; }
.label { font-size: 0.875rem; font-weight: 560; color: var(--ink-2); margin-bottom: 6px; }

input:not([type="checkbox"]):not([type="file"]), select {
  font: inherit;
  font-size: 16px; /* no zoom on focus in iOS */
  color: var(--ink);
  background: var(--bg);
  border: 0;
  box-shadow: var(--shadow-sm);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
}
input.mono { font-family: var(--f-mono); font-size: 15px; }
select { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus-visible, select:focus-visible, button:focus-visible, summary:focus-visible, .table-wrap:focus-visible, .drop:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input[aria-invalid="true"] { box-shadow: 0 0 0 1px var(--bad), 0 1px 2px rgba(0, 0, 0, 0.05); }
input::placeholder { color: var(--ink-soft); opacity: 0.7; }

.msg { font-size: 0.85rem; min-height: 0; }
.msg.error { color: var(--bad); margin-top: 4px; }
.msg.warning { color: var(--warn); margin-top: 4px; }

.check { display: inline-flex; gap: 8px; align-items: center; font-size: 0.925rem; color: var(--ink-2); margin-top: 16px; cursor: pointer; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }

/* ---------------------------------------------------------------- file */

.drop {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 28px 16px;
  border-radius: 10px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--line);
  text-align: center;
  cursor: pointer;
  transition: box-shadow 160ms ease, background-color 160ms ease;
}
.drop:hover, .drop.over { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop svg { width: 28px; height: 28px; color: var(--ink-soft); }
.drop-main { font-weight: 560; }
.drop-main u { text-decoration-color: var(--accent); text-underline-offset: 3px; }
.drop-file { color: var(--ink-soft); font-size: 0.9rem; overflow-wrap: anywhere; }
#sheet-field { margin-top: 16px; max-width: 24rem; }
.problem { color: var(--bad); background: var(--bad-soft); border-radius: 8px; padding: 10px 12px; margin: 12px 0 0; }

/* ---------------------------------------------------------------- mapping */

.map { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; margin-top: 4px; }
@media (max-width: 640px) { .map { grid-template-columns: minmax(0, 1fr); } }
.combo { display: flex; gap: 6px; }
.combo input { flex: 1; font-family: var(--f-mono); font-size: 15px; }
.combo select.insert { width: auto; flex: none; max-width: 8.5rem; color: var(--accent); font-size: 15px; background-color: var(--surface); }
.sample { font-size: 0.85rem; color: var(--ink-2); margin-top: 4px; overflow-wrap: anywhere; min-height: 1.3em; }
.sample:empty::before { content: "\00a0"; }

details.more { margin-top: 20px; }
details.more > .map { margin-top: 14px; }
summary { cursor: pointer; font-weight: 560; color: var(--ink-2); list-style-position: outside; }
summary .opt { display: block; font-weight: 400; margin-top: 2px; }

/* ---------------------------------------------------------------- check */

.summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 8px 0 16px; }
@media (max-width: 720px) { .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } .summary .stat:nth-child(2) { order: -1; grid-column: 1 / -1; } }
.stat { background: var(--bg); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow-sm); min-width: 0; }
.stat .v { display: block; font-size: 1.35rem; font-weight: 640; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .k { font-size: 0.8rem; color: var(--ink-soft); }
.stat.bad .v { color: var(--bad); }
.stat.warn .v { color: var(--warn); }
.stat.muted .v { color: var(--ink-soft); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 12px; }
.toolbar .check { margin: 0 auto 0 0; }

button { font: inherit; cursor: pointer; border: 0; border-radius: 8px; min-height: 40px; padding: 8px 14px; }
button.ghost { background: transparent; color: var(--accent); box-shadow: var(--shadow-sm); font-size: 0.9rem; }
button.ghost:hover { background: var(--accent-soft); }
button.primary { background: var(--ink); color: var(--bg); font-weight: 600; padding: 12px 22px; min-height: 48px; font-size: 1rem; }
button.primary:hover:not(:disabled) { background: var(--accent); color: var(--accent-ink); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
@media (hover: none) { button.ghost:hover { background: transparent; } }

.table-wrap { overflow: auto; max-height: 70vh; border-radius: 10px; box-shadow: var(--shadow-sm); background: var(--bg); }
table { border-collapse: collapse; width: 100%; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
th { position: sticky; top: 0; z-index: 1; background: var(--sunken); text-align: left; font-weight: 560; color: var(--ink-2); padding: 8px 10px; white-space: nowrap; }
td { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: top; }
td:nth-child(3) { min-width: 10rem; }
td:last-child { min-width: 12rem; }
.c-check { width: 1%; padding-right: 0; }
.c-n { width: 1%; color: var(--ink-soft); text-align: right; }
.c-amt { text-align: right; white-space: nowrap; }
tr.off > td { color: var(--ink-soft); }
tr.off > td:not(.c-check) { text-decoration: line-through; text-decoration-color: var(--line); }
tr.bad > td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tr.warn > td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tr.notes > td { border-top: 0; padding-top: 0; }
tr.notes span { display: inline-block; margin: 0 6px 4px 0; padding: 1px 8px; border-radius: 999px; font-size: 0.8rem; }
tr.notes .e { color: var(--bad); background: var(--bad-soft); }
tr.notes .w { color: var(--warn); background: var(--warn-soft); }
td.empty { text-align: center; color: var(--ink-soft); padding: 20px; }
#rows-more { margin: 10px 0 0; }

/* ---------------------------------------------------------------- download */

.blockers ul { margin: 0 0 16px; padding: 10px 12px 10px 30px; background: var(--warn-soft); color: var(--warn); border-radius: 8px; font-size: 0.925rem; }
.blockers li + li { margin-top: 4px; }
#download-info { margin: 10px 0 0; min-height: 1.4em; }
.next { margin: 20px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 0.925rem; }
.next li + li { margin-top: 6px; }

/* ---------------------------------------------------------------- facts */

.facts { margin-top: 40px; max-width: 44rem; }
.facts h2 { margin-bottom: 12px; }
.facts details { border-top: 1px solid var(--line); padding: 12px 0; }
.facts details:last-child { border-bottom: 1px solid var(--line); }
.facts p { color: var(--ink-2); margin: 10px 0 0; font-size: 0.95rem; }
