.map-button,
.map-close,
.point-overview,
.point-select,
.point-route {
  display: inline-flex;
  align-items: center;
  border: 0;
  color: var(--blue);
  font-weight: 700;
}

.map-button {
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 13px;
  border-radius: 12px;
  background: var(--blue-tint);
  font-size: .86rem;
  white-space: nowrap;
  transition: background-color var(--press), transform var(--press);
}

.map-button:hover,
.map-close:hover,
.point-overview:hover,
.point-route:hover { background: #e0e9ff; }

.map-button:active { transform: scale(.97); }

.map-pin {
  position: relative;
  flex: none;
  width: 13px;
  height: 13px;
  margin-bottom: 3px;
  border: 1.8px solid currentColor;
  border-radius: 50% 50% 50% 2px;
  transform: rotate(-45deg);
}

.map-pin::after {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.points-dialog {
  width: min(1000px, 100% - 32px);
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 18px 56px rgb(26 33 62 / 24%);
  overscroll-behavior: contain;
}

.points-dialog::backdrop { background: rgb(24 30 48 / 52%); }
body:has(.points-dialog[open]) { overflow: hidden; }

.points-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.points-header h2,
.points-sidebar h3 {
  margin: 0;
  letter-spacing: -.035em;
}

.points-header h2 { font-size: 1.4rem; }
.points-sidebar h3 { font-size: 1rem; }
.points-header p,
.points-sidebar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .87rem;
  line-height: 1.4;
}

.map-close {
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  background: var(--blue-tint);
  font-size: 1.6rem;
  line-height: 1;
}

.points-content {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.points-map {
  position: relative;
  overflow: hidden;
  height: clamp(300px, 60dvh, 540px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #e8edf5;
}

.points-map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.map-status {
  position: absolute;
  inset: 0;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 15px;
  padding: 18px;
  color: var(--blue);
  background: var(--blue-tint);
  text-align: center;
}

.map-status .map-pin { width: 22px; height: 22px; }
.map-status .map-pin::after { inset: 5px; }
.map-status strong { color: var(--ink); font-size: .96rem; }
.map-status .point-overview { background: #fff; }

.points-map [hidden] { display: none; }

.points-sidebar { min-width: 0; padding: 2px 4px; }

.points-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.point-overview {
  min-height: 36px;
  padding: 5px 11px;
  border-radius: 9px;
  background: var(--blue-tint);
  font-size: .78rem;
}

.point-overview[aria-pressed="true"] { background: #dce7ff; }

.points-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.points-list li {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fafbfe;
}

.points-list li:has(.point-select[aria-pressed="true"]) {
  border-color: #b9c8ed;
  background: #f1f5ff;
}

.point-select {
  display: flex;
  gap: 11px;
  width: 100%;
  min-height: 53px;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: left;
  background: transparent;
}

.point-select-copy { display: grid; gap: 4px; line-height: 1.28; }
.point-select-copy strong { color: var(--ink); font-size: .91rem; }
.point-select-copy small { color: var(--muted); font-size: .79rem; }

.point-number {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  color: #fff;
  background: var(--blue);
  font-size: .8rem;
}

.point-select[aria-pressed="true"] .point-number {
  color: var(--ink);
  background: var(--action);
}

.point-route {
  min-height: 42px;
  margin: 0 10px 9px;
  padding: 4px 10px;
  border-radius: 9px;
  background: #e7edfc;
  font-size: .82rem;
  text-decoration: none;
}

.points-external {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 5px;
  color: var(--blue);
  font-size: .82rem;
  font-weight: 700;
  text-underline-offset: .2em;
}

@media (max-width: 620px) {
  .points-dialog {
    width: 100%;
    min-height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .points-header { padding: 13px 16px; }
  .points-header h2 { font-size: 1.25rem; }
  .points-content { grid-template-columns: 1fr; gap: 10px; padding: 12px; }
  .points-map { height: clamp(280px, 39dvh, 350px); border-radius: 13px; }
  .points-map:has(#retry-map:not([hidden])) { height: 156px; }
}

@media (max-width: 350px) {
  .map-button { gap: 6px; padding-inline: 9px; font-size: .79rem; }
}
