:root {
  --hintergrund: #f6f4ef;
  --flaeche: #ffffff;
  --text: #1d2420;
  --text-leise: #5b665f;
  --linie: #dfdbd1;
  --akzent: #1f5a3d;
  --akzent-text: #ffffff;
  --fehler-hg: #fdecec;
  --fehler-text: #9b1c1c;
  --hinweis-hg: #fff6e0;
  --hinweis-text: #6b4a00;

  --reitweg: #1a7f37;
  --feld_waldweg: #8c6a14;
  --pfad: #3f8f6b;
  --geh_radweg: #7c3aed;
  --nebenstrasse: #2f6fde;
  --landstrasse: #e08a00;
  --hauptstrasse: #d1242f;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --hintergrund: #141816;
    --flaeche: #1c2220;
    --text: #e8ece9;
    --text-leise: #a3aea7;
    --linie: #2f3834;
    --akzent: #5fbf8a;
    --akzent-text: #0d1a13;
    --fehler-hg: #3a1717;
    --fehler-text: #ffb4b4;
    --hinweis-hg: #3a2e10;
    --hinweis-text: #f5d58a;
    color-scheme: dark;
  }
}

/* Design in den Einstellungen fest auf "Dunkel" gestellt */
:root[data-theme="dark"] {
  --hintergrund: #141816;
  --flaeche: #1c2220;
  --text: #e8ece9;
  --text-leise: #a3aea7;
  --linie: #2f3834;
  --akzent: #5fbf8a;
  --akzent-text: #0d1a13;
  --fehler-hg: #3a1717;
  --fehler-text: #ffb4b4;
  --hinweis-hg: #3a2e10;
  --hinweis-text: #f5d58a;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--hintergrund);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  /* App-Gefühl: kein Doppeltipp-Zoom, kein Gummiband-Scrollen, kein Tipp-Blitz */
  touch-action: manipulation;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* Bedienelemente nicht markierbar wie Text */
button,
.leiste,
.kachel,
.segmente,
.chip,
a.knopf,
.fahrt-oben,
.fahrt-unten {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ---------------------------------------------------------------- App-Rahmen */

.app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.inhalt {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.leiste {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  background: var(--flaeche);
  border-top: 1px solid var(--linie);
  padding-bottom: env(safe-area-inset-bottom);
}

.leiste a {
  position: relative;
  flex: 1;
  max-width: 120px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-height: 58px;
  padding: 6px 2px;
  color: var(--text-leise);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
}

.leiste a .symbol {
  width: 24px;
  height: 24px;
}

.leiste a.aktiv {
  color: var(--akzent);
}

.leiste a.aktiv::before {
  content: "";
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--akzent);
}

.punkt-hinweis {
  position: absolute;
  top: 8px;
  right: calc(50% - 16px);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d1242f;
  border: 2px solid var(--flaeche);
}

/* Navi füllt den Inhaltsbereich über der Leiste */
.layout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

[hidden] {
  display: none !important;
}

.kartenbereich {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.karte {
  position: absolute;
  inset: 0;
}

/* Handy: Bedienfeld unten als Blatt */
.panel {
  flex: 0 0 auto;
  max-height: 46vh;
  overflow-y: auto;
  background: var(--flaeche);
  border-top: 1px solid var(--linie);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 18px rgb(0 0 0 / 0.08);
}

/* Größere Bildschirme: Bedienfeld links */
@media (min-width: 800px) {
  .layout {
    flex-direction: row-reverse;
  }
  .panel {
    width: 380px;
    max-height: none;
    border-top: 0;
    border-right: 1px solid var(--linie);
    padding: 20px;
  }
}

.kopf {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.kopf .zurueck {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 20px;
}

.kopf .zurueck:hover {
  background: var(--linie);
}

.kopf h1 {
  margin: 0;
  font-size: 20px;
  color: var(--akzent);
}

.modul {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-leise);
}

.abschnitt {
  margin: 10px 0;
}

.leer,
.laedt {
  margin: 0;
  color: var(--text-leise);
}

.wegpunkte {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wegpunkte li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--linie);
}

.wegpunkte .name {
  flex: 1;
}

.marke,
.wegpunkt {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  background: #ffffff;
  color: #1d2420;
  border: 2px solid #1d2420;
}

.marke.start,
.wegpunkt.start {
  background: var(--reitweg);
  border-color: #ffffff;
  color: #ffffff;
}

.marke.ziel,
.wegpunkt.ziel {
  background: #1d2420;
  border-color: #ffffff;
  color: #ffffff;
}

.wegpunkt {
  cursor: grab;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.35);
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--akzent);
  background: var(--akzent);
  color: var(--akzent-text);
  padding: 7px 14px;
  min-height: 36px;
}

button:disabled {
  opacity: 0.4;
  cursor: default;
}

button.leise,
button.entfernen {
  background: transparent;
  color: var(--text);
  border-color: var(--linie);
}

button.entfernen {
  width: 36px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.aktionen {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.eckdaten {
  display: flex;
  gap: 24px;
  margin-bottom: 10px;
}

.eckdaten .wert {
  display: block;
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.eckdaten .einheit {
  color: var(--text-leise);
  font-size: 13px;
}

.balken {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--linie);
  margin-bottom: 8px;
}

.balken .teil {
  height: 100%;
}

.legende {
  list-style: none;
  margin: 0;
  padding: 0;
}

.legende li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}

.legende .name {
  flex: 1;
}

.legende .meter {
  font-variant-numeric: tabular-nums;
  color: var(--text-leise);
}

.punkt {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.reitweg { background: var(--reitweg); }
.feld_waldweg { background: var(--feld_waldweg); }
.pfad { background: var(--pfad); }
.geh_radweg { background: var(--geh_radweg); }
.nebenstrasse { background: var(--nebenstrasse); }
.landstrasse { background: var(--landstrasse); }
.hauptstrasse { background: var(--hauptstrasse); }

.hinweise {
  margin: 10px 0 0;
  padding: 8px 12px 8px 28px;
  background: var(--hinweis-hg);
  color: var(--hinweis-text);
  border-radius: 8px;
}

.fehler {
  margin: 0;
  padding: 8px 12px;
  background: var(--fehler-hg);
  color: var(--fehler-text);
  border-radius: 8px;
}

.hinweis-recht {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-leise);
}

/* ---------------------------------------------------------------- Übersicht */

.seite {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px calc(32px + env(safe-area-inset-bottom));
}

.seitenkopf h1 {
  margin: 0;
  font-size: 28px;
  color: var(--akzent);
}

.seitenkopf p {
  margin: 4px 0 0;
  color: var(--text-leise);
}

.seitenkopf.mit-symbol {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

.seitenkopf.mit-symbol .symbol {
  width: 44px;
  height: 44px;
  color: var(--akzent);
}

.kacheln {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.kachel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 16px;
  border-radius: 14px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.kachel:hover {
  border-color: var(--akzent);
  transform: translateY(-1px);
}

.kachel .symbol {
  width: 30px;
  height: 30px;
  margin-bottom: 6px;
  color: var(--text-leise);
}

.kachel.aktiv {
  border-color: var(--akzent);
  box-shadow: 0 0 0 1px var(--akzent);
}

.kachel.aktiv .symbol {
  color: var(--akzent);
}

.kachel .titel {
  font-weight: 700;
  font-size: 17px;
}

.kachel .kurz {
  color: var(--text-leise);
  font-size: 14px;
}

.abzeichen {
  align-self: flex-start;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--linie);
  color: var(--text-leise);
  font-size: 12px;
  font-weight: 600;
}

.zurueck {
  color: var(--akzent);
  text-decoration: none;
  font-weight: 600;
}

.karte-hinweis {
  margin-top: 20px;
  padding: 16px;
  border-radius: 14px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
}

.karte-hinweis .abzeichen {
  margin-top: 0;
}

.karte-hinweis h2 {
  margin: 12px 0 6px;
  font-size: 17px;
}

.geplant {
  margin: 0;
  padding-left: 20px;
}

.geplant li {
  margin: 4px 0;
}

/* ---------------------------------------------------------------- Suche */

.suchfelder {
  display: grid;
  gap: 8px;
}

.suchfeld {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.suchzeile {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.suchzeile label {
  flex: 1;
  display: grid;
  gap: 2px;
}

.suchfeld .beschriftung {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-leise);
}

.suchfeld input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--linie);
  background: var(--hintergrund);
  color: var(--text);
  font: inherit;
}

.suchfeld input:focus {
  outline: 2px solid var(--akzent);
  outline-offset: 0;
  border-color: transparent;
}

.treffer {
  position: absolute;
  z-index: 10;
  top: 100%;
  left: 0;
  right: 0;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
}

.treffer button {
  display: grid;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
}

.treffer button:hover {
  background: var(--linie);
}

.treffer .unter {
  font-size: 13px;
  color: var(--text-leise);
}

.treffer-fehler,
.hinweis-klein {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-leise);
}

button.losreiten {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 12px;
}

/* ---------------------------------------------------------------- Fahrt */

.wegpunkt.stopp {
  background: #ffffff;
}

.position {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2f6fde;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 6px rgb(47 111 222 / 0.25), 0 2px 6px rgb(0 0 0 / 0.4);
}

.fahrt-oben,
.fahrt-unten {
  position: absolute;
  left: 12px;
  right: 12px;
  z-index: 5;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
}

.fahrt-oben {
  top: calc(12px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #1f5a3d;
  color: #ffffff;
}

.fahrt-oben.abseits {
  background: #8a4b00;
}

.fahrt-oben .pfeil {
  font-size: 40px;
  line-height: 1;
  min-width: 44px;
  text-align: center;
}

.fahrt-oben .text {
  display: grid;
}

.fahrt-oben strong {
  font-size: 24px;
}

.fahrt-oben span {
  font-size: 16px;
}

.fahrt-unten {
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--flaeche);
}

.fahrt-unten .werte {
  display: flex;
  gap: 18px;
}

.fahrt-unten .wert {
  display: block;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fahrt-unten .einheit {
  font-size: 12px;
  color: var(--text-leise);
}

button.beenden {
  background: #d1242f;
  border-color: #d1242f;
  color: #ffffff;
  font-weight: 700;
}

@media (min-width: 800px) {
  .fahrt-oben,
  .fahrt-unten {
    left: 50%;
    right: auto;
    width: 440px;
    transform: translateX(-50%);
  }
}
/* ---------------------------------------------------------------- Startseite */

.startseite .gruss {
  margin: 0;
  color: var(--text-leise);
  font-weight: 600;
}

.kacheln {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kacheln .breit {
  grid-column: 1 / -1;
}

@media (min-width: 720px) {
  .kacheln {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .kacheln .breit {
    grid-column: span 2;
  }
}

.kachel .kurz {
  font-size: 13px;
}

.kachel.gross {
  background: linear-gradient(135deg, #1f5a3d, #2f7a52);
  border-color: transparent;
  color: #ffffff;
  padding: 20px;
}

.kachel.gross .symbol {
  color: #ffffff;
  width: 36px;
  height: 36px;
}

.kachel.gross .titel {
  font-size: 22px;
}

.kachel.gross .kurz {
  color: rgb(255 255 255 / 0.85);
  font-size: 14px;
  max-width: 420px;
}

.kachel.gross .knopf {
  align-self: flex-start;
  margin-top: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #ffffff;
  color: #1f5a3d;
  font-weight: 700;
}

.kachel.anzeige {
  border-style: dashed;
  background: transparent;
}

.kachel.anzeige:hover {
  transform: none;
  border-color: var(--linie);
}

/* ---------------------------------------------------------------- Formulare */

.leise {
  color: var(--text-leise);
}

.gruppe {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  display: grid;
  gap: 12px;
}

.gruppe h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-leise);
}

.feld {
  display: grid;
  gap: 4px;
}

.feld > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-leise);
}

.feld input,
.feld textarea,
.feld select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--linie);
  background: var(--hintergrund);
  color: var(--text);
  font: inherit;
}

.feld textarea {
  min-height: 70px;
  resize: vertical;
}

.feld input:focus,
.feld textarea:focus,
.feld select:focus {
  outline: 2px solid var(--akzent);
  border-color: transparent;
}

.profilkopf {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profilkopf h1 {
  margin: 0;
  font-size: 24px;
}

.profilkopf p {
  margin: 2px 0 0;
}

.avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--akzent);
  color: var(--akzent-text);
  font-size: 24px;
  font-weight: 700;
  flex: 0 0 auto;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button.chip {
  background: transparent;
  color: var(--text);
  border-color: var(--linie);
  border-radius: 999px;
}

button.chip.gewaehlt {
  background: var(--akzent);
  border-color: var(--akzent);
  color: var(--akzent-text);
}

.werteliste {
  margin: 0;
  display: grid;
  gap: 8px;
}

.werteliste div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.werteliste dt {
  color: var(--text-leise);
}

.werteliste dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.update {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--hintergrund);
}

.update.bereit {
  background: var(--hinweis-hg);
  color: var(--hinweis-text);
  font-weight: 600;
}

.schalter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.schalter .beschreibung {
  display: grid;
}

.schalter .beschreibung span {
  font-size: 13px;
  color: var(--text-leise);
}

.schalter input {
  appearance: none;
  flex: 0 0 auto;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  background: var(--linie);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}

.schalter input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
  transition: transform 0.15s;
}

.schalter input:checked {
  background: var(--akzent);
}

.schalter input:checked::after {
  transform: translateX(20px);
}

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

.segmente {
  display: flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--hintergrund);
  border: 1px solid var(--linie);
}

.segmente button {
  flex: 1;
  background: transparent;
  color: var(--text);
  border: 0;
}

.segmente button.gewaehlt {
  background: var(--akzent);
  color: var(--akzent-text);
}

ul.einfach {
  margin: 0;
  padding-left: 18px;
  color: var(--text-leise);
  font-size: 14px;
}

.offline-hinweis {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--hinweis-hg);
  color: var(--hinweis-text);
  font-size: 12px;
  font-weight: 600;
}
/* ---------------------------------------------------------------- Pferde & Boxenkarten */

.klein {
  font-size: 13px;
}

.seitenkopf.mit-aktion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.knopf-rund {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  color: var(--akzent);
}

.knopf-rund .symbol {
  width: 24px;
  height: 24px;
}

a.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--akzent);
  color: var(--akzent-text);
  text-decoration: none;
  font-weight: 600;
}

a.knopf.leise-knopf {
  background: transparent;
  color: var(--akzent);
  border: 1px solid var(--linie);
}

button.gefahr {
  background: transparent;
  color: #d1242f;
  border-color: #d1242f;
}

.kartenliste {
  list-style: none;
  margin: 0;
  padding: 0;
}

.kartenliste a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--linie);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.kartenliste a .symbol {
  width: 22px;
  height: 22px;
  color: var(--akzent);
}

.kartenliste a .klein {
  margin-left: auto;
  font-weight: 400;
}

.hinweis-box {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--hinweis-hg);
  color: var(--hinweis-text);
}

.mehrzeilig {
  margin: 0;
  white-space: pre-wrap;
}

.umbrechen {
  overflow-wrap: anywhere;
}

.pferdekarte .seitenkopf {
  margin-top: 8px;
}

.weide {
  margin-top: 16px;
  display: grid;
  gap: 2px;
  padding: 16px;
  border-radius: 14px;
  color: #ffffff;
}

.weide strong {
  font-size: 20px;
}

.weide.ja {
  background: #1a7f37;
}

.weide.nein {
  background: #b42318;
}

.weide.eingeschraenkt {
  background: #b25e00;
}

.segmente.klein {
  margin-top: 8px;
}

.segmente.klein button {
  min-height: 34px;
  font-size: 13px;
}

.futterliste {
  margin: 0;
  display: grid;
  gap: 8px;
}

.futterliste div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
}

.futterliste dt {
  font-weight: 700;
}

.futterliste dd {
  margin: 0;
}

.kontakte {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.kontakte li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kontakte li div {
  display: grid;
}

.zeile,
.kontaktzeile {
  display: flex;
  gap: 6px;
  align-items: center;
}

.kontaktzeile {
  flex-wrap: wrap;
}

.zeile input,
.kontaktzeile input {
  flex: 1 1 120px;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--linie);
  background: var(--hintergrund);
  color: var(--text);
  font: inherit;
}

.zeile input.schmal {
  flex: 0 0 90px;
}

.qr-bild {
  width: min(280px, 100%);
  margin: 0 auto;
  background: #ffffff;
  padding: 8px;
  border-radius: 12px;
}

.qr-bild svg {
  display: block;
  width: 100%;
  height: auto;
}

.druckblatt {
  margin-top: 16px;
  padding: 24px;
  border-radius: 14px;
  background: #ffffff;
  color: #000000;
  text-align: center;
  border: 1px solid var(--linie);
}

.druckblatt h1 {
  margin: 0 0 12px;
  font-size: 32px;
}

button.teilen {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

button.teilen .symbol {
  width: 18px;
  height: 18px;
}

.dialog-hintergrund {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(0 0 0 / 0.5);
}

.dialog {
  width: min(380px, 100%);
  padding: 20px;
  border-radius: 16px;
  background: var(--flaeche);
  text-align: center;
}

.dialog h2 {
  margin: 0 0 12px;
}

.dialog .aktionen {
  justify-content: center;
}

/* ---------------------------------------------------------------- Scanner */

.sucher {
  position: relative;
  margin-top: 16px;
  border-radius: 16px;
  overflow: hidden;
  background: #000000;
  aspect-ratio: 3 / 4;
  max-height: 60vh;
}

.sucher video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sucher .rahmen {
  position: absolute;
  inset: 18%;
  border: 3px solid rgb(255 255 255 / 0.85);
  border-radius: 16px;
  box-shadow: 0 0 0 999px rgb(0 0 0 / 0.35);
}

/* ---------------------------------------------------------------- Drucken */

@media print {
  .leiste,
  .nicht-drucken,
  .panel,
  .kartenbereich {
    display: none !important;
  }
  .app,
  .inhalt {
    position: static;
    overflow: visible;
  }
  body {
    background: #ffffff;
  }
  .druckblatt {
    border: 2px dashed #999999;
  }
  .dialog-hintergrund {
    position: static;
    background: none;
  }
  .dialog .aktionen,
  .dialog .leise {
    display: none;
  }
}
/* ---------------------------------------------------------------- Navi: Ausrichtung, Alternativen, Teilen */

.fahrt-knoepfe {
  position: absolute;
  z-index: 5;
  right: 12px;
  top: calc(110px + env(safe-area-inset-top));
  display: grid;
  gap: 8px;
  justify-items: end;
}

button.ausrichtung {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 0;
  background: var(--flaeche);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.25);
}

button.ausrichtung .zeichen {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--akzent);
  color: var(--akzent-text);
  font-size: 12px;
}

@media (min-width: 800px) {
  .fahrt-knoepfe {
    top: calc(120px + env(safe-area-inset-top));
  }
}

.blatt {
  position: absolute;
  z-index: 6;
  left: 12px;
  right: 12px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  padding: 14px;
  border-radius: 16px;
  background: var(--flaeche);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.3);
  display: grid;
  gap: 10px;
}

.blatt h2 {
  margin: 0;
  font-size: 16px;
}

@media (min-width: 800px) {
  .blatt {
    left: 50%;
    right: auto;
    width: 440px;
    transform: translateX(-50%);
  }
}

.routenwahl {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.routenwahl button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: var(--hintergrund);
  color: var(--text);
  border: 1px solid var(--linie);
}

.routenwahl button span {
  color: var(--text-leise);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.routenwahl button.gewaehlt {
  border-color: var(--akzent);
  box-shadow: 0 0 0 1px var(--akzent);
}

.teilen-zeile {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dialog.breit {
  width: min(420px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  display: grid;
  gap: 10px;
}

.feld.links {
  text-align: left;
}

.aktionen.mittig {
  justify-content: center;
}

/* Positionspunkt mit Richtungspfeil */
.position {
  position: relative;
  width: 22px;
  height: 22px;
  background: none;
  border: 0;
  box-shadow: none;
}

.position .punkt {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #2f6fde;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 6px rgb(47 111 222 / 0.25), 0 2px 6px rgb(0 0 0 / 0.4);
}

.position .pfeil {
  display: none;
  position: absolute;
  left: 50%;
  top: -14px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 14px solid #2f6fde;
}

.position.mit-richtung .pfeil {
  display: block;
}

/* Mitreitende auf der Karte */
.mitreiter {
  display: grid;
  justify-items: center;
  gap: 2px;
  pointer-events: none;
}

.mitreiter .kreis {
  order: 2;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--farbe);
  border: 3px solid #ffffff;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.4);
}

.mitreiter .schild {
  order: 1;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--farbe);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.mitreiter.alt {
  opacity: 0.5;
}

/* Zuschauer-Ansicht */
.live-punkt {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #d1242f;
}

.live-punkt::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1242f;
  animation: pulsieren 1.6s infinite;
}

@keyframes pulsieren {
  50% {
    opacity: 0.3;
  }
}

.personen {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.personen li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.personen li div {
  display: grid;
}

.personen strong {
  display: flex;
  align-items: center;
  gap: 6px;
}

.personen .abzeichen {
  margin-top: 0;
}

.farbpunkt {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 50%;
}

.warnung {
  color: #d1242f;
  font-weight: 700;
}
.kurzhinweis {
  padding: 4px 10px;
  border-radius: 8px;
  background: rgb(0 0 0 / 0.75);
  color: #ffffff;
  font-size: 12px;
}
/* Umsehen während der Fahrt: Knopf zurück zur eigenen Position */
.zu-mir {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: calc(100px + env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: #2f6fde;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.3);
}

.zu-mir svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
/* ---------------------------------------------------------------- Nie breiter als der Bildschirm
   Eingabefelder haben (besonders auf dem iPhone) eine eingebaute Mindestbreite.
   Ohne diese Regeln ziehen sie Raster und Zeilen über den Bildschirmrand. */

.gruppe,
.feld,
.suchfelder,
.dialog.breit,
.blatt {
  grid-template-columns: minmax(0, 1fr);
}

.gruppe > *,
.feld > *,
.dialog > *,
.blatt > *,
.suchfeld > *,
.suchzeile > *,
.zeile > *,
.kontaktzeile > * {
  min-width: 0;
}

input,
textarea,
select {
  min-width: 0;
  max-width: 100%;
}

/* In Zeilen bestimmt nur die Flex-Aufteilung die Breite, nicht die Eingabe selbst */
.zeile input,
.kontaktzeile input {
  width: 0;
}

/* 16 px: darunter zoomt iOS beim Antippen in das Feld */
.feld input,
.feld textarea,
.feld select,
.suchfeld input,
.zeile input,
.kontaktzeile input {
  font-size: 16px;
}

.futterliste div {
  grid-template-columns: 90px minmax(0, 1fr);
}

.futterliste dd,
.kartenliste a span,
.personen li div {
  overflow-wrap: anywhere;
}

/* Sicherheitsnetz: Seiten nie seitlich verschiebbar */
.inhalt {
  overflow-x: hidden;
}
/* ---------------------------------------------------------------- Verbotene Abschnitte, Einstufen */

.verbot-box {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--fehler-hg);
  color: var(--fehler-text);
}

.routenwahl button.mit-verbot {
  border-color: #d1242f;
}

.routenwahl button.mit-verbot strong {
  color: #d1242f;
}

.klein-schalter {
  margin-top: 10px;
}

.klein-schalter .beschreibung strong {
  font-size: 14px;
}

p.status {
  margin: 0;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
}

p.status.erlaubt {
  background: rgb(26 127 55 / 0.12);
  color: #1a7f37;
}

p.status.geduldet {
  background: var(--hinweis-hg);
  color: var(--hinweis-text);
}

p.status.verboten {
  background: var(--fehler-hg);
  color: var(--fehler-text);
}

.einstufen {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.einstufen button {
  min-height: 46px;
  font-weight: 700;
  color: #ffffff;
  border: 0;
}

.einstufen .erlaubt {
  background: #1a7f37;
}

.einstufen .geduldet {
  background: #b25e00;
}

.einstufen .verboten {
  background: #b42318;
}
/* ---------------------------------------------------------------- Konto, Pferde, Verwaltung */

.erfolg {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--akzent) 14%, transparent);
  color: var(--text);
}

.anmelden form {
  margin-top: 14px;
}

.chip-zusatz {
  opacity: 0.75;
  font-size: 12px;
}

details.aufklapper {
  margin-top: 12px;
  border: 1px solid var(--linie);
  border-radius: 10px;
  padding: 0 12px;
}

details.aufklapper > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

details.aufklapper > summary::-webkit-details-marker {
  display: none;
}

details.aufklapper > summary::after {
  content: "›";
  margin-left: auto;
  font-size: 20px;
  color: var(--text-leise);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

details.aufklapper[open] > summary::after {
  transform: rotate(90deg);
}

details.aufklapper[open] > :not(summary) {
  padding-bottom: 12px;
  animation: aufklappen 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

dl.angaben {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 6px 16px;
  margin: 0;
}

dl.angaben dt {
  color: var(--text-leise);
}

dl.angaben dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.notizen {
  white-space: pre-wrap;
  margin: 12px 0 0;
}

ul.zugaenge,
ul.nutzerliste {
  list-style: none;
  margin: 0;
  padding: 0;
}

ul.zugaenge li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--linie);
}

ul.zugaenge li > div {
  display: grid;
  min-width: 0;
  flex: 1;
}

ul.zugaenge li span {
  overflow-wrap: anywhere;
}

.suchzeile {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.suchzeile input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--linie);
  background: var(--flaeche);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

li.nutzer {
  margin-bottom: 8px;
  border: 1px solid var(--linie);
  border-radius: 12px;
  background: var(--flaeche);
}

li.nutzer.gesperrt {
  opacity: 0.6;
}

li.nutzer summary {
  display: grid;
  gap: 2px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

li.nutzer summary::-webkit-details-marker {
  display: none;
}

li.nutzer summary span {
  overflow-wrap: anywhere;
}

li.nutzer details > :not(summary) {
  margin-left: 12px;
  margin-right: 12px;
}

li.nutzer .abzeichen {
  margin-top: 0;
  justify-self: start;
}

.abzeichen.warten {
  background: var(--hinweis-hg);
  color: var(--hinweis-text);
}

table.rollentabelle {
  width: calc(100% - 24px);
  border-collapse: collapse;
  font-size: 14px;
}

table.rollentabelle th {
  text-align: left;
  color: var(--text-leise);
  font-weight: 600;
}

table.rollentabelle td,
table.rollentabelle th {
  padding: 4px 6px 4px 0;
  border-bottom: 1px solid var(--linie);
}

table.rollentabelle input {
  width: 20px;
  height: 20px;
}

/* ---------------------------------------------------------------- Bewegung
 *
 * Seitenwechsel wischen in Richtung der Leiste (weiter rechts = von rechts
 * herein), tiefer in einen Bereich ebenso, zurück umgekehrt. Bedienelemente
 * geben beim Antippen leicht nach. Alles aus bei "Bewegung reduzieren".
 */

:root {
  --schwung: cubic-bezier(0.2, 0.8, 0.2, 1);
  --feder: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.inhalt {
  view-transition-name: inhalt;
}

.leiste {
  view-transition-name: leiste;
}

::view-transition-old(inhalt),
::view-transition-new(inhalt) {
  animation-duration: 0.32s;
  animation-timing-function: var(--schwung);
  animation-fill-mode: both;
}

html[data-richtung="vor"]::view-transition-old(inhalt) {
  animation-name: raus-nach-links;
}

html[data-richtung="vor"]::view-transition-new(inhalt) {
  animation-name: rein-von-rechts;
}

html[data-richtung="zurueck"]::view-transition-old(inhalt) {
  animation-name: raus-nach-rechts;
}

html[data-richtung="zurueck"]::view-transition-new(inhalt) {
  animation-name: rein-von-links;
}

html[data-richtung="blende"]::view-transition-old(inhalt) {
  animation-name: ausblenden;
  animation-duration: 0.18s;
}

html[data-richtung="blende"]::view-transition-new(inhalt) {
  animation-name: hochgleiten;
}

/* Ohne View Transitions (ältere Browser): nur die neue Seite gleitet herein */
.inhalt.einblenden[data-richtung="vor"] > * {
  animation: rein-von-rechts 0.32s var(--schwung);
}

.inhalt.einblenden[data-richtung="zurueck"] > * {
  animation: rein-von-links 0.32s var(--schwung);
}

.inhalt.einblenden[data-richtung="blende"] > * {
  animation: hochgleiten 0.32s var(--schwung);
}

@keyframes raus-nach-links {
  to { transform: translateX(-28%); opacity: 0; }
}

@keyframes rein-von-rechts {
  from { transform: translateX(32%); opacity: 0; }
}

@keyframes raus-nach-rechts {
  to { transform: translateX(28%); opacity: 0; }
}

@keyframes rein-von-links {
  from { transform: translateX(-32%); opacity: 0; }
}

@keyframes ausblenden {
  to { opacity: 0; }
}

@keyframes hochgleiten {
  from { transform: translateY(14px); opacity: 0; }
}

@keyframes aufklappen {
  from { transform: translateY(-6px); opacity: 0; }
}

@keyframes huepfen {
  0% { transform: scale(1); }
  40% { transform: scale(1.22) translateY(-2px); }
  100% { transform: scale(1); }
}

@keyframes strich {
  from { transform: scaleX(0); }
}

/* Leiste: aktives Symbol hüpft, der Strich oben wächst auf */
.leiste a {
  transition: color 0.2s, transform 0.15s var(--schwung);
}

.leiste a:active {
  transform: scale(0.9);
}

.leiste a.aktiv .symbol {
  animation: huepfen 0.42s var(--feder);
}

.leiste a.aktiv::before {
  animation: strich 0.3s var(--schwung);
}

/* Antippen: Knöpfe, Kacheln und Chips geben nach */
button,
a.knopf,
.kachel,
.knopf-rund,
.kartenliste a {
  transition:
    transform 0.16s var(--schwung),
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s,
    box-shadow 0.2s;
}

button:active:not(:disabled),
a.knopf:active,
.knopf-rund:active {
  transform: scale(0.96);
}

.kachel:active {
  transform: scale(0.97);
}

.kartenliste a:active {
  transform: translateX(4px);
}

button.chip.gewaehlt {
  animation: huepfen 0.32s var(--feder);
}

/* Inhalte erscheinen gestaffelt statt auf einen Schlag */
.kacheln > *,
.kartenliste li,
ul.zugaenge li,
li.nutzer,
.seite > .gruppe {
  animation: hochgleiten 0.42s var(--schwung) both;
}

.kacheln > :nth-child(2), .kartenliste li:nth-child(2), ul.zugaenge li:nth-child(2), li.nutzer:nth-child(2), .seite > .gruppe:nth-of-type(2) { animation-delay: 0.04s; }
.kacheln > :nth-child(3), .kartenliste li:nth-child(3), ul.zugaenge li:nth-child(3), li.nutzer:nth-child(3), .seite > .gruppe:nth-of-type(3) { animation-delay: 0.08s; }
.kacheln > :nth-child(4), .kartenliste li:nth-child(4), ul.zugaenge li:nth-child(4), li.nutzer:nth-child(4), .seite > .gruppe:nth-of-type(4) { animation-delay: 0.12s; }
.kacheln > :nth-child(5), .kartenliste li:nth-child(5), ul.zugaenge li:nth-child(5), li.nutzer:nth-child(5), .seite > .gruppe:nth-of-type(5) { animation-delay: 0.16s; }
.kacheln > :nth-child(n + 6), .kartenliste li:nth-child(n + 6), ul.zugaenge li:nth-child(n + 6), li.nutzer:nth-child(n + 6), .seite > .gruppe:nth-of-type(n + 6) { animation-delay: 0.2s; }

/* Meldungen schieben sich herein */
.fehler,
.erfolg {
  animation: hochgleiten 0.3s var(--schwung);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* Checkbox mit Text daneben (nicht als großes Eingabefeld) */
.haken {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}

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

/* ---------------------------------------------------------------- Verwaltung, Recht, Hinweise */

.hinweisleiste {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: color-mix(in srgb, var(--akzent) 16%, var(--flaeche));
  border-bottom: 1px solid var(--linie);
  font-size: 14px;
  animation: hochgleiten 0.3s var(--schwung);
}

.hinweisleiste + .hinweisleiste {
  padding-top: 8px;
}

.hinweisleiste.warnung,
.hinweisleiste.wartung {
  background: var(--hinweis-hg);
  color: var(--hinweis-text);
}

.hinweisleiste a,
.hinweisleiste span {
  flex: 1;
  min-width: 0;
  color: inherit;
}

.hinweisleiste button.schliessen {
  flex: none;
  min-height: 32px;
  width: 32px;
  padding: 0;
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 20px;
}

.seite.verwaltung {
  max-width: 1100px;
}

nav.reiter {
  display: flex;
  gap: 6px;
  margin: 12px 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

nav.reiter::-webkit-scrollbar {
  display: none;
}

nav.reiter a {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--linie);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

nav.reiter a.aktiv {
  background: var(--akzent);
  border-color: var(--akzent);
  color: var(--akzent-text);
}

ul.kennzahlen {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

ul.kennzahlen li {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--linie);
  background: var(--hintergrund);
}

ul.kennzahlen li.hinweis {
  border-color: var(--hinweis-text);
  background: var(--hinweis-hg);
}

ul.kennzahlen .wert {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

ul.kennzahlen .name {
  font-size: 13px;
  color: var(--text-leise);
}

.aktionen.rechts {
  justify-content: flex-end;
  margin-top: 0;
}

.aktionen.klebend {
  position: sticky;
  bottom: 0;
  padding: 10px 0;
  background: linear-gradient(transparent, var(--hintergrund) 30%);
}

li.nutzer > a {
  display: grid;
  gap: 2px;
  padding: 12px;
  color: var(--text);
  text-decoration: none;
}

li.nutzer > a .abzeichen,
li.meldung .abzeichen {
  justify-self: start;
  margin-top: 0;
}

li.meldung {
  display: grid;
  gap: 8px;
  padding: 12px;
}

li.meldung > div:first-child {
  display: grid;
  gap: 2px;
}

li.meldung .aktionen {
  margin-top: 0;
}

.abzeichen.stufe-verboten {
  background: var(--fehler-hg);
  color: var(--fehler-text);
}

.abzeichen.stufe-geduldet {
  background: var(--hinweis-hg);
  color: var(--hinweis-text);
}

.abzeichen.stufe-erlaubt,
.abzeichen.geprueft {
  background: color-mix(in srgb, var(--akzent) 18%, transparent);
  color: var(--akzent);
}

.linkfeld {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.linkfeld input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--linie);
  background: var(--hintergrund);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

ul.protokoll {
  list-style: none;
  margin: 0;
  padding: 0;
}

ul.protokoll li {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--linie);
  overflow-wrap: anywhere;
}

ul.artikelliste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

ul.artikelliste a {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--linie);
  background: var(--flaeche);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.16s var(--schwung), border-color 0.2s;
}

ul.artikelliste a:active {
  transform: scale(0.98);
}

ul.artikelliste .abzeichen {
  justify-self: start;
}

.kategorie {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--akzent);
}

.pruefvermerk {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--hinweis-hg);
  color: var(--hinweis-text);
  font-size: 14px;
}

.pruefvermerk.geprueft {
  background: color-mix(in srgb, var(--akzent) 14%, transparent);
  color: var(--text);
}

.seite.artikel {
  max-width: 760px;
}

article.text {
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

article.text h2 {
  margin: 28px 0 8px;
  font-size: 20px;
}

article.text h3 {
  margin: 20px 0 6px;
  font-size: 17px;
}

article.text ul,
article.text ol {
  padding-left: 22px;
}

article.text li {
  margin: 4px 0;
}

article.text table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  font-size: 14px;
}

article.text th,
article.text td {
  padding: 6px 8px;
  border: 1px solid var(--linie);
  text-align: left;
  vertical-align: top;
}

article.text blockquote {
  margin: 12px 0;
  padding: 4px 14px;
  border-left: 3px solid var(--akzent);
  color: var(--text-leise);
}

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

article.vorschau {
  padding: 12px;
  border: 1px dashed var(--linie);
  border-radius: 10px;
  min-height: 200px;
}

textarea.markdown {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--linie);
  background: var(--hintergrund);
  color: var(--text);
  font: 14px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  resize: vertical;
}

.kachel.aus {
  opacity: 0.55;
}

/* ---------------------------------------------------------------- Navi: Blatt zum Hochziehen
   Handy: Das Bedienfeld liegt unten über der Karte. Zu: nur die Suchzeile
   (und kurz die Route). Hochziehen am Griff: Überschrift, Start und der Rest
   blenden nacheinander ein. Die Klassen offen/oeffnet/schliesst/bewegt setzt blatt.js. */

.blatt-griff {
  touch-action: none;
}

.griff-balken {
  display: block;
  width: 44px;
  height: 5px;
  margin: 0 auto;
  border-radius: 3px;
  background: color-mix(in srgb, var(--text) 22%, transparent);
  transition: width 0.2s var(--schwung), background-color 0.2s;
}

.blatt-griff:active .griff-balken {
  width: 56px;
  background: color-mix(in srgb, var(--text) 40%, transparent);
}

.panel .offline-hinweis {
  display: inline-block;
  margin: 0 0 8px;
}

.routenpunkte {
  position: relative;
  display: grid;
  gap: 8px;
  padding-right: 48px;
}

.routenpunkt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-radius: 12px;
  background: var(--flaeche);
}

.routenpunkt .suchfeld {
  flex: 1 1 auto;
  min-width: 0;
}

.routenpunkt .marke,
.routenpunkt .lupe {
  flex: none;
  margin-top: 10px;
}

.routenpunkt .lupe {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--text-leise);
}

.routenpunkt .lupe .symbol {
  width: 22px;
  height: 22px;
}

/* Beschriftung nur für Screenreader, die Marke zeigt die Rolle */
.routenpunkt .beschriftung {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.routenpunkt .suchfeld input {
  min-height: 46px;
  border-radius: 12px;
}

.zeilen-knopf,
.zeilen-griff {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-leise);
}

button.zeilen-knopf {
  background: transparent;
  color: var(--text-leise);
}

.zeilen-knopf .symbol,
.zeilen-griff .symbol {
  width: 20px;
  height: 20px;
}

.zeilen-griff {
  display: none;
  cursor: grab;
  touch-action: none;
}

.routenpunkte.sortierbar .zeilen-griff {
  display: grid;
}

.routenpunkt.zieht {
  z-index: 3;
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.22);
}

.routenpunkt.zieht .zeilen-griff {
  cursor: grabbing;
  color: var(--akzent);
}

.routenpunkt.neu {
  animation: hochgleiten 0.3s var(--schwung);
}

/* Start und Ziel tauschen: rechts neben der Liste */
button.tauschen {
  position: absolute;
  right: 0;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  background: var(--flaeche);
  color: var(--akzent);
  border: 1px solid var(--linie);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.08);
}

button.tauschen .symbol {
  width: 20px;
  height: 20px;
  transition: transform 0.35s var(--feder);
}

button.tauschen:active:not(:disabled) .symbol {
  transform: rotate(180deg);
}

/* Vorschläge im Blatt: im Fluss statt darüber schwebend */
.panel .treffer {
  position: static;
  margin: 6px 0 2px;
  box-shadow: none;
  animation: aufklappen 0.2s var(--schwung);
}

.treffer button {
  grid-template-columns: 22px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  min-height: 48px;
}

.treffer button .symbol {
  grid-row: span 2;
  width: 20px;
  height: 20px;
  color: var(--text-leise);
}

.treffer button.mein-standort .symbol {
  color: #2f6fde;
}

.treffer button.mein-standort .titel {
  font-weight: 600;
}

/* Kurzinfo im zugeklappten Blatt */
.blatt-kurz {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  animation: hochgleiten 0.3s var(--schwung);
}

.kurz-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
}

.kurz-text strong {
  font-size: 18px;
}

.kurz-verbot {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #b42318;
}

.fehler-text {
  color: #b42318;
  font-size: 14px;
}

button.losreiten.klein {
  width: auto;
  min-width: 108px;
  margin: 0;
  min-height: 46px;
  font-size: 17px;
}

.punkt-aktionen {
  margin-top: 10px;
}

button.mit-symbol {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

button.mit-symbol .symbol {
  width: 18px;
  height: 18px;
}

@keyframes blatt-ein {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
}

@media (max-width: 799px) {
  .layout .panel {
    position: absolute;
    z-index: 6;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: calc(100% - 72px - env(safe-area-inset-top));
    border-top: 0;
    border-radius: 20px 20px 0 0;
    padding: 0 16px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 30px rgb(0 0 0 / 0.18);
    overscroll-behavior: contain;
  }

  /* Die Karte endet unter dem zugeklappten Blatt (die runden Ecken überlappen). */
  .layout .karte {
    bottom: max(0px, calc(var(--blatt, 0px) - 20px));
  }

  .layout.unterwegs .karte {
    bottom: 0;
  }

  /* Griff: ganze Breite und gut 40 px hoch, auch für dicke Finger */
  .blatt-griff {
    position: sticky;
    top: 0;
    z-index: 4;
    margin: 0 -16px 4px;
    padding: 12px 16px 14px;
    background: var(--flaeche);
    cursor: grab;
  }

  .panel.offen .blatt-griff {
    padding-bottom: 4px;
  }

  .blatt-griff .kopf {
    margin: 10px 0 2px;
  }

  .panel.bewegt {
    overflow: hidden;
  }

  .panel:not(.offen) .nur-offen {
    display: none !important;
  }

  .panel:not(.offen) .routenpunkte {
    padding-right: 0;
  }

  .panel:not(.offen) .routenpunkt.ziel .zeilen-griff {
    display: none;
  }

  /* Zu: so flach wie möglich, damit viel Karte zu sehen ist (Griffbalken,
     Suchzeile, kaum Rand). Hochziehen geht auch an der Suchzeile selbst. */
  .panel:not(.offen) {
    padding-bottom: calc(5px + env(safe-area-inset-bottom));
  }

  .panel:not(.offen) .blatt-griff {
    margin-bottom: 0;
    padding-top: 5px;
    padding-bottom: 4px;
  }

  .panel:not(.offen) .suchzeile {
    margin-bottom: 0;
  }

  .panel:not(.offen) .routenpunkt.ziel {
    touch-action: none;
  }

  .panel:not(.offen) .routenpunkt.ziel input,
  .panel:not(.offen) .routenpunkt.ziel .zeilen-knopf {
    min-height: 40px;
    height: 40px;
  }

  .panel:not(.offen) .routenpunkt .lupe {
    margin-top: 7px;
  }

  .panel:not(.offen) .blatt-kurz {
    margin-top: 6px;
  }

  /* Beim Ziehen folgt der Inhalt der Zughöhe (--zug 0..1 setzt blatt.js),
     von oben nach unten leicht versetzt. */
  .panel .nur-offen {
    transition:
      opacity 0.2s,
      transform 0.25s var(--schwung);
  }

  .panel.zieht .nur-offen {
    transition: none;
    animation: none;
    opacity: clamp(0, calc(var(--zug, 1) * 1.8 - var(--i, 0) * 0.2), 1);
    transform: translateY(calc((1 - var(--zug, 1)) * (28px + var(--i, 0) * 10px)));
  }

  .panel.oeffnet .nur-offen {
    animation: blatt-ein 0.4s var(--schwung) both;
    animation-delay: calc(var(--i, 0) * 55ms + 60ms);
  }

  .panel.schliesst .nur-offen {
    opacity: 0;
    transition: opacity 0.14s;
  }

  .panel.offen .nur-zu {
    display: none !important;
  }
}

@media (min-width: 800px) {
  .griff-balken,
  .nur-zu {
    display: none !important;
  }
}

/* ---------------------------------------------------------------- Leiste gleitet weg
   Im Navi mit Ziel, beim Reiten und solange ein Dialog offen ist. */

.leiste {
  transition:
    transform 0.34s var(--schwung),
    margin-bottom 0.34s var(--schwung),
    opacity 0.34s;
}

.leiste.weg,
.app:has(.dialog-hintergrund) .leiste {
  transform: translateY(100%);
  margin-bottom: calc(-59px - env(safe-area-inset-bottom));
  opacity: 0;
  pointer-events: none;
}

/* ---------------------------------------------------------------- Dialoge auf dem Handy: Blatt von unten */

@media (max-width: 799px) {
  .dialog-hintergrund {
    place-items: end stretch;
    padding: calc(24px + env(safe-area-inset-top)) 0 0;
    animation: einblenden-hg 0.25s ease-out;
  }

  .dialog,
  .dialog.breit {
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 20px 20px 0 0;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
    animation: dialog-hoch 0.34s var(--schwung);
  }

  .dialog::before {
    content: "";
    display: block;
    width: 44px;
    height: 5px;
    margin: -8px auto 10px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--text) 22%, transparent);
  }
}

@keyframes einblenden-hg {
  from {
    opacity: 0;
  }
}

@keyframes dialog-hoch {
  from {
    transform: translateY(60%);
    opacity: 0;
  }
}

/* Ritt teilen: kompakt, damit alles ohne Scrollen passt */
.teilen-dialog .qr-bild {
  width: min(200px, 52vw);
}

.teilen-dialog p,
.teilen-dialog .aktionen {
  margin: 0;
}

button.gefahr.dezent {
  background: transparent;
  color: #b42318;
  border-color: transparent;
  min-height: 40px;
  font-size: 14px;
}

/* ---------------------------------------------------------------- Oberer Rand (iPhone)
   Die App reicht bis unter Statusleiste und Dynamic Island (Vollbild). iOS
   zeichnet die Uhr dort immer weiß. Darum liegen nur hinter Uhr (links) und
   Akku (rechts) zwei kleine weiche Schatten, sonst nichts:
   - Navi: Die Karte geht bis ganz oben.
   - Seiten: Seitenhintergrund bis oben; was man nach oben scrollt,
     verschwindet sauber hinter einem Streifen in Seitenfarbe (ohne
     Weichzeichner, oben bleibt alles klar). */

.inhalt {
  padding-top: env(safe-area-inset-top);
}

.hinweisleiste ~ .inhalt {
  padding-top: 0;
}

:root {
  --uhr-schatten:
    radial-gradient(ellipse 58px 21px at 16% 55%, rgb(0 0 0 / 0.3), rgb(0 0 0 / 0) 72%),
    radial-gradient(ellipse 62px 21px at 84% 55%, rgb(0 0 0 / 0.3), rgb(0 0 0 / 0) 72%);
}

.app::before {
  content: "";
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  height: env(safe-area-inset-top);
  background: var(--uhr-schatten), var(--hintergrund);
  pointer-events: none;
}

.app:has(.layout)::before {
  background: var(--uhr-schatten);
}

.app:has(.hinweisleiste)::before {
  display: none;
}

.maplibregl-ctrl-top-right,
.maplibregl-ctrl-top-left {
  top: env(safe-area-inset-top);
}

/* Eigenes × zum Löschen, das des Browsers ausblenden */
.routenpunkt input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  display: none;
}

/* ---------------------------------------------------------------- Ritte (Aufzeichnung) */

:root {
  --gang-halt: #8a958f;
  --gang-schritt: #2f80ed;
  --gang-trab: #e0a100;
  --gang-galopp: #d1242f;
}

.gang-halt { background: var(--gang-halt); }
.gang-schritt { background: var(--gang-schritt); }
.gang-trab { background: var(--gang-trab); }
.gang-galopp { background: var(--gang-galopp); }

/* Roter Aufnahmepunkt, pulsiert sanft */
.aufnahme-punkt {
  display: inline-block;
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d1242f;
  box-shadow: 0 0 0 0 rgb(209 36 47 / 0.5);
  animation: aufnahme-puls 1.6s ease-out infinite;
}

@keyframes aufnahme-puls {
  0% { box-shadow: 0 0 0 0 rgb(209 36 47 / 0.55); }
  70% { box-shadow: 0 0 0 10px rgb(209 36 47 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(209 36 47 / 0); }
}

.ritt-start,
.ritt-laeuft {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 0;
  padding: 16px 18px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.15s ease;
}

.ritt-start {
  justify-content: center;
  font-size: 18px;
  background: var(--akzent);
  color: var(--akzent-text);
}

.ritt-start .aufnahme-punkt {
  background: currentColor;
  animation: none;
}

.ritt-laeuft {
  background: var(--flaeche);
  color: var(--text);
  border: 2px solid #d1242f;
}

.ritt-laeuft .text {
  flex: 1;
  display: grid;
}

.ritt-laeuft .text span {
  font-weight: 400;
  color: var(--text-leise);
}

.ritt-laeuft .pfeil {
  font-size: 26px;
  color: var(--text-leise);
}

.ritt-start:active,
.ritt-laeuft:active,
.ritt-zeile:active {
  transform: scale(0.98);
}

.ritt-summen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.ritt-summe {
  display: grid;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
}

.ritt-summe .einheit {
  font-size: 13px;
  color: var(--text-leise);
}

.ritt-summe .wert {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ritt-summe .leise {
  font-size: 13px;
}

.ritt-hinweis {
  list-style: none;
  padding: 10px 12px;
}

.ritt-liste {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.ritt-liste li {
  animation: ritt-einblenden 0.35s ease-out both;
}

.ritt-liste li:nth-child(2) { animation-delay: 0.04s; }
.ritt-liste li:nth-child(3) { animation-delay: 0.08s; }
.ritt-liste li:nth-child(4) { animation-delay: 0.12s; }
.ritt-liste li:nth-child(n + 5) { animation-delay: 0.16s; }

@keyframes ritt-einblenden {
  from { opacity: 0; transform: translateY(8px); }
}

.ritt-zeile {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease;
}

.ritt-kopf {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.ritt-kopf .leise {
  font-size: 13px;
  white-space: nowrap;
}

.ritt-werte {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  color: var(--text-leise);
}

.ritt-werte .wert {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ritt-pferd {
  font-weight: 600;
  color: var(--akzent);
}

.ritt-werte .abzeichen {
  position: static;
}

.gangbalken {
  height: 8px;
  margin: 2px 0 0;
}

.gangbalken .teil {
  width: var(--breite);
  animation: balken-wachsen 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes balken-wachsen {
  from { width: 0; }
}

.leer-hinweis {
  margin: 24px 0;
  text-align: center;
  color: var(--text-leise);
}

button.mehr-laden {
  display: block;
  margin: 16px auto 0;
}

/* Kachel auf der Startseite */
.ritte-kachel {
  position: relative;
}

.ritte-kachel .aufnahme-punkt {
  position: absolute;
  top: 14px;
  right: 14px;
}

.ritte-kachel.laeuft {
  border-color: #d1242f;
}

/* Aufzeichnen: Karte mit Werten darüber */
.aufnahme-oben,
.aufnahme-unten {
  position: absolute;
  left: 12px;
  right: 12px;
  z-index: 5;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
}

.aufnahme-oben {
  top: calc(12px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--flaeche);
}

.aufnahme-oben .tempo {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.aufnahme-oben.pausiert .gang-chip {
  background: var(--gang-halt);
}

.aufnahme-oben.pausiert .tempo {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-leise);
  text-align: right;
}

.gang-chip {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  /* Neue Gangart: kurz aufploppen */
  animation: gang-wechsel 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

@keyframes gang-wechsel {
  from { transform: scale(0.7); opacity: 0.4; }
}

.aufnahme-fehler {
  position: absolute;
  z-index: 5;
  top: calc(84px + env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--fehler-hg);
  color: var(--fehler-text);
}

.aufnahme-unten {
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--flaeche);
}

.aufnahme-unten .werte {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.aufnahme-unten .wert {
  display: block;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.aufnahme-unten .einheit {
  font-size: 12px;
  color: var(--text-leise);
}

.aufnahme-knoepfe {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.aufnahme-knoepfe button {
  min-height: 48px;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
}

.aufnahme-start h1 {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--akzent);
}

.aufnahme-start .zurueck {
  display: block;
  margin-top: 12px;
  text-align: center;
}

.dialog .aktionen.spalte {
  display: grid;
  gap: 8px;
}

button.verwerfen {
  color: #d1242f;
}

.aufnahme-abzeichen {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--flaeche);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.25);
}

@media (min-width: 800px) {
  .aufnahme-oben,
  .aufnahme-unten {
    left: 50%;
    right: auto;
    width: 440px;
    transform: translateX(-50%);
  }
}

/* Auswertung eines Ritts */
.ritt-karte {
  position: relative;
  height: 42vh;
  min-height: 240px;
}

.zurueck-schwebend {
  position: absolute;
  z-index: 5;
  top: calc(12px + env(safe-area-inset-top));
  left: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--flaeche);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.25);
}

.ritt-seite .seite {
  padding-top: 16px;
}

.ritt-titel h1 {
  margin: 0;
  font-size: 24px;
  color: var(--akzent);
}

.ritt-titel p {
  margin: 2px 0 0;
}

.ritt-zahlen {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 14px 12px;
  margin: 16px 0;
}

.ritt-zahlen > div {
  display: grid;
  animation: ritt-einblenden 0.4s ease-out both;
}

.ritt-zahlen .wert {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ritt-zahlen .wert.klein {
  font-size: 16px;
}

.ritt-zahlen .einheit {
  font-size: 13px;
  color: var(--text-leise);
}

.gang-legende .punkt {
  flex: 0 0 auto;
}

/* ---------------------------------------------------------------- Pferdekalender
   Tagesansicht mit Zeitleiste (48 px je Stunde, siehe PX_MIN in kalender.rs),
   Formular und Details als Blatt, Einstellungen mit Sicht-Matrix. */

:root {
  --art-buchung: #2f6fde;
  --art-tierarzt: #d1242f;
  --art-hufschmied: #8c6a14;
  --art-training: #7c3aed;
  --art-sperre: #5b665f;
  --art-info: #0f766e;
  --art-sonstiges: #c2410c;
  --art-belegt: #8a918c;
}

.kalender-kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 12px;
}

.kalender-kopf h1 {
  margin: 0;
}

.kalender-kopf p {
  margin: 2px 0 0;
}

a.knopf.klein-knopf,
button.klein-knopf {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 14px;
  width: auto;
  white-space: nowrap;
}

.wochenleiste {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.wochentag {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 0;
  padding: 6px 0 4px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  transition:
    background-color 0.2s,
    transform 0.15s var(--schwung);
}

.wochentag:active {
  transform: scale(0.94);
}

.wochentag .kurz {
  font-size: 12px;
  color: var(--text-leise);
}

.wochentag .zahl {
  font-size: 17px;
  font-weight: 600;
}

.wochentag.heute .zahl {
  color: var(--akzent);
}

.wochentag.gewaehlt {
  background: var(--akzent);
  color: var(--akzent-text);
}

.wochentag.gewaehlt .kurz,
.wochentag.gewaehlt .zahl {
  color: var(--akzent-text);
}

.wochentag .punkt {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: transparent;
}

.wochentag .punkt.sichtbar {
  background: currentColor;
  opacity: 0.7;
}

.tag-steuerung {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tag-steuerung button {
  width: auto;
  min-width: 48px;
}

.zeitleiste {
  position: relative;
  height: min(62vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--linie);
  border-radius: 16px;
  background: var(--flaeche);
  cursor: copy;
}

.zeitleiste-innen {
  position: relative;
  height: 1152px;
}

.stunde {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--linie);
  pointer-events: none;
}

.stunde span {
  position: absolute;
  top: 2px;
  left: 8px;
  font-size: 12px;
  color: var(--text-leise);
  font-variant-numeric: tabular-nums;
}

.ruhezeit {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    -45deg,
    color-mix(in srgb, var(--text) 5%, transparent) 0 6px,
    transparent 6px 12px
  );
}

.jetzt-linie {
  position: absolute;
  left: 44px;
  right: 0;
  z-index: 3;
  border-top: 2px solid var(--art-tierarzt);
  pointer-events: none;
}

.jetzt-linie::before {
  content: "";
  position: absolute;
  left: -5px;
  top: -6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--art-tierarzt);
}

.zeitleiste .termin {
  --farbe: var(--art-sonstiges);
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-height: 0;
  margin: 0;
  padding: 4px 8px;
  overflow: hidden;
  border: 0;
  border-left: 4px solid var(--farbe);
  border-radius: 8px;
  background: color-mix(in srgb, var(--farbe) 16%, var(--flaeche));
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  animation: termin-ein 0.32s var(--schwung) both;
  transition: transform 0.15s var(--schwung);
}

.zeitleiste .termin:active {
  transform: scale(0.98);
}

.zeitleiste .termin span {
  color: var(--text-leise);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.zeitleiste .termin.kurz {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding-top: 1px;
  padding-bottom: 1px;
}

@keyframes termin-ein {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

.termin.art-buchung { --farbe: var(--art-buchung); }
.termin.art-tierarzt { --farbe: var(--art-tierarzt); }
.termin.art-hufschmied { --farbe: var(--art-hufschmied); }
.termin.art-training { --farbe: var(--art-training); }
.termin.art-sperre { --farbe: var(--art-sperre); }
.termin.art-info { --farbe: var(--art-info); }
.termin.art-sonstiges { --farbe: var(--art-sonstiges); }

.zeitleiste .termin.belegt {
  --farbe: var(--art-belegt);
  background: repeating-linear-gradient(
    -45deg,
    color-mix(in srgb, var(--farbe) 22%, var(--flaeche)) 0 8px,
    color-mix(in srgb, var(--farbe) 12%, var(--flaeche)) 8px 16px
  );
}

.zeitleiste .termin.angefragt {
  border: 2px dashed var(--farbe);
  border-left-width: 4px;
  background: color-mix(in srgb, var(--farbe) 8%, var(--flaeche));
}

.zeitleiste .termin.abgesagt {
  opacity: 0.55;
  background: transparent;
  border-left-style: dotted;
}

.zeitleiste .termin.abgesagt strong {
  text-decoration: line-through;
}

.knopf-neu {
  position: fixed;
  right: 20px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  z-index: 8;
  width: 56px;
  height: 56px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  font-size: 30px;
  line-height: 1;
  box-shadow: 0 8px 22px rgb(0 0 0 / 0.25);
  animation: knopf-ploppen 0.4s var(--schwung) both;
}

@keyframes knopf-ploppen {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
}

/* Formular und Details */

.art-wahl {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.art-wahl .chip {
  --farbe: var(--art-sonstiges);
  border-color: color-mix(in srgb, var(--farbe) 45%, var(--linie));
}

.art-wahl .chip.gewaehlt {
  background: var(--farbe);
  border-color: var(--farbe);
  color: #fff;
}

.chip.art-buchung { --farbe: var(--art-buchung); }
.chip.art-tierarzt { --farbe: var(--art-tierarzt); }
.chip.art-hufschmied { --farbe: var(--art-hufschmied); }
.chip.art-training { --farbe: var(--art-training); }
.chip.art-sperre { --farbe: var(--art-sperre); }
.chip.art-info { --farbe: var(--art-info); }
.chip.art-sonstiges { --farbe: var(--art-sonstiges); }

.zeit-felder {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
}

.pruef-zeile {
  min-height: 28px;
  margin: 2px 0 10px;
  font-size: 15px;
}

.pruef-zeile .frei {
  color: var(--akzent);
  font-weight: 600;
  animation: hochgleiten 0.25s var(--schwung);
}

.pruef-zeile .konflikt {
  display: grid;
  gap: 6px;
  animation: konflikt-wackeln 0.36s ease-in-out;
}

@keyframes konflikt-wackeln {
  20%,
  60% {
    transform: translateX(-4px);
  }
  40%,
  80% {
    transform: translateX(4px);
  }
}

button.vorschlag {
  justify-self: start;
  width: auto;
  min-height: 36px;
  padding: 6px 12px;
  font-size: 14px;
}

.konflikt-box {
  margin: 10px 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--fehler-hg);
  color: var(--fehler-text);
}

.konflikt-box p,
.konflikt-box ul {
  margin: 0 0 8px;
}

.termin-details .streifen {
  display: inline-block;
  margin: 0 0 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--farbe, var(--art-belegt));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.termin-details .streifen.belegt {
  --farbe: var(--art-belegt);
}

.termin-details h2 {
  margin: 4px 0 2px;
}

.status-zeile {
  font-weight: 600;
  color: var(--hinweis-text);
}

.absagen-box {
  animation: hochgleiten 0.25s var(--schwung);
}

/* Übersicht */

.zaehler {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--art-tierarzt);
  color: #fff;
  font-size: 13px;
  vertical-align: middle;
}

.nachrichten,
.terminliste ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nachrichten li a {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--linie);
  color: inherit;
  text-decoration: none;
}

.nachrichten li.neu a {
  font-weight: 600;
}

.nachrichten li.neu a::before {
  content: "";
  justify-self: start;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--art-tierarzt);
}

.terminliste h3 {
  margin: 14px 0 6px;
  font-size: 14px;
  color: var(--text-leise);
}

.terminliste li {
  --farbe: var(--art-sonstiges);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  border-left: 4px solid var(--farbe);
  border-radius: 10px;
  background: color-mix(in srgb, var(--farbe) 10%, var(--flaeche));
}

.terminliste li.belegt {
  --farbe: var(--art-belegt);
}

.terminliste li.abgesagt {
  opacity: 0.6;
}

.terminliste li.abgesagt .was {
  text-decoration: line-through;
}

.terminliste li.angefragt {
  border-left-style: dashed;
}

.terminliste li a {
  flex: 1 1 auto;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  color: inherit;
  text-decoration: none;
}

.terminliste .zeit {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.terminliste .status {
  font-size: 13px;
  color: var(--hinweis-text);
}

.terminliste li button {
  margin-right: 8px;
}

/* Einstellungen */

.regel-raster {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
  margin-top: 8px;
}

.sicht-gruppe {
  border-top: 1px solid var(--linie);
}

.sicht-gruppe summary {
  padding: 12px 0;
  font-weight: 600;
  cursor: pointer;
}

.sicht-gruppe[open] summary {
  color: var(--akzent);
}

.sicht-tabelle {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
}

.sicht-tabelle th {
  padding: 6px 8px 6px 0;
  font-weight: 500;
  text-align: left;
}

.sicht-tabelle td {
  padding: 4px 0;
}

.umschalter {
  display: inline-flex;
  padding: 2px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.umschalter button {
  width: auto;
  min-height: 32px;
  padding: 4px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-leise);
  font-size: 14px;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.umschalter button.gewaehlt {
  background: var(--flaeche);
  color: var(--text);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.15);
}

label.eintragen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  font-size: 14px;
  white-space: nowrap;
}

.sicht-person {
  border-top: 1px solid var(--linie);
  padding-top: 4px;
}

.aktionen.kleben {
  position: sticky;
  bottom: calc(68px + env(safe-area-inset-bottom));
  z-index: 5;
  align-items: center;
  padding: 10px 0;
  background: var(--hintergrund);
}

.erfolg-text {
  color: var(--akzent);
  font-weight: 600;
  animation: hochgleiten 0.25s var(--schwung);
}

@media (max-width: 420px) {
  .zeit-felder {
    grid-template-columns: 1fr 1fr;
  }

  .zeit-felder .feld:first-child {
    grid-column: 1 / -1;
  }

  .regel-raster {
    grid-template-columns: 1fr;
  }

  .sicht-tabelle th {
    font-size: 14px;
  }
}

/* ---------------------------------------------------------------- Pin per langem Drücken
   Beim Drücken füllt sich ein Ring unter dem Finger (0,5 s), dann fällt der
   Pin herunter. Kurzes Tippen setzt nichts. (Klassen setzt karte.js.) */

.druck-ring {
  position: absolute;
  z-index: 3;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  border: 3px solid var(--akzent);
  background: color-mix(in srgb, var(--akzent) 18%, transparent);
  pointer-events: none;
  animation: druck-ring 0.5s linear forwards;
}

@keyframes druck-ring {
  from {
    transform: scale(0.25);
    opacity: 0.15;
  }
  to {
    transform: scale(1);
    opacity: 0.95;
  }
}

.karte {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.karten-pin.faellt svg {
  animation: pin-faellt 0.55s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

.karten-pin.faellt .pin-schatten {
  animation: pin-schatten 0.55s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

@keyframes pin-schatten {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  55% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes pin-faellt {
  0% {
    translate: 0 -46px;
    opacity: 0;
  }
  55% {
    translate: 0 0;
    opacity: 1;
  }
  75% {
    translate: 0 -7px;
  }
  100% {
    translate: 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .druck-ring,
  .karten-pin.faellt svg,
  .karten-pin.faellt .pin-schatten,
  .ortkarte {
    animation: none;
  }
}

/* ---------------------------------------------------------------- Routenpunkte: Marke und × im Feld
   Die Marke (S, 1, 2 …, Z) liegt links im Suchfeld, das × rechts. So kann
   sich das zugeklappte Suchfeld beim Hochziehen in die Ziel-Zeile
   verwandeln: Die Lupe dreht sich weg, an ihrer Stelle erscheint das Z,
   und die Zeile wandert mit dem Finger an ihren Platz. */

.routenpunkt .marke,
.routenpunkt .lupe {
  position: absolute;
  z-index: 1;
  left: 9px;
  top: 10px;
  margin: 0;
  pointer-events: none;
}

.routenpunkt .suchfeld input {
  padding-left: 42px;
  padding-right: 42px;
  transition:
    min-height 0.3s var(--schwung),
    height 0.3s var(--schwung);
}

.routenpunkt > .zeilen-knopf {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
}

.routenpunkte.sortierbar .routenpunkt:has(> .zeilen-griff) > .zeilen-knopf {
  right: 48px;
}

@media (max-width: 799px) {
  .panel:not(.offen) .routenpunkt.ziel > .zeilen-knopf {
    right: 0;
  }

  .panel:not(.offen) .routenpunkt.ziel .lupe,
  .panel:not(.offen) .routenpunkt.ziel .marke {
    top: 7px;
  }

  /* Lupe und Z liegen übereinander und tauschen beim Öffnen. */
  .panel .routenpunkt.ziel .lupe.nur-zu,
  .panel .routenpunkt.ziel .marke.nur-offen {
    display: grid !important;
    transition:
      opacity 0.28s,
      transform 0.4s cubic-bezier(0.3, 1.4, 0.5, 1),
      top 0.3s var(--schwung);
  }

  .panel:not(.offen) .routenpunkt.ziel .marke {
    opacity: 0;
    transform: scale(0.3) rotate(-120deg);
  }

  .panel.offen .routenpunkt.ziel .marke {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .panel.offen .routenpunkt.ziel .lupe {
    opacity: 0;
    transform: scale(0.3) rotate(120deg);
  }

  .panel:not(.offen) .routenpunkt.ziel .lupe {
    opacity: 1;
    transform: none;
  }

  /* Beim Ziehen folgt der Tausch der Zughöhe (--zug 0..1). */
  .panel.zieht .routenpunkt.ziel .lupe {
    transition: top 0.3s var(--schwung);
    opacity: clamp(0, calc(1 - var(--zug, 0) * 3), 1);
    transform: scale(calc(1 - 0.7 * clamp(0, var(--zug, 0) * 3, 1))) rotate(calc(120deg * clamp(0, var(--zug, 0) * 3, 1)));
  }

  .panel.zieht .routenpunkt.ziel .marke {
    transition: top 0.3s var(--schwung);
    opacity: clamp(0, calc(var(--zug, 0) * 3), 1);
    transform: scale(calc(0.3 + 0.7 * clamp(0, var(--zug, 0) * 3, 1))) rotate(calc(-120deg + 120deg * clamp(0, var(--zug, 0) * 3, 1)));
  }

  /* Rechts wird Platz für „Tauschen“ frei, im Takt der Zughöhe. */
  .routenpunkte {
    transition: padding-right 0.34s cubic-bezier(0.22, 0.9, 0.25, 1);
  }

  .panel.zieht .routenpunkte {
    transition: none;
    padding-right: calc(48px * var(--zug, 0));
  }

  /* Die Ziel-Zeile wandert vom Platz des Suchfelds (oben im zugeklappten
     Blatt) an ihren Platz im offenen Blatt. --anker-weg misst blatt.js. */
  .panel .routenpunkt.ziel {
    z-index: 2;
    transition: transform 0.34s cubic-bezier(0.22, 0.9, 0.25, 1);
  }

  .panel.zieht .routenpunkt.ziel {
    transition: none;
    transform: translateY(calc(var(--anker-weg, 0px) * (1 - var(--zug, 1))));
  }

  .panel.offen.schliesst .routenpunkt.ziel {
    transform: translateY(var(--anker-weg, 0px));
  }

  /* Der Rest gleitet beim Zuklappen nach unten weg. */
  .panel.schliesst .nur-offen {
    transform: translateY(18px);
    transition:
      opacity 0.16s,
      transform 0.3s var(--schwung);
  }

  /* Am Ende eines Übergangs ohne Nachfedern umschalten (setzt blatt.js kurz). */
  .panel.still,
  .panel.still * {
    transition: none !important;
  }
}

.termin-formular,
.termin-details {
  text-align: left;
}

.zeitleiste .termin.abgesagt {
  z-index: 1;
}

/* ---------------------------------------------------------------- Pin und Ortskarte
   Langes Drücken: Ein roter Pin fällt auf die Karte, von unten fährt die
   Ortskarte hoch (Adresse, Koordinaten, Merken, „Als Ziel wählen“). Das
   Suchfeld taucht derweil nach unten weg. Als Ziel wird der Pin dunkel. */

.karten-pin {
  position: relative;
  width: 32px;
  height: 42px;
  cursor: grab;
  filter: drop-shadow(0 3px 3px rgb(0 0 0 / 0.3));
}

.karten-pin svg {
  display: block;
  width: 32px;
  height: 42px;
}

.karten-pin .pin-form {
  fill: #d1242f;
  stroke: #ffffff;
  stroke-width: 2;
}

.karten-pin.ziel .pin-form {
  fill: #1d2420;
}

.karten-pin .pin-punkt {
  fill: #ffffff;
}

.karten-pin .pin-schatten {
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: -3px;
  width: 14px;
  height: 6px;
  margin-left: -7px;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.3);
}

.marke.ziel .symbol {
  width: 15px;
  height: 15px;
}

.ortkarte {
  position: absolute;
  z-index: 8;
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 14px 16px 16px;
  border-radius: 22px;
  background: var(--flaeche);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.28);
  animation: ort-hoch 0.5s cubic-bezier(0.2, 1.25, 0.35, 1) both;
}

.app:has(.leiste.weg) .ortkarte {
  bottom: calc(8px + env(safe-area-inset-bottom));
}

@keyframes ort-hoch {
  from {
    transform: translateY(calc(100% + 30px));
    opacity: 0.5;
  }
}

.ort-kopf {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ort-pin {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: color-mix(in srgb, #d1242f 14%, var(--flaeche));
  color: #d1242f;
  animation: ort-pin-ein 0.6s 0.1s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

@keyframes ort-pin-ein {
  from {
    transform: scale(0.2) translateY(-10px);
    opacity: 0;
  }
}

.ort-pin .symbol {
  width: 22px;
  height: 22px;
}

.ort-text {
  flex: 1 1 auto;
  min-width: 0;
  animation: blatt-ein 0.4s 0.12s var(--schwung) both;
}

.ort-text h2 {
  margin: 2px 0 2px;
  font-size: 18px;
  line-height: 1.25;
}

.ort-text p {
  margin: 0;
  font-size: 14px;
}

.ort-text p.sucht {
  animation: ort-sucht 0.8s ease-in-out infinite alternate;
}

@keyframes ort-sucht {
  to {
    opacity: 0.45;
  }
}

.ortkarte .zeilen-knopf {
  margin: -6px -10px 0 0;
}

button.ort-ziel {
  width: 100%;
  margin: 14px 0 10px;
  animation: blatt-ein 0.4s 0.18s var(--schwung) both;
}

.ort-aktionen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  animation: blatt-ein 0.4s 0.24s var(--schwung) both;
}

button.ort-knopf {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  margin: 0;
  padding: 6px 14px;
  border-radius: 14px;
  border: 1px solid var(--linie);
  background: var(--hintergrund);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.ort-knopf > span {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.ort-knopf strong {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

.ort-knopf .klein {
  font-weight: 500;
}

.ort-knopf .symbol {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--akzent);
}

.ort-knopf.merken .symbol {
  color: var(--text-leise);
  transition:
    transform 0.4s cubic-bezier(0.3, 1.6, 0.5, 1),
    fill 0.2s,
    color 0.2s;
}

.ort-knopf.merken.gemerkt .symbol {
  color: #e0a100;
  fill: #e0a100;
  transform: scale(1.18) rotate(72deg);
}

.treffer button.favorit .symbol {
  color: #e0a100;
  fill: #e0a100;
}

@media (max-width: 799px) {
  /* Ortskarte offen: Das Suchfeld taucht nach unten weg. */
  .layout .panel {
    transition: transform 0.35s cubic-bezier(0.22, 0.9, 0.25, 1);
  }

  .layout.ort-offen .panel {
    transform: translateY(110%);
  }
}

@media (min-width: 800px) {
  .ortkarte {
    right: auto;
    width: 400px;
    left: 16px;
    bottom: 16px;
  }
}

/* Pferdekalender: Ziehen, Wochenansicht, Tauschanfragen */

.zeitleiste {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.zeitleiste.zieht {
  touch-action: none;
  cursor: grabbing;
}

.zeitleiste .termin.verschiebbar {
  cursor: grab;
}

.zeitleiste .termin.wird-verschoben {
  opacity: 0.35;
}

.auswahl {
  position: absolute;
  left: 52px;
  right: 4px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 8px;
  overflow: hidden;
  border: 2px solid var(--akzent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--akzent) 18%, transparent);
  font-size: 13px;
  pointer-events: none;
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.18);
  transition:
    top 0.08s ease-out,
    height 0.08s ease-out,
    border-color 0.2s,
    background-color 0.2s;
  animation: auswahl-ein 0.2s var(--schwung);
}

.auswahl.prueft {
  border-style: dashed;
}

.auswahl.belegt-auswahl {
  border-color: var(--art-tierarzt);
  background: color-mix(in srgb, var(--art-tierarzt) 16%, transparent);
  animation: konflikt-wackeln 0.36s ease-in-out;
}

.auswahl span {
  color: var(--text-leise);
}

@keyframes auswahl-ein {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
}

.tag-steuerung {
  align-items: center;
}

.ansicht-wahl button {
  min-width: 64px;
}

/* Woche */

.zeitleiste.woche {
  cursor: default;
}

.woche-kopf {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 28px repeat(7, 1fr);
  border-bottom: 1px solid var(--linie);
  background: var(--flaeche);
}

.woche-tag {
  display: grid;
  justify-items: center;
  gap: 0;
  min-height: 0;
  padding: 6px 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.woche-tag span {
  color: var(--text-leise);
}

.woche-tag strong {
  font-size: 15px;
}

.woche-tag.heute strong {
  color: var(--akzent);
}

.woche-raster {
  position: relative;
  display: grid;
  grid-template-columns: 28px repeat(7, 1fr);
  height: 1152px;
}

.woche-zeiten {
  position: relative;
}

.woche-zeiten span {
  position: absolute;
  left: 4px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-leise);
}

.woche-spalte {
  position: relative;
  border-left: 1px solid var(--linie);
  cursor: pointer;
}

.woche-spalte.heute {
  background: color-mix(in srgb, var(--akzent) 6%, transparent);
}

.woche-spalte .termin {
  --farbe: var(--art-sonstiges);
  position: absolute;
  z-index: 2;
  min-height: 0;
  margin: 0 1px;
  padding: 2px 3px;
  overflow: hidden;
  border: 0;
  border-left: 3px solid var(--farbe);
  border-radius: 5px;
  background: color-mix(in srgb, var(--farbe) 22%, var(--flaeche));
  color: var(--text);
  font-size: 10px;
  line-height: 1.15;
  text-align: left;
  animation: termin-ein 0.3s var(--schwung) both;
}

.woche-spalte .termin.belegt {
  --farbe: var(--art-belegt);
}

.woche-spalte .termin.angefragt {
  border: 1px dashed var(--farbe);
  border-left-width: 3px;
}

.woche-spalte .termin.abgesagt {
  z-index: 1;
  opacity: 0.4;
}

.woche-text {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Tauschanfragen */

.anfrage-liste {
  list-style: none;
  margin: 0;
  padding: 0;
}

.anfrage-liste li {
  padding: 10px 0;
  border-bottom: 1px solid var(--linie);
}

.anfrage-liste li.offen {
  animation: hochgleiten 0.3s var(--schwung);
}

.anfrage-liste li a {
  display: grid;
  gap: 2px;
  color: inherit;
  text-decoration: none;
}

.anfrage-liste .status {
  font-size: 13px;
  color: var(--hinweis-text);
}

.anfrage-liste .aktionen {
  margin-top: 8px;
}

.anfrage-box {
  margin: 6px 0;
}

.anfrage-box .feld {
  margin-top: 6px;
}

.umschalter button.gewaehlt {
  background: var(--akzent);
  color: var(--akzent-text);
}

.woche-spalte .termin {
  background: color-mix(in srgb, var(--farbe) 38%, var(--flaeche));
}

/* ---------------------------------------------------------------- Start als Navigationspfeil */

.symbol .gefuellt {
  fill: currentColor;
  stroke-width: 1.4;
}

.marke.start .symbol {
  width: 15px;
  height: 15px;
}

.wegpunkt.start svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: #ffffff;
}
