:root { color-scheme: light dark; font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif; color: #1d2738; background: #f6f7fb; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
.lab { max-width: 1120px; margin: 0 auto; padding: 20px; }
header { margin-bottom: 14px; }
.eyebrow { margin: 0 0 4px; color: #9a4e2c; font-size: 12px; font-weight: 700; letter-spacing: .14em; }
h1 { margin: 0; font-size: clamp(25px, 4vw, 38px); }
h2 { margin: 8px 0 12px; font-size: clamp(22px, 3vw, 31px); }
header > p:last-child { margin: 7px 0 0; color: #5d6879; }
button, select, .detail-link { min-height: 44px; border: 1px solid #aeb7c7; border-radius: 10px; color: inherit; background: #fff; }
button { padding: 8px 14px; cursor: pointer; }
button.active, .detail-link { border-color: #3157b7; color: #fff; background: #3157b7; }
button:disabled { cursor: default; opacity: .45; }
.course-tabs, .layer-controls, .step-buttons, .event-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.course-tabs button { flex: 1 1 180px; font-weight: 700; }
.controls { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(260px, 2fr) auto; gap: 12px; align-items: end; margin-top: 13px; }
.controls label { display: grid; gap: 5px; font-weight: 650; }
select { width: 100%; padding: 8px 11px; }
.time-control { display: grid; gap: 6px; }
.time-control > div { display: flex; justify-content: space-between; gap: 12px; }
.time-control output { color: #3157b7; font-size: 19px; font-weight: 750; }
.time-control input { width: 100%; min-height: 30px; accent-color: #3157b7; }
.layer-controls { margin: 13px 0; }
.layer-controls label { display: flex; min-height: 44px; align-items: center; padding: 6px 11px; border-radius: 9px; background: #e9edf5; }
.layer-controls input { width: 20px; height: 20px; margin-right: 6px; accent-color: #3157b7; }
.main-grid, .geography-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .75fr); gap: 18px; align-items: center; }
.map-panel { min-width: 0; }
.map-stage { position: relative; width: 100%; margin: auto; overflow: hidden; border-radius: 16px; background: #dceafb; isolation: isolate; }
.map-stage img, .map-base { display: block; width: 100%; height: 100%; object-fit: contain; opacity: .74; filter: saturate(.55); }
.map-japan { width: min(100%, 410px); aspect-ratio: 2090 / 2600; }
.map-world { aspect-ratio: 2370 / 1200; }
.map-east-asia { width: min(100%, 560px); aspect-ratio: 800 / 760; }
.zone, .geo-zone { position: absolute; z-index: 2; left: var(--x); top: var(--y); width: var(--size); aspect-ratio: 1; border-radius: 50%; background: rgba(211, 87, 60, .28); transform: translate(-50%, -50%); }
.zone span, .geo-zone b { position: absolute; left: 50%; top: 50%; min-width: max-content; padding: 3px 6px; border-radius: 6px; color: #722f1e; background: rgba(255,255,255,.84); font-size: 12px; transform: translate(-50%, -50%); }
.routes { position: absolute; z-index: 3; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.routes line { stroke: #c67a1f; stroke-width: 3; stroke-dasharray: 6 5; }
.event-marker { position: absolute; z-index: 4; left: var(--x); top: var(--y); display: grid; justify-items: center; transform: translate(-50%, -50%); }
.event-marker i { width: 17px; height: 17px; border: 4px solid #fff; border-radius: 50%; background: #3157b7; box-shadow: 0 2px 7px rgba(0,0,0,.35); }
.event-marker b { min-width: max-content; margin-top: 4px; padding: 3px 7px; border-radius: 6px; color: #fff; background: #263c72; font-size: 12px; }
.map-caption { margin: 7px 0 0; color: #5d6879; text-align: center; }
.event-card { padding: 18px; border-radius: 16px; background: #fff; box-shadow: 0 12px 35px rgba(25, 35, 55, .1); }
.event-card > p { line-height: 1.75; }
.event-meta span { padding: 4px 8px; border-radius: 999px; color: #4b5870; background: #e9edf5; font-size: 12px; font-weight: 650; }
dl { margin: 12px 0 18px; }
dl div { display: grid; grid-template-columns: 72px 1fr; gap: 9px; padding: 8px 0; border-top: 1px solid #e0e4ec; }
dt { color: #687386; }
dd { margin: 0; }
.detail-link { display: inline-flex; align-items: center; padding: 8px 14px; text-decoration: none; }
.nearby-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 17px; }
.nearby { display: grid; gap: 3px; min-height: 72px; padding: 8px; text-align: left; }
.nearby span { font-size: 12px; }
.nearby b { font-size: 13px; }
.source-note { color: #687386; font-size: 12px; }
.geography-tabs { margin-bottom: 14px; }
.geography-tabs button { flex-basis: 120px; }
.geography-map { background: #e2edf5; }
.geo-zone { background: rgba(49, 87, 183, .3); }
.geo-zone b { color: #213f89; }
@media (max-width: 760px) {
  .lab { padding: 15px 12px; }
  .controls { grid-template-columns: 1fr; }
  .step-buttons button { flex: 1; }
  .main-grid, .geography-grid { grid-template-columns: 1fr; }
  .map-japan { width: min(100%, 360px); }
  .nearby-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .nearby { flex: 0 0 42%; scroll-snap-align: start; }
  .zone span, .geo-zone b { font-size: 11px; }
}
@media (max-width: 420px) { .nearby { flex-basis: 58%; } .map-world .zone span { min-width: 70px; white-space: normal; text-align: center; } }
@media (prefers-color-scheme: dark) {
  :root { color: #eef2fa; background: #111722; }
  header > p:last-child, .map-caption, .source-note, dt { color: #b6c0d1; }
  button, select, .event-card { color: #eef2fa; background: #1c2535; border-color: #4c5870; }
  .layer-controls label, .event-meta span { color: #d8dfec; background: #273247; }
  .map-stage { background: #25344b; }
  .map-stage img, .map-base { filter: invert(.84) hue-rotate(175deg) saturate(.45); opacity: .56; }
  .zone span, .geo-zone b { color: #fff; background: rgba(25,34,50,.9); }
  dl div { border-color: #3d485d; }
}
