:root {
  --bg: #0f1a14;
  --panel: #16241c;
  --ink: #f4f1ea;
  --muted: #b7c4ba;
  --accent: #2f6f4e;
  --line: #2a3d32;
  --pin: #c45c26;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  padding: 0.75rem 1rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  background: #132017;
}

h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.status {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.layout {
  display: grid;
  height: calc(100% - 4.2rem);
  grid-template-rows: 1fr;
}

#map {
  min-height: 0;
  height: 100%;
}

.map-wrap {
  position: relative;
  min-height: 0;
}

.suggest-btn {
  position: absolute;
  z-index: 400;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  max-width: calc(100% - 2rem);
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.suggest-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.report-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 1rem;
}

.report-btn {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.toast {
  position: fixed;
  z-index: 800;
  left: 50%;
  bottom: 5.5rem;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: #1e3d2c;
  border: 1px solid var(--accent);
  color: var(--ink);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.toast-error {
  background: #4a1c18;
  border-color: #c45c26;
}

.toast[hidden] {
  display: none;
}

.panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  max-height: min(70vh, 32rem);
  overflow: auto;
  padding: 1rem 1.1rem 1.4rem;
  padding-bottom: max(1.4rem, env(safe-area-inset-bottom));
  background: var(--panel);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}

.panel[hidden] {
  display: none;
}

.close {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.panel h2 {
  margin: 0 1.6rem 0.4rem 0;
  font-size: 1.15rem;
}

.rating {
  margin: 0 0 0.8rem;
  color: var(--muted);
}

dl {
  margin: 0;
}

dt {
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

dd {
  margin: 0.15rem 0 0;
}

.hours {
  margin: 0;
  padding-left: 1.1rem;
}

a {
  color: #8fd0a8;
}

.leaflet-container {
  background: #1a2a20;
  font: inherit;
}

.custom-pin,
.group-pin {
  background: none;
  border: 0;
}

.group-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  border: 2px solid #f4f1ea;
  font: 700 0.75rem/1 system-ui, sans-serif;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.group-marker.medium {
  width: 38px;
  height: 38px;
  font-size: 0.8rem;
}

.group-marker.large {
  width: 46px;
  height: 46px;
  font-size: 0.85rem;
}

@media (min-width: 720px) {
  .layout {
    grid-template-columns: 1fr 22rem;
    grid-template-rows: 1fr;
    height: calc(100% - 4.4rem);
  }

  .suggest-btn {
    left: 0.9rem;
    transform: none;
    bottom: 1.1rem;
  }

  .toast {
    bottom: 1.4rem;
  }

  .panel {
    position: static;
    max-height: none;
    border-top: 0;
    border-left: 1px solid var(--line);
    box-shadow: none;
  }

  .panel[hidden] {
    display: none;
  }

  .layout:has(.panel[hidden]) {
    grid-template-columns: 1fr;
  }
}
