:root {
  --ink: #181713;
  --muted: #6f6a5f;
  --line: #ddd7cb;
  --paper: #f6f1e8;
  --panel: #fffaf1;
  --accent: #1d6f5f;
  --accent-2: #b5462f;
  --dark: #202723;
  --shadow: 0 22px 50px rgba(26, 25, 21, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(380px, 34vw) 1fr;
  min-height: 100vh;
}

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: 100vh;
  overflow: auto;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.masthead {
  padding: 32px 28px 20px;
}

.kicker,
.section-label {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.08;
  letter-spacing: 0;
}

.lead {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.controls {
  display: grid;
  gap: 16px;
  padding: 0 28px 22px;
}

.search-box {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 111, 95, 0.15);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.result-bar button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
}

.chip.is-active {
  border-color: var(--dark);
  background: var(--dark);
  color: #fff;
}

.route-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 28px 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1eadf;
}

.route-panel h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.store-list {
  display: grid;
  gap: 10px;
  padding: 0 18px 28px;
}

.store-card {
  display: grid;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 14px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.store-card:hover,
.store-card.is-selected {
  border-color: var(--line);
  background: #fff;
  box-shadow: 0 8px 24px rgba(32, 39, 35, 0.08);
}

.store-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.store-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.tag {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 8px;
  background: #e7f0ed;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.store-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: #4d4a42;
  font-size: 12px;
  font-weight: 700;
}

.map-stage {
  position: relative;
  min-width: 0;
  min-height: 100vh;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  background: #dfe5df;
}

.number-marker {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--dark);
  color: #fff;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.24);
  font-size: 13px;
  font-weight: 900;
}

.number-marker.is-selected {
  background: var(--accent-2);
}

.detail-card {
  position: absolute;
  right: 24px;
  bottom: 78px;
  z-index: 500;
  width: min(420px, calc(100% - 48px));
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 250, 241, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.detail-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.detail-card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.65;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-actions a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--dark);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.detail-actions a.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.map-note {
  position: absolute;
  right: 24px;
  bottom: 18px;
  left: 24px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #4d4a42;
  font-size: 12px;
  font-weight: 700;
}

.map-note span {
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 250, 241, 0.92);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

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

.leaflet-popup-content {
  margin: 12px 14px;
  color: var(--ink);
  font-family: inherit;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .panel {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .masthead {
    padding: 24px 18px 18px;
  }

  h1 {
    font-size: 30px;
  }

  .controls,
  .result-bar {
    padding-right: 18px;
    padding-left: 18px;
  }

  .route-panel {
    margin-right: 18px;
    margin-left: 18px;
  }

  .map-stage,
  #map {
    min-height: 68vh;
  }

  .detail-card {
    right: 12px;
    bottom: 92px;
    width: calc(100% - 24px);
  }

  .map-note {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }
}
