* {
  box-sizing: border-box;
}

/* Visually hidden but accessible to screen readers and keyboard users */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 4px 8px;
}

body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  color: #111827;
  background: #f9fafb;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

#clearBtn {
  display: none;
}

.wrap {
  width: 100%;
  max-width: 720px;
  text-align: center;
}
.logo {
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.logo img {
  width: 220px;
  aspect-ratio: 600 / 500;
  border-radius: 10px;
  display: block;
  margin: 0 auto 8px;
}
h1 {
  margin: 0;
  font-size: 36px;
  letter-spacing: -0.5px;
}
.term {
  font-weight: 600;
  margin-left: -32px;
  color: #374151;
  min-width: 160px;
  display: inline-block;
  text-align: right;
}
.term span {
  display: inline-block;
  transition:
    opacity 300ms ease,
    transform 300ms ease;
}
.term.fade-out span {
  opacity: 0;
  transform: translateY(-6px);
}
.term.fade-in span {
  opacity: 1;
  transform: translateY(0);
}
.sub {
  color: #6b7280;
  margin-bottom: 24px;
}

/* Beta notice displayed on the start page */
.beta-notice {
  margin: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  text-align: center;
  font-size: 13px;
}

/* theme colors (einsatz already defined in navigation.css) */
.term.einsatz {
  color: #b91c1c;
}
.term.wellness {
  color: #0ea5a4;
}
.term.hotel {
  color: #f59e0b;
}
.term.speise {
  color: #10b981;
}
.term.tankstellen {
  color: #0891b2;
}
.term.parkplatz {
  color: #1d4ed8;
}
.term.event {
  color: #7c3aed;
}
.term.land {
  color: #141414;
}
.term.natur {
  color: #6de90e;
}
.term.kultur {
  color: #f43f5e;
}
.term.sport {
  color: #ef4444;
}
.term.freizeit {
  color: #1fddff;
}
.search {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 8px 12px 8px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  margin-bottom: 6px;
}
.search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 16px;
  padding: 10px 6px;
  background: transparent;
}
.search button {
  min-width: 0;
  border: none;
  background: #2563eb;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    box-shadow 0.2s;
  outline: none;
}
.search button:hover,
.search button:focus-visible {
  background: #1d4ed8;
  box-shadow: 0 0 0 3px #93c5fd;
}
.search button:active {
  background: #1e40af;
}
.search .clear {
  position: absolute;
  right: 96px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #6b7280;
  padding: 6px 8px;
  font-size: 18px;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
  outline: none;
}
.search .clear:hover,
.search .clear:focus-visible {
  background: #f3f4f6;
  color: #111827;
}
.search .clear.hidden {
  display: none;
}
.near,
.locate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  transition:
    background 0.2s,
    color 0.2s,
    box-shadow 0.2s;
  outline: none;
}

/* Mobile tweaks: prevent the locate button from forcing horizontal overflow
   by hiding its text label and allowing buttons to shrink. */
@media (max-width: 480px) {
  .wrap {
    padding: 12px;
  }
  .search {
    padding: 6px 10px;
    gap: 6px;
  }
  .search input {
    font-size: 15px;
    padding: 8px 6px;
  }
  .search .btn-label {
    display: none;
  }
  .near,
  .locate,
  .chip,
  .btn-neutral {
    padding: 8px 10px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .search .clear {
    right: 84px;
  }
}
.near:hover,
.near:focus-visible,
.locate:hover,
.locate:focus-visible {
  background: #f3f4f6;
  color: #1d4ed8;
  box-shadow: 0 0 0 3px #93c5fd;
}
.near:active,
.locate:active {
  background: #e0e7ef;
}
.near[disabled],
.locate[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
.chips {
  margin: 16px 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.chip {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    box-shadow 0.2s;
  outline: none;
}
.chip:hover {
  background: #f3f4f6;
  color: #1d4ed8;
}
.chip:focus-visible {
  background: #f3f4f6;
  color: #1d4ed8;
  box-shadow: 0 0 0 3px #93c5fd;
}
.chip:active {
  background: #e0e7ef;
}
.map-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: center;
}
#openMapLocBtn {
  display: none;
}
.btn-neutral {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: #374151;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition:
    background 0.12s,
    box-shadow 0.12s,
    transform 0.08s;
  outline: none;
}
.btn-neutral:hover,
.btn-neutral:focus-visible {
  background: #f8fafc;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}
.btn-neutral:active {
  transform: translateY(0);
}

.list {
  text-align: left;
  margin: 6px auto 0;
  width: 100%;
  max-width: 720px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  display: none;
}
.item {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s;
}
.item:last-child {
  border-bottom: none;
}
.item:hover {
  background: #e0f2fe;
  color: #0c4a6e;
}
.item.active {
  background: #bae6fd;
  color: #0c4a6e;
  box-shadow: 0 0 0 3px #38bdf8;
}

.item-title {
  font-weight: 600;
}
.item-sub {
  color: #6b7280;
  font-size: 13px;
  margin-top: 2px;
}
.item-detail {
  color: #4b5563;
  font-size: 11px;
  margin-top: 2px;
}
.item-desc {
  color: #6b7280;
  font-size: 11px;
  margin-top: 4px;
  font-style: italic;
  line-height: 1.4;
  border-top: 1px solid #f3f4f6;
  padding-top: 4px;
}
.item mark {
  background: #fef3c7;
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}
footer {
  margin-top: 24px;
  font-size: 12px;
  color: #9ca3af;
}
footer a {
  color: #6b7280;
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}

/* Mobile optimizations */
@media (max-width: 600px) {
  body {
    padding: 12px;
  }
  .wrap {
    max-width: 100%;
    padding: 0 8px;
  }
  h1 {
    font-size: 28px;
  }
  .sub {
    font-size: 14px;
    margin-bottom: 16px;
  }

  .search {
    flex-direction: row;
    gap: 6px;
    padding: 8px 10px;
  }
  .search input {
    font-size: 18px;
    padding: 12px 8px;
  }
  .search button {
    padding: 10px 12px;
  }

  .near,
  .locate,
  .chip {
    padding: 10px 12px;
    font-size: 15px;
  }

  .chips {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .list {
    margin: 10px 0;
    width: calc(100% - 8px);
    border-radius: 16px;
  }
  .item {
    padding: 18px 14px;
    font-size: 17px;
    line-height: 1.5;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    -webkit-tap-highlight-color: #bae6fd;
    transition:
      background 0.15s,
      color 0.15s;
    touch-action: manipulation;
  }
  .item:active {
    background: #e0f2fe;
    color: #0c4a6e;
  }
  .item-title {
    font-size: 18px;
  }
  .item-sub {
    font-size: 15px;
  }

  footer {
    margin-top: 18px;
    font-size: 13px;
  }
}

@media (max-width: 400px) {
  .item {
    padding: 16px 8px;
    font-size: 16px;
  }
  .item-title {
    font-size: 16px;
  }
  .item-sub {
    font-size: 13px;
  }
}

/* Larger mobile / small tablets */
@media (min-width: 601px) and (max-width: 900px) {
  .wrap {
    max-width: 640px;
  }
  h1 {
    font-size: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .term span,
  .btn-neutral,
  .near,
  .locate,
  .chip,
  .item {
    transition: none;
  }
  .term.fade-out span,
  .term.fade-in span {
    opacity: 1;
    transform: none;
  }
}
