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

html {
  scroll-behavior: smooth;
}

body {
  background: #f0efec;
  color: #1a1a1a;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 48px;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 24px 0;
  background: #f0efec;
}

.nav-logo {
  padding: 7px 14px;
  border-radius: 10px;
  background: #1a1a1a;
  color: white;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.nav-links a {
  padding: 6px 16px;
  border-radius: 8px;
  color: #555;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-links a:hover {
  background: #1a1a1a;
  color: white;
}

.mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 10px;
  padding: 12px 16px;
  border: 1px solid #dedad5;
  border-radius: 12px;
  background: #fbfaf7;
  color: #3f3b37;
}

.mode-banner div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
}

.mode-banner strong {
  color: #1a1a1a;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mode-banner span,
.mode-banner a {
  font-size: 13px;
  line-height: 1.45;
}

.mode-banner a {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 8px;
  background: #1a1a1a;
  color: white;
  font-weight: 600;
}

.tool-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 32px;
  align-items: end;
  padding: 40px 0 44px;
}

.section-label {
  margin-bottom: 18px;
  color: #1a1a1a;
  font-size: 28px;
  font-weight: 400;
}

.section-label-logo {
  display: flex;
  align-items: center;
}

.section-label-logo svg {
  height: 88px;
  width: auto;
  display: block;
}

.tool-hero h1 {
  max-width: 760px;
  font-size: 56px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-card,
.toolbar,
.results-area,
.detail-card,
.tournament-card {
  border: 1px solid #dedad5;
  border-radius: 16px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.hero-card {
  padding: 24px;
}

.hero-card p {
  color: #444;
  font-size: 15px;
  line-height: 1.7;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-meta span,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 10px;
  border: 1px solid #cfcac4;
  border-radius: 20px;
  background: #ebe7e1;
  color: #1a1a1a;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding-bottom: 80px;
}

.toolbar {
  position: sticky;
  top: 96px;
  padding: 24px;
}

.brand-block {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.eyebrow {
  color: #68615b;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h2 {
  color: #1a1a1a;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
}

h3 {
  color: #1a1a1a;
  font-size: 16px;
  font-weight: 700;
}

.brand-block p:not(.eyebrow),
.tournament-card p,
.detail-panel p,
.empty-state p {
  color: #3f3b37;
  font-size: 13px;
  line-height: 1.6;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field,
.check-row {
  display: grid;
  gap: 7px;
}

.field-wide,
.segmented,
.actions,
.check-row {
  grid-column: 1 / -1;
}

.field span,
.segmented legend {
  color: #888;
  font-size: 12px;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #e0dedd;
  border-radius: 10px;
  background: #f8f7f5;
  color: #1a1a1a;
}

.location-field {
  gap: 8px;
}

.location-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.location-controls .ghost-button {
  min-height: 42px;
  padding: 0 14px;
  white-space: nowrap;
}

.location-input {
  position: relative;
  display: flex;
  align-items: center;
}

.location-input input {
  width: 100%;
  padding-right: 84px;
}

.input-icon-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #555;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.input-icon-button:hover {
  background: #eae6df;
  color: #1a1a1a;
}

.input-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#useLocation.input-icon-button { right: 44px; }
#pickOnMap.input-icon-button  { right: 6px; }

.field-hint {
  margin: 0;
  color: #5f5953;
  font-size: 12px;
  line-height: 1.4;
}

.field-value {
  float: right;
  font-weight: 700;
  color: #1a1a1a;
  font-size: 12px;
}

.radius-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.radius-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px 2px 8px;
  border: 1px solid #d9d4ce;
  border-radius: 8px;
  background: #fbfaf7;
  font-size: 12px;
  font-weight: 700;
  color: #1a1a1a;
  transition: border-color 0.15s ease;
}

.radius-input-wrap:focus-within {
  border-color: #1a1a1a;
  background: #fff;
}

.radius-input-wrap input {
  width: 36px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: right;
  outline: none;
  /* Spinner-Pfeile entfernen */
  -moz-appearance: textfield;
}

.radius-input-wrap input::-webkit-outer-spin-button,
.radius-input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.radius-unit {
  color: #5f5953;
  font-weight: 600;
}

.range-input {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
  outline: none;
  padding: 0;
  margin: 14px 0 6px;
  cursor: pointer;
}

.range-input::-webkit-slider-runnable-track {
  height: 6px;
  background: #d9d4ce;
  border-radius: 999px;
}

.range-input::-moz-range-track {
  height: 6px;
  background: #d9d4ce;
  border-radius: 999px;
  border: 0;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 3px solid #f0efec;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  margin-top: -7px;
}

.range-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 3px solid #f0efec;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.range-input:focus {
  outline: 3px solid rgba(26, 26, 26, 0.08);
  outline-offset: 2px;
}

.field-hint[data-state="error"] {
  color: #8a2824;
  font-weight: 700;
}

.field input:focus,
.field select:focus {
  border-color: #1a1a1a;
  outline: 3px solid rgba(26, 26, 26, 0.08);
}

.segmented {
  display: grid;
  gap: 7px;
  border: 0;
}

.segmented legend {
  padding: 0;
}

.segmented-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border-radius: 12px;
  background: #f8f7f5;
}

.segmented-options label {
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #555;
  font-size: 13px;
  font-weight: 600;
}

.segmented input:checked + span {
  border-color: #d8d5d2;
  background: white;
  color: #1a1a1a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #555;
  font-size: 13px;
  font-weight: 500;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: #1a1a1a;
}

.actions {
  display: flex;
  gap: 10px;
}

.primary-button,
.ghost-button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.primary-button {
  flex: 1;
  background: #1a1a1a;
  color: white;
}

.ghost-button {
  padding: 0 14px;
  background: #f0efec;
  color: #555;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.results-area {
  min-width: 0;
  padding: 24px;
}

.topline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.compact {
  width: min(220px, 100%);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.content-grid.has-detail {
  grid-template-columns: minmax(0, 1fr) clamp(320px, 34vw, 390px);
}

.tournament-list {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.list-panel,
.detail-panel {
  min-width: 0;
}

.tournament-card {
  display: grid;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.tournament-card:hover,
.tournament-card.is-active {
  transform: translateY(-3px);
  border-color: #1a1a1a;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.16);
}

.tournament-card.is-active {
  background: #fbfaf8;
}

.tournament-card h3,
.tournament-card p {
  overflow-wrap: anywhere;
}

/* === Result card — mobile first === */

.card-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  align-items: stretch;
}

.date-tile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  height: 28px;
  padding: 0 12px;
  border: 1px solid #dedad5;
  border-radius: 999px;
  background: #fbfaf7;
  font-family: Inter, sans-serif;
  user-select: none;
}

.date-tile .date-weekday {
  background: none;
  color: #1a1a1a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0;
}

.date-tile .date-day {
  font-size: 13px;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1;
  padding: 0;
}

.date-tile .date-month {
  font-size: 11px;
  font-weight: 700;
  color: #5f5953;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0;
}

.date-tile-empty {
  color: #aaa;
}

.date-tile-empty .date-day {
  color: #aaa;
  font-size: 13px;
}

.card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.card-sub {
  margin: 0;
  font-size: 13px;
  color: #5f5953;
  font-weight: 500;
}

.card-facts-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12px;
  color: #3f3b37;
  font-weight: 600;
}

.card-facts-inline:empty { display: none; }

.fact {
  white-space: nowrap;
}

.card-title {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

.card-classes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 9px;
  border-radius: 6px;
  background: #efece6;
  color: #3f3b37;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pill.association {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: white;
}

.card-distance {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px dashed #d9d4ce;
  text-align: left;
}

.dist-air {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: #1a1a1a;
}

.dist-air-value {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.dist-air-unit {
  font-size: 12px;
  font-weight: 600;
  color: #5f5953;
}

.dist-air-sub {
  font-size: 11px;
  color: #5f5953;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dist-drive {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: none;
  min-width: 0;
}

.dist-drive-value {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
}

.dist-drive-sub {
  font-size: 11px;
  color: #5f5953;
  font-weight: 500;
}

.dist-drive.is-loading {
  animation: dist-pulse 1.4s ease-in-out infinite;
}

.dist-drive.is-loading .dist-drive-value,
.dist-drive.is-missing .dist-drive-value {
  color: #999;
  font-weight: 600;
}

@keyframes dist-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.card-distance-missing {
  font-size: 12px;
  color: #5f5953;
  text-align: right;
}

.card-distance-missing .dist-note {
  font-weight: 700;
  color: #1a1a1a;
}

.card-distance-missing .dist-sub {
  display: block;
  font-size: 11px;
  margin-top: 2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge-open {
  background: #e4ecdf;
  color: #335521;
}

.badge-soon {
  background: #fff0bd;
  color: #5e4300;
}

.badge-closed {
  background: #f4d1ce;
  color: #7a1f1a;
}

.detail-panel {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 0;
  width: 100%;
  max-height: calc(100vh - 120px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.detail-panel[hidden] {
  display: none;
}

.detail-panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 12px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid #d9d4ce;
}

.detail-panel-header h2 {
  margin-top: 2px;
}

.detail-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-color: #cfcac4;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #1a1a1a;
  border-radius: 50%;
  background: #1a1a1a;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition: background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.icon-button path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.icon-button:hover {
  background: white;
  color: #1a1a1a;
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.2);
}

.map-embed {
  display: grid;
  gap: 8px;
}

.map-embed .map-canvas {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 210px;
  border: 1px solid #d9d4ce;
  border-radius: 14px;
  background: #e9e5da;
  overflow: hidden;
  z-index: 0;
}

.map-embed .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.75);
  font-size: 10px;
  padding: 1px 6px;
}

.map-open-link {
  justify-self: start;
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.map-open-link:hover {
  color: #555;
}

.detail-list {
  display: grid;
  gap: 0;
  margin-top: 14px;
}

.detail-list div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid #e1ddd7;
}

.detail-list dt {
  color: #5f5953;
  font-size: 12px;
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
  color: #1f1d1b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.class-details {
  margin-top: 18px;
}

.class-details-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5f5953;
}

.class-details-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.class-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #e1ddd7;
  border-radius: 8px;
  background: #faf8f4;
}

.class-card.is-full {
  opacity: 0.55;
  background: #f1eee9;
}

.class-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.class-card-name {
  font-size: 12px;
  font-weight: 700;
  color: #1f1d1b;
  line-height: 1.3;
}

.class-card-badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 10px;
  background: #c44a3b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.class-card-ttr {
  font-size: 12px;
  font-weight: 600;
  color: #3f3b37;
}

.class-card-meta {
  font-size: 11px;
  color: #6b655f;
  line-height: 1.4;
}

.chip.is-full {
  background: #eadcd9;
  color: #8a3a2f;
  text-decoration: line-through;
  text-decoration-color: rgba(138, 58, 47, 0.55);
}

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

.demo-note {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #ead6bd;
  border-radius: 10px;
  background: #fff7ed;
  color: #5d4530;
  font-size: 12px;
  line-height: 1.5;
}

.detail-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid #d0cbc5;
  background: #ebe7e1;
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.detail-cta.primary {
  border-color: #1a1a1a;
  background: #1a1a1a;
  color: white;
}

.detail-cta:hover {
  border-color: #1a1a1a;
  background: #f8f7f5;
  transform: translateY(-1px);
}

.detail-cta.primary:hover {
  background: #000;
  color: white;
}

.empty-state {
  padding: 28px;
  border-radius: 16px;
  background: #f8f7f5;
}

.empty-state-illustrated {
  text-align: left;
}

.empty-state-art {
  display: block;
  width: 220px;
  max-width: 60%;
  height: auto;
  margin: 18px 0 0;
  user-select: none;
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-top: 1px solid #e0dedd;
}

footer span,
footer span a,
.footer-links,
.footer-links a {
  color: #aaa;
  font-size: 13px;
}

.data-freshness {
  font-variant-numeric: tabular-nums;
}

footer span a:hover {
  color: #555;
}

.footer-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.footer-links a:hover {
  color: #555;
}

/* === Result card — Desktop-Layout (Drei-Spalten-Grid) === */
@media (min-width: 769px) {
  .card-grid {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    padding: 18px 20px 16px;
    align-items: start;
  }

  .date-tile {
    display: grid;
    grid-template-rows: auto auto auto;
    align-self: start;
    width: 56px;
    height: auto;
    gap: 0;
    padding: 0;
    border-radius: 10px;
    background: #fbfaf7;
    overflow: hidden;
    text-align: center;
  }

  .date-tile .date-weekday {
    background: #1a1a1a;
    color: #fff;
    font-size: 10px;
    letter-spacing: 0.12em;
    padding: 4px 0;
  }

  .date-tile .date-day {
    font-size: 22px;
    padding: 8px 0 2px;
  }

  .date-tile .date-month {
    font-size: 10px;
    letter-spacing: 0.1em;
    padding: 0 0 7px;
  }

  .date-tile-empty .date-day {
    font-size: 18px;
  }

  .card-distance {
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    border-top: none;
    padding-top: 0;
    min-width: 100px;
    gap: 6px;
  }

  .dist-air-value {
    font-size: 26px;
  }

  .dist-drive {
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px dashed #d9d4ce;
  }
}

@media (max-width: 1020px) {
  .tool-hero,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .content-grid,
  .content-grid.has-detail {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .detail-panel {
    position: static;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 24px;
  }

  .tool-hero {
    padding: 32px 0 36px;
  }

  .tool-hero h1 {
    font-size: 42px;
  }

  .topline {
    align-items: stretch;
    flex-direction: column;
  }

  .location-controls {
    grid-template-columns: 1fr;
  }

  /* Card-Layout: Mobile-Default (Flex-Column) bleibt — Detail-Panel-Override unten. */

  .detail-panel {
    position: fixed;
    inset: auto 16px 16px;
    z-index: 200;
    max-height: 82vh;
    overflow: auto;
    padding: 14px;
    border-radius: 18px;
    background: #f0efec;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
  }

  .detail-panel-header {
    padding: 0;
  }

  .detail-card {
    border: 1px solid #e0dedd;
  }

}

@media (max-width: 520px) {
  .container {
    padding: 0 16px;
  }

  nav {
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: calc(100% - 118px);
  }

  .nav-links a {
    padding: 6px 8px;
    font-size: 13px;
  }

  .mode-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-banner a {
    text-align: center;
  }

  .tool-hero h1 {
    font-size: 32px;
  }

  .section-label,
  h2 {
    font-size: 22px;
  }

  .filters,
  .segmented-options {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }

  .detail-list div {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

.map-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 26, 26, 0.55);
  padding: 32px;
}

.map-picker-overlay[hidden] {
  display: none;
}

.map-picker {
  background: #f0efec;
  border-radius: 18px;
  width: min(880px, 100%);
  max-height: calc(100vh - 64px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.map-picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 12px;
}

.map-picker-header h2 {
  font-size: 22px;
  margin-top: 2px;
}

.map-picker-canvas {
  width: 100%;
  height: 60vh;
  min-height: 320px;
  background: #e9e5da;
  border-top: 1px solid #d9d4ce;
  border-bottom: 1px solid #d9d4ce;
  z-index: 0;
}

.map-picker-canvas .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.75);
  font-size: 10px;
  padding: 1px 6px;
}

.map-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px 20px;
  flex-wrap: wrap;
}

.map-picker-status {
  font-size: 13px;
  color: #555;
  margin: 0;
}

.map-picker-status[data-state="error"] {
  color: #b00020;
}

.map-picker-actions {
  display: flex;
  gap: 10px;
}

.map-picker-actions .detail-cta[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

.drive-time {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #d9d4ce;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: #555;
}

.drive-time strong {
  color: #1a1a1a;
  font-size: 15px;
}

.drive-time.is-loading strong,
.drive-time.is-missing strong {
  color: #888;
  font-weight: 600;
}

.drive-time.is-loading {
  animation: drive-pulse 1.4s ease-in-out infinite;
}

@keyframes drive-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 14px 18px;
  background: #fbfaf7;
  border: 1px solid #e1ddd7;
  border-radius: 14px;
  flex-wrap: wrap;
}

.pagination button[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.pagination-info {
  font-size: 13px;
  color: #555;
}
