:root {
  --paper:#f6f8f5;
  --white:#fff;
  --ink:#203c34;
  --muted:#718078;
  --accent:#136b58;
  --accent-light:#e9f2ec;
  --line:#e4e9e2;
  --station:#d89549;
  --shadow:0 3px 16px #263a3010;
  font-family: -apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Noto Sans JP",Meiryo,sans-serif;
  color: var(--ink);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,body {
  height: 100%;
  margin: 0;
}

body {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
}

button,input {
  font: inherit;
}

button,a,input {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button {
  color: inherit;
}

button:disabled {
  opacity: .3;
  cursor: default;
}

button:focus-visible,a:focus-visible,input:focus-visible {
  outline: 3px solid #278e78;
  outline-offset: 3px;
}

button {
  touch-action: manipulation;
}

a {
  color: var(--accent);
}

[hidden] {
  display: none!important;
}

.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  flex: none;
  height: 80px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  z-index: 2;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: white;
  width: 43px;
  height: 43px;
  border-radius: 13px;
}

.brand-mark .icon {
  width: 27px;
  height: 27px;
}

.brand strong {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: .04em;
}

.brand-subtitle {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: .09em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 28px;
}

.edition {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.button:hover:not(:disabled) {
  background: var(--accent-light);
}

.share-button {
  font-size: 12px;
  font-weight: 600;
}

.share-button .icon {
  width: 18px;
  height: 18px;
}

.workspace {
  flex: 1;
  min-height: 0;
  display: flex;
}

.explorer {
  flex: none;
  width: 344px;
  background: var(--white);
  padding: 29px 25px 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  z-index: 1;
  border-right: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: .05em;
  font-weight: 600;
}

.text-button {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 11px;
  min-height: 44px;
  padding: 8px 0 8px 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.year-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 9px 0 15px;
  gap: 7px;
}

.year-step {
  border-radius: 50%;
  padding: 10px;
  flex: none;
}

.year-heading {
  text-align: center;
  min-width: 0;
}

.year-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}

.year-value input {
  width: 140px;
  padding: 0;
  border: none;
  background: none;
  color: var(--ink);
  font-family: Georgia,"Times New Roman",serif;
  font-size: 59px;
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1.1;
  text-align: center;
  border-radius: 4px;
  appearance: textfield;
  -moz-appearance: textfield;
}

.year-value input::-webkit-inner-spin-button,.year-value input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.year-value>span {
  font-size: 13px;
  color: var(--muted);
}

.era-label {
  display: block;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  margin-top: 4px;
  min-height: 17px;
}

.all-years-label {
  font-size: 36px;
  font-weight: 500;
  line-height: 1.65;
}

.slider-wrap {
  position: relative;
}

input[type=range] {
  --progress:100%;
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}

input[type=range]::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(to right,var(--accent) var(--progress),var(--line) var(--progress));
  border-radius: 4px;
}

input[type=range]::-moz-range-track {
  height: 4px;
  background: var(--line);
  border-radius: 4px;
}

input[type=range]::-moz-range-progress {
  height: 4px;
  background: var(--accent);
  border-radius: 4px;
}

input[type=range]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin-top: -9px;
  background: var(--accent);
  border: 4px solid white;
  box-shadow: 0 0 0 1px var(--accent),0 2px 5px #163b3020;
}

input[type=range]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  border: 4px solid white;
  box-shadow: 0 0 0 1px var(--accent);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--muted);
  margin: 0 0 17px;
}

.year-presets {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 7px;
}

.year-presets button {
  height: 44px;
  padding: 0 4px;
  white-space: nowrap;
  background: var(--paper);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.year-presets button[aria-pressed=true] {
  background: var(--accent-light);
  border-color: #c6dfd0;
  color: var(--accent);
  font-weight: 700;
}

.year-presets button span {
  font-size: 9px;
  margin-left: 4px;
}

.mobile-tools,.decade-step {
  display: none;
}

.details {
  padding-top: 29px;
}

h2 {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .05em;
  margin: 0 0 13px;
}

.search-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 10px;
  padding: 0 11px;
  gap: 8px;
  min-height: 46px;
}

.search-field>.icon {
  width: 18px;
  color: var(--muted);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 13px;
  height: 44px;
  color: var(--ink);
  padding: 0;
}

.search-field:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.search-field input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-field input::placeholder {
  color: #88938b;
}

.clear-search {
  width: 44px;
  min-height: 44px;
  border: 0;
  padding: 0;
  background: none;
  flex: none;
}

.clear-search .icon {
  width: 17px;
}

.hint {
  font-size: 10px;
  color: var(--muted);
  margin: 9px 0 0;
  line-height: 1.6;
}

.search-results {
  list-style: none;
  margin: 9px 0 0;
  padding: 0;
  max-height: 230px;
  overflow: auto;
}

.search-action {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-light);
  font-size: 13px;
  font-weight: 600;
}

.search-results:empty {
  display: none;
}

.search-result {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 11px 7px;
  background: white;
  border: 0;
  border-bottom: 1px solid var(--line);
  min-height: 52px;
}

.search-result:hover,.search-result:focus-visible {
  background: var(--accent-light);
}

.result-kind {
  font-size: 10px;
  background: var(--accent-light);
  border-radius: 5px;
  color: var(--accent);
  padding: 5px;
  flex: none;
}

.result-content {
  min-width: 0;
}

.result-name {
  font-size: 13px;
  font-weight: 600;
  display: block;
}

.result-detail {
  font-size: 10px;
  color: var(--muted);
  display: block;
  line-height: 1.5;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.layers-section {
  padding-top: 25px;
  margin-top: 25px;
  border-top: 1px solid var(--line);
}

.layer-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  position: relative;
  min-height: 48px;
  cursor: pointer;
}

.layer-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.legend-line {
  display: inline-block;
  height: 3px;
  width: 18px;
  border-radius: 2px;
  background: var(--accent);
  flex: none;
}

.legend-station {
  display: inline-block;
  height: 9px;
  width: 9px;
  flex: none;
  background: var(--station);
  border: 2px solid white;
  outline: 1px solid var(--station);
  border-radius: 50%;
  margin: 0 4.5px;
}

.feature-count {
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.layer-option input {
  position: absolute;
  right: 0;
  width: 38px;
  height: 30px;
  opacity: 0;
  cursor: pointer;
}

.switch {
  width: 34px;
  height: 21px;
  background: #c5cdc7;
  border-radius: 20px;
  pointer-events: none;
  flex: none;
}

.switch:before {
  content: "";
  display: block;
  width: 15px;
  height: 15px;
  background: white;
  border-radius: 50%;
  margin: 3px;
  transition: transform .16s;
}

.layer-option input:checked+.switch {
  background: var(--accent);
}

.layer-option input:checked+.switch:before {
  transform: translateX(13px);
}

.layer-option input:focus-visible+.switch {
  outline: 3px solid #278e78;
  outline-offset: 3px;
}

.data-note {
  border-top: 1px solid var(--line);
  margin-top: 23px;
  padding-top: 21px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.9;
}

.note-label {
  font-size: 11px;
  color: #586d60;
}

.data-note p {
  margin: 9px 0 0;
}

.data-note a {
  text-underline-offset: 3px;
}

.map-section {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: #e8eee4;
  isolation: isolate;
}

.map-section #map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #e8eee4;
  z-index: auto;
}

.maplibregl-map {
  font-family: inherit;
}

.maplibregl-map a {
  color: var(--accent);
}

.maplibregl-ctrl-attrib {
  font-size: 9px!important;
  max-width: 100%;
  background: #ffffffe6!important;
}

.map-context {
  position: absolute;
  left: 22px;
  top: 23px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fffffff2;
  padding: 11px 14px;
  border: 1px solid #dce4dacc;
  border-radius: 9px;
  box-shadow: var(--shadow);
  font-size: 11px;
  pointer-events: none;
  max-width: calc(100% - 95px);
}

.status-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}

.loading-indicator {
  font-size: 10px;
  color: var(--muted);
}

.map-section.is-loading .status-dot {
  animation: pulse 1s ease-in-out infinite;
}

.map-actions {
  position: absolute;
  right: 22px;
  top: 23px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.map-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #dce4da;
  background: #fffffff7;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.map-button:hover {
  background: var(--accent-light);
}

.zoom-actions {
  border: 1px solid #dce4da;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.zoom-actions .map-button {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.zoom-actions .map-button:first-child {
  border-bottom: 1px solid var(--line);
}

.map-legend {
  position: absolute;
  bottom: 31px;
  left: 22px;
  display: flex;
  gap: 17px;
  font-size: 10px;
  color: #50645a;
  background: #fffffff0;
  padding: 10px 13px;
  border-radius: 7px;
  pointer-events: none;
  box-shadow: var(--shadow);
}

.map-legend>span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.map-message {
  position: absolute;
  left: 50%;
  bottom: 70px;
  transform: translateX(-50%);
  max-width: calc(100% - 35px);
  width: max-content;
  padding: 13px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  box-shadow: 0 4px 20px #193a3426;
  font-size: 12px;
  line-height: 1.7;
  z-index: 500;
}

.map-message button {
  color: white;
  background: transparent;
  border: 1px solid #ffffff75;
  border-radius: 6px;
  min-height: 36px;
  padding: 6px 10px;
  margin-left: 9px;
}

.rail-popup {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rail-popup strong {
  font-size: 15px;
  display: block;
  line-height: 1.5;
}

.rail-popup p {
  margin: 6px 0;
  color: #617065;
  font-size: 11px;
  line-height: 1.6;
}

.rail-popup .popup-kind {
  display: block;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: .06em;
  margin-bottom: 5px;
}

.station-choices {
  display: grid;
  gap: 6px;
}

.station-choices button {
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-align: left;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.station-choices button[aria-pressed=true] {
  background: #fff3e4;
  border-color: #a54e12;
}

.station-choices small {
  display: block;
  margin-top: 3px;
  color: #617065;
  font-size: 11px;
}

.maplibregl-popup-content {
  border-radius: 12px;
}

.maplibregl-popup-content {
  padding: 20px 32px 18px 20px;
  min-width: 130px;
}

.maplibregl-popup-close-button {
  min-width: 44px;
  min-height: 44px;
}

.maplibregl-canvas:focus-visible {
  outline: 3px solid #278e78;
  outline-offset: -3px;
}

dialog {
  max-width: calc(100vw - 32px);
  width: 410px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  color: var(--ink);
  box-shadow: 0 15px 70px #0002;
}

dialog::backdrop {
  background: #18372f66;
  backdrop-filter: blur(3px);
}

.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.dialog-heading h2 {
  margin: 0;
  font-size: 17px;
}

dialog p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}

#shareUrl {
  width: 100%;
  font-size: 16px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin: 10px 0 16px;
}

.primary-button {
  width: 100%;
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.primary-button:hover:not(:disabled) {
  background: #0c5445;
}

#copyStatus {
  display: block;
  font-size: 12px;
  margin-top: 12px;
}

.noscript {
  position: fixed;
  inset: 100px 20px auto;
  z-index: 9999;
  background: white;
  padding: 25px;
  text-align: center;
}

@keyframes pulse {
  50% {
    opacity: .25;
  }
}

@media(min-width:1400px) {
  .explorer {
    width: 370px;
    padding-left: 30px;
    padding-right: 30px;
  }
}

/* Keep the same controls in the desktop sidebar and the mobile dialog. */
.mobile-panel {
  padding: 0;
  width: min(560px,calc(100% - 16px));
  max-width: none;
  max-height: min(680px,calc(var(--visual-height,100dvh) - 16px));
  position: fixed;
  inset: auto auto auto 50%;
  top: calc(var(--visual-top,0px) + var(--visual-height,100dvh));
  transform: translate(-50%,-100%);
  margin: 0;
  border: 0;
  border-radius: 22px 22px 0 0;
  overflow: hidden;
}

.mobile-panel[open] {
  display: flex;
  flex-direction: column;
}

.mobile-panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: none;
  gap: 12px;
  padding: 14px 16px 10px 20px;
  border-bottom: 1px solid var(--line);
}

.mobile-panel-heading h2 {
  margin: 0;
  font-size: 17px;
}

.mobile-panel-heading .button {
  border: 0;
  background: var(--paper);
}

.mobile-panel-content {
  padding: 18px 20px;
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
}

.mobile-panel-content h3 {
  margin: 0 0 14px;
  font-size: 13px;
}

.mobile-panel .search-section h2 {
  display: none;
}

.mobile-panel .search-field {
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 1;
}

.mobile-panel .search-field input {
  font-size: 16px;
  height: 48px;
}

.mobile-panel .search-results {
  max-height: none;
  overflow: visible;
}

.mobile-panel .search-result {
  min-height: 64px;
  padding: 13px 2px;
}

.mobile-panel .result-name {
  font-size: 15px;
}

.mobile-panel .result-detail,.mobile-panel .hint {
  font-size: 12px;
}

.mobile-panel .layers-section {
  padding-top: 20px;
  margin-top: 20px;
}

.mobile-panel .layer-option {
  min-height: 54px;
}

.mobile-panel .layer-label {
  font-size: 14px;
}

.mobile-panel .data-note {
  font-size: 11px;
}

#mobileAllYearsSlot .text-button {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

#mobileAllYearsSlot .text-button[aria-pressed=true] {
  background: var(--accent-light);
}

.mobile-panel-footer {
  flex: none;
  padding: 12px 20px max(12px,env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: white;
}

.mobile-panel-footer .button {
  min-height: 48px;
  font-size: 14px;
}

@media(max-width:760px),(max-height:550px) and (orientation:landscape) {
  .site-header {
    height: calc(54px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left));
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .brand-mark .icon {
    width: 21px;
    height: 21px;
  }

  .brand strong {
    font-size: 15px;
    letter-spacing: .025em;
  }

  .brand-subtitle,.edition {
    display: none;
  }

  .header-actions {
    gap: 0;
  }

  .share-button {
    min-height: 44px;
    min-width: 44px;
    padding: 8px;
    border-color: transparent;
    font-size: 12px;
  }

  .workspace {
    flex-direction: column;
  }

  .map-section {
    order: 0;
    min-height: 100px;
  }

  .explorer {
    order: 1;
    width: 100%;
    border: 0;
    border-top: 1px solid var(--line);
    padding: 12px max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
    overflow-y: auto;
    max-height: 55%;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -4px 20px #234a3310;
    z-index: 2;
    flex-shrink: 0;
  }

  .timeline,.mobile-tools {
    max-width: 520px;
    margin: 0 auto;
  }

  .timeline .section-heading,.details {
    display: none;
  }

  .year-navigation {
    display: grid;
    grid-template-columns: 44px 44px minmax(100px,1fr) 44px 44px;
    align-items: center;
    margin: 0;
    gap: 4px;
  }

  .year-step,.decade-step {
    display: inline-flex;
    min-width: 44px;
    min-height: 48px;
    width: 44px;
    padding: 0;
    background: var(--paper);
    border: 0;
    border-radius: 12px;
  }

  .decade-step {
    font-size: 13px;
    font-weight: 650;
    color: var(--accent);
    background: var(--accent-light);
    font-variant-numeric: tabular-nums;
  }

  .year-heading {
    min-width: 0;
  }

  .year-value {
    gap: 3px;
  }

  .year-value input {
    font-size: 36px;
    width: 86px;
    line-height: 1;
  }

  .year-value>span {
    font-size: 11px;
  }

  .era-label {
    font-size: 10px;
    margin-top: 2px;
    min-height: 14px;
    letter-spacing: 0;
  }

  .all-years-label {
    font-size: 25px;
    line-height: 1.45;
  }

  .all-years-label:not([hidden])+.era-label {
    font-size: 8px;
  }

  .slider-wrap {
    margin: 2px 7px 6px;
  }

  input[type=range] {
    height: 44px;
  }

  input[type=range]::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
    margin-top: -12px;
  }

  input[type=range]::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }

  .slider-labels {
    font-size: 10px;
    margin: -2px 0 0;
  }

  .mobile-tools {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 8px;
    border-top: 1px solid var(--line);
    padding-top: 8px;
  }

  .mobile-tools button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    border: 1px solid var(--line);
    background: white;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
  }

  .mobile-tools button:first-child {
    background: var(--accent-light);
    border-color: var(--accent-light);
    color: var(--accent);
  }

  .mobile-tools .icon {
    width: 18px;
    height: 18px;
  }

  .map-context {
    left: 12px;
    top: 12px;
    gap: 6px;
    padding: 10px 11px;
    font-size: 11px;
    max-width: calc(100% - 24px);
  }

  .loading-indicator {
    font-size: 10px;
  }

  .map-actions {
    right: max(12px,env(safe-area-inset-right));
    top: auto;
    bottom: 28px;
    display: grid;
    grid-template-columns: repeat(2,44px);
    gap: 8px;
  }

  .zoom-actions {
    display: contents;
  }

  .zoom-actions .map-button {
    border: 1px solid #dce4da;
    border-radius: 10px;
    box-shadow: var(--shadow);
  }

  .map-legend {
    bottom: 28px;
    left: 12px;
    padding: 8px 10px;
    gap: 12px;
    font-size: 10px;
  }

  .maplibregl-ctrl-attrib {
    font-size: 8px!important;
    line-height: 1.35!important;
    max-width: calc(100vw - 12px);
  }

  .map-message {
    bottom: 136px;
    padding: 10px 13px;
    font-size: 12px;
    max-width: calc(100% - 24px);
  }

  .map-message button {
    margin: 6px 0 0;
    display: block;
    min-height: 44px;
  }
}

.offline-section {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 22px;
}

.offline-section h2 { font-size: 13px; margin: 0 0 12px; }
.offline-section .hint { line-height: 1.7; }
.offline-wide { width: 100%; font-size: 12px; }
.offline-plan { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--accent-light); }
.offline-plan label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600; }
.offline-plan input { width: 100%; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 16px; }
.offline-section progress { display: block; width: 100%; height: 9px; accent-color: var(--accent); margin: 16px 0; }
.offline-packs { padding: 0; margin: 14px 0; list-style: none; }
.offline-packs li { padding: 13px 0; border-top: 1px solid var(--line); }
.offline-packs strong { display: block; overflow-wrap: anywhere; font-size: 12px; }
.offline-packs .hint { display: block; margin: 4px 0 10px; }
.offline-pack-actions { display: flex; gap: 8px; }
.offline-pack-actions .button { font-size: 12px; flex: 1; }
.offline-toggle { display: flex; gap: 10px; align-items: center; min-height: 44px; font-size: 12px; cursor: pointer; }
.offline-toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
.offline-badge { position: absolute; left: 14px; top: 77px; max-width: calc(100% - 85px); background: #fffffff2; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 10px; pointer-events: none; }
.maplibregl-ctrl-bottom-left { max-width: calc(100% - 10px); }
.maplibregl-ctrl-attrib-button { min-width: 24px; min-height: 24px; }
.maplibregl-popup { max-width: min(300px, calc(100vw - 40px)) !important; z-index: 3; }
.maplibregl-popup-content { box-shadow: 0 4px 22px #203c3430; }
.mobile-panel .offline-section { margin: 20px 0 0; padding-top: 20px; }
@media (max-width: 760px) {
  .offline-badge { top: 60px; }
}

@media(max-width:360px) {
  .brand strong {
    font-size: 14px;
  }

  .map-legend {
    display: none;
  }
}

@media(max-height:550px) and (orientation:landscape) {
  .site-header {
    height: 48px;
  }

  .workspace {
    flex-direction: row;
  }

  .explorer {
    order: 0;
    width: 320px;
    border-radius: 0;
    max-height: 100%;
    padding: 14px 12px max(8px,env(safe-area-inset-bottom));
  }

  .map-section {
    order: 1;
  }

  .mobile-panel {
    max-height: calc(var(--visual-height,100dvh) - 12px);
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    animation: none!important;
    transition: none!important;
    scroll-behavior: auto!important;
  }
}
