:root {
  --panel-width: 400px;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-subtle: #f8f9fb;
  --text: #17191c;
  --muted: #68707c;
  --border: #e1e5ea;
  --accent: #e31937;
  --accent-soft: #fff0f2;
  --flash: #2563eb;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  display: flex;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  font-feature-settings: "palt" 1;
}
button, select, input { font: inherit; }
a { color: #0969da; text-underline-offset: 2px; }

#panel {
  width: var(--panel-width);
  flex: 0 0 var(--panel-width);
  height: 100%;
  overflow-y: auto;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 22px 18px 28px;
  z-index: 2;
  scrollbar-width: thin;
  scrollbar-color: #c6cbd2 transparent;
  transition: width .2s ease, flex-basis .2s ease, padding .2s ease, border-color .2s ease;
}
#map { flex: 1; height: 100%; }
#panel-toggle {
  position: fixed;
  top: 14px;
  left: calc(var(--panel-width) + 12px);
  z-index: 6;
  width: 32px;
  height: 32px;
  padding: 0;
  color: #4f5661;
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: 0 4px 14px rgba(16, 24, 40, .12);
  cursor: pointer;
  transition: left .2s ease, background .15s ease, transform .15s ease;
}
#panel-toggle::before {
  content: "‹";
  font-size: 24px;
  line-height: 1;
}
#panel-toggle:hover { background: #fff; transform: translateY(-1px); }
body.panel-collapsed #panel {
  width: 0;
  flex-basis: 0;
  padding-right: 0;
  padding-left: 0;
  border-color: transparent;
  overflow: hidden;
}
body.panel-collapsed #panel-toggle { left: 12px; }
body.panel-collapsed #panel-toggle::before { content: "›"; }
body.panel-collapsed #loading { inset: 0; }

.panel-header { padding: 0 2px 16px; }
.eyebrow {
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}
.panel-header h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -.035em;
}
.panel-header .sub {
  margin: 5px 0 11px;
  color: var(--muted);
  font-size: 12px;
}
.quick-links { display: flex; gap: 7px; }
.quick-links a {
  padding: 5px 9px;
  color: #4f5661;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  text-decoration: none;
}
.quick-links a:hover { color: var(--text); border-color: #b9c0c9; }

.tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 0 -2px 12px;
  padding: 5px;
  background: rgba(245, 246, 248, .94);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}
.tabs button {
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tabs button.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .1);
}

.panel-card {
  margin-bottom: 12px;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.card-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-heading h2, .rank-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 750;
}
.card-heading span { color: #9299a3; font-size: 10px; }

.ctl { margin-bottom: 13px; }
.ctl:last-child { margin-bottom: 0; }
.ctl > label:first-child {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
#bw-value { margin-left: 4px; color: var(--text, #1f2328); font-weight: 700; }
#bw-slider { display: block; width: 100%; margin: 2px 0 0; accent-color: #22262b; }
.bw-scale {
  display: flex;
  justify-content: space-between;
  padding: 0 3px;
  color: var(--muted);
  font-size: 10px;
}
.bw-scale span { width: 0; display: flex; justify-content: center; white-space: nowrap; }
.seg button {
  min-height: 34px;
  flex: 1 1 auto;
  padding: 6px 9px;
  color: #4d5560;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.seg button:hover { border-color: #b7bec7; transform: translateY(-1px); }
.seg button.active {
  color: #fff;
  background: #22262b;
  border-color: #22262b;
}
select {
  width: 100%;
  min-height: 38px;
  padding: 7px 34px 7px 10px;
  color: var(--text);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%2368707c' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  appearance: none;
}
select:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .2);
  outline-offset: 1px;
}

.network-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.network-option {
  position: relative;
  display: grid;
  grid-template-columns: 10px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 9px 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.network-option input { position: absolute; opacity: 0; pointer-events: none; }
.network-option .network-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #a6adb7;
  box-shadow: 0 0 0 3px rgba(166, 173, 183, .15);
}
.network-option strong { display: block; font-size: 12px; line-height: 1.2; }
.network-option small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.network-option:has(input:checked) { background: var(--surface); box-shadow: 0 1px 4px rgba(16, 24, 40, .08); }
.network-option.tesla:has(input:checked) { border-color: rgba(227, 25, 55, .55); }
.network-option.flash:has(input:checked) { border-color: rgba(37, 99, 235, .55); }
.network-option.tesla:has(input:checked) .network-dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(227, 25, 55, .14); }
.network-option.flash:has(input:checked) .network-dot { background: var(--flash); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }

.display-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 9px;
  color: #4d5560;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 10px;
  cursor: pointer;
}
.check-row input { accent-color: #22262b; }
.transport-road span::before, .transport-facility span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 999px;
  vertical-align: 0;
}
.transport-road span::before { background: #006e54; }
.transport-facility span::before { background: #7c3aed; }
.transport-key {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
  color: #68707c;
  font-size: 9px;
}
.transport-key button {
  padding: 3px 6px;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition: opacity .15s ease, background .15s ease, border-color .15s ease;
}
.transport-key button:hover {
  background: var(--surface-subtle);
  border-color: #c7ccd3;
}
.transport-key button.off {
  color: #a0a7b0;
  background: transparent;
  border-style: dashed;
}
.transport-key button.off::before {
  background: transparent !important;
  box-shadow: inset 0 0 0 1.5px #b8bec7;
}
.transport-key button::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 3px;
  border: 1px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .12);
  vertical-align: -1px;
}
.transport-key .ic::before { background: #7c3aed; }
.transport-key .jct::before { background: #334155; }
.transport-key .smart::before { background: #0284c7; }
.transport-key .sa::before { background: #f97316; }
.transport-key .pa::before { background: #eab308; }
.key-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}
.key-row .transport-key { margin-top: 0; }
.key-label {
  flex: none;
  color: #68707c;
  font-size: 9px;
  font-weight: 650;
}
.poi-key button::before { border-radius: 2px; }
.poi-key .convenience::before { background: #475569; }
.poi-key .michinoeki::before { background: #9a5b13; }
.poi-key .mall::before { background: #a21caf; }
.poi-source { margin-top: 4px; font-size: 9px; }
.brand-key {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin: 6px 0 0 50px;
  color: #68707c;
  font-size: 9px;
}
.brand-key span { display: inline-flex; align-items: center; gap: 3px; }
.brand-key img { display: block; width: 14px; height: 14px; }
.poi-logo { display: block; height: 18px; width: auto; max-width: 120px; margin-bottom: 6px; }
.transport-key .toll::before { background: #16a34a; }
.toll-key {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin: 5px 0 0 50px;
  color: #68707c;
  font-size: 9px;
}
.toll-key span { display: inline-flex; align-items: center; gap: 3px; }
.toll-key img { display: block; height: 15px; width: auto; }
.toll-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 6px 0 4px;
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.toll-badge img { height: 18px; width: auto; }
.toll-badge.kashikoi { color: #166534; background: #dcfce7; }
.toll-badge.ev { color: #92400e; background: #fef3c7; }
.toll-rule { margin: 4px 0 6px; font-size: 11px; line-height: 1.6; }
.maplibregl-popup-content .toll-popup td:last-child { text-align: left; }
.brand-key i {
  display: inline-grid;
  place-items: center;
  width: 12px;
  height: 12px;
  color: #fff;
  border-radius: 3px;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}
.brand-key i.other { background: #475569; }
.field-note {
  margin-top: 6px;
  color: #9299a3;
  font-size: 9px;
  line-height: 1.45;
}

#legend { margin: 0; }
#legend .title {
  margin-bottom: 9px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}
#legend .row {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  min-height: 20px;
  color: #59616c;
  font-size: 10px;
}
#legend .sw {
  width: 28px;
  height: 9px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 3px;
}
.method-note, .sources { border-top: 1px solid var(--border); }
.method-note { margin-top: 10px; padding-top: 9px; }
.method-note summary, .sources summary {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.method-note summary::after, .sources summary::after {
  content: "＋";
  float: right;
  font-weight: 400;
}
.method-note[open] summary::after, .sources[open] summary::after { content: "−"; }
.note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.rank-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rank-head select { width: auto; min-height: 30px; padding-top: 4px; padding-bottom: 4px; font-size: 10px; }
#rank-list {
  margin: 9px -5px -4px;
  padding: 0;
  list-style: none;
  counter-reset: rank;
}
#rank-list li {
  display: grid;
  grid-template-columns: 20px minmax(78px, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  min-height: 29px;
  padding: 4px 5px;
  border-radius: 7px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  counter-increment: rank;
}
#rank-list li::before { content: counter(rank); color: #a0a7b0; text-align: center; }
#rank-list li:hover { background: var(--surface-subtle); }
#rank-list li .nm { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
#rank-list li .pp { color: #9299a3; font-size: 9px; }
#rank-list li > span:last-child { color: #3f4650; font-size: 10px; text-align: right; white-space: nowrap; }

#summary { color: var(--muted); font-size: 11px; line-height: 1.65; }
#summary .big { color: var(--accent); font-size: 22px; font-weight: 750; letter-spacing: -.03em; }

footer { padding: 2px 2px 0; }
.sources { padding-top: 10px; }
.source-body {
  padding: 4px 2px 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}
.source-body p { margin: 7px 0; }
.muted { color: #9299a3; }

#tooltip {
  position: fixed;
  z-index: 10;
  max-width: 290px;
  padding: 8px 10px;
  color: #fff;
  background: rgba(23, 25, 28, .94);
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  font-size: 11px;
  line-height: 1.55;
  pointer-events: none;
}
#loading {
  position: fixed;
  inset: 0 0 0 var(--panel-width);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: rgba(255, 255, 255, .72);
  font-size: 13px;
  backdrop-filter: blur(3px);
}
#loading[hidden] { display: none; }

.maplibregl-popup-content {
  min-width: 230px;
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, .16);
  font-size: 11px;
  line-height: 1.6;
}
.maplibregl-popup-content h3 { margin: 0 0 4px; font-size: 14px; }
.maplibregl-popup-content table { width: 100%; border-collapse: collapse; }
.maplibregl-popup-content td { padding: 2px 4px; }
.maplibregl-popup-content td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.maplibregl-popup-content td:first-child { color: #68707c; white-space: nowrap; vertical-align: top; }
#summary:empty { display: none; }
.charger-popup .muted { color: #68707c; }
.spec-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 6px;
  padding: 6px 8px;
  background: #f8f9fb;
  border: 1px solid #e1e5ea;
  border-radius: 8px;
}
.spec-badges .kw { font-size: 12px; font-weight: 700; }
.bolts { display: inline-flex; gap: 1px; }
.bolts i { display: inline-flex; width: 13px; height: 13px; }
.bolts svg { width: 100%; height: 100%; fill: #d0d5dc; }
.bolts i.on svg { fill: #f59e0b; }
.charger-popup.tesla .bolts i.on svg { fill: #e31937; }
.charger-popup.flash .bolts i.on svg { fill: #2563eb; }
.power-key {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 8px;
  color: #68707c;
  font-size: 9px;
}
.power-key > span { display: inline-flex; align-items: center; gap: 4px; }
.power-key img { display: block; height: 14px; width: auto; }
.aerial {
  position: relative;
  width: 272px;
  height: 150px;
  margin: 8px 0 6px;
  overflow: hidden;
  background: #dfe3e8;
  border-radius: 8px;
}
.aerial-tiles { position: absolute; width: 768px; height: 768px; }
.aerial-tiles img { position: absolute; width: 256px; height: 256px; max-width: none; }
.aerial-pin {
  position: absolute;
  left: 129px;
  top: 68px;
  width: 14px;
  height: 14px;
  background: #e31937;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
.charger-popup.flash .aerial-pin { background: #0969da; }
.aerial figcaption {
  position: absolute;
  right: 5px;
  bottom: 3px;
  color: #fff;
  font-size: 9px;
  text-shadow: 0 0 3px #000, 0 0 2px #000;
}
.popup-links { display: flex; gap: 6px; margin-bottom: 6px; }
.popup-links a {
  flex: 1;
  padding: 5px 6px;
  color: #22262b;
  background: #fff;
  border: 1px solid #e1e5ea;
  border-radius: 7px;
  font-size: 11px;
  text-align: center;
  text-decoration: none;
}
.popup-links a:hover { background: #f8f9fb; border-color: #c7ccd3; }
.share-link {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 6px;
  color: #22262b;
  background: #f5f6f8;
  border: 1px solid #e1e5ea;
  border-radius: 7px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.share-link:hover { background: #eceef1; }
.share-link.copied { color: #166534; background: #dcfce7; border-color: #bbf7d0; }
.aerial { cursor: zoom-in; }
.aerial:focus-visible { outline: 2px solid #22262b; outline-offset: 2px; }
.aerial-expand {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 2px 6px;
  color: #fff;
  background: rgba(23, 25, 28, .72);
  border-radius: 999px;
  font-size: 9px;
  pointer-events: none;
}
#aerial-viewer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3vh 3vw;
  background: rgba(15, 17, 20, .72);
  backdrop-filter: blur(3px);
}
.viewer-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 1400px;
  overflow: hidden;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .35);
}
.viewer-head, .viewer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
}
.viewer-head strong { display: block; font-size: 15px; }
#viewer-sub, #viewer-note { color: #68707c; font-size: 11px; }
#viewer-close {
  width: 34px;
  height: 34px;
  flex: none;
  color: #22262b;
  background: #f5f6f8;
  border: 1px solid #e1e5ea;
  border-radius: 9px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
#viewer-close:hover { background: #eceef1; }
#viewer-map { flex: 1; min-height: 0; }
.viewer-foot .popup-links { margin: 0; min-width: 280px; }
@media (max-width: 760px) {
  #aerial-viewer { padding: 0; }
  .viewer-panel { border-radius: 0; }
  .viewer-foot { flex-direction: column; align-items: stretch; }
  .viewer-foot .popup-links { min-width: 0; }
}

@media (max-width: 900px) {
  :root { --panel-width: 370px; }
}
@media (max-width: 760px) {
  body { flex-direction: column-reverse; }
  #panel {
    width: 100%;
    flex: 0 0 52%;
    padding: 15px 14px 24px;
    border-top: 1px solid var(--border);
    border-right: 0;
    border-radius: 18px 18px 0 0;
  }
  #panel-toggle {
    top: auto;
    bottom: calc(52% + 10px);
    left: 12px;
  }
  #panel-toggle::before { content: "⌄"; }
  body.panel-collapsed #panel {
    width: 100%;
    height: 0;
    flex-basis: 0;
    padding: 0;
    border-color: transparent;
  }
  body.panel-collapsed #panel-toggle { top: 12px; bottom: auto; left: 12px; }
  body.panel-collapsed #panel-toggle::before { content: "⌃"; }
  .panel-header { display: none; }
  .tabs { top: -1px; }
  .panel-card { border-radius: 12px; }
  #loading { inset: 0; }
}
@media (max-width: 420px) {
  .network-options, .display-options { grid-template-columns: 1fr 1fr; }
  #rank-list li { grid-template-columns: 18px minmax(72px, 1fr) auto; }
  #rank-list li .pp { display: none; }
}

[hidden] { display: none !important; }

/* ---------- 災害リスク tab ---------- */
.hz-group { margin-bottom: 10px; }
.hz-group-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: #57606a; margin-bottom: 5px; }
.hz-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.hz-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 12px; border: 1px solid #d0d7de; border-radius: 999px; background: #fff; color: #1f2328; cursor: pointer; transition: border-color .15s, background .15s; }
.hz-chip:hover { border-color: #8c959f; }
.hz-chip .sw { width: 10px; height: 10px; border-radius: 3px; border: 1px solid rgba(0,0,0,.2); }
.hz-chip.on { background: #1f2328; border-color: #1f2328; color: #fff; }
.hz-chip.on .sw { border-color: rgba(255,255,255,.7); }
.hz-range { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #57606a; }
.hz-range input { flex: 1; accent-color: #22262b; }
.hz-legend { display: grid; gap: 8px; margin: 4px 0 10px; }
.hz-lg-title { font-size: 11px; font-weight: 700; color: #57606a; margin-bottom: 3px; }
.hz-lg-rows { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 11px; color: #1f2328; }
.hz-lg-rows i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.15); }
.hz-summary { font-size: 13px; line-height: 1.65; border-top: 1px solid #eaeef2; padding-top: 10px; }
.hz-summary b { font-size: 16px; }
.hz-stats { display: flex; gap: 12px; margin: 4px 0; }
.hz-stat { font-size: 12px; font-weight: 600; }
.hz-stat i, #hz-list .lv, .hz-pop i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 3px solid; margin-right: 5px; vertical-align: -2px; background: #fff; box-sizing: content-box; }
.hz-list-wrap { margin-top: 8px; font-size: 13px; }
.hz-list-wrap summary { cursor: pointer; font-weight: 600; font-size: 12px; color: #0969da; }
#hz-list { list-style: none; padding: 0; margin: 6px 0 0; max-height: 300px; overflow-y: auto; }
#hz-list li { display: grid; grid-template-columns: 18px 1fr; gap: 1px 6px; padding: 6px 4px; border-radius: 6px; cursor: pointer; }
#hz-list li:hover { background: #f6f8fa; }
#hz-list .lv { grid-row: span 2; margin-top: 3px; }
#hz-list .nm { font-weight: 600; }
#hz-list .meta { font-size: 11px; color: #57606a; }
.hz-alone { font-size: 10px; font-weight: 700; color: #9a3412; background: #fff1e5; border-radius: 999px; padding: 0 6px; margin-left: 6px; }
.hz-pop { margin-top: 8px; border-top: 1px solid #eaeef2; padding-top: 6px; }
.hz-pop-title { font-size: 11px; font-weight: 700; color: #57606a; margin-bottom: 2px; }
.hz-pop table td { font-size: 11px; }
.hz-pop tr:not(.on) td { color: #8c959f; }
.hz-pop i { width: 6px; height: 6px; border-width: 2px; margin-right: 4px; }

/* ---------- brand header ---------- */
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 40px; height: 40px; flex: 0 0 40px; filter: drop-shadow(0 4px 10px rgba(20, 23, 28, .18)); }
.brand-text { flex: 1; min-width: 0; }
.panel-header .brand h1 { font-size: 20px; line-height: 1.15; letter-spacing: -.02em; white-space: nowrap; }
.brand-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin-top: 3px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.brand-meta span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.brand-meta b { color: var(--text); font-weight: 700; }
.brand-meta i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.brand-meta i.flash { background: var(--flash); }
.panel-header .quick-links { gap: 6px; }
.panel-header .quick-links a { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 10px; color: #4f5661; }
.panel-header .quick-links a:hover { color: var(--text); background: var(--surface-subtle); }
.panel-header .quick-links svg { width: 17px; height: 17px; fill: currentColor; }

/* ---------- map search ---------- */
.maplibregl-ctrl-top-left .map-search { margin: 12px 0 0 54px; }
body.panel-collapsed .maplibregl-ctrl-top-left .map-search { margin-left: 54px; }
.map-search {
  width: min(360px, calc(100vw - var(--panel-width) - 130px));
  min-width: 240px;
  font-size: 13px;
  pointer-events: auto;
}
body.panel-collapsed .map-search { width: min(360px, calc(100vw - 130px)); }
.ms-bar {
  display: flex; align-items: center; gap: 4px;
  height: 38px; padding: 0 4px 0 10px;
  background: rgba(255, 255, 255, .97);
  border: 1px solid var(--border); border-radius: 11px;
  box-shadow: 0 4px 14px rgba(16, 24, 40, .12);
}
.ms-bar:focus-within { border-color: #8aa4c8; box-shadow: 0 0 0 3px rgba(9, 105, 218, .15), 0 4px 14px rgba(16, 24, 40, .12); }
.ms-ico { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.ms-bar input {
  flex: 1; min-width: 0; height: 100%; padding: 0 4px;
  border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--text);
}
.ms-bar input::-webkit-search-cancel-button { display: none; }
.ms-clear, .ms-geo {
  flex: none; width: 30px; height: 30px; padding: 0; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer;
}
.ms-clear:hover, .ms-geo:hover { background: #eef1f4; color: var(--text); }
.ms-geo svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ms-geo { border-left: 1px solid var(--border); border-radius: 0 8px 8px 0; }
.ms-route { flex: none; width: 30px; height: 30px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.ms-route:hover { background: #e8f0fe; }
.ms-route svg { width: 20px; height: 20px; }
.ms-route svg path:first-child { fill: #1a73e8; stroke: #1a73e8; stroke-width: 1.5; stroke-linejoin: round; }
.ms-route svg path + path { stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ms-list {
  list-style: none; margin: 6px 0 0; padding: 4px;
  max-height: min(380px, 55vh); overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 11px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .16);
}
.ms-list li[data-i] {
  display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 8px; cursor: pointer;
}
.ms-list li[data-i]:hover, .ms-list li.on { background: #eef4fc; }
.ms-k { font-size: 15px; text-align: center; line-height: 1; }
.ms-t { min-width: 0; }
.ms-t b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-t small { display: block; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-list em { font-style: normal; font-size: 10px; color: var(--muted); background: #f1f3f5; padding: 2px 6px; border-radius: 99px; white-space: nowrap; }
.ms-list li.kind-tesla em { color: #b0122b; background: var(--accent-soft); }
.ms-list li.kind-flash em { color: #1d4ed8; background: #eaf1ff; }
.ms-list li.kind-osm em, .ms-list li.kind-gsi em { color: #0f766e; background: #e6f6f4; }
.ms-status, .ms-more { padding: 8px 10px; color: var(--muted); font-size: 12px; }
.ms-more { cursor: pointer; border-top: 1px dashed var(--border); margin-top: 2px; }
.ms-more:hover { color: #0969da; }
.ms-hint {
  margin-top: 6px; padding: 7px 10px; font-size: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow);
}
.ms-card {
  margin-top: 8px; padding: 10px 12px 10px;
  background: rgba(255, 255, 255, .98); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .14);
}
.ms-list:not([hidden]) ~ .ms-card { display: none; }
.ms-card-head { display: grid; grid-template-columns: 22px 1fr 26px; gap: 8px; align-items: start; }
.ms-card-head strong { display: block; font-size: 14px; line-height: 1.3; }
.ms-card-head small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.ms-card-close { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 17px; cursor: pointer; }
.ms-card-close:hover { background: #eef1f4; color: var(--text); }
.ms-near { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 9px 0 4px; font-size: 12px; color: #3d444d; }
.ms-near b { font-size: 13px; color: var(--text); margin-left: 2px; }
.ms-card i.tesla, .ms-card i.flash { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e31937; margin-right: 5px; vertical-align: 1px; }
.ms-card i.flash { background: #0969da; }
.ms-near-list { list-style: none; margin: 0; padding: 0; }
.ms-near-list button {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2px;
  padding: 5px 6px; border: 0; border-radius: 7px; background: transparent; font: inherit; font-size: 12px; text-align: left; cursor: pointer; color: var(--text);
}
.ms-near-list button:hover { background: #f1f4f8; }
.ms-near-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-near-list b { font-variant-numeric: tabular-nums; color: #3d444d; font-weight: 600; }
.ms-note { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.ms-hz { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12px; }
.ms-hz.muted, .ms-hz .muted { color: var(--muted); }
.ms-hz-title { font-weight: 700; font-size: 11px; letter-spacing: .04em; color: #57606a; margin-bottom: 4px; }
.ms-hz ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.ms-hz li { display: grid; grid-template-columns: 12px 1fr auto; gap: 6px; align-items: center; }
.ms-hz li i { width: 10px; height: 10px; border-radius: 3px; }
.ms-pin {
  width: 26px; height: 34px;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 34'%3E%3Cpath d='M13 33s11-11.2 11-19.5A11 11 0 0 0 2 13.5C2 21.8 13 33 13 33z' fill='%2317191c' stroke='%23fff' stroke-width='2'/%3E%3Ccircle cx='13' cy='13.5' r='4.2' fill='%23fff'/%3E%3C/svg%3E");
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3));
}
.ms-pin.here {
  width: 18px; height: 18px; border-radius: 50%; background: #0969da; border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(9, 105, 218, .22), 0 2px 6px rgba(0, 0, 0, .3); filter: none;
}
@media (max-width: 760px) {
  .map-search, body.panel-collapsed .map-search { width: calc(100vw - 118px); min-width: 0; }
  .maplibregl-ctrl-top-left .map-search { margin-left: 12px; }
  body.panel-collapsed .maplibregl-ctrl-top-left .map-search { margin-left: 54px; }
  .ms-list { max-height: 34vh; }
  .ms-card { max-height: 30vh; overflow-y: auto; }
}

/* ---------- basemap switcher (map, bottom-left) ---------- */
.maplibregl-ctrl-bottom-left .base-switcher { margin: 0 0 30px 12px; }
.base-switcher { position: relative; display: flex; align-items: flex-end; gap: 6px; pointer-events: auto; font-size: 11px; }
.bs-main {
  position: relative; width: 68px; height: 68px; padding: 0; overflow: hidden; cursor: pointer;
  border: 2px solid #fff; border-radius: 10px; background: #dde3ea;
  box-shadow: 0 2px 8px rgba(16, 24, 40, .28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.bs-main:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(16, 24, 40, .32); }
.bs-main img, .bs-panel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.bs-main span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 4px 4px;
  color: #fff; font-weight: 700; text-align: center; letter-spacing: .02em;
  background: linear-gradient(transparent, rgba(0, 0, 0, .62));
}
.bs-main::before {
  content: ""; position: absolute; top: 5px; left: 5px; z-index: 1; width: 16px; height: 16px;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='m12 3 9 5-9 5-9-5 9-5z'/%3E%3Cpath d='m3 13 9 5 9-5'/%3E%3C/svg%3E");
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6));
}
.bs-more {
  width: 22px; height: 30px; padding: 0; margin-bottom: 19px; cursor: pointer;
  color: #4f5661; font-size: 12px; background: rgba(255, 255, 255, .96);
  border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 2px 8px rgba(16, 24, 40, .16);
}
.base-switcher.open .bs-more { display: none; }
.bs-panel {
  display: none; gap: 6px; padding: 6px;
  background: rgba(255, 255, 255, .98); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .18);
}
.base-switcher.open .bs-panel { display: flex; }
.bs-panel button {
  position: relative; width: 60px; padding: 0 0 4px; cursor: pointer; background: none; border: 0;
  display: grid; justify-items: center; gap: 3px; color: #3d444d; font: inherit; font-size: 11px;
}
.bs-panel button::before { content: ""; display: block; width: 56px; height: 56px; }
.bs-panel img { inset: 0 auto auto 2px; width: 56px; height: 56px; border-radius: 8px; border: 2px solid transparent; box-sizing: border-box; }
.bs-panel button:hover img { border-color: #b9c0c9; }
.bs-panel button.active img { border-color: var(--accent); }
.bs-panel button.active span { color: var(--accent); font-weight: 700; }
.base-switcher.bs-right { flex-direction: row-reverse; align-items: flex-start; clear: both; margin: 10px 10px 0 0; }
.base-switcher.bs-right .bs-more { margin: 9px 0 0; }
@media (max-width: 760px) {
  .bs-main { width: 48px; height: 48px; font-size: 10px; }
  .bs-main span { padding: 8px 0 3px; letter-spacing: 0; white-space: nowrap; }
  .bs-main::before { width: 13px; height: 13px; top: 3px; left: 3px; }
  .bs-panel button { width: 50px; }
  .bs-panel button::before, .bs-panel img { width: 46px; height: 46px; }
}

/* ---------- app version chip ---------- */
.app-version {
  display: inline-block; margin-left: 4px; padding: 1px 7px; vertical-align: 3px;
  font: 600 10.5px/1.5 ui-monospace, Consolas, monospace; letter-spacing: 0;
  color: #57606a; background: #eef1f4; border: 1px solid #dde2e8; border-radius: 99px; text-decoration: none;
}
.app-version:hover { color: var(--accent); border-color: #f3b1bb; background: var(--accent-soft); }

/* ---------- route & fare ---------- */
.route-set { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 6px; }
.route-set button {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px; color: #1e3a8a; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 7px;
  font: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
}
.route-set button:hover { background: #dbeafe; }
.route-set button b, .route-pin-mini {
  display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  color: #fff; background: #1d4ed8; font-size: 10px; font-weight: 800; line-height: 1;
}
.route-set button[data-route-set="d"] b, .route-pin-mini.d { background: #b91c1c; }
.route-pin {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); color: #fff; background: #1d4ed8; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35); font-size: 12px; font-weight: 800;
}
.route-pin.d { background: #b91c1c; }
.route-pin span { transform: rotate(45deg); }
.route-card {
  width: min(340px, calc(100vw - var(--panel-width) - 130px)); min-width: 260px;
  max-height: calc(100vh - 140px); overflow: auto; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 4px 18px rgba(16, 24, 40, .14); font-size: 12px; pointer-events: auto;
}
body.panel-collapsed .route-card { width: min(340px, calc(100vw - 130px)); }
.route-card[hidden] { display: none; }
.route-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.route-head h3 { flex: 1; margin: 0; font-size: 13px; }
.route-x, .route-swap {
  width: 24px; height: 24px; padding: 0; color: var(--muted); background: transparent;
  border: 1px solid transparent; border-radius: 6px; font-size: 15px; line-height: 1; cursor: pointer;
}
.route-x:hover, .route-swap:hover { color: var(--text); background: var(--surface-subtle); border-color: var(--border); }
.route-ep { display: flex; align-items: center; gap: 6px; min-height: 26px; }
.route-ep .name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-ep.empty { color: var(--muted); }
.route-warn { padding: 1px 5px; color: #92400e; background: #fef3c7; border-radius: 4px; font-size: 10px; }
.route-time { display: flex; align-items: center; gap: 6px; margin: 6px 0 8px; color: var(--muted); }
.route-time input { flex: 1; min-width: 0; padding: 3px 5px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.route-summary { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.route-summary div { display: flex; flex-direction: column; padding: 6px 8px; background: var(--surface-subtle); border-radius: 8px; }
.route-summary b { font-size: 15px; font-variant-numeric: tabular-nums; }
.route-summary div:first-child b { color: #1d4ed8; font-size: 17px; }
.route-cash { margin: -2px 0 6px; }
.route-tolls { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.route-tolls td { padding: 4px 2px; border-top: 1px solid var(--border); vertical-align: top; }
.route-tolls td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.route-hint { margin: 4px 0 8px; color: var(--muted); line-height: 1.5; }
.route-error { margin: 4px 0 6px; color: #b91c1c; }
.route-retry { margin-bottom: 8px; padding: 4px 10px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 6px; font: inherit; cursor: pointer; }
.route-links { margin: 4px 0 6px; }
.route-note { font-size: 10px; line-height: 1.5; }
.route-card .muted { color: var(--muted); }
@media (max-width: 760px) {
  .route-card { width: calc(100vw - 110px); min-width: 0; max-height: 32vh; }
}
.route-detour { margin: 2px 0 8px; padding-top: 6px; border-top: 1px solid var(--border); }
.route-detour summary { font-weight: 700; cursor: pointer; margin-bottom: 4px; }
.route-stop { display: flex; align-items: center; gap: 6px; margin: 4px 0 6px; color: var(--muted); }
.route-stop { white-space: nowrap; }
.route-stop select { width: auto; flex: none; padding: 2px 4px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.route-cands { margin: 0 0 6px; padding: 0; list-style: none; }
.route-cands li { padding: 5px 0; border-top: 1px dashed var(--border); }
.route-cand { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.route-cand .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-net { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.route-net.flash { background: var(--flash); }
.route-calc, .route-det-result {
  width: 100%; padding: 4px 8px; background: var(--surface-subtle); border: 1px solid var(--border);
  border-radius: 6px; font: inherit; font-size: 11px; cursor: pointer;
}
.route-det-result { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; text-align: left; }
.route-det-result.active { background: #fff7ed; border-color: #fdba74; }
.route-det-result b { font-size: 14px; font-variant-numeric: tabular-nums; }
.route-det-result b.up { color: #c2410c; }
.route-exit { margin-top: 3px; font-size: 11px; }
.route-smart { margin-top: 3px; padding: 3px 6px; color: #166534; background: #dcfce7; border-radius: 5px; font-size: 11px; }
.route-onhw { margin: 2px 0 6px; font-size: 11px; line-height: 1.5; }

.route-mini { font-weight: 700; font-variant-numeric: tabular-nums; }
.route-set .route-from-here { grid-column: 1 / -1; color: #0f5132; background: #ecfdf5; border-color: #a7f3d0; }
.route-set .route-from-here:hover { background: #d1fae5; }
.route-set svg, .route-here svg { width: 13px; height: 13px; fill: currentColor; stroke: currentColor; stroke-width: 2; }
/* 現在地: an icon inside the right end of the search box */
.route-search.has-icon .route-q { padding-right: 30px; }
.route-here {
  position: absolute; top: 3px; right: 3px; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; color: var(--muted); background: none; border: 0; border-radius: 6px; cursor: pointer;
}
.route-here:hover, .route-here:focus-visible { color: #1d4ed8; background: #e8effd; outline: none; }
.route-here.locating { color: #1d4ed8; cursor: default; animation: route-pulse 1s ease-in-out infinite; }
@keyframes route-pulse { 50% { opacity: .35; } }
.route-here svg { width: 15px; height: 15px; }
.route-locating { flex: none; font-size: 11px; }
.route-card.idle { padding: 8px 10px; }
.route-card.idle .route-head { margin-bottom: 4px; }
.route-search { position: relative; flex: 1; min-width: 0; }
.route-q {
  width: 100%; padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface-subtle); font: inherit; font-size: 12px;
}
.route-q:focus { outline: none; border-color: #93c5fd; background: #fff; box-shadow: 0 0 0 3px rgba(59, 130, 246, .15); }
.route-ep.empty + .route-ep.empty { margin-top: 4px; }
.route-sug {
  position: static; max-height: 240px; overflow: auto; margin-top: 3px !important;
  margin: 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 6px 20px rgba(16, 24, 40, .16);
}
.route-sug li { display: flex; align-items: center; gap: 6px; padding: 5px 8px; cursor: pointer; }
.route-sug li.on, .route-sug li[data-i]:hover { background: #eff6ff; }
.route-sug .k { flex: none; width: 18px; text-align: center; }
.route-sug .t { display: flex; flex-direction: column; min-width: 0; }
.route-sug .t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-sug .t small { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-sug li.st { color: var(--muted); font-size: 11px; cursor: default; }
.route-sug li.more { cursor: pointer; color: #1d4ed8; }
.route-ep.empty { align-items: flex-start; }
.route-ep.empty > .route-pin-mini { margin-top: 5px; }
.route-visit {
  display: flex; flex-direction: column; gap: 2px; width: 100%; margin-top: 4px; text-align: left;
  border: 1px solid #bbf7d0; font: inherit; font-size: 11px; cursor: pointer;
}
.route-visit small { color: #166534; opacity: .85; font-size: 10px; }
.route-visit:hover, .route-visit.active { background: #bbf7d0; border-color: #4ade80; }
.route-smart-list { margin: 2px 0 8px; padding: 6px 8px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; }
.route-smart-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; color: #14532d; font-weight: 700; }
.route-smart-head small { color: #166534; font-weight: 400; font-size: 10px; line-height: 1.5; }
.route-smart-pair { margin-top: 4px; color: #14532d; font-size: 11px; font-weight: 600; }
.route-smart-list .route-cands li { border-top-color: #bbf7d0; }
.route-alts { display: flex; gap: 4px; margin-bottom: 6px; overflow-x: auto; }
.route-alts button {
  flex: 1; min-width: 88px; display: flex; flex-direction: column; align-items: flex-start; padding: 5px 7px;
  background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 11px; cursor: pointer; text-align: left;
}
.route-alts button b { font-size: 13px; font-variant-numeric: tabular-nums; }
.route-alts button small { color: var(--muted); font-size: 10px; }
.route-alts button.active { background: #eff6ff; border-color: #93c5fd; box-shadow: inset 0 0 0 1px #93c5fd; }
.route-num {
  flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  color: #fff; background: #ea580c; font-size: 10px; font-weight: 700;
}
.route-num.smart { background: #16a34a; }
.route-card .share-link { margin-top: 2px; }
/* waypoints */
.route-set { grid-template-columns: 1fr auto 1fr; }
.route-set [data-route-set="v"] { padding: 6px 8px; color: #9a3412; background: #fff7ed; border-color: #fed7aa; }
.route-set [data-route-set="v"]:hover { background: #ffedd5; }
.route-set button b.v, .route-pin-mini.v { background: #ea580c; }
.route-pin-mini.v.smart { background: #16a34a; }
.route-ep.via { gap: 5px; }
.route-stop-sel { flex: none; padding: 1px 2px; border: 1px solid var(--border); border-radius: 5px; font: inherit; font-size: 11px; }
.route-add-via {
  display: block; margin: 2px 0 2px 22px; padding: 2px 6px; color: #9a3412; background: none;
  border: 1px dashed #fdba74; border-radius: 6px; font: inherit; font-size: 11px; cursor: pointer;
}
.route-add-via:hover { background: #fff7ed; }
.route-tag { display: inline-block; flex: none; margin-top: 3px; padding: 1px 6px; border-radius: 4px; font-size: 10px; }
.route-tag.split { color: #9a3412; background: #ffedd5; }
.route-tag.smart { color: #166534; background: #dcfce7; }
.route-compare { display: grid; gap: 2px; margin: 0 0 6px; padding: 6px 8px; background: var(--surface-subtle); border-radius: 8px; }
.route-compare div { display: flex; align-items: baseline; gap: 6px; }
.route-compare span { flex: 1; color: var(--muted); }
.route-compare b { font-variant-numeric: tabular-nums; }
.route-compare em { min-width: 64px; text-align: right; font-style: normal; font-variant-numeric: tabular-nums; color: var(--muted); }
.route-compare em.up { color: #c2410c; }
.route-compare .smart span, .route-compare .smart b, .route-compare .smart em { color: #166534; }
.route-groups { margin: 0 0 6px; padding: 0; list-style: none; }
.route-groups li { padding: 5px 0; border-top: 1px dashed var(--border); font-size: 11px; }
.route-exit-where { font-weight: 600; }
.route-hint-smart { margin-top: 4px; padding: 5px 7px; color: #14532d; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 6px; line-height: 1.5; }
.route-hint-smart button { display: block; margin-top: 4px; padding: 3px 8px; color: #fff; background: #16a34a; border: 0; border-radius: 5px; font: inherit; font-size: 11px; cursor: pointer; }
.route-toll-detail summary { cursor: pointer; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.route-pin-mini { flex: none; }
.route-ep.via .name { flex: 1; min-width: 0; }
.route-ep.via .route-stop-sel { width: auto; min-width: 0; flex: none; }
.route-ep.via .route-tag { margin-top: 0; }
.route-ep.via .route-stop-sel { height: 22px; padding: 0 2px; line-height: 1; appearance: auto; background: #fff; }
/* place category icons in the route panel */
.route-cat {
  flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  color: #fff; font-size: 9px; font-weight: 800; line-height: 1;
}
.route-cat svg { width: 12px; height: 12px; fill: #fff; }
.route-cat.tesla { background: #e31937; }
.route-cat.flash { background: #0969da; }
.route-cat.michi { background: #9a5b13; border-radius: 5px; }
.route-cat.ic { background: #7c3aed; border-radius: 5px; font-size: 8px; }
.route-cat.sa { background: #ea580c; border-radius: 5px; }
.route-cat.mall { background: #a21caf; border-radius: 5px; }
.route-cat.here { background: #0f766e; }
.route-ep .name { display: flex; flex-direction: column; min-width: 0; }
.route-ep .name .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-ep .name em { margin-left: 5px; color: var(--muted); font-size: 10px; font-style: normal; font-weight: 500; }
.route-ep .name small { color: var(--muted); font-size: 10px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-sug .kl { flex: none; margin-left: auto; color: var(--muted); font-size: 10px; font-style: normal; }
.route-sug .t { flex: 1; }
.route-disc { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: -2px 0 6px; color: var(--muted); font-size: 10px; }
.route-disc span { padding: 1px 6px; color: #1e40af; background: #dbeafe; border-radius: 4px; font-weight: 600; }
.route-breakdown { margin: 0 0 6px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; }
.route-breakdown-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; font-weight: 700; font-size: 12px; }
.route-breakdown-head small { color: var(--muted); font-weight: 400; font-size: 10px; }
.route-breakdown ol { margin: 0; padding: 0; list-style: none; }
.route-breakdown li { display: flex; align-items: center; gap: 7px; padding: 4px 0; border-top: 1px solid var(--border); }
.route-breakdown li:first-child { border-top: 0; }
.route-breakdown li i { flex: none; width: 5px; align-self: stretch; min-height: 26px; border-radius: 3px; }
.route-breakdown .seg { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.route-breakdown .seg b { font-size: 12px; font-weight: 600; }
.route-breakdown .seg small { color: var(--muted); font-size: 10px; }
.route-breakdown .fare { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.route-smart-cond { margin-top: 2px; font-size: 10px; line-height: 1.5; }

/* ===== route card: refined layout (overrides earlier route-* rules) ===== */
.route-card {
  width: min(344px, calc(100vw - var(--panel-width) - 130px));
  padding: 12px 14px 10px;
  border: 0; border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 28px rgba(16, 24, 40, .14);
  font-size: 12.5px; line-height: 1.45;
}
.route-card.idle { padding: 10px 12px; }
.route-head { gap: 2px; margin-bottom: 8px; }
.route-head h3 { font-size: 13.5px; font-weight: 700; letter-spacing: .01em; }
.route-icon {
  display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0;
  color: var(--muted); background: transparent; border: 0; border-radius: 8px; cursor: pointer;
}
.route-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.route-icon:hover { color: var(--text); background: #f1f3f6; }

/* stops: vertical timeline */
.route-stops { position: relative; display: flex; flex-direction: column; gap: 2px; }
.route-stops::before {
  content: ''; position: absolute; left: 8px; top: 16px; bottom: 16px;
  border-left: 2px dotted #cbd2db;
}
.route-stops .route-ep { position: relative; min-height: 34px; gap: 7px; padding: 2px 0; }
.route-stops .route-ep + .route-ep { margin-top: 0; }
.route-pin-mini { position: relative; z-index: 1; width: 18px; height: 18px; box-shadow: 0 0 0 3px #fff; font-size: 9.5px; }
.route-ep .name { gap: 1px; }
.route-ep .name .n { font-size: 12.5px; font-weight: 600; }
.route-ep .route-x { opacity: .55; }
.route-ep:hover .route-x { opacity: 1; }
.route-ep.empty > .route-pin-mini { margin-top: 7px; }
.route-q { padding: 7px 10px; background: #f3f5f8; border-color: transparent; border-radius: 9px; font-size: 12.5px; }
.route-q:focus { border-color: #93c5fd; }
.route-add-via { margin: 2px 0 6px 25px; padding: 3px 8px; border: 0; color: #c2410c; font-weight: 600; }
.route-add-via:hover { background: #fff7ed; }
.route-ep.via .route-stop-sel { height: 24px; padding: 0 4px; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--text); }

/* departure */
.route-time { gap: 8px; margin: 4px 0 10px; padding: 6px 10px; background: #f3f5f8; border-radius: 9px; }
.route-time span { flex: none; color: var(--muted); font-size: 11px; }
.route-time input { padding: 0; background: transparent; border: 0; font-size: 12.5px; }

/* summary */
.route-summary { display: block; margin: 0 0 10px; padding: 0; }
.route-summary .price { display: flex; align-items: baseline; gap: 8px; }
.route-summary .price b { color: #1d4ed8; font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.route-summary .price span { color: var(--muted); font-size: 11px; font-weight: 600; }
.route-summary .meta { margin-top: 1px; color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.route-summary .route-disc { margin: 5px 0 0; }
.route-alts { gap: 6px; margin-bottom: 10px; }
.route-alts button { border-radius: 10px; }

/* compare + exits */
.route-compare { margin: 0 0 8px; padding: 8px 10px; border-radius: 10px; background: #f6f7f9; }
.route-compare div { font-size: 12px; }
.route-groups li { padding: 7px 0; }
.route-exit-where { font-size: 12px; }
.route-tag { padding: 2px 7px; border-radius: 6px; font-size: 10.5px; line-height: 1.5; }

/* breakdown */
.route-breakdown { padding: 8px 10px; border: 1px solid #edf0f3; border-radius: 10px; }
.route-breakdown-head { font-size: 11.5px; }
.route-breakdown li i { width: 4px; min-height: 30px; }
.route-breakdown .seg b { font-size: 12px; }
.route-breakdown .fare { font-size: 13px; }

/* actions + note */
.route-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.route-actions a, .route-actions button {
  flex: 1 1 auto; padding: 6px 10px; color: #1f2937; background: #fff; border: 1px solid var(--border);
  border-radius: 999px; font: inherit; font-size: 11.5px; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer;
}
.route-actions a:hover, .route-actions button:hover { background: #f6f7f9; }
.route-actions button.copied { color: #166534; background: #dcfce7; border-color: #bbf7d0; }
.route-note { color: var(--muted); font-size: 10.5px; line-height: 1.55; }
.route-note summary { cursor: pointer; list-style: none; }
.route-note summary::-webkit-details-marker { display: none; }
.route-note summary::after { content: ' ▾'; }
.route-note[open] summary { margin-bottom: 3px; }
.route-hint { font-size: 11.5px; }
@media (max-width: 760px) {
  .route-card { width: calc(100vw - 110px); padding: 10px 12px; }
  .route-summary .price b { font-size: 20px; }
}
.route-summary > div { display: block; padding: 0; background: none; border-radius: 0; }
.route-summary > .price { display: flex; }
.route-stops::before { border-left: 2px dashed #c3cad4; }
.route-summary > .price { flex-direction: row; align-items: baseline; }
/* insert-a-stop buttons on the timeline (between rows) */
.route-insert {
  position: relative; z-index: 2; display: flex; align-items: center; gap: 6px; height: 14px; margin: -3px 0; padding: 0;
  background: none; border: 0; font: inherit; cursor: pointer; color: #9aa3ae;
}
.route-insert span {
  display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 1.5px solid #d3d8df; font-size: 12px; font-weight: 700; line-height: 1;
  opacity: 0; transform: scale(.8); transition: opacity .12s, transform .12s;
}
.route-insert em { font-style: normal; font-size: 11px; font-weight: 600; color: #c2410c; opacity: 0; transition: opacity .12s; }
.route-stops:hover .route-insert span { opacity: 1; transform: none; }
.route-insert:hover span, .route-insert:focus-visible span { color: #fff; background: #ea580c; border-color: #ea580c; }
.route-insert:hover em, .route-insert:focus-visible em { opacity: 1; }
@media (hover: none) {
  .route-insert span { opacity: 1; transform: none; }
}
.route-cat-img { flex: none; width: 20px; height: 20px; }
/* optional stop time: quiet until set */
.route-ep.via .route-stop-sel {
  height: 22px; padding: 0 2px; color: var(--muted); background: transparent; border: 0; border-radius: 6px;
  font-size: 10.5px; cursor: pointer;
}
.route-ep.via .route-stop-sel:hover { background: #f1f3f6; }
.route-ep.via .route-stop-sel.set { color: #1f2937; font-weight: 600; background: #f1f3f6; }
.route-compare span small { display: block; color: var(--muted); font-size: 10px; }
.route-cheaper { margin: -4px 0 8px; font-size: 10.5px; line-height: 1.5; }
.route-stops .route-ep { min-height: 30px; }
.route-insert { margin: -5px 0; }
.route-compare .smart span small { color: #15803d; }
.route-insert { width: fit-content; }
.route-insert em { padding: 0 6px; background: #fff; border-radius: 999px; box-shadow: 0 1px 3px rgba(16,24,40,.15); }
/* tabs: 直行 / 寄り道 / 道の駅経由 */
.route-alts button span { display: flex; align-items: baseline; gap: 5px; width: 100%; font-weight: 600; }
.route-alts button span em { margin-left: auto; font-style: normal; font-size: 10.5px; font-variant-numeric: tabular-nums; color: var(--muted); }
.route-alts button span em.up { color: #c2410c; }
.route-alts button span em.down { color: #15803d; }
.route-alts button small.smart { color: #15803d; }
.route-alts button.proposal { color: #14532d; background: #f0fdf4; border: 1px dashed #86efac; }
.route-alts button.proposal:hover { background: #dcfce7; }
.route-alts button.proposal b { color: #15803d; }
/* price with the fare without 賢い料金 struck through */
.route-summary .price s { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
/* 出/入 chips (same markers as the map) */
.route-io { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.route-io .chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  color: #9a3412; background: #fff7ed; border: 1px solid #fed7aa; font-size: 11px; font-weight: 600; cursor: help;
}
.route-io .chip.smart { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.route-io .chip.warn { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.route-io .chip b { padding: 0 5px; color: #fff; background: #16a34a; border-radius: 999px; font-size: 9.5px; }
/* place names are buttons: click to change */
.route-edit {
  flex: 1; min-width: 0; padding: 2px 4px; margin: 0 -4px; text-align: left;
  color: inherit; background: none; border: 0; border-radius: 6px; font: inherit; cursor: text;
}
.route-edit:hover { background: #f3f5f8; }
.route-note { margin-top: 2px; }
.route-note a { color: inherit; }
.route-usage { float: right; margin-left: 6px; opacity: .6; font-variant-numeric: tabular-nums; cursor: default; }
.route-usage.full { color: #c0392b; opacity: 1; }
