:root {
  --bg: #f4f7f5;
  --card: #ffffff;
  --text: #102018;
  --muted: #607069;
  --line: #d7e0dc;
  --dark: #163326;
  --accent: #1f7a4d;
  --accent-2: #0f5c38;
  --bad: #991b1b;
}
* { box-sizing: border-box; }
html, body, #root { min-height: 100%; height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
.compatibility-open { overflow: hidden; }
.compatibility-gate {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow-y: auto;
  background: linear-gradient(145deg, #edf5f2 0%, #f7faf9 48%, #e7f1f4 100%);
  transition: opacity .2s ease, visibility .2s ease;
}
.compatibility-gate[hidden] { display: none !important; }
.compatibility-gate.is-closing { opacity: 0; visibility: hidden; }
.compatibility-panel {
  width: min(560px, 100%);
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(8, 45, 57, .12);
  border-radius: 24px;
  background: rgba(255, 255, 255, .96);
}
.compatibility-logo {
  display: block;
  width: 150px;
  max-height: 68px;
  margin: 0 0 18px;
  object-fit: contain;
  object-position: left center;
}
.compatibility-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: #0b6c69;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.compatibility-panel h1 { margin-bottom: 8px; font-size: clamp(1.65rem, 5vw, 2.2rem); }
.compatibility-intro { margin-bottom: 18px; color: var(--muted); }
.compatibility-progress {
  height: 7px;
  margin: 0 0 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7efed;
}
.compatibility-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16816f, #176c9c);
  transition: width .35s ease;
}
.compatibility-origin {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
  transition: opacity .3s ease, transform .3s ease;
}
.compatibility-origin.is-pending { opacity: 0; transform: translateY(4px); }
.compatibility-origin.is-visible { opacity: 1; transform: translateY(0); }
.compatibility-origin > div { padding: 10px 12px; background: #f8fbfa; }
.compatibility-origin span { display: block; font-size: 13px; font-weight: 400; }
.compatibility-origin span:first-child { margin-bottom: 2px; color: var(--muted); font-size: 11px; }
.compatibility-results { display: grid; gap: 7px; margin: 0 0 16px; padding: 0; list-style: none; }
.compatibility-results li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #284149;
  font-size: 13px;
  animation: compatibility-result-in .25s ease both;
}
.compatibility-result-icon {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #eaf1ef;
}
.compatibility-results .is-checking .compatibility-result-icon::after {
  content: '';
  width: 10px;
  height: 10px;
  border: 2px solid #8ba4a1;
  border-top-color: #0b6c69;
  border-radius: 50%;
  animation: compatibility-spin .7s linear infinite;
}
.compatibility-results .is-compatible .compatibility-result-icon { background: #dff4eb; color: #08634c; }
.compatibility-results .is-warning .compatibility-result-icon { background: #fff2cf; color: #775300; }
.compatibility-results .is-incompatible .compatibility-result-icon { background: #fee2e2; color: #991b1b; }
.compatibility-status { margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; background: #eef3f2; font-size: 13px; }
.compatibility-status.is-compatible { background: #dff4eb; color: #08634c; }
.compatibility-status.is-incompatible { background: #fee2e2; color: #991b1b; }
.compatibility-completion {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 12px;
  padding: 11px 12px;
  border: 1px solid #bfe2d4;
  border-radius: 14px;
  background: #eff9f5;
  animation: compatibility-complete-in .4s ease both;
}
.compatibility-completion[hidden] { display: none !important; }
.compatibility-completion.is-incompatible { border-color: #fecaca; background: #fff1f1; }
.compatibility-completion-icon {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #16816f;
  color: #fff;
  font-size: 18px;
}
.compatibility-completion.is-incompatible .compatibility-completion-icon { background: #991b1b; }
.compatibility-completion strong,
.compatibility-completion small { display: block; font-weight: 400; }
.compatibility-completion strong { margin-bottom: 2px; font-size: 14px; }
.compatibility-completion small { color: var(--muted); font-size: 12px; }
.compatibility-panel button { width: 100%; }
.compatibility-privacy { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
@keyframes compatibility-spin { to { transform: rotate(360deg); } }
@keyframes compatibility-result-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes compatibility-complete-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .compatibility-gate *, .compatibility-gate *::before, .compatibility-gate *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-width: 520px) {
  .compatibility-gate { place-items: start center; padding: 10px; }
  .compatibility-panel { margin: 8px 0; padding: 20px 17px; border-radius: 20px; }
  .compatibility-origin { grid-template-columns: 1fr; }
}
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.brand {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
  text-align: left;
}
.brand strong { font-size: 20px; letter-spacing: -.03em; }
.brand span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand:hover strong { text-decoration: none; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.layout {
  display: grid;
  grid-template-columns: 55% 45%;
  height: calc(100vh - 64px);
  min-height: 620px;
}
.map-panel { position: relative; min-height: 420px; }
#map { height: 100%; width: 100%; background: #dde3ea; }
.side-panel {
  overflow: auto;
  padding: 18px;
  border-left: 1px solid var(--line);
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin: 0 0 14px;
  box-shadow: 0 10px 24px rgba(16, 32, 24, .06);
}
h1 { margin: 0; font-size: 26px; line-height: 1.15; }
h2 { margin: 0 0 10px; font-size: 18px; line-height: 1.25; letter-spacing: -.02em; }
h3 { margin: 0 0 8px; font-size: 15px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 14px; }
.form-row { margin: 0 0 12px; }
label { display: block; margin: 0 0 5px; font-size: 14px; font-weight: 800; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
}
input:focus, textarea:focus {
  border-color: #2f8f5b;
  box-shadow: 0 0 0 4px rgba(47,143,91,.12);
}
textarea { min-height: 86px; resize: vertical; }
button, .button-link {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--dark);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
button.full { width: 100%; }
button.secondary {
  display: block;
  width: 100%;
  margin-top: 8px;
  text-align: left;
  background: #eef5f1;
  color: var(--text);
  border: 1px solid #d6e2dc;
}
button.compact, .button-link.compact {
  width: auto;
  padding: 7px 10px;
  font-size: 13px;
}
button:disabled { opacity: .45; cursor: not-allowed; }
.notice, .error, .success {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}
.notice { background: #f7f0d8; border: 1px solid #e7d289; color: #5f4300; }
.error { background: #fee2e2; border: 1px solid #fecaca; color: var(--bad); }
.success { background: #dff7e9; border: 1px solid #b6ebcd; color: #075f34; }
.pill, .status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.muted-pill { background: #eef2f0; color: var(--muted); }
.ok-pill { background: #d8f6e5; color: #075f34; }
.bad-pill { background: #fee2e2; color: var(--bad); }
.selected-box, .route-box, .weather-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin: 12px 0;
  background: #f8fbf9;
}
.stack { margin-top: 10px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-header h2 { margin: 0; }
.close-button { margin-top: 0 !important; width: auto !important; }
.weather-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.weather-grid > div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}
.metric { display: block; font-size: 19px; font-weight: 900; color: var(--text); }
.route-actions, .report-actions, .popup-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}
.report {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.report:last-child { border-bottom: 0; }
.list-overview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
}
.list-overview h2 {
  flex: 0 0 auto;
  margin: 0;
  font-size: 13px;
}
.list-overview-items {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 0;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}
.list-overview-item { white-space: nowrap; font-weight: 400; }
.list-overview-item + .list-overview-item::before {
  content: "|";
  padding: 0 8px;
  color: var(--line);
}
.list-overview-count { color: var(--text); font-variant-numeric: tabular-nums; }
.report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.status { background: #e1f4e8; color: #075f34; padding: 2px 8px; }
.link-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #0f5c38;
  padding: 0;
  border-radius: 0;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  text-align: left;
}
.link-button:hover { text-decoration: none; }
.site-name-link { display: inline; }
.site-popup {
  width: clamp(220px, 26vw, 270px);
  max-width: calc(100vw - 72px);
}
.popup-preview-data {
  display: grid;
  gap: 2px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}
.popup-visibility-scale {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid #cfe1d5;
  border-radius: 10px;
  font-size: 10px;
  line-height: 1.2;
}
.popup-visibility-title {
  padding: 6px 7px;
  background: #f3f8f5;
  color: var(--muted);
  font-size: 11px;
}
.popup-visibility-title.has-update { padding-bottom: 2px; }
.popup-visibility-update {
  padding: 0 7px 6px;
  background: #f3f8f5;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}
.visibility-scale-legend {
  display: grid;
  grid-template-columns: auto minmax(70px, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.visibility-scale-track {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #245f3c 0%, #176f5c 25%, #087d82 50%, #176c9c 75%, #174f91 100%);
}
.popup-scale-legend {
  margin: 0;
  padding: 5px 7px;
  background: #f3f8f5;
  font-size: 9px;
}
.popup-scale-legend .visibility-scale-track { height: 5px; }
.popup-depth-head,
.popup-depth-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.popup-depth-head span {
  padding: 5px 2px;
  overflow: hidden;
  background: #f0f7f2;
  color: #0f6548;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.popup-vis-cell {
  min-width: 0;
  padding: 6px 2px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.popup-vis-empty {
  padding: 7px;
  border-top: 1px solid #d7e7dc;
  background: #f8fbf9;
  color: var(--muted);
  text-align: center;
}
.fill-info-card .site-info-row:nth-last-child(-n+3) { grid-column: auto; }
.fill-info-card .site-info-row.wide { grid-column: 1 / -1; }
.fill-route-button {
  width: max-content;
  min-height: 34px;
  padding: 7px 11px;
  font-size: .78rem;
  text-decoration: none;
}
.route-only {
  display: flex;
  align-items: center;
}
.route-only strong { margin-top: 0; }
.fill-info-card .fill-option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}
.fill-data-option {
  display: inline-flex !important;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(8,45,57,.14);
  border-radius: 11px;
  background: #f3f7f6;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 400;
}
.fill-data-option.active {
  border-color: rgba(13,125,119,.28);
  background: #dff4eb;
  color: #08634c;
}
.fill-data-option.inactive { opacity: .48; }
.leaflet-popup-content button { margin-top: 6px; }

.visibility-writer-card {
  border: 1px solid #d7e7dc;
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f3faf5 100%);
  margin: 14px 0;
}
.writer-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.writer-title-row h3 { margin: 0 0 4px; }
.visibility-writer { display: grid; gap: 10px; }
.report-location-check {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #d9e8df;
  border-radius: 16px;
  background: #fff;
}
.report-location-check h3 { margin-bottom: 4px; }
.report-location-check > p { margin-bottom: 8px; }
.report-location-check .secondary { margin-top: 0; text-align: center; }
.report-location-check .location-result { margin-bottom: 0; }
.writer-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  padding: 9px;
  border: 1px solid #d9e8df;
  border-radius: 16px;
  background: #fff;
  overflow-x: auto;
}
.writer-depth {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  color: #0f261b;
  font-size: .92rem;
  white-space: nowrap;
  background: #eff8f2;
  border-radius: 12px;
  border: 1px solid #d7e7dc;
}
.writer-options {
  display: grid;
  grid-template-columns: repeat(6, minmax(78px, 1fr));
  gap: 7px;
  min-width: 540px;
}
.writer-chip {
  border: 1px solid rgba(12, 60, 36, .16);
  border-radius: 12px;
  padding: 10px 8px;
  font-size: .82rem;
  font-weight: 950;
  cursor: pointer;
  color: #052d19;
  transition: transform .08s ease, box-shadow .08s ease, border-color .08s ease, filter .08s ease;
  white-space: nowrap;
  min-height: 42px;
}
.writer-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(13, 83, 49, .14);
  filter: saturate(1.08);
}
.writer-chip.active {
  border-color: #052d19;
  box-shadow: inset 0 0 0 2px rgba(5,45,25,.25), 0 8px 18px rgba(13,83,49,.16);
  transform: translateY(-1px);
}
.writer-chip.active::before { content: '✓ '; }

/* Sichtweitenskala: Grün = trüb, Türkis = mittel, Blau = klar */
.chip-trueb, .cell-trueb { background: #245f3c; color: #ffffff; }
.chip-leicht_trueb, .cell-leicht_trueb { background: #176f5c; color: #ffffff; }
.chip-ok, .cell-ok { background: #087d82; color: #ffffff; }
.chip-gut, .cell-gut { background: #176c9c; color: #ffffff; }
.chip-sehr_gut, .cell-sehr_gut { background: #174f91; color: #ffffff; }
.chip-na, .cell-na { background: #eef2ef; color: #65736b; }
.writer-summary {
  margin-top: 10px;
  padding: 10px 12px;
  background: #eff8f2;
  border-radius: 13px;
}
.depth-table {
  margin: 10px 0;
  border: 1px solid #d7e7dc;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.depth-table-head, .depth-table-row { display: grid; grid-template-columns: repeat(4, 1fr); }
.depth-table-head span {
  padding: 8px;
  font-size: .78rem;
  font-weight: 950;
  color: #0f5c38;
  background: #f3faf5;
  border-bottom: 1px solid #d7e7dc;
}
.depth-cell {
  padding: 10px 8px;
  font-size: .82rem;
  font-weight: 900;
  min-height: 20px;
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: 55% 45%; }
}
@media (max-width: 920px) {
  html, body, #root { height: auto; }
  .layout { grid-template-columns: 1fr; height: auto; min-height: unset; }
  .map-panel { height: 54vh; min-height: 380px; }
  .side-panel { border-left: 0; }
  .brand span { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 12px; }
  .side-panel { padding: 12px; }
  .top-actions .pill { display: none; }
  .writer-row { grid-template-columns: 70px minmax(0, 1fr); }
  .writer-options { grid-template-columns: repeat(6, 78px); min-width: 505px; }
  .depth-table { overflow-x: auto; }
  .depth-table-head, .depth-table-row { grid-template-columns: repeat(4, 96px); min-width: 384px; }
  .weather-grid { grid-template-columns: 1fr 1fr; }
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}
.profile-grid > div,
.user-status-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbf9;
  padding: 10px;
}
.profile-grid span,
.profile-grid strong {
  display: block;
  overflow-wrap: anywhere;
}
.user-status-box strong {
  display: block;
  color: #075f34;
  font-size: 16px;
  margin-bottom: 4px;
}
input[readonly] {
  background: #eef5f1;
  color: var(--muted);
}
@media (max-width: 760px) {
  .profile-grid { grid-template-columns: 1fr; }
}

.site-info-card {
  border: 1px solid #d7e3dc;
  border-radius: 18px;
  padding: 14px;
  background: #f8fbf9;
  margin-bottom: 12px;
}
.site-info-title {
  font-size: 1.05rem;
  margin-bottom: 10px;
  color: #123f2a;
}
.site-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.site-info-row {
  border: 1px solid #d7e3dc;
  border-radius: 14px;
  padding: 10px;
  background: #fff;
  min-height: 58px;
}
.site-info-row span,
.site-info-row strong {
  display: block;
}
.site-info-row strong {
  margin-top: 3px;
  line-height: 1.25;
  word-break: break-word;
}
.site-info-row:nth-last-child(-n+3) {
  grid-column: 1 / -1;
}
@media (max-width: 900px) {
  .site-info-grid { grid-template-columns: 1fr; }
  .site-info-row:nth-last-child(-n+3) { grid-column: auto; }
}

.map-live-search {
  position: absolute;
  z-index: 900;
  top: 14px;
  left: 14px;
  width: min(420px, calc(100% - 28px));
  pointer-events: auto;
}
.map-live-search input {
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(15, 92, 56, .22);
  box-shadow: 0 10px 24px rgba(16, 32, 24, .18);
  background: rgba(255,255,255,.96);
  padding: 0 18px;
  font-weight: 800;
}
.map-search-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  margin-top: 6px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid rgba(8, 45, 57, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 22px rgba(8, 38, 48, .12);
  scrollbar-width: none;
}
.map-search-filters::-webkit-scrollbar { display: none; }
.map-search-filters button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.map-search-filters button.active {
  border-color: rgba(13, 125, 119, .18);
  background: #e4f3f0;
  color: #0b5f61;
}
.map-search-filters button:hover,
.map-search-filters button:focus-visible,
.map-search-filters button.active:hover,
.map-search-filters button.active:focus-visible {
  border-color: var(--dark);
  background: var(--dark);
  color: #fff;
  box-shadow: none;
  transform: none;
}
.map-search-results {
  margin-top: 8px;
  background: rgba(255,255,255,.98);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 34px rgba(16, 32, 24, .18);
  overflow: hidden;
  max-height: min(58vh, 440px);
  overflow-y: auto;
}
.map-search-summary {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 7px 12px;
  border-bottom: 1px solid #edf3ef;
  background: rgba(247, 251, 250, .98);
  color: var(--muted);
  font-size: 11px;
}
.map-search-results button {
  width: 100%;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  grid-template-areas:
    "type title"
    "type meta";
  align-items: center;
  gap: 2px 10px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #edf3ef;
  border-radius: 0;
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
}
.map-search-results button:hover {
  background: #f2faf5;
}
.map-search-results button.active { background: #e8f5f3; }
.map-search-results button:last-child { border-bottom: 0; }
.map-result-type {
  grid-area: type;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 950;
}
.type-site { background: #dff5e8; color: #0f5c38; }
.type-fill { background: #e7f1ff; color: #174a7c; }
.map-result-main {
  grid-area: title;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-result-meta {
  grid-area: meta;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-no-results {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 640px) {
  .map-live-search {
    top: 10px;
    left: 10px;
    width: calc(100% - 20px);
  }
  .map-live-search input { height: 42px; }
  .map-search-results button {
    grid-template-columns: 80px minmax(0, 1fr);
    padding: 10px 12px;
  }
}

/* Weather graphic support */
.weather-card { overflow: hidden; }
.weather-hero {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #d7e7dc;
  border-radius: 16px;
  background: linear-gradient(135deg, #f7fbf8 0%, #e6f4ec 100%);
  margin-bottom: 10px;
}
.weather-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 950;
  color: #0b3a22;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(15,92,56,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 8px 20px rgba(16,32,24,.08);
}
.weather-main {
  font-size: 34px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -.04em;
  color: #0f3f29;
  margin-bottom: 4px;
}
.weather-sun { background: linear-gradient(135deg, #f3fff2 0%, #c7efbd 100%); }
.weather-partly { background: linear-gradient(135deg, #f6fbf7 0%, #d5efdc 100%); }
.weather-cloud { background: linear-gradient(135deg, #f3f7f4 0%, #d7e6dc 100%); }
.weather-rain { background: linear-gradient(135deg, #eef8f2 0%, #bddac9 100%); }
.weather-fog { background: linear-gradient(135deg, #f4f8f5 0%, #e2ebe5 100%); }
.weather-storm { background: linear-gradient(135deg, #edf8f1 0%, #a9cbb8 100%); }
.weather-grid-visual > div { min-height: 78px; }
.weather-source { margin-top: 6px; margin-bottom: 0; }

/* Route + freshness additions */
.secondary-link {
  background: #eef5f1;
  color: var(--text);
  border: 1px solid #d6e2dc;
}
.route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.leaflet-interactive {
  transition: opacity .15s ease;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

/* Map marker icons */
.ld-map-marker {
  background: transparent;
  border: 0;
}
.ld-marker-pin {
  width: 38px;
  height: 38px;
  border-radius: 18px 18px 18px 4px;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(0,0,0,.28);
  border: 3px solid #fff;
}
.ld-marker-pin svg {
  width: 25px;
  height: 25px;
  transform: rotate(45deg);
  fill: #fff;
}
.ld-map-marker-site .ld-marker-pin {
  background: #116149;
}
.ld-map-marker-fill .ld-marker-pin {
  background: #0b4f6c;
}
.ld-user-location-marker {
  background: transparent;
  border: 0;
}
.ld-user-location-badge {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #0d7d77;
  box-shadow: 0 10px 26px rgba(5,31,40,.34);
}
.ld-user-location-badge svg {
  width: 32px;
  height: 32px;
  fill: #fff;
}
.ld-map-marker-site .ld-marker-pin:hover,
.ld-map-marker-fill .ld-marker-pin:hover {
  filter: brightness(1.08);
  transform: rotate(-45deg) scale(1.06);
}

/* Dive site detail refinements */
.brand.brand-link span { display: none; }
.site-info-grid .site-info-row.wide {
  grid-column: 1 / -1;
}
.site-info-row .row-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.description-html {
  margin-top: 4px;
  color: var(--text);
  font-size: .95rem;
  line-height: 1.55;
}
.description-html > :first-child { margin-top: 0; }
.description-html > :last-child { margin-bottom: 0; }
.description-html p { margin: 0 0 .75em; }
.description-html ul,
.description-html ol { margin: .45em 0 .8em; padding-left: 1.35rem; }
.description-html li + li { margin-top: .25em; }
.description-html h3,
.description-html h4 { margin: .9em 0 .4em; }
.description-html blockquote {
  margin: .75em 0;
  padding-left: 12px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
.description-html strong,
.description-html b { font-weight: 400; }
.description-html a,
.description-html a:hover,
.description-html a:focus-visible { color: var(--accent-2); text-decoration: none; }
.field-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eaf4ed;
  color: #0f3f29;
  font-size: 13px;
  line-height: 1;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 850;
  border: 1px solid #cfe1d5;
  background: #f6fbf7;
  color: #15351f;
}
.tag-ok {
  background: #e8f7ec;
  border-color: #bfe2c8;
  color: #0f5b31;
}
.tag-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0f6b3d;
  color: #fff;
  font-size: 12px;
}
.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid #dfe8dc;
  border-radius: 14px;
  background: #fbfdfb;
}
.checkbox-pill {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 750;
  margin: 0 !important;
}
.checkbox-pill input { width: auto !important; }

.captcha-inline {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.captcha-question {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #cfe0d7;
  background: #f7fbf9;
  font-weight: 800;
  color: #143b29;
  white-space: nowrap;
}
.captcha-answer {
  margin: 0 !important;
}
button.secondary.small {
  width: auto;
  min-width: 72px;
  padding: 9px 12px;
  border-radius: 12px;
  background: #e7f3ec;
  color: #143b29;
  border: 1px solid #c2d8cc;
}
button.secondary.small.icon-button {
  min-width: 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 20px;
  line-height: 1;
}
button.secondary.small.icon-button span {
  display: inline-block;
  transform: translateY(-1px);
}
@media (max-width: 520px) {
  .captcha-inline {
    grid-template-columns: auto 1fr;
  }
  .captcha-refresh {
    grid-column: auto;
  }
}
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
/* Modern Lake-Diver UI */
:root {
  --bg: #edf3f3;
  --card: rgba(255, 255, 255, .94);
  --text: #0a2028;
  --muted: #62747a;
  --line: rgba(11, 47, 58, .12);
  --dark: #082d39;
  --accent: #0d7d77;
  --accent-2: #075b62;
  --aqua: #57d3c7;
  --bad: #a11e2e;
  --shadow-sm: 0 8px 22px rgba(8, 38, 48, .07);
  --shadow-lg: 0 24px 70px rgba(5, 31, 40, .14);
}

body {
  background:
    radial-gradient(circle at 92% 5%, rgba(87, 211, 199, .16), transparent 32rem),
    linear-gradient(145deg, #f2f7f6 0%, #e8f0f1 100%);
  font-feature-settings: "ss01" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
  font-size: clamp(15px, calc(14px + .18vw), 17px);
  line-height: 1.55;
}

button, input, textarea { transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease; }
button:focus-visible, input:focus-visible, textarea:focus-visible, .button-link:focus-visible {
  outline: 3px solid rgba(87, 211, 199, .45);
  outline-offset: 2px;
}

.topbar {
  position: relative;
  z-index: 1100;
  height: 78px;
  padding: 0 clamp(18px, 3vw, 42px);
  background: rgba(250, 253, 252, .86);
  border-bottom-color: rgba(8, 45, 57, .09);
  box-shadow: none;
  backdrop-filter: blur(18px) saturate(1.35);
}
.brand { align-items: center; gap: 0; }
.brand:hover strong { text-decoration: none; color: inherit; }
.brand,
.brand:hover,
.brand:focus,
.brand:focus-visible,
.brand:active {
  min-height: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  filter: none !important;
  transition: none !important;
}
.brand-logo-window {
  position: relative;
  display: block !important;
  width: 190px;
  height: 64px;
  overflow: hidden;
}
.brand-logo {
  position: absolute;
  top: -35px;
  left: -20px;
  display: block;
  width: 240px;
  max-width: none;
  height: auto;
}
.account-button {
  min-height: 44px;
  padding: 5px 14px 5px 6px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  background: var(--dark);
  box-shadow: 0 10px 24px rgba(8, 45, 57, .18);
}
.location-button {
  min-height: 44px;
  padding: 5px 13px 5px 6px;
  border: 1px solid rgba(8,45,57,.12);
  border-radius: 999px;
  background: #edf6f4;
  color: var(--dark);
  box-shadow: none;
  font-weight: 500;
}
.location-button:hover,
.location-button:focus-visible { background: #e4f2ef; box-shadow: none; transform: none; }
.location-button.success { background: #dff4eb; color: #08634c; }
.location-button.error { background: #fee2e2; color: var(--bad); }
.location-control { position: relative; }
.location-radius-popover {
  position: absolute;
  z-index: 1400;
  top: calc(100% - 1px);
  left: 50%;
  width: 238px;
  max-width: calc(100vw - 24px);
  padding: 11px;
  border: 1px solid rgba(8,45,57,.14);
  border-radius: 15px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 42px rgba(8,38,48,.2);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  filter: blur(3px);
  transform: translate(-50%, -8px) scale(.96);
  transform-origin: top center;
  transition: opacity .18s ease, transform .22s cubic-bezier(.2,.8,.2,1), filter .18s ease, visibility 0s linear .22s;
}
.location-control:focus-within .location-radius-popover,
.location-control.is-open .location-radius-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  filter: blur(0);
  transform: translate(-50%, 0) scale(1);
  transition-delay: 0s;
}
@media (hover: hover) and (pointer: fine) {
  .location-control:hover .location-radius-popover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    filter: blur(0);
    transform: translate(-50%, 0) scale(1);
    transition-delay: 0s;
  }
}
.location-radius-heading,
.location-radius-limits {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.location-radius-heading { margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.location-radius-heading-actions { display: inline-flex; align-items: center; gap: 7px; }
.location-radius-value { color: var(--dark); font-variant-numeric: tabular-nums; }
.location-radius-close,
.location-radius-close:hover,
.location-radius-close:focus-visible {
  display: grid;
  place-items: center;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
}
.location-radius-close:hover,
.location-radius-close:focus-visible { background: #e4f2ef; color: var(--dark); }
.location-radius-controls {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 7px;
}
.location-radius-step {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 50%;
}
.location-radius-controls input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}
.location-radius-controls input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--dark) 0%, var(--dark) var(--radius-progress), #d9e7e2 var(--radius-progress), #d9e7e2 100%);
}
.location-radius-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--dark);
  box-shadow: 0 2px 8px rgba(8,45,57,.28);
}
.location-radius-controls input[type="range"]::-moz-range-track {
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: #d9e7e2;
}
.location-radius-controls input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--dark);
}
.location-radius-controls input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--dark);
  box-shadow: 0 2px 8px rgba(8,45,57,.28);
}
.location-radius-controls input[type="range"]:focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: 4px;
}
.location-radius-limits { margin-top: 3px; padding-inline: 37px; color: var(--muted); font-size: 9px; }
.location-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  font-size: 19px;
  line-height: 1;
}
.account-button,
.account-button:hover,
.account-button:focus-visible {
  box-shadow: none;
}
.account-button:hover { background: #0c3d49; transform: none; }
.account-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #07343b;
  background: var(--aqua);
  font-size: 13px;
  font-weight: 950;
}

.layout {
  position: relative;
  grid-template-columns: minmax(0, 55fr) minmax(390px, 45fr);
  height: calc(100vh - 78px);
  min-height: 620px;
}
.map-panel { background: #dce9e8; overflow: hidden; }
.map-panel::after {
  content: '';
  position: absolute;
  z-index: 450;
  inset: 0 0 0 auto;
  width: 45px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(7, 35, 44, .08));
}
.side-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 0;
  border-left: 0;
  background: linear-gradient(180deg, rgba(241, 247, 246, .96), rgba(234, 242, 242, .98));
}
.side-scroll {
  min-height: 0;
  overflow: auto;
  padding: 28px clamp(18px, 2.4vw, 34px) 24px;
  scrollbar-color: rgba(8,45,57,.25) transparent;
  scrollbar-width: thin;
}
.side-intro { padding: 8px 4px 22px; }
.side-intro-compact { padding-top: 0; }
.side-intro-compact .quick-stats { margin-top: 0; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.eyebrow::before { content: ''; width: 18px; height: 2px; border-radius: 9px; background: var(--aqua); }
.side-intro h1 { max-width: 37.5rem; font-size: clamp(2rem, 3vw, 2.75rem); line-height: 1.08; letter-spacing: -.045em; text-wrap: balance; }
.side-intro > p { max-width: 580px; margin: 13px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.quick-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.quick-stats span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.6); color: var(--muted); font-size: 11px; font-weight: 750; }
.quick-stats strong { color: var(--text); }

.card {
  margin-bottom: 16px;
  padding: clamp(17px, 2vw, 22px);
  border-color: rgba(8, 45, 57, .1);
  border-radius: 22px;
  background: var(--card);
  box-shadow: none;
  backdrop-filter: none;
}
.card:hover { border-color: rgba(13, 125, 119, .18); box-shadow: none; }
h1 { font-size: clamp(2rem, 3vw, 2.75rem); }
h2 { margin-bottom: .75rem; font-size: clamp(1.15rem, 1.5vw, 1.35rem); line-height: 1.25; letter-spacing: -.025em; }
h3 { font-size: 1rem; line-height: 1.35; letter-spacing: -.015em; }
p { line-height: 1.6; }
.muted { font-size: .875rem; line-height: 1.55; }

input, textarea {
  border-color: rgba(8, 45, 57, .14);
  border-radius: 13px;
  padding: 12px 13px;
  background: rgba(248, 251, 251, .92);
}
input:hover, textarea:hover { border-color: rgba(13, 125, 119, .35); }
input:focus, textarea:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(87, 211, 199, .15); }
label { color: #294149; font-size: 12px; letter-spacing: .015em; }
button, .button-link { min-height: 42px; border-radius: 13px; background: var(--dark); box-shadow: none; }
button:hover, .button-link:hover { background: #0c414e; transform: none; }
button:active, .button-link:active { transform: none; }
button.secondary, .secondary-link {
  background: #edf6f4;
  color: #15383f;
  border-color: rgba(13, 125, 119, .15);
  box-shadow: none;
}
button.secondary:hover, .secondary-link:hover { background: #e1f1ee; border-color: rgba(13, 125, 119, .3); }
.notice, .error, .success { border-radius: 14px; line-height: 1.45; }

.map-live-search { top: 22px; left: 22px; width: min(460px, calc(100% - 44px)); }
.map-live-search::before {
  content: '';
  position: absolute;
  z-index: 2;
  top: 17px;
  left: 18px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--accent-2);
  border-radius: 50%;
  pointer-events: none;
}
.map-live-search::after {
  content: '';
  position: absolute;
  z-index: 2;
  top: 28px;
  left: 29px;
  width: 7px;
  height: 2px;
  background: var(--accent-2);
  transform: rotate(45deg);
  pointer-events: none;
}
.map-live-search input {
  height: 52px;
  padding: 0 20px 0 47px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 16px;
  background: rgba(255,255,255,.93);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  backdrop-filter: blur(18px);
}
.map-search-results { border-radius: 18px; box-shadow: var(--shadow-lg); }
.map-search-results button { min-height: auto; box-shadow: none; }
.map-search-results button:hover { transform: none; }
.leaflet-control-zoom { overflow: hidden; border: 0 !important; border-radius: 14px !important; box-shadow: 0 12px 30px rgba(8,38,48,.18) !important; }
.leaflet-control-zoom a { width: 38px !important; height: 38px !important; line-height: 38px !important; color: var(--dark) !important; border-color: var(--line) !important; }
.leaflet-popup-content-wrapper { border-radius: 18px; box-shadow: 0 18px 45px rgba(6,31,40,.22); }
.leaflet-popup-content { margin: 16px; line-height: 1.55; }
.leaflet-popup-content button { box-shadow: none; }

.selected-box, .route-box, .weather-box, .site-info-card, .profile-grid > div, .user-status-box {
  border-color: rgba(8, 45, 57, .1);
  border-radius: 17px;
  background: #f5f9f8;
}
.site-info-row, .weather-grid > div { border-color: rgba(8,45,57,.1); border-radius: 14px; }
.weather-hero { border-radius: 18px; background: linear-gradient(135deg, #eaf8f4, #d9eeeb); }
.weather-icon { color: var(--accent-2); }
.visibility-writer-card { border-radius: 20px; border-color: rgba(13,125,119,.14); background: linear-gradient(180deg, #fbfefd, #eff8f5); }
.writer-row { border-color: rgba(8,45,57,.1); border-radius: 17px; }
.writer-depth { color: var(--dark); background: #eaf5f2; border-color: rgba(13,125,119,.12); }
.report { padding: 16px 2px; }
.status { background: #dff4eb; color: #08634c; }
.pagination button { min-height: 36px; }
.detail-heading { align-items: flex-start; }
.detail-heading h1 { font-size: clamp(1.65rem, 2.6vw, 2.25rem); }
.detail-heading .eyebrow { margin-bottom: 7px; }

/* Textlinks bleiben beim Rollover neutral. */
.link-button,
.link-button:hover,
.link-button:focus-visible {
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  transform: none;
  text-decoration: none;
}

.link-button.site-name-link {
  display: inline-block;
  min-height: 0;
  margin-left: 0;
  padding: 3px 6px;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
}
.link-button.site-name-link:hover,
.link-button.site-name-link:focus-visible {
  background: var(--dark);
  color: #fff;
  box-shadow: none;
  transform: none;
  text-decoration: none;
}

/* Im Inhaltsbereich sind nur echte Überschriften hervorgehoben. */
.side-panel { font-weight: 400; }
.side-panel h1,
.side-panel h2,
.side-panel h3 {
  font-weight: 650;
}
.side-panel strong,
.side-panel label,
.side-panel button,
.side-panel .button-link,
.side-panel .pill,
.side-panel .status,
.side-panel .metric,
.side-panel .writer-depth,
.side-panel .writer-chip,
.side-panel .depth-cell,
.side-panel .depth-table-head span,
.side-panel .tag,
.side-panel .eyebrow,
.side-panel .link-button,
.side-panel .quick-stats span {
  font-weight: 400;
}
.side-panel button,
.side-panel .button-link {
  font-weight: 500;
}

.content-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 0;
  padding: 13px clamp(18px, 2.4vw, 34px) calc(13px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(244, 249, 248, .98);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 400;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.footer-links a,
.footer-links a:hover,
.footer-links a:focus-visible {
  color: inherit;
  font-weight: 400;
  text-decoration: none;
}
.footer-links a:hover { color: inherit; }
.footer-links .footer-nav-link,
.footer-links .footer-nav-link:hover,
.footer-links .footer-nav-link:focus,
.footer-links .footer-nav-link:focus-visible,
.footer-links .footer-nav-link:active,
.footer-links .footer-nav-link:visited {
  appearance: none;
  -webkit-appearance: none;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: inherit !important;
  box-shadow: none !important;
  font-size: inherit;
  font-weight: 400;
  text-decoration: none !important;
  transform: none !important;
  filter: none !important;
  opacity: 1;
  transition: none !important;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 55fr) minmax(390px, 45fr); }
}
@media (max-width: 920px) {
  html, body, #root { height: 100%; overflow: hidden; }
  .topbar { position: sticky; top: 0; height: 70px; }
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(240px, 42%) minmax(0, 58%);
    height: calc(100svh - 70px);
    min-height: 0;
    overflow: hidden;
  }
  .map-panel { display: block; grid-row: 1; height: auto; min-height: 0; max-height: none; }
  .map-panel::after { display: none; }
  .side-panel { display: grid; grid-row: 2; height: auto; min-height: 0; overflow: hidden; padding: 0; }
  .side-scroll { padding: 20px clamp(14px, 4vw, 34px) 28px; }
  .side-intro h1 { font-size: clamp(2rem, 6vw, 2.75rem); }
}
@media (max-width: 640px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .brand-logo-window { width: 158px; height: 54px; }
  .brand-logo { top: -29px; left: -17px; width: 200px; }
  .top-actions { min-width: 0; }
  .location-button { min-width: 42px; min-height: 42px; padding: 5px; }
  .location-label { display: none; }
  .location-icon { width: 30px; height: 30px; }
  .location-radius-popover {
    position: fixed;
    top: 68px;
    right: 12px;
    left: 12px;
    width: auto;
    transform: translateY(-8px) scale(.97);
  }
  .location-control:focus-within .location-radius-popover,
  .location-control.is-open .location-radius-popover { transform: translateY(0) scale(1); }
  .account-button { min-width: 0; min-height: 42px; padding-right: 10px; font-size: .75rem; }
  .account-button > span:last-child { max-width: 8.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-icon { width: 28px; height: 28px; }
  .map-panel { height: auto; min-height: 0; max-height: none; }
  .map-live-search { top: 12px; left: 12px; width: calc(100% - 24px); }
  .map-live-search input { height: 48px; }
  .map-live-search::before { top: 15px; }
  .map-live-search::after { top: 26px; }
  .side-panel { padding: 0; }
  .side-scroll { padding: 21px 12px 28px; }
  .side-intro { padding: 6px 5px 18px; }
  .side-intro h1 { font-size: 2rem; }
  .quick-stats { gap: 6px; }
  .card { border-radius: 19px; padding: 17px; }
  .writer-title-row { align-items: center; }
  .writer-row { grid-template-columns: 1fr; overflow: visible; }
  .writer-depth { min-height: 38px; justify-content: flex-start; padding: 0 12px; }
  .writer-options { grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; }
  .writer-chip { min-height: 46px; white-space: normal; }
  .route-actions > *,
  .report-actions > * { flex: 1 1 9rem; }
  .content-footer { align-items: center; flex-direction: row; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .footer-links { gap: 10px 18px; }
}
@media (max-width: 640px) and (hover: hover) and (pointer: fine) {
  .location-control:hover .location-radius-popover { transform: translateY(0) scale(1); }
}
@media (max-width: 420px) {
  .topbar { height: 64px; }
  .layout { height: calc(100svh - 64px); grid-template-rows: minmax(210px, 40%) minmax(0, 60%); }
  .brand-logo-window { width: 140px; height: 48px; }
  .brand-logo { top: -26px; left: -14px; width: 180px; }
  .account-button { min-width: 42px; padding: 5px; }
  .account-button > span:last-child { display: none; }
  .map-panel { height: auto; min-height: 0; max-height: none; }
  .side-panel { height: auto; min-height: 0; padding: 0; }
  .side-scroll { padding: 18px 10px 24px; }
  .side-intro h1 { font-size: 1.8rem; }
  .quick-stats span { flex: 1 1 auto; text-align: center; }
  .captcha-inline { grid-template-columns: minmax(0, 1fr) auto; }
  .captcha-question { grid-column: 1 / -1; }
  .captcha-refresh { grid-column: auto; }
}
@media (max-width: 360px) {
  .topbar { gap: 6px; padding-inline: 8px; }
  .brand-logo-window { width: 110px; }
  .brand-logo { top: -20px; left: -10px; width: 150px; }
  .top-actions { gap: 5px; }
}

/* Kompakte Kartensuche: Lupe im Ruhezustand, vollständige Suche bei Interaktion. */
.map-live-search {
  top: 22px;
  left: 22px;
  width: 50px;
  min-height: 50px;
  transition: width .22s ease;
}
.map-live-search::before,
.map-live-search::after { display: none; }
.map-live-search:focus-within,
.map-live-search.is-open { width: min(460px, calc(100% - 44px)); }
.map-search-toggle {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  width: 50px;
  min-width: 50px;
  height: 50px;
  min-height: 50px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 16px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-lg);
}
.map-search-toggle:hover,
.map-search-toggle:focus-visible { background: #fff; transform: none; }
.map-search-toggle span {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
  margin: auto;
  border: 2px solid var(--accent-2);
  border-radius: 50%;
}
.map-search-toggle span::after {
  content: '';
  position: absolute;
  right: -6px;
  bottom: -3px;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-2);
  transform: rotate(45deg);
}
.map-search-panel {
  width: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-6px);
  transition: opacity .16s ease, transform .22s ease, visibility 0s linear .22s;
}
.map-live-search:focus-within .map-search-panel,
.map-live-search.is-open .map-search-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition-delay: 0s;
}
.map-search-panel > input { width: 100%; padding-left: 60px; }
.map-live-search:focus-within .map-search-toggle,
.map-live-search.is-open .map-search-toggle {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
@media (max-width: 640px) {
  .map-live-search { top: 12px; left: 12px; width: 48px; min-height: 48px; }
  .map-live-search:focus-within,
  .map-live-search.is-open { width: calc(100% - 24px); }
  .map-search-toggle { width: 48px; min-width: 48px; height: 48px; min-height: 48px; }
}
@media (hover: hover) and (pointer: fine) {
  .map-live-search:hover { width: min(460px, calc(100% - 44px)); }
  .map-live-search:hover .map-search-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition-delay: 0s;
  }
  .map-live-search:hover .map-search-toggle {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }
}
@media (max-width: 640px) and (hover: hover) and (pointer: fine) {
  .map-live-search:hover { width: calc(100% - 24px); }
}
@media (prefers-reduced-motion: reduce) {
  .map-live-search,
  .map-search-panel,
  .location-radius-popover { transition: none; }
  .location-radius-popover { filter: none; }
}

/* Einheitlicher Aktiv- und Rolloverzustand für reguläre App-Buttons. */
button.active:not(.writer-chip),
button[aria-pressed="true"]:not(.writer-chip) {
  border-color: var(--dark);
  background: var(--dark);
  color: #fff;
  box-shadow: none;
  transform: none;
}
button:not(.writer-chip):not(.map-search-toggle):not(.link-button):not(:disabled):hover,
button:not(.writer-chip):not(.map-search-toggle):not(.link-button):not(:disabled):focus-visible,
.button-link:not(.link-button):hover,
.button-link:not(.link-button):focus-visible {
  border-color: #0c414e;
  background: #0c414e;
  color: #fff;
  box-shadow: none;
  transform: none;
  text-decoration: none;
}
.map-search-results button.active .map-result-main,
.map-search-results button.active .map-result-meta,
.map-search-results button:hover .map-result-main,
.map-search-results button:hover .map-result-meta,
.map-search-results button:focus-visible .map-result-main,
.map-search-results button:focus-visible .map-result-meta {
  color: #fff;
}
button:not(.writer-chip):not(.map-search-toggle):not(.link-button):focus-visible,
.button-link:not(.link-button):focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: 2px;
}
