/* Kunden-Eingabe: mobil zuerst */
html { -webkit-text-size-adjust: 100%; }
body { padding-bottom: env(safe-area-inset-bottom); }
main { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

/* Größere Bedienelemente, 16 px verhindert den Zoom beim Fokus auf iPhones */
input, select, textarea { font-size: 16px; min-height: 48px; }
input[type=checkbox], input[type=radio] { min-height: 0; }
.btn, button.btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; text-align: center; line-height: 1.2; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button.link { min-height: 44px; padding: 0 6px; }

/* Fortschrittsanzeige */
.stepper { margin: 0 -4px 8px; }
.stepper ol { display: flex; list-style: none; margin: 0; padding: 0; gap: 4px; }
.stepper li { flex: 1; text-align: center; font-size: .78rem; color: var(--muted); }
.stepper li a, .stepper li > span.num { text-decoration: none; color: inherit; }
.stepper .num { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-weight: 600; }
.stepper .lbl { display: block; margin-top: 2px; }
.stepper li.current { color: var(--fg); font-weight: 600; }
.stepper li.current .num { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper li.done .num { background: color-mix(in srgb, var(--accent) 18%, var(--card)); border-color: var(--accent); }
@media (max-width: 520px) {
    .stepper .lbl { display: none; }
    .stepper li.current .lbl { display: block; position: absolute; left: 0; right: 0; }
    .stepper { position: relative; padding-bottom: 20px; }
}

/* Formular und feste Leiste unten */
.wizard-form { padding-bottom: 8px; }
.wizard-bar { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); margin-top: 20px; background: linear-gradient(to top, var(--bg) 75%, transparent); z-index: 5; }
.wizard-bar .btn { flex: 1; margin: 0; }
.center { text-align: center; }
.foot { text-align: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); font-size: .85rem; color: var(--muted); }

/* Wahlkarten */
fieldset.choice { border: 0; padding: 0; margin: 12px 0; }
fieldset.choice legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.option { display: flex; align-items: center; gap: 12px; padding: 14px; margin: 0 0 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; font-weight: 400; min-height: 56px; cursor: pointer; }
.option input { width: 22px; height: 22px; flex: none; }
.option:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
label.check { gap: 12px; align-items: flex-start; margin: 12px 0; }
label.check input { width: 22px; height: 22px; flex: none; margin-top: 0; }
label.consent { padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
details.special { margin: 16px 0; padding: 4px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
details.special summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 500; }

/* Foto-Upload */
.slot { padding: 14px; margin: 0 0 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.slot.has-file { border-color: var(--accent); }
.slot h3 { margin: 0 0 6px; color: var(--fg); font-size: 1rem; }
.slot h3 em { color: var(--muted); font-style: normal; font-weight: 400; font-size: .85em; }
.slot .file { display: flex; gap: 12px; align-items: center; margin: 6px 0; }
.slot .fname { flex: 1; word-break: break-all; font-size: .9rem; }
.slot-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.slot-form .btn { flex: 1 1 140px; margin: 0; position: relative; overflow: hidden; cursor: pointer; }
.slot-form input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; min-height: 0; }
.slot-form .uploading { flex-basis: 100%; margin: 0; color: var(--accent); }
.slot-form.busy .btn { opacity: .5; pointer-events: none; }

/* Zusammenfassung */
.summary { padding: 4px 14px 10px; margin: 0 0 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.summary h2 { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; margin: 12px 0 6px; }
.summary .edit { font-size: .9rem; font-weight: 400; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv strong { text-align: right; font-weight: 500; word-break: break-word; }
.miss { color: var(--err); font-style: normal; }
ul.mini { list-style: none; padding: 0; margin: 4px 0; }
ul.mini li { padding: 8px 0 8px 28px; position: relative; border-bottom: 1px solid var(--line); }
ul.mini li::before { content: "✓"; position: absolute; left: 4px; color: var(--accent); font-weight: 700; }
ul.mini li.miss::before { content: "!"; color: var(--err); }
ul.mini li.miss a { color: var(--err); }
.hint ul { margin: 6px 0 0; padding-left: 20px; }
.hint li { margin: 6px 0; }

@media (min-width: 700px) {
    main { max-width: 640px; }
}

/* Sprachumschalter und Kopfzeile */
.top { flex-wrap: wrap; gap: 6px 12px; }
.top nav { flex-wrap: wrap; justify-content: flex-end; gap: 6px 14px; }
.lang { display: inline-flex; gap: 4px; font-size: .85rem; }
.lang a { text-decoration: none; color: var(--muted); padding: 4px 6px; border-bottom: 2px solid transparent; min-height: 0; }
.lang a.active { color: var(--fg); font-weight: 700; border-bottom-color: var(--accent); }

/* Angebot "Zum Startbildschirm hinzufügen" (nur Kunden) */
.install-banner { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px max(14px, env(safe-area-inset-left)); background: var(--card); border-bottom: 1px solid var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.install-banner[hidden] { display: none; }
.install-banner img { border-radius: 10px; flex: none; }
.install-banner .txt { flex: 1; font-size: .9rem; line-height: 1.35; }
.install-banner .txt strong { display: block; }
.install-banner .txt span[hidden] { display: none; }
.install-banner .txt span { display: block; }
.install-banner .btn.small { margin: 0; flex: none; }
.install-banner .link { flex: none; color: var(--muted); font-size: .85rem; }

/* Eingabe des Anmeldecodes */
input.code { font-size: 1.6rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }

/* Das hidden-Attribut gilt immer, auch bei Klassen mit eigenem display (z. B. .btn) */
[hidden] { display: none !important; }

/* Großer Schieberegler mit zwei Stellungen (Käufer / Verkäufer). Ohne JavaScript bedienbar: Tippen auf eine Hälfte. */
.switch2 { position: relative; display: grid; grid-template-columns: 1fr 1fr; height: 76px; padding: 5px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.switch2 input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.switch2 .thumb { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); background: var(--accent); border-radius: 13px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); transition: transform .22s ease; }
.switch2 #role_seller:checked ~ .thumb { transform: translateX(100%); }
.switch2 label { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; margin: 0; padding: 0 10px; text-align: center; font-size: 1.05rem; font-weight: 600; line-height: 1.2; color: var(--muted); cursor: pointer; transition: color .22s ease; }
.switch2 #role_buyer:checked ~ label[for="role_buyer"], .switch2 #role_seller:checked ~ label[for="role_seller"] { color: #fff; }
.switch2 input:focus-visible ~ .thumb { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .switch2 .thumb, .switch2 label { transition: none; } }

/* Löschen-Kreuz in der Liste der Expedientes */
ul.checklist li { align-items: center; }
form.row-delete { margin: 0 0 0 auto; }
form.row-delete button { width: 44px; height: 44px; padding: 0; font-size: 1.7rem; line-height: 1; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 50%; cursor: pointer; }
form.row-delete button:hover, form.row-delete button:focus-visible { color: var(--err); border-color: var(--err); }
