:root {
  --navy: #0f2540;
  --navy-2: #16345a;
  --green: #c7e570;
  --green-2: #a8cc4a;
  --orange: #f5a623;
  --red: #e05548;
  --bg: #eef1f5;
  --card: #ffffff;
  --text: #1a2b40;
  --muted: #5a6d85;
  --radius-pill: 999px;
  --radius: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* PWA safe area (Notch) */
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }

header.top {
  background: var(--navy);
  color: #fff;
  padding: 16px 18px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 28px; display: flex; align-items: center; }
.brand h1 { font-size: 20px; font-weight: 800; letter-spacing: .3px; }
.brand p { font-size: 12.5px; color: var(--green); font-weight: 600; }

main { flex: 1; padding: 18px 16px 30px; max-width: 560px; margin: 0 auto; width: 100%; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(15,37,64,.08);
  padding: 20px 18px;
  margin-bottom: 18px;
}
.card h2 { font-size: 18px; font-weight: 800; color: var(--navy); margin-bottom: 16px; }
.card h3.sec {
  font-size: 12px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); margin: 18px 0 10px; font-weight: 700;
  padding-top: 14px; border-top: 1px solid #e6eaf0;
}

label { display: block; margin-bottom: 14px; }
label span { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
input {
  width: 100%;
  padding: 13px 16px;
  font-size: 16px;
  border: 1.5px solid #d7dde6;
  border-radius: var(--radius-pill);
  background: #f7f9fc;
  color: var(--text);
  outline: none;
  min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(199,229,112,.35); }
.select {
  width: 100%;
  padding: 13px 16px;
  font-size: 16px;
  border: 1.5px solid #d7dde6;
  border-radius: var(--radius-pill);
  background: #f7f9fc;
  color: var(--text);
  outline: none;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%235a6d85' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  transition: border-color .15s, box-shadow .15s;
}
.select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(199,229,112,.35); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
  background: var(--green);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  margin-top: 8px;
  transition: transform .1s, background .15s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(168,204,74,.45);
}
.btn:active { transform: scale(.97); }
.btn:hover { background: var(--green-2); }

.hint { font-size: 11.5px; color: var(--muted); margin-top: 10px; text-align: center; }

/* Ergebnis */
.result .badge {
  display: inline-block;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 14px;
}
.badge.ok { background: var(--green); color: var(--navy); }
.badge.no { background: var(--red); color: #fff; }

.verdict { font-size: 24px; font-weight: 800; line-height: 1.2; margin-bottom: 16px; color: var(--navy); }

.summary {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  font-size: 14px;
}
.summary b { color: var(--green); }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.col { background: #f7f9fc; border-radius: var(--radius); padding: 14px; }
.col h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 10px; font-weight: 700; }
.col .type { font-weight: 800; font-size: 14px; margin-bottom: 8px; color: var(--navy); }
.col.win { border: 2px solid var(--green-2); }
.col .row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; border-bottom: 1px dashed #e1e6ec; }
.col .row:last-child { border-bottom: none; }
.col .row span:first-child { color: var(--muted); }
.col .row span:last-child { font-weight: 700; }

.break-even { font-size: 13.5px; background: #fff7e8; border: 1px solid var(--orange); border-radius: var(--radius); padding: 12px 14px; color: #7a4d00; }

.hidden { display: none; }

/* Route-Formular */
#route { border: 2px solid var(--green-2); }
#route .sub { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.btn-green { background: var(--navy); color: #fff; box-shadow: 0 4px 14px rgba(15,37,64,.3); }
.btn-green:hover { background: var(--navy-2); }
.result-inline { font-size: 13.5px; color: var(--navy); font-weight: 600; margin-top: 12px; text-align: center; min-height: 20px; }
#route_maut_hint { font-size: 12.5px; color: var(--muted); font-weight: 500; }

/* Autocomplete-Dropdown (Photon) */
.autocomplete { position: relative; }
.autocomplete-list { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #dfe4ec; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(15,37,64,.12); z-index: 30; max-height: 210px; overflow-y: auto; margin-top: 4px; }
.autocomplete-item { padding: 9px 12px; font-size: 13.5px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid #f0f2f6; }
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.active { background: #eef4fb; }
.autocomplete-item .ac-country { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* Routen-Karte (Leaflet) */
#karte_card #map { height: 380px; border-radius: var(--radius); overflow: hidden; border: 1px solid #dfe4ec; z-index: 1; }
#karte_card { margin-top: 16px; }
.leaflet-container { font-family: inherit; }

/* Ergebnis-Box nicht unter den sticky Header scrollen */
.result { scroll-margin-top: 90px; }

footer { text-align: center; padding: 16px; font-size: 12px; color: var(--muted); }
