:root {
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #d7dee8;
  --panel: rgba(255, 255, 255, 0.94);
  --blue: #2563eb;
  --sky: #0891b2;
  --orange: #f59e0b;
  --green: #059669;
  --brown: #5b554f;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.22);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "YuGothic", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  overflow: hidden;
  background: #bfe7ef;
}

.app-shell,
.map-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
}

.map-stage {
  background: #bfe7ef;
}

#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #bfe7ef;
}

.leaflet-container {
  width: 100%;
  height: 100%;
  background: #bfe7ef;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-container {
  overflow: hidden;
  touch-action: pan-x pan-y;
  -webkit-tap-highlight-color: transparent;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
  -webkit-user-drag: none;
}

.leaflet-tile {
  border: 0;
  width: 256px;
  height: 256px;
  image-rendering: auto;
  backface-visibility: hidden;
}

.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-control {
  pointer-events: auto;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-control-zoom a {
  display: block;
  width: 30px;
  height: 30px;
  background: #fff;
  color: #111827;
  text-align: center;
  line-height: 30px;
  text-decoration: none;
  border-bottom: 1px solid #d1d5db;
}

.leaflet-control-attribution {
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.84);
  font-size: 11px;
}

.leaflet-popup {
  position: absolute;
  text-align: center;
}

.leaflet-popup-content-wrapper {
  padding: 1px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.leaflet-popup-content {
  margin: 13px;
  line-height: 1.4;
}

.leaflet-popup-tip-container {
  width: 40px;
  height: 20px;
  position: absolute;
  left: 50%;
  margin-left: -20px;
  overflow: hidden;
  pointer-events: none;
}

.leaflet-popup-tip {
  width: 17px;
  height: 17px;
  padding: 1px;
  margin: -10px auto 0;
  transform: rotate(45deg);
  background: #fff;
  box-shadow: var(--shadow);
}

.map-notice {
  position: absolute;
  z-index: 7;
  left: 24px;
  right: 370px;
  bottom: 24px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #374151;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.top-search {
  position: absolute;
  top: 22px;
  left: 24px;
  right: 370px;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 0.9fr) 68px;
  gap: 12px;
  align-items: stretch;
}

.search-field {
  min-height: 66px;
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  padding: 0 18px;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
}

.search-field span {
  font-size: 0;
}

.search-field span::before {
  content: "🔍";
  font-size: 35px;
}

.search-field.wish span::before {
  content: "✨";
}

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

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

.top-search input {
  border: 0;
  padding: 0;
  font-size: 20px;
  font-weight: 700;
  background: transparent;
}

input::placeholder,
textarea::placeholder {
  color: #98a1b2;
}

button {
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.icon-button,
.primary-button {
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.icon-button {
  font-size: 20px;
}

.control-panel {
  position: absolute;
  top: 22px;
  right: 24px;
  z-index: 5;
  width: 322px;
  padding: 22px 24px;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hello {
  margin: 0 0 14px;
  font-size: 21px;
  font-weight: 800;
}

.hello strong {
  color: #22c55e;
}

.primary-button {
  width: 100%;
  min-height: 56px;
  font-size: 22px;
}

.budget-button {
  width: 100%;
  min-height: 78px;
  margin: 14px 0;
  border-radius: 8px;
  background: var(--orange);
  color: #fff;
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.26);
}

.budget-button span,
.budget-button small {
  display: block;
}

.budget-button span {
  font-size: 27px;
}

.budget-button small {
  margin-top: 2px;
  font-size: 16px;
}

.toggle-stack {
  display: grid;
  gap: 10px;
}

.toggle {
  min-height: 52px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #374151;
  font-size: 21px;
}

.toggle[data-category="beach"].active {
  background: var(--sky);
  border-color: var(--sky);
  color: #fff;
}

.toggle[data-category="station"].active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.toggle[data-category="food"].active {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.recommend-panel {
  position: absolute;
  left: 24px;
  bottom: 26px;
  z-index: 6;
  width: min(580px, calc(100vw - 48px));
  max-height: 45vh;
  overflow: auto;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.hidden {
  display: none;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.panel-head h2 {
  margin: 2px 0 10px;
  font-size: 24px;
  line-height: 1.25;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.small-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #eef2f7;
  color: #4b5563;
  font-size: 26px;
  line-height: 1;
}

.recommend-list,
.budget-list {
  display: grid;
  gap: 10px;
}

.place-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.place-card h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.place-card p {
  margin: 0;
  color: #4b5563;
  line-height: 1.45;
}

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

.chip {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef6ff;
  color: #075985;
  font-size: 13px;
  font-weight: 800;
}

.jump-button {
  align-self: center;
  min-width: 78px;
  min-height: 42px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
}

.pin-marker {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 999px 999px 999px 0;
  transform: rotate(-45deg);
  background: #fff;
  border: 6px solid var(--sky);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.35);
}

.pin-marker span {
  transform: rotate(45deg);
  font-size: 23px;
}

.pin-marker.beach {
  border-color: #facc15;
}

.pin-marker.station {
  border-color: #16a34a;
}

.pin-marker.food {
  border-color: #dc2626;
}

.pin-marker.custom {
  border-color: #a855f7;
}

.fallback-map {
  position: relative;
  overflow: hidden;
}

.fallback-map::before {
  content: "沖縄";
  position: absolute;
  left: 52%;
  top: 48%;
  transform: translate(-50%, -50%) rotate(-26deg);
  width: 24vw;
  min-width: 180px;
  height: 68vh;
  border-radius: 55% 45% 50% 45%;
  background: linear-gradient(180deg, #8ccf99, #edf1d1 48%, #7fc28d);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.45), inset 0 0 42px rgba(20, 83, 45, 0.18);
  color: rgba(31, 41, 55, 0.34);
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 900;
}

.fallback-pin {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
}

.fallback-pin .pin-marker {
  position: relative;
  flex: 0 0 auto;
}

.fallback-label {
  max-width: 160px;
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.95);
  color: #222;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.3);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaflet-tooltip.place-label {
  border: 0;
  border-radius: 7px;
  padding: 5px 10px;
  color: #222;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.3);
}

.popup-card {
  min-width: 230px;
}

.popup-card h3 {
  margin: 4px 0;
  font-size: 22px;
}

.popup-card p {
  margin: 6px 0;
  font-size: 15px;
  line-height: 1.45;
}

.rating {
  color: #b45309;
  font-weight: 900;
}

.popup-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.popup-actions a,
.popup-actions button {
  flex: 1;
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  text-decoration: none;
  background: #e0f2fe;
  color: #075985;
  font-weight: 900;
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}

.dialog-card {
  width: min(430px, calc(100vw - 40px));
  display: grid;
  gap: 14px;
  padding: 20px;
  background: #fff;
}

.dialog-card.wide {
  width: min(760px, calc(100vw - 40px));
}

.dialog-card label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

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

  .top-search {
    top: calc(10px + env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    grid-template-columns: 1fr 54px;
    gap: 8px;
  }

  .search-field {
    min-height: 54px;
    grid-template-columns: 40px 1fr;
    padding: 0 12px;
  }

  .search-field span::before {
    font-size: 26px;
  }

  .search-field.wish {
    grid-column: 1 / -1;
    order: 2;
  }

  .icon-button {
    order: 1;
    min-height: 54px;
  }

  .top-search input {
    font-size: 16px;
  }

  .control-panel {
    right: 10px;
    left: 10px;
    top: auto;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: auto;
    padding: 12px;
    border-radius: 8px;
  }

  .hello,
  .budget-button {
    display: none;
  }

  .primary-button {
    min-height: 48px;
    font-size: 18px;
  }

  .toggle-stack {
    grid-template-columns: 1fr 1fr;
    margin-top: 10px;
    gap: 8px;
  }

  .toggle {
    min-height: 44px;
    font-size: 16px;
  }

  .recommend-panel {
    bottom: calc(206px + env(safe-area-inset-bottom));
    left: 10px;
    width: calc(100vw - 20px);
    max-height: 34dvh;
    padding: 12px;
  }

  .map-notice {
    left: 10px;
    right: 10px;
    bottom: calc(206px + env(safe-area-inset-bottom));
    font-size: 13px;
  }

  .place-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .jump-button {
    width: 100%;
  }

  .leaflet-tooltip.place-label,
  .fallback-label {
    font-size: 12px;
    max-width: 118px;
  }

  .pin-marker {
    width: 42px;
    height: 42px;
    border-width: 5px;
  }

  .pin-marker span {
    font-size: 19px;
  }
}

@media (max-width: 480px) {
  .top-search {
    grid-template-columns: 1fr 50px;
  }

  .search-field {
    min-height: 50px;
  }

  .top-search input {
    font-size: 14px;
  }

  .primary-button {
    min-height: 44px;
  }

  .toggle {
    min-height: 40px;
    font-size: 14px;
  }

  .recommend-panel {
    bottom: calc(190px + env(safe-area-inset-bottom));
  }
}
