:root {
  --ink: #111312;
  --muted: #626861;
  --paper: #fffaf1;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --line: rgba(17, 19, 18, 0.14);
  --shadow: 0 18px 45px rgba(12, 22, 20, 0.18);
  --green: #00a86b;
  --mango: #ffbd00;
  --coral: #ff4f4f;
  --teal: #00a6b2;
  --blue: #1565c0;
  --purple: #7a2dd2;
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
.app-shell,
#map {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #c7f2ff;
  color: var(--ink);
  font-family: var(--font);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  isolation: isolate;
}

#map {
  z-index: 0;
  background: #bdeaf6;
}

.leaflet-control-container .leaflet-top.leaflet-left {
  top: auto;
  bottom: 144px;
  left: 16px;
}

.leaflet-control-zoom {
  border: 0 !important;
  box-shadow: var(--shadow);
}

.leaflet-control-zoom a {
  width: 44px !important;
  height: 44px !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
  font-size: 24px !important;
  line-height: 42px !important;
}

.intro-panel,
.top-search,
.details-panel,
.category-rail {
  position: absolute;
  z-index: 500;
}

.intro-panel {
  top: 16px;
  left: 16px;
  width: min(330px, calc(100vw - 32px));
  max-height: calc(100vh - 170px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.brand-lockup {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 18px 20px;
  background: #080908;
  color: #fff;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--mango), var(--green));
  font-size: 30px;
}

h1,
h2,
p {
  margin: 0;
}

.brand-lockup h1 {
  font-size: clamp(1.6rem, 3.2vw, 2rem);
  line-height: 1;
  letter-spacing: 0;
}

.brand-lockup p {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.intro-copy {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.intro-copy h2 {
  margin-bottom: 8px;
  color: #008b6f;
  font-size: 1.25rem;
}

.intro-copy p,
.disclaimer,
.empty-state,
.submit-form p {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.feature-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.feature-list li {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #333a35;
  font-size: 0.95rem;
}

.primary-button,
.secondary-button,
.icon-button,
.category-chip {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
}

.primary-button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  width: calc(100% - 40px);
  margin: 18px 20px;
  padding: 0 18px;
  background: var(--mango);
  color: #111312;
  box-shadow: 0 12px 20px rgba(255, 189, 0, 0.24);
}

.secondary-button {
  padding: 0 18px;
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.disclaimer {
  margin: 0 20px 20px;
  padding: 12px 0 0;
  border-top: 5px solid;
  border-image: linear-gradient(90deg, var(--green), var(--mango), var(--ink)) 1;
}

.top-search {
  top: 24px;
  left: 370px;
  display: flex;
  gap: 10px;
  width: min(580px, calc(100vw - 760px));
  min-width: 360px;
}

.search-box {
  display: flex;
  flex: 1;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.search-box span {
  font-size: 2rem;
  line-height: 0;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.08rem;
}

.icon-button {
  display: grid;
  width: 58px;
  min-width: 58px;
  place-items: center;
  border: 1px solid var(--line);
  background: #101211;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 1.45rem;
}

.category-rail {
  right: 16px;
  bottom: 16px;
  left: 16px;
  display: flex;
  gap: 8px;
  align-items: stretch;
  padding: 10px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  scrollbar-width: thin;
}

.category-chip {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-width: 105px;
  padding: 0 12px;
  background: #fff;
  border-color: var(--line);
  color: #333a35;
  font-size: 0.88rem;
  white-space: nowrap;
}

.category-chip span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #f0f2ee;
}

.category-chip.is-active {
  background: #101211;
  color: #fff;
}

.details-panel {
  right: 16px;
  bottom: 112px;
  width: min(390px, calc(100vw - 32px));
  max-height: calc(100vh - 160px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateY(0);
  transition: transform 180ms ease, opacity 180ms ease;
}

.details-panel:not(.has-place) {
  transform: translateY(18px);
  opacity: 0.96;
}

.panel-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #111312;
  font-size: 1.3rem;
  line-height: 1;
}

#details-content {
  padding: 22px;
}

.empty-state {
  padding-right: 38px;
}

.place-media {
  display: grid;
  min-height: 150px;
  margin: -4px -4px 16px;
  place-items: center;
  border-radius: 12px;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.64), transparent 28%),
    linear-gradient(135deg, var(--teal), var(--green) 46%, var(--mango));
  color: #fff;
  font-size: 3rem;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.24);
}

.place-title {
  padding-right: 38px;
  font-size: 1.55rem;
  line-height: 1.05;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(0, 166, 178, 0.12);
  color: #07545a;
  font-size: 0.78rem;
  font-weight: 800;
}

.vibe-callout,
.tip-box {
  margin-top: 14px;
  padding: 13px;
  border-radius: var(--radius);
  line-height: 1.42;
}

.vibe-callout {
  background: #111312;
  color: #fff;
  font-weight: 900;
}

.tip-box {
  background: rgba(0, 168, 107, 0.12);
  color: #07533d;
}

.info-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.info-item {
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.info-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 0.84rem;
}

.info-item p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.42;
}

.submit-dialog {
  width: min(520px, calc(100vw - 28px));
  border: 0;
  border-radius: 18px;
  padding: 0;
  background: var(--surface-strong);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
}

.submit-dialog::backdrop {
  background: rgba(0, 0, 0, 0.38);
}

.submit-form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.dialog-heading {
  position: relative;
  display: flex;
  justify-content: space-between;
  padding-right: 44px;
}

.dialog-heading h2 {
  margin-bottom: 5px;
}

.submit-form label {
  display: grid;
  gap: 7px;
  color: #303632;
  font-size: 0.88rem;
  font-weight: 800;
}

.submit-form input,
.submit-form select,
.submit-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
  color: var(--ink);
  resize: vertical;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.dialog-actions .primary-button {
  width: auto;
  margin: 0;
}

.vibe-marker {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 1.16rem;
}

.map-label {
  color: #fff;
  font-weight: 1000;
  line-height: 0.96;
  text-align: center;
  text-shadow:
    -2px -2px 0 #202020,
    2px -2px 0 #202020,
    -2px 2px 0 #202020,
    2px 2px 0 #202020,
    0 5px 10px rgba(0, 0, 0, 0.3);
  transform: rotate(var(--label-rotate, -2deg));
  pointer-events: none;
}

.map-label span {
  display: block;
  max-width: 230px;
  font-size: clamp(1.2rem, 2.2vw, 2rem);
}

.leaflet-popup-content-wrapper {
  border-radius: 12px;
}

.leaflet-popup-content {
  min-width: 210px;
  margin: 14px;
}

.popup-title {
  margin-bottom: 6px;
  font-weight: 900;
}

.popup-vibe {
  color: var(--muted);
  font-size: 0.88rem;
}

.toast {
  position: absolute;
  z-index: 800;
  right: 24px;
  top: 96px;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #111312;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  font-weight: 800;
}

@media (max-width: 980px) {
  .intro-panel {
    top: 12px;
    left: 12px;
    width: min(310px, calc(100vw - 24px));
    max-height: 44vh;
  }

  .top-search {
    top: 12px;
    right: 12px;
    left: auto;
    width: calc(100vw - 348px);
    min-width: 250px;
  }

  .brand-lockup {
    padding: 14px 16px;
  }

  .intro-copy,
  .feature-list {
    padding: 14px 16px;
  }

  .primary-button {
    width: calc(100% - 32px);
    margin: 14px 16px;
  }

  .disclaimer {
    margin: 0 16px 16px;
  }
}

@media (max-width: 760px) {
  body {
    overflow: hidden;
  }

  .intro-panel {
    top: 10px;
    width: calc(100vw - 20px);
    max-height: none;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .intro-copy,
  .feature-list,
  .disclaimer {
    display: none;
  }

  .brand-lockup {
    border-radius: 14px;
    box-shadow: var(--shadow);
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  .brand-lockup h1 {
    font-size: 1.45rem;
  }

  .intro-panel .primary-button {
    position: fixed;
    right: 10px;
    bottom: calc(48vh + 64px);
    z-index: 650;
    width: 48px;
    height: 48px;
    min-height: 48px;
    margin: 0;
    padding: 0;
    border-radius: 12px;
    font-size: 0;
  }

  .top-search {
    top: 82px;
    left: 10px;
    right: 10px;
    width: auto;
    min-width: 0;
  }

  .search-box {
    min-height: 48px;
    border-radius: 12px;
  }

  .search-box input {
    font-size: 0.98rem;
  }

  .icon-button {
    width: 48px;
    min-width: 48px;
  }

  .intro-panel .primary-button span {
    font-size: 1.25rem;
  }

  .details-panel {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 48vh;
    border-radius: 18px 18px 0 0;
  }

  .details-panel:not(.has-place) {
    transform: translateY(calc(100% - 76px));
  }

  .category-rail {
    right: 10px;
    bottom: calc(48vh + 10px);
    left: 10px;
    padding: 8px;
    border-radius: 12px;
  }

  .category-chip {
    min-width: 86px;
    min-height: 40px;
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .leaflet-control-container .leaflet-top.leaflet-left {
    bottom: calc(48vh + 78px);
    left: 10px;
  }

  .map-label span {
    max-width: 170px;
    font-size: 1.2rem;
  }

  .place-media {
    min-height: 118px;
  }
}
