/* App-Ansichten */
body { padding-bottom: env(safe-area-inset-bottom, 0px); }
.ansicht { padding-bottom: 48px; overflow-wrap: anywhere; }
.ansicht :is(.stack, .reihe, .zwei) > * { min-width: 0; }
.ansicht a { display: inline-flex; align-items: center; min-width: 48px; min-height: 48px; max-width: 100%; }
.appkopf { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: minmax(48px, max-content) minmax(0, 1fr) 48px; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top, 0px) + 10px) max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px)); background: var(--gruen); color: #fff; margin-bottom: 18px; }
.appkopf h1 { font-size: 1.15rem; text-align: center; font-stretch: 112%; }
.appkopf .marke { display: inline-flex; align-items: center; min-width: 48px; min-height: 48px; color: #fff; font-weight: 800; text-decoration: none; font-size: 0.9rem; letter-spacing: 0.04em; }
.zurueck { width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgb(255 255 255 / 12%); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.reihe.zwischen { justify-content: space-between; }

.fz { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; text-align: left; cursor: pointer; width: 100%; color: var(--ink); }
.fz > :not(.fz-plakette) { grid-column: 1; }
.fz-plakette { grid-column: 2; grid-row: 1 / span 3; align-self: start; }
.fz-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; }
.fz-kopf > div { flex: 1 1 140px; min-width: 0; }
.plakette { flex: none; filter: drop-shadow(0 4px 10px rgb(200 16 46 / 22%)); }
.marke-l { color: #ffb3c0; }
.fz strong { font-size: 1.1rem; }
.kennzeichen { justify-self: start; font-family: var(--mono); font-weight: 600; padding: 2px 10px; border: 2px solid var(--ink); border-radius: 6px; background: var(--panel); letter-spacing: 0.06em; }
.leer { text-align: left; }

.fortschritt { display: grid; gap: 6px; font-size: 0.92rem; }
.balken { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.balken i { display: block; height: 100%; background: var(--gruen-2); border-radius: 999px; }
.fortschritt.knapp .balken i { background: var(--amber); }
.fortschritt.voll .balken i { background: var(--rot); }
.fortschritt.voll strong { color: var(--rot); }

.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 5rem), 1fr)); gap: 8px; text-align: center; }
.kennzahlen div { display: grid; padding: 10px 4px; border-radius: 12px; background: var(--bg); }
.kennzahlen strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.kennzahlen span { font-size: 0.875rem; color: var(--muted); }

.losfahren { flex-direction: column; gap: 2px; min-height: 84px; }
.losfahren span { font-size: 1.3rem; }
.losfahren small { font-weight: 500; opacity: 0.85; }
.unterwegs { border-color: var(--amber); border-width: 2px; }
.route-panel h2 { font-size: 1.05rem; }
.route-status { display: grid; gap: 6px; margin: 0; }
.route-status > strong { font-size: 1.1rem; }
.route-status > span { font-size: 0.9rem; }
.route-aktionen > .btn { flex: 1 1 180px; }
.verankert { text-align: center; }

.fahrtenliste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fahrt-zeile { width: 100%; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 10px; align-items: center; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; color: var(--ink); }
.fahrt-zeile .nr { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--bg); font-weight: 700; font-variant-numeric: tabular-nums; }
.fahrt-zeile .was { display: grid; min-width: 0; }
.fahrt-zeile .was strong { overflow-wrap: anywhere; }
.fahrt-zeile small { color: var(--muted); }
.fahrt-zeile .wieviel { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px 10px; font-variant-numeric: tabular-nums; }
.werkzeuge .btn { flex: 1 1 160px; }

/* Erfassen */
.nur-sr { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.fotoknopf { display: grid; place-items: center; gap: 2px; min-height: 120px; border: 2px dashed var(--gruen-2); border-radius: 16px; background: var(--bg); color: var(--gruen-2); font-weight: 700; font-size: 1.1rem; cursor: pointer; text-align: center; padding: 12px; }
.fotoknopf small { font-weight: 500; color: var(--muted); font-size: 0.875rem; }
#foto:focus-visible + .fotoknopf { outline: 3px solid var(--amber); outline-offset: 2px; }
.vorschau, .foto { width: 100%; max-height: 360px; object-fit: contain; border-radius: 12px; background: #000; }
#km { font-family: var(--mono); font-size: 1.6rem; letter-spacing: 0.08em; }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: 48px; padding-block: 12px; font-size: 0.95rem; cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; margin-top: 1px; accent-color: var(--gruen-2); }
fieldset.art { min-width: 0; border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 10px; }
fieldset.art legend { margin-bottom: 6px; }
.wahl { display: flex; gap: 10px; align-items: center; min-height: 48px; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.wahl input { flex: none; width: 22px; min-height: 22px; height: 22px; padding: 0; margin: 0; accent-color: var(--gruen-2); }
.wahl:has(input:checked) { border-color: var(--gruen-2); background: var(--ok-bg); }
.wahl span { display: grid; min-width: 0; }
.wahl small { color: var(--muted); }
.gefahren { color: var(--gruen-2); }
.fingerabdruecke { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
details summary { min-height: 48px; padding-block: 12px; cursor: pointer; font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 20; max-width: min(92vw, 480px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgb(0 0 0 / 25%); font-weight: 600; }

/* Druck: Bildschirmvorschau und Papier */
.druckansicht { background: var(--bg); }
.druckleiste { padding-block: 14px; position: sticky; top: 0; background: var(--bg); z-index: 3; }
.buch { max-width: 980px; margin: 0 auto; padding: 0 16px; color: #111; }
.seite { background: #fff; color: #111; padding: 28px; margin-bottom: 18px; border-radius: 8px; box-shadow: var(--schatten); overflow-x: auto; }
.seite h1 { font-size: 2rem; margin: 4px 0 18px; }
.seite h2 { font-size: 1.2rem; margin-bottom: 12px; }
.deckblatt dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0 0 18px; font-size: 1.05rem; }
.deckblatt dt { color: #555; }
.deckblatt dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 600px) { .deckblatt dl { grid-template-columns: 1fr; gap: 2px; } .deckblatt dd { margin-bottom: 10px; } .seite { padding: 18px; } }
.fahrten-tabelle { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.fahrten-tabelle th, .fahrten-tabelle td { border: 1px solid #bbb; padding: 5px 6px; text-align: left; vertical-align: top; }
.fahrten-tabelle th { background: #eef1ee; }
.fahrten-tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fahrten-tabelle tr.storniert td { color: #888; text-decoration: line-through; }
.fahrten-tabelle tr.vermerk td { font-size: 0.75rem; color: #444; background: #fafafa; border-top: 0; }
.fahrten-tabelle .mono { font-size: 0.72rem; }
.fotoraster { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.fotoraster figure { margin: 0; break-inside: avoid; }
.fotoraster .paar { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.fotoraster img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 4px; background: #000; }
.fotoraster figcaption { font-size: 0.72rem; color: #444; margin-top: 3px; }

@page { size: A4 landscape; margin: 14mm 12mm 16mm; @bottom-center { content: 'Seite ' counter(page) ' von ' counter(pages); font: 9pt 'Archivo', sans-serif; color: #444; } @bottom-right { content: 'OldieGo · digitales Fahrtenbuch'; font: 8pt 'Archivo', sans-serif; color: #888; } }
@media print {
	.druckansicht { background: #fff; }
	body { background: #fff; }
	.nicht-drucken, .toast, .appkopf { display: none !important; }
	.buch { max-width: none; padding: 0; }
	.seite { box-shadow: none; border-radius: 0; padding: 0; margin: 0; break-after: auto; margin-bottom: 7mm; overflow: visible; }
	.deckblatt { break-after: page; }
	.jahresabschnitt, .belege { break-before: page; }
	.vermerke, .pruefvermerk { break-inside: avoid; }
	.seite:last-child { break-after: auto; }
	.fahrten-tabelle tr { break-inside: avoid; }
	.fahrten-tabelle thead { display: table-header-group; }
}

.kontozeile { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.anmelden { justify-items: start; }

.zusatz { margin-top: 16px; }
.tacho-stunden { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tacho-stunden.tacho--gross { font-size: 2rem; }

/* Große Schrift bleibt groß. Nur ein langes Zählwerk scrollt innerhalb seiner Karte. */
.ansicht .tacho { max-width: 100%; min-width: 0; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; scrollbar-color: var(--muted) var(--line); }
.ansicht .tacho::-webkit-scrollbar { height: 8px; }
.ansicht .tacho::-webkit-scrollbar-track { background: var(--line); border-radius: 4px; }
.ansicht .tacho::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 4px; }
.ansicht .tacho > span { flex-shrink: 0; }
.ansicht .tacho-stunden { overflow-wrap: anywhere; }
.ansicht .pill { white-space: normal; }
.ansicht .klein, .ansicht small, .ansicht .eyebrow, .ansicht .pill, .legal-links { font-size: 0.875rem; }

.legal-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding-block: 24px; }
.legal-links a { display: inline-flex; align-items: center; min-width: 48px; min-height: 48px; overflow-wrap: anywhere; }
@media print { .legal-links { display: none; } }

/* OldieGo: classic badge, warm surfaces, clear modern controls. */
.appkopf { background: var(--bg); color: var(--ink); border-bottom: 1px solid var(--line); }
.appkopf .marke { color: var(--ink); width: 144px; max-width: 100%; }
.appkopf .marke img { display: block; width: 144px; height: auto; max-width: 100%; }
.appkopf .zurueck { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.garage-hero { gap: 12px; margin-bottom: 12px; }
.garage-hero h2 { font-family: Georgia, serif; font-size: clamp(1.8rem, 7vw, 2.7rem); line-height: 1.12; letter-spacing: -.035em; }
.ausfahrt-motiv { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 22px; }
.garage-titel { font-size: 1.35rem; margin-block: 8px 0; }
.fz { box-shadow: none; padding: 18px; }
.fz:hover { border-color: var(--gruen-2); }
.konto-details { margin-top: 12px; border-top: 1px solid var(--line); }
.kontozeile { padding-bottom: 12px; }
.anmelde-logo { max-width: 100%; height: auto; }
.route-status { border-radius: 18px; }
.route-aktionen .btn { min-height: 56px; border-radius: 18px; }
.losfahren { background: var(--amber); color: #1a1100; border-color: var(--amber); }
@media (max-width: 360px) { .appkopf:has(.marke) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .appkopf:has(.marke) > span:last-child { display: none; } }

/* Native text scaling and visible touch feedback. */
html.ios-app { font: -apple-system-body; }
button, .btn { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.btn:active { filter: brightness(.9); }
.buch td, .buch th { overflow-wrap: anywhere; }

.toast { width: min(560px, calc(100vw - 32px)); max-width: calc(100vw - 32px); box-sizing: border-box; }
.toast--fehler { background: #642a26; color: #fff; display: grid; gap: 12px; }
