:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #64717f;
  --line: rgba(23, 33, 43, 0.14);
  --paper: rgba(255, 255, 255, 0.92);
  --panel: #f7f4ee;
  --green: #2f6d58;
  --blue: #316b9f;
  --red: #b94848;
  --amber: #b8842b;
  --shadow: 0 20px 60px rgba(26, 33, 39, 0.18);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #dfe8e1;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  overflow: hidden;
}

.panel {
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  height: 100vh;
  padding: 22px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(247, 244, 238, 0.98), rgba(235, 239, 233, 0.96)),
    var(--panel);
  border-right: 1px solid var(--line);
  box-shadow: 10px 0 42px rgba(31, 43, 51, 0.12);
}

.brand-block {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
  background: #17212b;
  border-radius: 8px;
}

.eyebrow,
.section-title span,
.stats-grid span,
.meta,
.detail-label {
  color: var(--muted);
  font-size: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 23px;
  line-height: 1.15;
}

.search-card,
.stats-grid,
.place-card,
.update-card,
.detail-drawer {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 32px rgba(32, 42, 48, 0.09);
  backdrop-filter: blur(14px);
}

.search-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.search-card label {
  color: #31424e;
  font-size: 13px;
  font-weight: 700;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 8px;
}

.search-row input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.search-row input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 107, 159, 0.15);
}

.search-row button,
.icon-button {
  display: grid;
  place-items: center;
  color: #17212b;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

.chip,
.view-tabs button {
  min-height: 32px;
  padding: 0 11px;
  color: #31424e;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.chip.is-active,
.view-tabs button.is-active {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.stats-grid div {
  display: grid;
  gap: 4px;
  padding: 14px 10px;
  text-align: center;
}

.stats-grid div + div {
  border-left: 1px solid var(--line);
}

.stats-grid strong {
  font-size: 24px;
}

.place-list {
  display: grid;
  min-height: 0;
  gap: 10px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-title h2 {
  font-size: 17px;
}

.cards {
  display: grid;
  gap: 10px;
}

.place-card {
  display: grid;
  grid-template-columns: 5px 1fr;
  gap: 0;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  text-align: left;
}

.place-card:hover,
.place-card.is-selected {
  transform: translateY(-1px);
  box-shadow: 0 14px 38px rgba(32, 42, 48, 0.14);
}

.place-strip {
  background: var(--marker-color);
}

.place-content {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 13px;
}

.place-content h3 {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 3px 8px;
  color: #263640;
  font-size: 12px;
  background: #eef1ed;
  border-radius: 999px;
}

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

#map {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 20%, rgba(255, 255, 255, 0.5), transparent 0 22%, transparent 45%),
    radial-gradient(circle at 25% 80%, rgba(255, 255, 255, 0.24), transparent 0 18%, transparent 38%),
    linear-gradient(135deg, #d9e8e5, #cadfdd 50%, #b9d0ce);
}

.static-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-grid path {
  fill: none;
  stroke: rgba(38, 67, 72, 0.08);
  stroke-width: 1;
}

.mainland,
.suruga-land,
.izu {
  fill: url("#land");
  stroke: rgba(47, 72, 78, 0.18);
  stroke-width: 2;
}

.suruga-land,
.izu {
  opacity: 0.96;
}

.tokyo-bay {
  fill: rgba(135, 183, 195, 0.72);
}

.coastline {
  fill: none;
  stroke: rgba(47, 72, 78, 0.18);
  stroke-width: 2.4;
}

.corridor {
  fill: none;
  stroke: rgba(182, 142, 75, 0.42);
  stroke-linecap: round;
  stroke-width: 4;
}

.corridor-primary {
  stroke: rgba(185, 76, 70, 0.56);
  stroke-width: 6;
}

.corridor-thin {
  stroke-width: 3;
}

.rail-line {
  fill: none;
  stroke: rgba(28, 43, 52, 0.22);
  stroke-dasharray: 10 9;
  stroke-linecap: round;
  stroke-width: 3;
}

.rail-secondary {
  opacity: 0.7;
}

.city-hubs circle {
  fill: rgba(47, 109, 88, 0.075);
  stroke: rgba(47, 109, 88, 0.16);
  stroke-width: 1.4;
}

.hub-title {
  fill: rgba(23, 33, 43, 0.46);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.hub-caption,
.map-labels text {
  fill: rgba(23, 33, 43, 0.34);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.map-labels text {
  font-size: 12px;
}

.marker-layer {
  position: absolute;
  inset: 0;
}

#map[data-view="street"] .static-map {
  filter: saturate(0.75) brightness(1.04);
}

#map[data-view="satellite"] .static-map {
  filter: saturate(0.75) brightness(0.76) contrast(1.12);
}

.top-bar {
  position: absolute;
  z-index: 650;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.view-tabs,
.icon-button {
  pointer-events: auto;
}

.view-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.view-tabs button {
  border-radius: 6px;
}

.icon-button {
  width: 42px;
  height: 42px;
  font-size: 20px;
  box-shadow: var(--shadow);
}

.update-card {
  position: absolute;
  z-index: 620;
  top: 72px;
  right: 16px;
  width: min(340px, calc(100vw - 430px));
  padding: 15px;
}

.update-card h2 {
  margin-bottom: 8px;
  font-size: 16px;
}

.update-card p {
  color: #41515c;
  font-size: 13px;
  line-height: 1.65;
}

.map-notice {
  position: absolute;
  z-index: 710;
  right: 16px;
  bottom: 16px;
  max-width: min(360px, calc(100vw - 430px));
  padding: 10px 12px;
  color: #31424e;
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.map-notice.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.detail-drawer {
  position: absolute;
  z-index: 700;
  right: 16px;
  bottom: 16px;
  width: min(410px, calc(100vw - 430px));
  max-height: min(72vh, 620px);
  overflow: hidden auto;
  transform: translateY(calc(100% + 24px));
  opacity: 0;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.detail-drawer.is-open {
  transform: translateY(0);
  opacity: 1;
}

.detail-cover {
  min-height: 156px;
  padding: 16px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(23, 33, 43, 0.86), rgba(47, 109, 88, 0.58)),
    var(--marker-color);
}

.detail-cover h2 {
  max-width: 86%;
  margin-top: 46px;
  font-size: 24px;
  line-height: 1.16;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  color: #fff;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
}

.detail-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.detail-meta div {
  min-width: 0;
  padding: 10px;
  background: #f3f5f1;
  border-radius: 6px;
}

.detail-meta strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.detail-body p,
.detail-body li {
  color: #354653;
  font-size: 14px;
  line-height: 1.7;
}

.detail-body ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

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

.action-link {
  padding: 9px 12px;
  color: #fff;
  text-decoration: none;
  background: var(--blue);
  border-radius: 6px;
}

.action-link-secondary {
  color: var(--ink);
  background: #e7ece8;
}

.mao-marker {
  position: absolute;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: var(--marker-color);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(23, 33, 43, 0.26);
  transform: translate(-50%, -50%);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
  z-index: 5;
}

.mao-marker::after {
  position: absolute;
  inset: -8px;
  content: "";
  border: 1px solid color-mix(in srgb, var(--marker-color), transparent 45%);
  border-radius: 50%;
}

.mao-marker:hover,
.mao-marker.is-selected {
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 16px 34px rgba(23, 33, 43, 0.32);
  z-index: 8;
}

.mao-marker span {
  transform: none;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 44vh 56vh;
  }

  .panel {
    order: 2;
    height: 56vh;
    padding: 16px;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .map-stage {
    order: 1;
    height: 44vh;
  }

  .update-card {
    display: none;
  }

  .map-notice {
    right: 10px;
    bottom: 10px;
    left: 10px;
    max-width: none;
  }

  .detail-drawer {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-height: 82%;
  }

  .top-bar {
    top: 10px;
    left: 10px;
    right: 10px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    grid-template-rows: 42vh 58vh;
  }

  .brand-block {
    grid-template-columns: 52px 1fr;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
    font-size: 13px;
  }

  h1 {
    font-size: 20px;
  }

  .detail-meta,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}
