@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/bricolage-grotesque/bricolage-grotesque-latin-ext-opsz-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/bricolage-grotesque/bricolage-grotesque-latin-opsz-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Farben, auch von der Karte genutzt (siehe karte.js) */
  --hintergrund: #0e1013;
  --flaeche: #15181d;
  --flaeche-2: #1b1f25;
  --text: #ece9e1;
  --text-2: #c7c4bd;
  --gedaempft: #9299a5;
  --gedaempft-2: #5f6570;
  --linie: #242930;
  --linie-stark: #353b44;
  --akzent: #c8f169;
  --akzent-text: #12150a;
  --akzent-hell: rgba(200, 241, 105, 0.1);
  --warnung: #ffc670;
  --warnung-hell: rgba(255, 198, 112, 0.1);
  --radius: 14px;
  --schrift: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --links: 100%;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--hintergrund);
  color: var(--text);
  font: 16px/1.55 var(--schrift);
  font-optical-sizing: auto;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text);
  text-decoration-color: var(--akzent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--akzent);
}

:focus-visible {
  outline: 2px solid var(--akzent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--akzent);
  color: var(--akzent-text);
}

.sprung {
  position: absolute;
  left: -9999px;
}

.sprung:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--flaeche);
  padding: 8px 12px;
  border-radius: 8px;
}

.seite {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 20px 48px;
}

/* Kopf */

.kopf {
  margin-bottom: 32px;
}

.marke {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--akzent);
}

.marke::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--akzent);
  box-shadow: 0 0 0 4px var(--akzent-hell);
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 4.2vw, 2.6rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.einleitung {
  margin: 0 0 18px;
  color: var(--gedaempft);
  font-size: 1.08rem;
}

.inoffiziell {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--linie);
  border-left: 3px solid var(--warnung);
  border-radius: 10px;
  background: var(--flaeche);
  color: var(--text-2);
  font-size: 0.92rem;
}

.inoffiziell strong {
  color: var(--text);
}

/* Eingabe */

.eingabe {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

legend,
.feld > label {
  display: block;
  margin-bottom: 6px;
  padding: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.optional {
  margin-left: 6px;
  font-weight: 400;
  color: var(--gedaempft);
  font-size: 0.85rem;
}

.hilfe {
  margin: 6px 0 0;
  color: var(--gedaempft);
  font-size: 0.85rem;
}

.umschalter {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--linie);
  border-radius: 999px;
  background: var(--flaeche);
}

.umschalter label {
  position: relative;
  cursor: pointer;
}

.umschalter input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.umschalter span {
  display: block;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gedaempft);
  transition: background 0.15s, color 0.15s;
}

.umschalter input:hover + span {
  color: var(--text);
}

.umschalter input:checked + span {
  background: var(--akzent);
  color: var(--akzent-text);
  font-weight: 600;
}

.umschalter input:focus-visible + span {
  outline: 2px solid var(--akzent);
  outline-offset: 2px;
}

.orte,
.daten {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .orte,
  .daten {
    grid-template-columns: 1fr 1fr;
  }
}

input[type="text"],
input[type="date"] {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--linie-stark);
  border-radius: 11px;
  background: var(--flaeche-2);
  color: var(--text);
  font: inherit;
}

input[type="text"]:hover,
input[type="date"]:hover {
  border-color: #454c57;
}

input[type="text"]:focus,
input[type="date"]:focus {
  border-color: var(--akzent);
  outline: 3px solid var(--akzent-hell);
  outline-offset: 0;
}

input::placeholder {
  color: var(--gedaempft-2);
}

/* Ortsvorschläge */

.combo {
  position: relative;
}

.vorschlaege {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--flaeche-2);
  border: 1px solid var(--linie-stark);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.vorschlag {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.vorschlag[aria-selected="true"],
.vorschlag:hover {
  background: var(--akzent-hell);
}

.vorschlag-name {
  font-weight: 600;
}

.vorschlag-zusatz {
  font-size: 0.85rem;
  color: var(--gedaempft);
}

.vorschlag-meldung {
  padding: 8px 10px;
  color: var(--gedaempft);
  font-size: 0.9rem;
}

/* Karte */

.kartenbereich {
  position: relative;
  margin-bottom: 28px;
}

.karte {
  height: 300px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  overflow: hidden;
  background: #111418;
}

.karte-fehlt {
  display: grid;
  place-items: center;
  color: var(--gedaempft);
}

.marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--akzent);
  background: var(--hintergrund);
  box-shadow: 0 0 0 4px rgba(14, 16, 19, 0.6);
}

.marker-ziel {
  background: var(--akzent);
  border-color: var(--hintergrund);
  box-shadow: 0 0 0 3px var(--akzent), 0 0 0 8px rgba(200, 241, 105, 0.18);
}

.strecke {
  margin: 10px 0 0;
  min-height: 1.55em;
  color: var(--gedaempft);
  font-size: 0.95rem;
}

.strecke strong {
  color: var(--text);
}

.link-knopf {
  padding: 0;
  border: 0;
  background: none;
  color: var(--akzent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Kartensteuerung von MapLibre an das dunkle Design anpassen */

.maplibregl-ctrl-group {
  background: var(--flaeche-2) !important;
  border: 1px solid var(--linie-stark);
  box-shadow: none !important;
}

.maplibregl-ctrl-group button + button {
  border-top-color: var(--linie-stark) !important;
}

.maplibregl-ctrl-group button .maplibregl-ctrl-icon {
  filter: invert(1) brightness(0.9);
}

.maplibregl-ctrl-group button:not(:disabled):hover {
  background-color: rgba(255, 255, 255, 0.06) !important;
}

.maplibregl-ctrl.maplibregl-ctrl-attrib {
  background: rgba(14, 16, 19, 0.8);
  color: var(--gedaempft);
}

.maplibregl-ctrl-attrib a {
  color: var(--gedaempft);
}

.maplibregl-ctrl-attrib-button {
  filter: invert(1);
  background-color: transparent !important;
}

.maplibregl-cooperative-gesture-screen {
  background: rgba(14, 16, 19, 0.75);
  font-family: var(--schrift);
}

/* Ergebnis */

.ergebnis {
  margin-bottom: 36px;
}

.ergebnis:empty {
  display: none;
}

.ergebnis-titel,
.hinweise h2 {
  margin: 0 0 14px;
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.posten-raster {
  display: grid;
  gap: 12px;
}

@media (min-width: 640px) {
  .posten-raster {
    grid-template-columns: 1fr 1fr;
  }
}

.posten {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
}

.posten-titel {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gedaempft);
}

.posten-betrag {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.posten-vorsatz {
  margin-right: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gedaempft);
  letter-spacing: 0;
}

.posten-neben {
  margin: -2px 0 0;
  font-size: 0.9rem;
  color: var(--text-2);
}

.posten-text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--gedaempft);
}

.posten-gedimmt .posten-betrag {
  color: var(--gedaempft-2);
}

.zaehler {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.zaehler-label {
  margin-right: auto;
  font-size: 0.9rem;
}

.zaehler-knopf {
  width: 34px;
  height: 34px;
  border: 1px solid var(--linie-stark);
  border-radius: 50%;
  background: var(--flaeche-2);
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.zaehler-knopf:hover:not(:disabled) {
  border-color: var(--akzent);
  color: var(--akzent);
}

.zaehler-knopf:disabled {
  opacity: 0.35;
  cursor: default;
}

.zaehler-wert {
  min-width: 1.5em;
  text-align: center;
  font-weight: 600;
}

.schalter {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 4px 0;
  padding: 10px 12px;
  border: 1px solid var(--linie);
  border-radius: 10px;
  background: var(--flaeche-2);
  color: var(--text-2);
  font-size: 0.875rem;
  cursor: pointer;
}

.schalter input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--akzent);
}

.meldung {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--akzent-hell);
  color: var(--text-2);
  font-size: 0.92rem;
}

.meldung strong {
  color: var(--text);
}

.meldung-warnung {
  background: var(--warnung-hell);
  color: var(--warnung);
}

.meldung-warnung strong {
  color: var(--warnung);
}

.satz-zeile {
  margin: 0 0 12px;
  color: var(--gedaempft);
}

.satz-zeile strong {
  color: var(--text);
}

.fussnote {
  margin: 12px 0 0;
  font-size: 0.875rem;
  color: var(--gedaempft);
}

/* Hinweise */

.hinweise {
  padding-top: 28px;
  border-top: 1px solid var(--linie);
}

.hinweise ul {
  margin: 0;
  padding-left: 1.2em;
}

.hinweise li {
  margin-bottom: 8px;
  color: var(--text-2);
  font-size: 0.95rem;
}

.hinweise li::marker {
  color: var(--akzent);
}

.tabelle {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.tabelle caption {
  margin-bottom: 8px;
  text-align: left;
  font-weight: 600;
}

.tabelle th,
.tabelle td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--linie);
  vertical-align: top;
  color: var(--text-2);
}

.tabelle th {
  color: var(--gedaempft);
  font-weight: 500;
}

.tabelle td:last-child,
.tabelle th:last-child {
  white-space: nowrap;
}

/* Fuß */

.fuss {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--linie);
  color: var(--gedaempft);
  font-size: 0.85rem;
}

.fuss p {
  margin: 0 0 10px;
}

.fuss a {
  color: inherit;
}

.rechtliches {
  display: flex;
  gap: 20px;
  margin-top: 16px;
}

.rechtliches a {
  color: var(--text);
}

/* Telefone: Karte etwas flacher */

@media (max-width: 639px) {
  .karte {
    height: 260px;
  }
}

/* Desktop: Eingaben und Ergebnisse links, Karte rechts über die volle Höhe */

@media (min-width: 1024px) {
  :root {
    --links: clamp(500px, 45vw, 700px);
  }

  .seite {
    width: var(--links);
    max-width: none;
    margin: 0;
    padding: 48px 40px 40px;
  }

  .kartenbereich {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: var(--links);
    margin: 0;
  }

  .karte {
    height: 100%;
    border: 0;
    border-left: 1px solid var(--linie);
    border-radius: 0;
  }

  .strecke {
    position: absolute;
    top: 20px;
    left: 20px;
    max-width: min(560px, calc(100% - 100px));
    margin: 0;
    padding: 10px 14px;
    border: 1px solid var(--linie-stark);
    border-radius: 12px;
    background: rgba(14, 16, 19, 0.82);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--text-2);
    pointer-events: auto;
  }

  .strecke:empty {
    display: none;
  }
}
