:root {
  color-scheme: only light;
  --bg: #f7efe7;
  --ink: #1f1c1a;
  --muted: #5c5b5b;
  --accent: #ff6a4f;
  --accent-dark: #e1563e;
  --sea: #12736f;
  --card: #fff9f1;
  --stroke: #e4d6c7;
  --shadow: 0 24px 40px rgba(18, 26, 28, 0.18);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Work Sans", sans-serif;
  background: radial-gradient(circle at 10% 10%, #fff6ea 0%, #f9efe2 38%, #f4e7d7 100%);
  color: var(--ink);
  min-height: 100vh;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0;
}

a {
  color: inherit;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 18px 18px 12px;
  background: rgba(255, 249, 241, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stroke);
  box-shadow: 0 12px 24px rgba(44, 38, 32, 0.06);
}

.topbar__title {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.title-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sea);
  margin: 0 0 6px;
}

.subtitle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.subtitle-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
  flex: 1;
}

.subtitle__kicker {
  font-weight: 600;
  color: var(--sea);
}

.subtitle__detail {
  display: none;
}

.cta {
  border: none;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 18px rgba(255, 106, 79, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta--inline {
  height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cta__icon {
  font-size: 1rem;
  line-height: 1;
}

.cta__label {
  display: none;
  font-size: 0.85rem;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--sea);
}

.cta:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 6px 12px rgba(255, 106, 79, 0.3);
}

.cta:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

#debugPanel {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 9999;
  background: rgba(20, 18, 16, 0.9);
  color: #fff;
  font-size: 0.7rem;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 10px;
  max-width: 85vw;
  white-space: pre;
  pointer-events: none;
}

.filters {
  margin-top: 10px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: white;
  padding: 6px 10px;
}

.filters__summary {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.filters__grid {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.filters:not([open]) {
  border: none;
  background: transparent;
  padding: 0;
  margin-top: 0;
}

.filters:not([open]) .filters__grid {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.field input,
.field select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: white;
  font-size: 0.95rem;
  font-family: "Work Sans", sans-serif;
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(255, 106, 79, 0.25);
  border-color: var(--accent);
}

.range-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-wrap input {
  flex: 1;
}

.range-wrap span {
  min-width: 32px;
  font-weight: 600;
  color: var(--sea);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

.switch input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px 18px 30px;
  animation: fadeIn 0.6s ease;
}

.map-column {
  display: grid;
  gap: 16px;
}

.best-card:empty {
  display: none;
}

.street-card:empty {
  display: none;
}

.card--street {
  border: 1px dashed rgba(18, 115, 111, 0.5);
  background: #f0f9f7;
}

.map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--stroke);
  position: relative;
  background: #fdf6ed;
}

#map {
  height: var(--map-height, 46vh);
  min-height: 320px;
}

.map-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  display: none;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.status {
  font-size: 0.9rem;
  color: var(--muted);
}

.list {
  display: grid;
  gap: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
  box-shadow: 0 10px 20px rgba(36, 30, 24, 0.08);
  animation: fadeUp 0.45s ease;
}

.card h3 {
  font-size: 1.05rem;
}

.card--best {
  border: 2px solid #d6a13c;
  background: #fff2d6;
  box-shadow: 0 18px 26px rgba(198, 143, 36, 0.2);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge--best {
  background: #d6a13c;
  color: #3b2a0f;
}

.badge--open {
  background: rgba(18, 115, 111, 0.12);
  color: var(--sea);
}

.badge--closed {
  background: rgba(255, 106, 79, 0.14);
  color: var(--accent-dark);
}

.badge--warning {
  background: rgba(255, 106, 79, 0.2);
  color: var(--accent-dark);
}

.badge--info {
  background: rgba(31, 28, 26, 0.08);
  color: var(--ink);
}

.capacity {
  display: grid;
  gap: 6px;
}

.capacity__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.capacity__note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.capacity__bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(31, 28, 26, 0.08);
  overflow: hidden;
}

.capacity__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.capacity__fill--high {
  background: #1f9d55;
}

.capacity__fill--mid {
  background: #f0a202;
}

.capacity__fill--low {
  background: #e4572e;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-link {
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 600;
  font-family: "Work Sans", sans-serif;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.button-link.primary {
  background: var(--sea);
  color: white;
}

.button-link.secondary {
  background: white;
  color: var(--sea);
  border: 1px solid rgba(18, 115, 111, 0.35);
}

.footer {
  padding: 20px 18px 28px;
  font-size: 0.8rem;
  color: var(--muted);
}

.parking-marker {
  background: white;
  border: 2px solid var(--sea);
  border-radius: 999px;
  padding: 6px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--sea);
  box-shadow: 0 12px 18px rgba(18, 115, 111, 0.25);
}

.parking-marker.best {
  background: #d6a13c;
  border-color: #d6a13c;
  color: #3b2a0f;
}

.machine-marker {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: white;
  border: 2px solid #2b7bbb;
  color: #2b7bbb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  box-shadow: 0 8px 16px rgba(43, 123, 187, 0.3);
}

.user-marker {
  background: #1b4b7a;
  color: white;
  border-radius: 999px;
  padding: 6px 8px;
  font-weight: 600;
  font-size: 0.7rem;
  box-shadow: 0 10px 16px rgba(27, 75, 122, 0.4);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 820px) {
  .content {
    flex-direction: row;
    align-items: flex-start;
  }

  .map-column {
    flex: 1.1;
  }

  .map-wrap {
    position: sticky;
    top: 160px;
    height: fit-content;
  }

  #map {
    height: var(--map-height, 70vh);
  }

  .panel {
    flex: 0.9;
  }

  .topbar__title {
    align-items: flex-start;
  }

  .filters {
    border: none;
    background: transparent;
    padding: 0;
    margin-top: 12px;
  }

  .filters__grid {
    margin-top: 0;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .subtitle__detail {
    display: inline;
  }

  .cta__label {
    display: inline;
  }

  .icon-btn {
    display: none;
  }

  .cta--inline {
    height: auto;
    padding: 8px 14px;
  }
}

@media (max-width: 819px) {
  .content,
  .card {
    animation: none;
  }
}
