:root {
  --green: #67AE2F;
  --green-dark: #4F8A20;
  --green-bg: #EAF5E0;
  --dark: #253539;
  --dark-2: #3C4E53;
  --light: #EEF2F5;
  --line: #D5DDE2;
  --muted: #5E6E73;
  --yellow: #E0A100;
  --yellow-bg: #FFF4D6;
  --red: #C8372D;
  --red-bg: #FDE7E5;
  --white: #fff;
  --radius: 14px;
  font-size: 19px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--light); color: var(--dark); line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Kopfzeile */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--dark); color: #fff; padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.1rem; }
.brand b { color: var(--green); }
.logo { width: 34px; height: 34px; display: block; }
.pill { background: var(--dark-2); padding: 6px 12px; border-radius: 999px; font-size: .85rem; white-space: nowrap; }

main { max-width: 760px; margin: 0 auto; padding: 16px; }
.loading { text-align: center; color: var(--muted); padding: 60px 0; }
h1 { font-size: 1.6rem; margin: 6px 0 4px; }
h2 { font-size: 1.25rem; margin: 26px 0 10px; }
h3 { font-size: 1.05rem; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 14px; }
.small { font-size: .85rem; color: var(--muted); }

/* Fortschritt */
.progress { background: #fff; border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 0 var(--line); }
.progress .num { font-size: 1.15rem; font-weight: 700; }
.bar { height: 14px; background: var(--light); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width .3s; }

/* Umschalter offen / erledigt */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.seg button {
  min-height: 58px; border-radius: var(--radius); border: 2px solid var(--line); background: #fff;
  font-weight: 700; font-size: 1.05rem; cursor: pointer;
}
.seg button.on { background: var(--dark); color: #fff; border-color: var(--dark); }

/* Fahrzeugkarten */
.cards { display: grid; gap: 10px; }
.card {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  background: #fff; border-radius: var(--radius); padding: 16px; min-height: 84px;
  border: 2px solid transparent; box-shadow: 0 1px 0 var(--line);
}
.card:active { border-color: var(--green); }
.card .plate { font-size: 1.35rem; font-weight: 800; letter-spacing: .02em; }
.card .meta { color: var(--muted); font-size: .92rem; }
.card .grow { flex: 1; min-width: 0; }
.card .go { font-size: 1.8rem; color: var(--muted); }
.card.done { background: var(--green-bg); }
.check { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 1.5rem; font-weight: 800; }
.dot { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 3px solid var(--line); }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-left: 6px; vertical-align: middle; }
.tag.ok { background: var(--green-bg); color: var(--green-dark); }
.tag.grenzwertig { background: var(--yellow-bg); color: #8A6300; }
.tag.bestellen { background: var(--red-bg); color: var(--red); }
.tag.bestellt { background: #E3ECF7; color: #2C5C93; }
.tag.miss { background: var(--light); color: var(--muted); }

/* Detailseite */
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 16px; margin-bottom: 8px; border-radius: var(--radius); background: #fff; border: 2px solid var(--line); text-decoration: none; font-weight: 700; }
.bigplate { font-size: 2.2rem; font-weight: 900; letter-spacing: .03em; margin: 8px 0 0; }
.box { background: #fff; border-radius: var(--radius); padding: 16px; margin: 12px 0; box-shadow: 0 1px 0 var(--line); }
.box.on { border-left: 8px solid var(--green); }
.box.off { border-left: 8px solid var(--dark); }
.box .lbl { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.box .val { font-size: 1.15rem; font-weight: 700; margin-top: 2px; }
.warn { background: var(--red-bg); color: var(--red); border-radius: var(--radius); padding: 12px 16px; font-weight: 600; margin: 12px 0; }
.info { background: var(--yellow-bg); color: #6B4D00; border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; }

.q { font-size: 1.25rem; font-weight: 800; margin: 26px 0 10px; }
.choices { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer;
  min-height: 76px; padding: 12px 16px; border-radius: var(--radius); border: 3px solid var(--line); background: #fff;
  font-size: 1.15rem; font-weight: 700;
}
.choice .ic { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 1.4rem; font-weight: 900; }
.choice .txt small { display: block; font-weight: 500; font-size: .88rem; color: var(--muted); }
.choice.ok .ic { background: var(--green); }
.choice.grenzwertig .ic { background: var(--yellow); }
.choice.bestellen .ic { background: var(--red); }
.choice.ok.sel { border-color: var(--green); background: var(--green-bg); }
.choice.grenzwertig.sel { border-color: var(--yellow); background: var(--yellow-bg); }
.choice.bestellen.sel { border-color: var(--red); background: var(--red-bg); }

.stepper { display: grid; grid-template-columns: 76px 1fr 76px; gap: 10px; align-items: center; }
.stepper button { min-height: 68px; border-radius: var(--radius); border: 2px solid var(--line); background: #fff; font-size: 2rem; font-weight: 800; cursor: pointer; }
.stepper input { min-height: 68px; text-align: center; font-size: 1.6rem; font-weight: 800; border-radius: var(--radius); border: 2px solid var(--line); background: #fff; width: 100%; }
.hint { margin-top: 8px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { min-height: 50px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font-weight: 600; cursor: pointer; }
.chip.sel { background: var(--dark); color: #fff; border-color: var(--dark); }

input.big, select.big, textarea.big { width: 100%; min-height: 60px; padding: 10px 14px; border-radius: var(--radius); border: 2px solid var(--line); background: #fff; font-size: 1.1rem; }
textarea.big { min-height: 90px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid var(--green); outline-offset: 1px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; cursor: pointer;
  min-height: 56px; padding: 0 20px; border-radius: var(--radius); border: 2px solid var(--dark); background: #fff; font-weight: 700;
}
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.sm { min-height: 44px; padding: 0 14px; font-size: .92rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.huge { width: 100%; min-height: 84px; font-size: 1.35rem; margin-top: 26px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
.footer-links .btn { width: 100%; }
.badge { background: var(--red); color: #fff; border-radius: 999px; padding: 0 9px; font-size: .85rem; }

/* Verwaltung */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 8px 0 16px; padding-bottom: 4px; }
.tabs a { white-space: nowrap; text-decoration: none; padding: 10px 16px; border-radius: 999px; background: #fff; border: 2px solid var(--line); font-weight: 700; }
.tabs a.on { background: var(--dark); color: #fff; border-color: var(--dark); }
.list { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 0 var(--line); }
.li { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--light); text-decoration: none; }
.li:first-child { border-top: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: 700; }
.li.inactive { opacity: .55; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: block; }
.field > span { display: block; font-size: .85rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; min-height: 50px; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--line); background: #fff; }
.checkline { display: flex; align-items: center; gap: 10px; min-height: 50px; font-weight: 600; }
.checkline input { width: 26px; height: 26px; accent-color: var(--green); }
.setcard { background: #fff; border-radius: var(--radius); padding: 16px; margin: 12px 0; box-shadow: 0 1px 0 var(--line); }
.setcard h3 { display: flex; justify-content: space-between; align-items: center; }
.order { border-left: 6px solid var(--red); }
.order.grenz { border-left-color: var(--yellow); }
.order.wait { border-left-color: #2C5C93; }
.sum { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; }
.sum th, .sum td { text-align: left; padding: 10px 12px; border-top: 1px solid var(--light); }
.sum th { background: var(--dark); color: #fff; font-size: .85rem; }
pre.copy { white-space: pre-wrap; background: #fff; border-radius: var(--radius); padding: 14px; font-size: .9rem; border: 2px dashed var(--line); }

/* Language switch + header */
.topright { display: flex; align-items: center; gap: 8px; }
.langsw { display: inline-flex; border: 2px solid var(--dark-2); background: var(--dark-2); border-radius: 999px; padding: 2px; cursor: pointer; }
.langsw span { padding: 6px 10px; border-radius: 999px; font-weight: 800; font-size: .85rem; color: #B9C6CB; }
.langsw span.on { background: var(--green); color: #fff; }
@media (max-width: 420px) { .pill { display: none; } }

/* Search */
.search { display: flex; align-items: center; gap: 8px; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 0 8px 0 14px; margin-bottom: 14px; min-height: 60px; }
.search:focus-within { border-color: var(--green); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 1.1rem; min-height: 56px; min-width: 0; }
.search input::-webkit-search-cancel-button { display: none; }
.search button { border: 0; background: var(--light); width: 44px; height: 44px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; }

/* Quick update */
.quick { background: #fff; border-radius: var(--radius); padding: 14px 16px; margin: 10px 0; box-shadow: 0 1px 0 var(--line); }
.quick-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quick-body { margin-top: 12px; border-top: 1px solid var(--light); padding-top: 6px; }
.lbl2 { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 6px; }
.chip.cond-ok.sel { background: var(--green); border-color: var(--green); color: #fff; }
.chip.cond-grenzwertig.sel { background: var(--yellow); border-color: var(--yellow); color: #fff; }
.chip.cond-bestellen.sel { background: var(--red); border-color: var(--red); color: #fff; }

/* Install banner */
.install { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer; margin-bottom: 14px;
  background: var(--dark); color: #fff; border: 0; border-radius: var(--radius); padding: 14px 16px; min-height: 76px; }
.install img { width: 48px; height: 48px; flex: none; }
.install b { color: var(--green); font-size: 1.1rem; }

/* Size check */
.sizecheck { background: #fff; border-radius: var(--radius); padding: 14px 16px; margin: 10px 0; box-shadow: 0 1px 0 var(--line); }
.sizecheck .row { margin-top: 8px; }
.sizecheck .lbl { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sizecheck .val { font-size: 1.1rem; font-weight: 700; }
.chip[data-sc].sel { background: var(--green); border-color: var(--green); color: #fff; }

/* Login */
.login { max-width: 420px; margin: 40px auto; background: #fff; padding: 24px; border-radius: var(--radius); }
.login .btn { width: 100%; margin-top: 14px; }
.err { color: var(--red); font-weight: 600; margin-top: 10px; }

#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(140%); background: var(--dark); color: #fff; padding: 14px 22px; border-radius: 999px; font-weight: 700; transition: transform .25s; z-index: 50; max-width: calc(100% - 32px); text-align: center; }
#toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 520px) {
  :root { font-size: 18px; }
  .grid2 { grid-template-columns: 1fr; }
  .bigplate { font-size: 1.9rem; }
}
@media print {
  .top, .tabs, .btn, .footer-links { display: none !important; }
  body { background: #fff; }
}
