/* Problemmelder – Gestaltung nach SPD-CD:
   Rot (#E3000F) als Hauptfarbe, Weiß, Schwarz nur als Akzent (z. B. Call-to-Action), Hellgrau #ededed für Kacheln.
   Schrift: Open Sans als offizielle Ersatzschrift für SPD The Sans (selbst gehostet, keine Google-Server). */

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/vendor/fonts/open-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/vendor/fonts/open-sans-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/vendor/fonts/open-sans-latin-800-normal.woff2') format('woff2');
}

:root {
  --red: #e3000f;
  --black: #000;
  --white: #fff;
  --grey: #ededed;
  --text-muted: #4d4d4d;
  --topbar-h: 68px;
  --panel-w: 430px;
  --font: 'Open Sans', Calibri, Arial, sans-serif;
  --stoerer-angle: -8deg;
  --arrows: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cpath d='M0 0h6.5l8 10-8 10H0l8-10zM13 0h6.5l8 10-8 10H13l8-10z'/%3E%3C/svg%3E");
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--red);
  font-weight: 700;
}

img {
  max-width: 100%;
  display: block;
}

[hidden] {
  display: none !important;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 3000;
  background: var(--black);
  color: var(--white);
  padding: 10px 16px;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* Honeypot-Feld für Spam-Bots */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.icon {
  display: block;
  flex-shrink: 0;
}
.icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Kopfzeile (roter Markenraum) ---------- */

.topbar {
  height: var(--topbar-h);
  background: var(--red);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  position: relative;
  z-index: 1100;
}

.brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--white);
  text-decoration: none;
  line-height: 1.05;
  margin-right: auto;
}
.brand-title {
  font-weight: 800;
  font-size: 26px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.brand-city {
  font-weight: 700;
  font-size: 16px;
}

.logo-slot {
  color: var(--white);
  text-decoration: none;
  display: flex;
  align-items: center;
}
.logo-text {
  font-weight: 800;
  font-size: 17px;
  text-transform: uppercase;
  white-space: nowrap;
}
.logo-img {
  height: 44px;
  width: auto;
}

/* ---------- Schaltflächen ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font);
  font-weight: 800;
  font-size: 15px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 14px 20px;
  min-height: 48px;
  border: 2px solid var(--black);
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.btn-block {
  width: 100%;
}
.btn-square {
  padding: 0;
  width: 48px;
}

/* Call-to-Action: Schwarz als Akzentfarbe */
.btn-cta {
  background: var(--black);
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  color: var(--black);
}

.btn-danger {
  background: var(--white);
  color: var(--red);
  border-color: var(--red);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

/* Breite Doppelpfeile aus dem CD */
.arrows {
  display: inline-block;
  width: 24px;
  height: 15px;
  background: currentColor;
  -webkit-mask: var(--arrows) center / contain no-repeat;
  mask: var(--arrows) center / contain no-repeat;
}

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: var(--panel-w) 1fr;
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
}

.panel {
  position: relative;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--grey);
  background: var(--white);
  z-index: 1000;
}
.panel > .view {
  flex: 1 0 auto;
}

.map-wrap {
  position: relative;
  min-height: 0;
}
.map {
  position: absolute;
  inset: 0;
  background: var(--grey);
}

.sheet-handle,
.mobile-actions,
.mobile-pick,
.mobile-search {
  display: none;
}

.panel-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 16px 24px;
  font-size: 13px;
  border-top: 1px solid var(--grey);
}
.panel-footer a {
  color: var(--black);
  font-weight: 400;
}

/* ---------- Einleitung ---------- */

.intro {
  background: var(--red);
  color: var(--white);
  padding: 26px 24px 28px;
}
.intro-title {
  font-weight: 800;
  font-size: 38px;
  line-height: 1;
  text-transform: uppercase;
  margin: 0 0 14px;
  hyphens: auto;
}
.intro-text {
  margin: 0 0 20px;
  font-size: 16px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--grey);
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 6px;
  text-align: center;
}
.stat + .stat {
  border-left: 1px solid var(--grey);
}
.stat-num {
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  color: var(--red);
}
.stat-in_progress .stat-num,
.stat-done .stat-num {
  color: var(--black);
}
.stat-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ---------- Filter ---------- */

.filters {
  padding: 16px 24px 8px;
}
.filter-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.chip {
  font-family: var(--font);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  border: 2px solid var(--black);
  background: var(--white);
  color: var(--black);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.chip.is-active {
  background: var(--black);
  color: var(--white);
}
.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.input {
  width: 100%;
  font-family: var(--font);
  font-size: 16px;
  padding: 10px 12px;
  border: 2px solid var(--black);
  border-radius: 0;
  background: var(--white);
  color: var(--black);
}
.input:focus {
  outline: 3px solid var(--red);
  outline-offset: 0;
}
select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #000 50%), linear-gradient(135deg, #000 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
textarea.input {
  resize: vertical;
  min-height: 100px;
}

/* ---------- Liste ---------- */

.report-list {
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
}
.report-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 24px;
  color: var(--black);
  text-decoration: none;
  font-weight: 400;
  border-bottom: 1px solid var(--grey);
}
.item-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  background: var(--grey);
}
.item-thumb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
}
.item-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.item-cat {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--red);
}
.item-title {
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.item-meta {
  font-size: 13px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 8px;
  white-space: nowrap;
  border: 2px solid var(--red);
  background: var(--red);
  color: var(--white);
}
.badge-in_progress {
  background: var(--black);
  border-color: var(--black);
}
.badge-done {
  background: var(--white);
  border-color: var(--black);
  color: var(--black);
}
.badge-pending {
  background: var(--white);
  color: var(--red);
}
.badge-rejected,
.badge-merged {
  background: var(--grey);
  border-color: var(--grey);
  color: var(--black);
}

.empty,
.loading {
  padding: 24px;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Ansichtskopf ---------- */

.view-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--white);
  border-bottom: 1px solid var(--grey);
  min-height: 56px;
}
.view-bar-title {
  font-weight: 800;
  text-transform: uppercase;
  flex: 1;
}

.steps {
  display: flex;
  gap: 6px;
  padding-right: 8px;
}
.steps i {
  display: block;
  width: 26px;
  height: 6px;
  background: var(--grey);
}
.steps i.is-active {
  background: var(--red);
}

/* ---------- Störer (gedreht wie im CD) ---------- */

.stoerer {
  display: inline-block;
  font-weight: 800;
  text-transform: uppercase;
  transform: rotate(var(--stoerer-angle));
  background: var(--red);
  color: var(--white);
  line-height: 1.05;
}
.stoerer-rect {
  font-size: 15px;
  padding: 8px 14px;
  margin: 18px 0 8px 2px;
}
.stoerer-rect.status-in_progress {
  background: var(--black);
}
.stoerer-rect.status-done {
  background: var(--white);
  color: var(--black);
  border: 2px solid var(--black);
}
.stoerer-round {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 26px;
  margin: 8px auto 20px;
}

/* ---------- Detail ---------- */

.detail {
  padding: 4px 24px 24px;
}
.detail-cat {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--red);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 14px;
  margin: 12px 0 4px;
}
.detail-title {
  font-weight: 800;
  font-size: 28px;
  line-height: 1.05;
  text-transform: uppercase;
  margin: 0 0 14px;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.detail-meta {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  font-size: 15px;
}
.detail-meta li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 4px;
}
.detail-meta .icon-wrap {
  margin-top: 2px;
}
.detail-desc {
  white-space: pre-line;
  overflow-wrap: anywhere;
  margin: 0 0 18px;
}
.detail-id {
  font-size: 13px;
  color: var(--text-muted);
  margin: 16px 0 0;
}
.detail-actions {
  margin-top: 20px;
}

.gallery {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}
.gallery-2 {
  grid-template-columns: 1fr 1fr;
}
.gallery-3 {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.gallery-3 .gallery-item:first-child {
  grid-row: span 2;
}
.gallery-item {
  border: 0;
  padding: 0;
  cursor: zoom-in;
  background: var(--grey);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.gallery-3 .gallery-item {
  aspect-ratio: auto;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.note {
  background: var(--grey);
  border-left: 6px solid var(--red);
  padding: 14px 16px;
  margin: 0 0 8px;
}
.note-title {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 13px;
  margin: 0 0 4px;
}
.note-text {
  margin: 0;
  white-space: pre-line;
}
.note-date {
  font-weight: 400;
  text-transform: none;
}

/* ---------- Formular ---------- */

.report-form {
  padding: 8px 24px 24px;
}
.step {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.step-title {
  font-weight: 800;
  font-size: 28px;
  line-height: 1.05;
  text-transform: uppercase;
  margin: 12px 0 10px;
  padding: 0;
}
.hint {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 12px;
}
.field {
  margin-bottom: 18px;
  position: relative;
}
.label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}
.req {
  color: var(--red);
}
.opt {
  font-weight: 400;
  color: var(--text-muted);
}
.counter {
  display: block;
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.notice {
  background: var(--grey);
  padding: 12px 14px;
  font-size: 14px;
  margin: 0 0 16px;
}
.form-error {
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  padding: 10px 14px;
  margin: 12px 0;
}
.step-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.step-actions .btn-cta {
  flex: 1;
}

.search-box {
  position: relative;
  margin-bottom: 10px;
}
.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--white);
  border: 2px solid var(--black);
  border-top: 0;
  z-index: 20;
  max-height: 260px;
  overflow-y: auto;
}
.search-results button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}
.search-results button:focus {
  background: var(--grey);
}
.search-empty {
  padding: 10px 12px;
  color: var(--text-muted);
}

.location-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--grey);
  font-weight: 700;
}
.location-box .icon-wrap {
  color: var(--red);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.category-option {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  padding: 10px;
  min-height: 56px;
  min-width: 0;
  border: 2px solid var(--black);
  background: var(--white);
  color: var(--black);
  cursor: pointer;
}
.category-option .category-name {
  min-width: 0;
  overflow-wrap: break-word;
  hyphens: auto;
}
.category-option .category-icon {
  color: var(--red);
  display: flex;
}
.category-option[aria-checked='true'] {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}
.category-option[aria-checked='true'] .category-icon {
  color: var(--white);
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0;
  font-size: 15px;
  cursor: pointer;
}
.check input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  flex-shrink: 0;
  accent-color: var(--red);
}
.check-privacy {
  margin-top: 20px;
  background: var(--grey);
  border-left: 6px solid var(--red);
  padding: 12px 14px;
}
.check-privacy a {
  color: var(--black);
  font-weight: 700;
}
.check-consent {
  background: var(--grey);
  padding: 10px 12px;
}

/* ---------- Datenschutzerklärung als Fenster im Formular ---------- */

.legal-dialog {
  border: 0;
  padding: 0;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  flex-direction: column;
}
.legal-dialog[open] {
  display: flex;
}
.legal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}
.legal-dialog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--red);
  color: var(--white);
  padding: 8px 8px 8px 20px;
}
.legal-dialog-title {
  font-weight: 800;
  text-transform: uppercase;
}
.legal-dialog-bar .btn-icon {
  color: var(--white);
}
.legal-dialog-body {
  overflow-y: auto;
  padding: 8px 20px 20px;
  margin: 0;
  max-width: none;
}
.legal-dialog-body h1 {
  display: none;
}
.legal-dialog-actions {
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--grey);
}

.photo-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.photo-picker:not(:empty) {
  margin-bottom: 10px;
}
.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  background: var(--grey);
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.photo-add {
  margin-bottom: 8px;
}

.contact {
  border: 2px solid var(--black);
  padding: 0 14px;
  margin: 18px 0 0;
}
.contact summary {
  font-weight: 700;
  cursor: pointer;
  padding: 12px 0;
}
.contact[open] summary {
  margin-bottom: 4px;
}

.step-done {
  text-align: center;
  padding-top: 24px;
}
.step-done .step-title {
  margin-bottom: 14px;
}
.done-notice {
  margin: 16px 0 20px;
  background: var(--grey);
  border-left: 6px solid var(--red);
  padding: 12px 14px;
  text-align: left;
}

/* ---------- Karte ---------- */

.leaflet-container {
  font-family: var(--font);
}
.leaflet-bar a,
.leaflet-bar a:hover {
  width: 40px;
  height: 40px;
  line-height: 40px;
  color: var(--black);
  border-radius: 0 !important;
}
.leaflet-bar {
  border-radius: 0 !important;
  border: 2px solid var(--black) !important;
  box-shadow: none !important;
}
.leaflet-control-attribution {
  font-size: 11px;
}
.leaflet-control-attribution a {
  font-weight: 400;
  color: var(--black);
}
.leaflet-tooltip {
  font-family: var(--font);
  font-weight: 700;
  border-radius: 0;
  border: 2px solid var(--black);
  box-shadow: none;
}

.pm-marker-wrap,
.pm-cluster-wrap,
.pm-picker-wrap {
  background: none;
  border: 0;
}
.pm-marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  border: 3px solid var(--white);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s;
}
.pm-marker.status-in_progress,
.pm-marker.status-pending {
  background: var(--black);
}
.pm-marker.status-done {
  background: var(--white);
  color: var(--black);
  border-color: var(--black);
  border-width: 2px;
}
.pm-marker.status-rejected,
.pm-marker.status-merged {
  background: var(--grey);
  color: var(--black);
}
.pm-marker.is-selected {
  transform: scale(1.3);
  outline: 3px solid var(--black);
  outline-offset: 2px;
}
.pm-marker-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
}

.pm-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  font-weight: 800;
  font-size: 15px;
  border: 3px solid var(--white);
  box-shadow: 0 0 0 3px rgba(227, 0, 15, 0.35), 0 1px 4px rgba(0, 0, 0, 0.4);
}

.pm-picker {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}
.pm-picker svg {
  width: 44px;
  height: 44px;
  fill: var(--red);
  stroke: var(--white);
}

.pick-hint {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 800;
  background: var(--black);
  color: var(--white);
  font-weight: 700;
  padding: 10px 16px;
  pointer-events: none;
}

body.picking .leaflet-grab {
  cursor: crosshair;
}

/* ---------- Lightbox & Hinweise ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
}
.lightbox .btn-icon {
  position: absolute;
  color: var(--white);
  width: 56px;
  height: 56px;
}
.lightbox-close {
  top: 12px;
  right: 12px;
}
.lightbox-nav.prev {
  left: 8px;
}
.lightbox-nav.next {
  right: 8px;
}
.lightbox.single .lightbox-nav {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 3100;
  background: var(--black);
  color: var(--white);
  font-weight: 700;
  padding: 12px 18px;
  max-width: calc(100vw - 32px);
}
.toast.is-error {
  background: var(--red);
}

/* ---------- Textseiten (Impressum, Datenschutz) ---------- */

.page-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}
.page-content h1 {
  font-weight: 800;
  font-size: 40px;
  line-height: 1.05;
  text-transform: uppercase;
  margin: 8px 0 20px;
}
.page-content h2 {
  font-weight: 800;
  font-size: 20px;
  text-transform: uppercase;
  margin: 32px 0 8px;
}
.page-content .lead {
  font-size: 18px;
}
/* Pflichtangabe fehlt noch (wird im Admin-Portal ergänzt) */
.page-content .missing {
  background: var(--grey);
  color: var(--red);
  outline: 2px dashed var(--red);
  padding: 0 4px;
}
.back-link {
  color: var(--black);
}
.page-footer {
  display: flex;
  gap: 18px;
  justify-content: center;
  padding: 24px;
  border-top: 1px solid var(--grey);
}
.page-footer a {
  color: var(--black);
  font-weight: 400;
}

@media (max-width: 640px) {
  .legal-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
  }
}

/* ---------- Touch-Bedienung ---------- */

button,
.btn,
a,
label {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: none) {
  .btn-cta:active:not(:disabled) {
    background: var(--red);
    border-color: var(--red);
  }
  .topbar .btn-cta:active,
  .intro .btn-cta:active {
    background: var(--white);
    color: var(--black);
  }
  .btn-secondary:active:not(:disabled) {
    background: var(--black);
    color: var(--white);
  }
  .report-item:active,
  .category-option:active,
  .search-results button:active {
    background: var(--grey);
  }
  .chip:active {
    opacity: 0.7;
  }
}

/* ---------- Formular-Ergänzungen ---------- */

.location-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--grey);
  padding: 8px 8px 8px 12px;
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 700;
}
.location-summary .icon-wrap {
  color: var(--red);
}
.location-summary-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-btn {
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--red);
  text-decoration: underline;
  cursor: pointer;
  padding: 10px 8px;
  min-height: 40px;
}

.photo-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.photo-buttons .btn {
  flex: 1;
  padding-left: 10px;
  padding-right: 10px;
}
.photo-camera,
.label-touch {
  display: none !important;
}
@media (pointer: coarse) {
  .photo-camera {
    display: inline-flex !important;
  }
  .label-touch {
    display: inline !important;
  }
  .label-desktop {
    display: none;
  }
}

.list-count {
  font-weight: 400;
}

/* ---------- Hover nur mit Maus (auf Touch-Geräten bleiben sonst Farben nach dem Tippen hängen) ---------- */

@media (hover: hover) {
  .btn-cta:hover:not(:disabled) {
    background: var(--red);
    border-color: var(--red);
  }

  .topbar .btn-cta:hover,
  .intro .btn-cta:hover {
    background: var(--white);
    color: var(--black);
    border-color: var(--white);
  }

  .btn-secondary:hover:not(:disabled) {
    background: var(--black);
    color: var(--white);
  }

  .btn-danger:hover:not(:disabled) {
    background: var(--red);
    color: var(--white);
  }

  .btn-icon:hover {
    color: var(--red);
  }

  .report-item:hover {
    background: var(--grey);
  }

  .category-option:hover {
    border-color: var(--red);
  }

  .pm-marker-wrap:hover .pm-marker {
    transform: scale(1.15);
  }

  .lightbox .btn-icon:hover {
    color: var(--red);
  }

  .search-results button:hover {
    background: var(--grey);
  }
}

/* ---------- Handy im Hochformat (und sehr schmale Geräte) ----------
   Muss mit „mobileQuery“ in public/js/app.js übereinstimmen. */

@media (max-width: 899px) and (orientation: portrait), (max-width: 559px) {
  :root {
    --topbar-h: 58px;
    --sheet-h: calc(100dvh - var(--topbar-h));
    /* Sichtbarer Kartenstreifen bei halb geöffneter Liste (siehe SHEET_GAP in app.js) */
    --sheet-gap: calc(var(--sheet-h) * 0.38);
  }
  html:has(> body.app),
  body.app {
    /* kein versehentliches Neuladen der Seite beim Verschieben der Karte */
    overscroll-behavior: none;
  }
  .topbar {
    padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
    gap: 12px;
  }
  .brand-title {
    font-size: 20px;
  }
  .brand-city {
    font-size: 14px;
  }
  .logo-text {
    font-size: 13px;
    white-space: normal;
    text-align: right;
    line-height: 1.1;
    max-width: 110px;
  }
  .logo-img {
    height: 34px;
  }
  .topbar-cta {
    display: none;
  }

  .layout {
    display: block;
    position: relative;
  }
  .map-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
  }
  .map {
    position: relative;
    inset: auto;
    flex: 1 1 auto;
    min-height: 0;
  }

  /* Bottom-Sheet: geschlossen → halb (.panel-open) → ganz (.panel-full) */
  .panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(100vh - var(--topbar-h));
    height: var(--sheet-h);
    border-right: 0;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.25);
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.28s ease, visibility 0s linear 0.28s;
    overscroll-behavior: contain;
    z-index: 1200;
  }
  body.panel-open .panel {
    transform: translateY(var(--sheet-gap));
    visibility: visible;
    transition: transform 0.28s ease;
  }
  body.panel-open.panel-full .panel {
    transform: none;
    border-radius: 0;
  }
  .panel.is-dragging {
    transition: none !important;
  }
  /* Platzhalter, damit bei halb geöffneter Liste auch die letzten Einträge erreichbar sind */
  .panel::after {
    content: '';
    flex: 0 0 auto;
    height: 0;
  }
  body.panel-open:not(.panel-full) .panel::after {
    height: var(--sheet-gap);
  }
  .panel-footer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .sheet-handle {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 12px 12px 0 0;
    background: var(--white);
    cursor: grab;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 6;
    touch-action: none;
  }
  .sheet-handle span {
    width: 52px;
    height: 5px;
    border-radius: 3px;
    background: #9a9a9a;
  }
  body.mode-report .sheet-handle {
    display: none;
  }
  .view-bar {
    top: 44px;
    touch-action: none;
  }
  .view-bar-title {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body.mode-report .view-bar {
    top: 0;
  }

  .intro {
    padding: 14px 18px 20px;
  }
  .intro-title {
    font-size: 30px;
  }
  .filters,
  .detail,
  .report-form {
    padding-left: 18px;
    padding-right: 18px;
  }
  .report-item {
    padding: 12px 18px;
  }
  .chip {
    min-height: 40px;
    padding: 8px 14px;
  }

  /* Weiter/Absenden bleibt beim Scrollen unten sichtbar */
  .report-form .step-actions {
    position: sticky;
    bottom: 0;
    z-index: 4;
    background: var(--white);
    margin: 20px -18px 0;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 12px -10px rgba(0, 0, 0, 0.35);
  }

  .photo-remove {
    width: 38px;
    height: 38px;
  }

  .mobile-actions {
    display: flex;
    gap: 10px;
    position: absolute;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 900;
  }
  .mobile-actions .btn {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    padding-left: 14px;
    padding-right: 14px;
    font-size: 14px;
  }
  .mobile-actions .btn-secondary {
    white-space: nowrap;
    gap: 6px;
  }
  .photo-buttons .btn {
    font-size: 14px;
    letter-spacing: 0;
  }
  .mobile-actions .btn-cta {
    flex: 1;
  }
  body.panel-open .mobile-actions,
  body.picking .mobile-actions {
    display: none;
  }

  /* Ort wählen: Karte oben, Bedienleiste darunter (verdeckt nichts) */
  body.picking .mobile-pick {
    display: block;
    flex: 0 0 auto;
    position: relative;
    z-index: 900;
    background: var(--white);
    padding: 12px max(14px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.25);
  }
  .mobile-pick-title {
    font-weight: 800;
    text-transform: uppercase;
    font-size: 20px;
    margin: 0 0 8px;
  }
  .mobile-pick .location-box {
    margin: 0 0 10px;
    font-size: 15px;
  }
  .mobile-pick-actions {
    display: flex;
    gap: 8px;
  }
  .mobile-pick-actions .btn-cta {
    flex: 1;
  }
  .mobile-pick-actions .btn-square {
    flex: 0 0 48px;
  }
  .mobile-pick-actions .btn:first-child {
    padding: 14px 12px;
  }

  body.picking .mobile-search {
    display: block;
    position: absolute;
    top: 10px;
    left: max(10px, env(safe-area-inset-left));
    right: 62px;
    z-index: 950;
  }
  .mobile-search .input {
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
  }

  .pick-hint {
    display: none;
  }

  .leaflet-bottom.leaflet-right {
    margin-bottom: calc(76px + env(safe-area-inset-bottom));
  }
  body.picking .leaflet-bottom.leaflet-right {
    margin-bottom: 0;
  }

  .category-option {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 6px;
    font-size: 13px;
    padding: 10px 6px;
    min-height: 84px;
  }

  .lightbox {
    touch-action: pinch-zoom;
  }
  .lightbox img {
    max-width: 100vw;
    max-height: 80vh;
  }
  .lightbox-nav {
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .stoerer-round {
    width: 130px;
    height: 130px;
    font-size: 22px;
  }
  .toast {
    bottom: calc(84px + env(safe-area-inset-bottom));
    text-align: center;
  }
}

/* Schmale Handys: Liste zweizeilig, damit Titel nicht vom Status-Etikett gequetscht werden */
@media (max-width: 480px) {
  .report-item {
    grid-template-columns: 56px 1fr;
    row-gap: 6px;
    align-items: start;
  }
  .report-item .item-thumb {
    width: 56px;
    height: 56px;
    grid-row: span 2;
  }
  .report-item .badge {
    grid-column: 2;
    justify-self: start;
  }
  .item-meta {
    white-space: normal;
  }
}

/* Sehr kleine Handys (z. B. iPhone SE der ersten Generation) */
@media (max-width: 360px) {
  .brand-title {
    font-size: 17px;
  }
  .brand-city {
    font-size: 13px;
  }
  .logo-text {
    font-size: 12px;
    max-width: 90px;
  }
  .btn {
    font-size: 14px;
    letter-spacing: 0;
    padding-left: 14px;
    padding-right: 14px;
  }
  .intro-title,
  .step-title,
  .detail-title {
    font-size: 25px;
  }
  .steps i {
    width: 16px;
  }
  .category-option {
    font-size: 12px;
  }
  .filter-row {
    grid-template-columns: 1fr;
  }
}

/* Handy im Querformat: Seitenleiste wie am Computer, aber kompakter */
@media (max-height: 520px) and (orientation: landscape) {
  :root {
    --topbar-h: 50px;
    --panel-w: min(46vw, 400px);
  }
  .topbar {
    padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
    gap: 12px;
  }
  .brand-title {
    font-size: 18px;
  }
  .brand-city {
    font-size: 12px;
  }
  .logo-text {
    font-size: 13px;
  }
  .logo-img {
    height: 32px;
  }
  .topbar-cta {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 13px;
  }
  .panel {
    padding-left: env(safe-area-inset-left);
  }
  .intro {
    padding: 16px 18px;
  }
  .intro-title {
    font-size: 24px;
  }
  .intro-text {
    font-size: 14px;
    margin-bottom: 14px;
  }
  .step-title,
  .detail-title {
    font-size: 22px;
  }
  .stat {
    padding: 8px 4px;
  }
  .stat-num {
    font-size: 22px;
  }
  .chip {
    min-height: 40px;
  }
}

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