:root {
  --grund: #ffffff;
  --flaeche: #f3f6fa;
  --tinte: #253041;
  --leise: #667085;
  --linie: #cfd6e0;
  --blau: #2f6bd0;
  --blau-dunkel: #1f4f8f;
  --rot: #b3261e;
  --gruen: #1e7a3c;
  --gelb: #e0a100;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--tinte); font: 16px/1.5 var(--sans); }
a { color: var(--blau); }
h1 { font-size: clamp(28px, 5vw, 40px); font-weight: 500; margin: 20px 0 14px; line-height: 1.2; }
h2 { font-size: 20px; font-weight: 600; margin: 30px 0 10px; }
h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--leise); margin: 0 0 4px; }
main { max-width: 1180px; margin: 0 auto; padding: 0 16px 64px; }

.kopf { max-width: 1180px; margin: 0 auto; padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #e7ebf0; }
.marke { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 19px; color: var(--tinte); text-decoration: none; }
.marke .leise { font-weight: 400; }
.marke { gap: 12px; }
.marke img { display: block; height: 34px; width: auto; }
.marke .leise { font-size: 15px; padding-left: 12px; border-left: 1px solid var(--linie); }
.anmelden h1 { margin: 34px 0 18px; }
.logo-gross { display: block; width: 100%; max-width: 440px; height: auto; }
.kopf nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.kopf nav a { color: var(--tinte); text-decoration: none; font-size: 15px; padding: 2px 0; border-bottom: 2px solid transparent; }
.kopf nav a[aria-current] { border-color: var(--blau); }
.kopf nav form { margin: 0; }
button.link { background: none; border: 0; padding: 0; font: inherit; font-size: 15px; color: var(--leise); cursor: pointer; }
.umschalter { display: inline-flex; border: 1px solid var(--linie); border-radius: 6px; overflow: hidden; }
.umschalter button { background: #fff; border: 0; padding: 3px 10px; font: inherit; font-size: 14px; color: var(--leise); cursor: pointer; }
.umschalter button[aria-pressed="true"] { background: var(--blau); color: #fff; }

.leise { color: var(--leise); }
.klein, small { font-size: 13px; }
.schmal { max-width: 460px; }
.leer { color: var(--leise); padding: 20px; background: var(--flaeche); border-radius: 8px; }
.zurueck { margin: 16px 0 0; font-size: 14px; }
.zurueck a { text-decoration: none; }
.notiz { white-space: pre-line; background: var(--flaeche); padding: 12px 16px; border-radius: 8px; }

.meldung { padding: 10px 14px; border-radius: 6px; margin: 0 0 18px; }
.meldung.ok { background: #e6f4ea; color: var(--gruen); }
.meldung.fehler { background: #fce8e6; color: var(--rot); }
.live-box { background: #fff1ee; }
.live { display: inline-block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; background: #d6452b; color: #fff; padding: 1px 8px; border-radius: 99px; vertical-align: middle; }
.live::before { content: "● "; animation: blinken 1.6s infinite; }
@keyframes blinken { 50% { opacity: .3; } }

.kacheln { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 8px 0 20px; }
.kacheln.klein { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kachel { background: var(--flaeche); border-radius: 10px; padding: 14px 16px; }
.kachel .gross { font-size: 26px; font-weight: 600; margin: 0 0 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kacheln.klein .gross { font-size: 22px; margin: 0; }
.kachel dl { display: grid; grid-template-columns: auto auto; gap: 2px 10px; margin: 0; font-size: 14px; }
.kachel dt { color: var(--leise); }
.kachel dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 900px) { .kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kacheln .kachel:last-child:nth-child(odd) { grid-column: 1 / -1; } }

.karte { height: 460px; border-radius: 10px; border: 1px solid #e7ebf0; margin: 6px 0 8px; background: #dfe8f1; z-index: 0; }
.karte.gross { height: min(70vh, 640px); }
.karte.zeichnen { cursor: crosshair; }
.karte.zeichnen .leaflet-interactive { cursor: crosshair; }
.boot-live { animation: blinken 1.6s infinite; }
.zaun-ecke { background: #fff; border: 2px solid #d6452b; border-radius: 50%; cursor: move; }
.zaun-mitte { background: #d6452b; color: #fff; border-radius: 50%; text-align: center; line-height: 22px; font-size: 14px; cursor: move; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
@media (max-width: 640px) { .karte { height: 340px; } }

.legende { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--leise); margin: 0 0 10px; }
.legende i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.v0 { background: #7a8ca8; } .v1 { background: #2f8fd8; } .v2 { background: #18a058; } .v3 { background: #e0a100; } .v4 { background: #d6452b; }

.diagramm { margin: 0; }
.diagramm svg { width: 100%; height: auto; display: block; }
.diagramm .gitter { stroke: #e7ebf0; stroke-width: 1; }
.diagramm .kurve { fill: none; stroke: var(--blau); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.diagramm text { font-size: 13px; fill: var(--leise); font-family: var(--sans); }

.geofence-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; border-left: 4px solid var(--linie); background: var(--flaeche); padding: 10px 14px; border-radius: 6px; margin: 0 0 16px; }
.geofence-status p { margin: 0; }
.geofence-status.scharf { border-color: var(--gruen); }
.geofence-status.pausiert { border-color: var(--gelb); background: #fff7e0; }
.knopfreihe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.knopfreihe form { margin: 0; }
.werkzeug { margin: 16px 0 4px; }
.werkzeug p { margin: 0 0 8px; }
.werkzeug #zaun-hilfe { margin: 8px 0 0; }

.formular { display: grid; gap: 18px; margin-top: 8px; }
.feld { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
input, select, textarea { font: inherit; color: inherit; padding: 6px 10px; min-height: 36px; border: 1px solid var(--linie); border-radius: 6px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #a8c7fa; border-color: var(--blau); }
input[type=file] { padding: 6px; }

.knopf { display: inline-block; background: var(--blau); color: #fff; border: 1px solid var(--blau); border-radius: 6px; padding: 9px 20px; font: inherit; text-decoration: none; cursor: pointer; }
.knopf:hover { background: var(--blau-dunkel); }
.knopf.klein { padding: 4px 12px; font-size: 14px; }
.knopf.hell { background: #fff; color: var(--blau); }
.knopf.hell:hover { background: var(--flaeche); }
.knopf.rot { background: var(--rot); border-color: var(--rot); }
.knopf:disabled { opacity: .45; cursor: default; }
.aktionen { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
details.loeschen { margin-top: 24px; }
details.loeschen summary { cursor: pointer; color: var(--leise); font-size: 14px; }
details.loeschen form { margin: 8px 0 0; }

.zeile { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.zeile h2 { margin-bottom: 6px; }
.zeile p { margin: 0; }
.jahre { display: flex; gap: 12px; }
.jahre a { text-decoration: none; padding: 2px 0; border-bottom: 2px solid transparent; }
.jahre a[aria-current] { border-color: var(--blau); color: var(--tinte); }
.spalten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; align-items: start; }
@media (max-width: 900px) { .spalten { grid-template-columns: 1fr; } }

.tabelle { overflow-x: auto; border: 1px solid #e7ebf0; border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eef1f5; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th { background: var(--flaeche); font-weight: 600; white-space: nowrap; }
td { white-space: nowrap; }
.zahl { text-align: right; font-variant-numeric: tabular-nums; }
tr.summe td { font-weight: 600; background: var(--flaeche); }
.liste-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.liste-dl dd { margin: 0; }

.kacheln.klein.fuenf { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 900px) { .kacheln.klein.fuenf { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Wiedergabe */
.kartenrahmen { position: relative; }
.anzeige-oben { position: absolute; top: 8px; left: 56px; right: 56px; z-index: 500; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; padding: 6px 14px; background: rgba(255,255,255,.92); border-radius: 10px; box-shadow: 0 1px 6px rgba(0,0,0,.18); pointer-events: none; font-variant-numeric: tabular-nums; }
.anzeige-oben .wert { display: flex; flex-direction: column; line-height: 1.2; }
.anzeige-oben .titel { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--leise); }
.anzeige-oben b { font-size: 18px; font-weight: 600; white-space: nowrap; }
.anzeige-oben small { font-size: 12px; color: var(--leise); white-space: nowrap; }
.anzeige-oben .wind { flex-direction: row; align-items: center; gap: 8px; }
.anzeige-oben .wind > div { display: flex; flex-direction: column; }
.rose { width: 46px; height: 46px; flex: none; }
.rose .ring { fill: #f3f6fa; stroke: var(--linie); }
.rose .n { font-size: 9px; text-anchor: middle; fill: var(--leise); font-weight: 600; }
.rose .boot { fill: var(--blau-dunkel); }
.rose .pfeil { fill: none; stroke: #d6452b; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.boot-symbol { background: none; border: 0; pointer-events: none; }
.boot-symbol .wg-boot path { fill: #253041; stroke: #fff; stroke-width: 2; }
.boot-symbol .wg-wind path { fill: none; stroke: #d6452b; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.wiedergabe { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.wiedergabe .knopf { min-width: 46px; text-align: center; }
.wiedergabe input[type=range] { flex: 1; padding: 0; min-height: 30px; border: 0; background: none; }
.wiedergabe select { width: auto; }
.diagramm .cursor { stroke: #d6452b; stroke-width: 2; vector-effect: non-scaling-stroke; }
#tempo-diagramm { cursor: pointer; }
@media (max-width: 640px) {
  .anzeige-oben { left: 50px; right: 50px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 4px 10px; }
  .anzeige-oben b { font-size: 14px; }
  .anzeige-oben .titel { font-size: 10px; }
  .anzeige-oben .wind { grid-column: 1 / -1; }
  .anzeige-oben small { white-space: normal; }
  .rose { width: 36px; height: 36px; }
}
