:root {
  --bg: #eef0f2;
  --panel: rgba(250, 251, 252, 0.96);
  --panel-strong: #ffffff;
  --line: #dfe3e7;
  --line-soft: #eceff1;
  --text: #202528;
  --muted: #7c858a;
  --green: #19a873;
  --green-dark: #11845a;
  --green-soft: #e4f5ee;
  --shadow: 0 12px 32px rgba(34, 45, 50, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  color: var(--text);
  background: #d9dddf;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Pretendard", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
input,
label,
a {
  touch-action: manipulation;
}

button {
  color: inherit;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.app-shell {
  display: grid;
  grid-template-rows: 58px minmax(390px, 1fr) 216px;
  height: 100vh;
  background: var(--bg);
  transition: grid-template-rows 0.28s ease;
}

.app-shell.stats-collapsed {
  grid-template-rows: 58px minmax(390px, 1fr) 48px;
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 300px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 16px 0 18px;
  border-bottom: 1px solid rgba(201, 207, 211, 0.9);
  background: rgba(250, 251, 252, 0.92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(22px) saturate(1.3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: white;
  border-radius: 10px;
  background: linear-gradient(145deg, #1db77d, #0b8c5d);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.3), 0 4px 10px rgba(17, 132, 90, 0.22);
}

.brand-mark svg {
  width: 24px;
  stroke: none;
  fill: currentColor;
}

.brand > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand strong {
  font-size: 14px;
  letter-spacing: -0.2px;
}

.brand span {
  max-width: 190px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-bar {
  display: flex;
  align-items: center;
  gap: 2px;
}

.menu-item {
  padding: 7px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.menu-item:hover,
.menu-item.open {
  background: #e9edef;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 7px;
  color: var(--muted);
  font-size: 10px;
}

.sync-status span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.icon-button,
.mini-button,
.collapse-button {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.icon-button {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.icon-button:hover,
.mini-button:hover {
  background: #e8ecee;
}

.icon-button:disabled,
.save-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.icon-button svg {
  width: 17px;
}

.save-button {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  color: white;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(#1eb47b, #159a69);
  box-shadow: 0 4px 10px rgba(25, 168, 115, 0.22);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.save-button:hover {
  filter: brightness(1.03);
}

.save-button svg {
  width: 15px;
}

.language-picker {
  position: relative;
}

.language-button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 112px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.language-button span:nth-child(2) {
  flex: 1;
  text-align: left;
  white-space: nowrap;
}

.language-button:hover,
.language-button[aria-expanded="true"] {
  border-color: #b8c2c7;
  background: white;
}

.language-menu {
  position: absolute;
  z-index: 1700;
  top: calc(100% + 8px);
  right: 0;
  width: 172px;
  padding: 6px;
  border: 1px solid rgba(200, 208, 212, 0.9);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.language-menu[hidden] {
  display: none;
}

.language-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.language-menu button:hover {
  background: #f0f3f4;
}

.language-menu button.active {
  color: var(--green-dark);
  background: var(--green-soft);
  font-weight: 750;
}

.mobile-panel-button,
.mobile-panel-backdrop {
  display: none;
}

.workspace {
  position: relative;
  display: grid;
  grid-template-columns: 238px minmax(520px, 1fr) 250px;
  min-height: 0;
  transition: grid-template-columns 0.28s ease;
}

.workspace.left-collapsed {
  grid-template-columns: 44px minmax(520px, 1fr) 250px;
}

.workspace.right-collapsed {
  grid-template-columns: 238px minmax(520px, 1fr) 44px;
}

.workspace.left-collapsed.right-collapsed {
  grid-template-columns: 44px minmax(520px, 1fr) 44px;
}

.panel {
  position: relative;
  z-index: 10;
  overflow: auto;
  background: var(--panel);
  backdrop-filter: blur(18px);
}

.left-panel {
  border-right: 1px solid var(--line);
}

.right-panel {
  border-left: 1px solid var(--line);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 46px;
  padding: 0 15px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px;
  font-weight: 700;
}

.mini-button {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  color: #798287;
}

.mini-button svg {
  width: 14px;
  transition: transform 0.25s ease;
}

.panel.collapsed {
  overflow: hidden;
}

.panel.collapsed > :not(.panel-heading) {
  display: none;
}

.panel.collapsed .panel-heading {
  justify-content: center;
  padding: 0;
}

.panel.collapsed .panel-heading > span {
  display: none;
}

.left-panel.collapsed .mini-button svg,
.right-panel.collapsed .mini-button svg {
  transform: rotate(180deg);
}

.tool-group {
  padding: 11px 10px 8px;
  border-bottom: 1px solid var(--line-soft);
}

.group-label {
  margin: 0 7px 6px;
  color: #9aa1a5;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  gap: 8px;
  padding: 7px 7px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.tool-item:hover {
  background: #eef1f2;
}

.tool-item.active {
  color: #0c8257;
  background: var(--green-soft);
}

.tool-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #596268;
  border: 1px solid #e1e5e7;
  border-radius: 9px;
  background: white;
  box-shadow: 0 1px 2px rgba(30, 40, 45, 0.05);
}

.active .tool-icon {
  color: white;
  border-color: var(--green);
  background: var(--green);
}

.tool-icon svg {
  width: 16px;
}

.tool-item > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.tool-item strong {
  font-size: 11px;
  font-weight: 650;
}

.tool-item small {
  overflow: hidden;
  color: #9aa1a5;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-item kbd {
  color: #9ba2a6;
  border: 0;
  background: transparent;
  font-size: 8px;
}

.track-card {
  margin: 11px 10px;
  padding: 11px;
  border: 1px solid #e3e7e8;
  border-radius: 12px;
  background: white;
  box-shadow: 0 3px 10px rgba(40, 50, 55, 0.04);
}

.track-card-head {
  display: grid;
  grid-template-columns: 8px 1fr;
  align-items: center;
  gap: 8px;
}

.track-swatch {
  width: 5px;
  height: 28px;
  border-radius: 5px;
  background: var(--green);
}

.track-card-head > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.track-card-head strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-card-head small {
  color: var(--muted);
  font-size: 8px;
}

.import-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 10px 12px;
  height: 35px;
  color: #596267;
  border: 1px dashed #cbd2d5;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.import-button:hover {
  color: var(--green-dark);
  border-color: var(--green);
  background: var(--green-soft);
}

.import-button svg {
  width: 15px;
}

.map-area {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 25%, rgba(213, 228, 205, 0.9), transparent 27%),
    linear-gradient(140deg, #eceddf, #dfe6d4 52%, #e8e6d7);
}

#leafletMap {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: #dfe5df;
}

.leaflet-container {
  font-family: inherit;
}

.leaflet-control-attribution {
  margin: 0 54px 5px 0 !important;
  padding: 3px 7px !important;
  color: #60696c;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.8) !important;
  font-size: 8px !important;
  backdrop-filter: blur(8px);
}

.leaflet-control-attribution a {
  color: #33775f;
}

.map-grid,
.terrain,
.river,
.road,
.map-label,
.peak-label,
.route-layer,
.map-badge,
.map-scale {
  display: none;
}

.leaflet-pane {
  z-index: 2;
}

.leaflet-tile-pane {
  z-index: 1;
}

.leaflet-overlay-pane,
.leaflet-marker-pane,
.leaflet-tooltip-pane {
  z-index: 4;
}

.leaflet-edit-point {
  width: 10px;
  height: 10px;
  border: 3px solid var(--green);
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 5px rgba(20, 42, 34, 0.28);
}

.leaflet-edit-point.selected {
  width: 15px;
  height: 15px;
  margin: -2px 0 0 -2px;
  border: 3px solid white;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green), 0 2px 8px rgba(20, 42, 34, 0.3);
}

.leaflet-edit-point.route-endpoint {
  position: relative;
  display: grid;
  width: 26px;
  height: 26px;
  margin: 0;
  place-items: center;
  color: white;
  border: 3px solid white;
  background: var(--green);
  box-shadow: 0 0 0 2px var(--green), 0 3px 9px rgba(20, 42, 34, 0.32);
}

.leaflet-edit-point.route-endpoint.end {
  background: #e36f42;
  box-shadow: 0 0 0 2px #e36f42, 0 3px 9px rgba(75, 39, 25, 0.32);
}

.leaflet-edit-point.route-endpoint.start-end {
  background: #3478f6;
  box-shadow: 0 0 0 2px #3478f6, 0 3px 9px rgba(24, 58, 112, 0.3);
}

.leaflet-edit-point.route-endpoint.selected {
  width: 26px;
  height: 26px;
  margin: 0;
  border-color: white;
}

.endpoint-symbol {
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.endpoint-label {
  position: absolute;
  top: 32px;
  left: 50%;
  padding: 4px 7px;
  color: #25302c;
  border: 1px solid rgba(215, 221, 219, 0.95);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 3px 9px rgba(35, 43, 40, 0.16);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transform: translateX(-50%);
}

.gpx-route-line {
  cursor: move;
}

.gpx-route-hit-line {
  cursor: move;
}

.leaflet-waypoint {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: white;
  border: 3px solid white;
  border-radius: 8px 8px 8px 2px;
  background: #f2a32b;
  box-shadow: 0 3px 8px rgba(42, 48, 44, 0.25);
  font-size: 9px;
  font-weight: 800;
  transform: rotate(-45deg);
}

.leaflet-waypoint span {
  transform: rotate(45deg);
}

.leaflet-waypoint.selected {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green), 0 4px 12px rgba(28, 54, 44, 0.32);
}

.leaflet-tooltip.gpx-tooltip {
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 12px rgba(35, 43, 40, 0.15);
  color: #303638;
  font-size: 9px;
  font-weight: 700;
}

.leaflet-tooltip.gpx-tooltip::before {
  display: none;
}

.map-area.tool-draw,
.map-area.tool-point {
  cursor: crosshair;
}

.map-area.tool-select,
.map-area.tool-split {
  cursor: pointer;
}

.map-grid {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(91, 104, 88, 0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 104, 88, 0.25) 1px, transparent 1px);
  background-size: 70px 70px;
  transition: opacity 0.2s;
}

.terrain {
  position: absolute;
  border: 1px solid rgba(128, 151, 115, 0.25);
  border-radius: 48% 52% 65% 35% / 50% 42% 58% 50%;
  background: repeating-radial-gradient(ellipse at 45% 50%, transparent 0 9px, rgba(109, 139, 95, 0.16) 10px 11px);
  transform: rotate(-18deg);
  transition: opacity 0.2s;
}

.terrain-one {
  top: -110px;
  left: 5%;
  width: 420px;
  height: 390px;
}

.terrain-two {
  top: 20%;
  right: -60px;
  width: 490px;
  height: 420px;
  transform: rotate(24deg);
}

.terrain-three {
  bottom: -210px;
  left: 17%;
  width: 500px;
  height: 410px;
  transform: rotate(8deg);
}

.terrain-four {
  top: 30%;
  left: -180px;
  width: 390px;
  height: 360px;
  transform: rotate(36deg);
}

.road {
  position: absolute;
  height: 5px;
  border: 1px solid rgba(169, 159, 137, 0.32);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transform-origin: left center;
  transition: opacity 0.2s;
}

.road-one {
  top: 65%;
  left: -5%;
  width: 78%;
  transform: rotate(-8deg);
}

.road-two {
  top: 10%;
  right: -15%;
  width: 72%;
  transform: rotate(58deg);
}

.road-three {
  top: 40%;
  left: 24%;
  width: 65%;
  transform: rotate(19deg);
}

.river {
  position: absolute;
  top: -20%;
  left: 55%;
  width: 9px;
  height: 140%;
  border: 2px solid rgba(116, 175, 192, 0.22);
  border-radius: 50%;
  background: rgba(130, 193, 207, 0.18);
  transform: rotate(34deg);
}

.map-label,
.peak-label {
  position: absolute;
  z-index: 2;
  color: rgba(70, 76, 69, 0.6);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.label-one { left: 9%; top: 25%; }
.label-two { left: 43%; top: 45%; font-weight: 700; letter-spacing: 0.12em; }
.label-three { right: 10%; top: 69%; }
.label-four { left: 18%; bottom: 12%; }
.peak-one { right: 26%; top: 18%; }
.peak-two { left: 34%; top: 32%; }

.peak-label::before {
  content: "△";
  margin-right: 4px;
  color: #79856f;
}

.peak-label b {
  color: #929a8e;
  font-size: 7px;
  font-weight: 500;
}

.route-layer {
  position: absolute;
  z-index: 4;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: url(#routeShadow);
}

.route-layer {
  transform-origin: center;
}

.route-halo {
  fill: none;
  stroke: rgba(255, 255, 255, 0.96);
  stroke-width: 11;
  vector-effect: non-scaling-stroke;
}

.route-path {
  fill: none;
  stroke: var(--green);
  stroke-width: 6;
  vector-effect: non-scaling-stroke;
  transition: stroke 0.2s, stroke-width 0.2s;
}

.route-point {
  fill: white;
  stroke: var(--green);
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}

.route-point.selected {
  fill: var(--green);
  stroke: white;
}

.route-point {
  cursor: pointer;
}

.waypoint-marker {
  fill: #ffb13b;
  stroke: white;
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}

.waypoint-label {
  fill: #303638;
  stroke: none;
  font-size: 18px;
  font-weight: 700;
  paint-order: stroke;
  stroke: white;
  stroke-width: 5px;
  vector-effect: non-scaling-stroke;
}

.map-area.is-dirty .sync-status {
  color: #a66c11;
}

.start-point,
.end-point {
  fill: white;
  stroke-width: 5;
}

.floating-search {
  position: absolute;
  z-index: 600;
  top: 13px;
  left: 50%;
  display: flex;
  width: min(330px, 45%);
  height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid rgba(205, 211, 212, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(47, 58, 61, 0.12);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.floating-search svg {
  width: 16px;
  color: #818a8e;
}

.floating-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 10px;
}

.search-submit {
  padding: 5px 8px;
  color: white;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}

.search-submit:disabled {
  cursor: wait;
  opacity: 0.55;
}

.floating-search kbd {
  padding: 2px 5px;
  color: #9aa1a4;
  border: 1px solid #dfe3e5;
  border-radius: 5px;
  background: #f5f6f7;
  font-size: 8px;
}

.search-results {
  position: absolute;
  z-index: 710;
  top: 44px;
  right: 0;
  left: 0;
  overflow: hidden;
  padding: 5px;
  border: 1px solid #d8dddf;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 30px rgba(40, 51, 54, 0.18);
  backdrop-filter: blur(18px);
}

.search-results[hidden] {
  display: none;
}

.search-result {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  width: 100%;
  gap: 8px;
  padding: 8px;
  color: #303638;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.search-result:hover,
.search-result:focus-visible {
  background: var(--green-soft);
  outline: none;
}

.search-result-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--green-dark);
  border-radius: 8px;
  background: var(--green-soft);
  font-size: 10px;
  font-weight: 800;
}

.search-result-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.search-result-text strong,
.search-result-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-text strong {
  font-size: 9px;
}

.search-result-text small {
  color: #81898d;
  font-size: 7px;
}

.search-empty {
  padding: 12px 10px;
  color: #7c858a;
  font-size: 9px;
  text-align: center;
}

.zoom-control {
  position: absolute;
  z-index: 600;
  right: 13px;
  bottom: 18px;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid #d7dcde;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 7px 18px rgba(48, 59, 62, 0.12);
}

.zoom-control button {
  display: grid;
  width: 34px;
  height: 32px;
  place-items: center;
  border: 0;
  border-bottom: 1px solid #e5e8e9;
  background: transparent;
  font-size: 17px;
  cursor: pointer;
}

.zoom-control button:last-child {
  border: 0;
}

.zoom-control button:hover {
  background: #f0f3f3;
}

.zoom-control svg {
  width: 15px;
}

.map-scale,
.coordinates {
  position: absolute;
  z-index: 600;
  bottom: 14px;
  color: rgba(65, 72, 70, 0.68);
  font-size: 8px;
}

.map-scale {
  left: 15px;
}

.map-scale span {
  display: inline-block;
  width: 48px;
  margin-right: 5px;
  border-top: 2px solid rgba(55, 62, 61, 0.55);
}

.coordinates {
  right: 13px;
  bottom: 124px;
  padding: 5px 8px;
  border: 1px solid rgba(215, 220, 222, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 12px rgba(48, 59, 62, 0.08);
  backdrop-filter: blur(8px);
}

.map-badge {
  position: absolute;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 130px;
  padding: 7px 9px 7px 7px;
  border: 1px solid rgba(214, 220, 220, 0.95);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 18px rgba(42, 54, 57, 0.12);
  font-size: 8px;
  pointer-events: none;
}

.map-badge b {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  color: white;
  border-radius: 7px;
  background: var(--green);
  font-size: 9px;
}

.map-badge span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-weight: 650;
}

.map-badge small {
  color: var(--muted);
  font-size: 7px;
  font-weight: 400;
}

.start-badge {
  left: 14%;
  bottom: 9%;
}

.end-badge {
  top: 9%;
  right: 15%;
}

.setting-section {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line-soft);
}

.section-title,
.color-row,
.range-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  margin-bottom: 10px;
  font-size: 9px;
  font-weight: 700;
}

.map-style-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.style-card {
  padding: 3px 3px 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.style-card.active {
  color: var(--green-dark);
  border-color: var(--green);
  background: var(--green-soft);
}

.style-card strong {
  display: block;
  margin-top: 4px;
  font-size: 7px;
  font-weight: 600;
}

.style-preview {
  position: relative;
  display: block;
  height: 38px;
  overflow: hidden;
  border-radius: 6px;
  background: #dfe5d5;
}

.terrain-preview {
  background: repeating-radial-gradient(ellipse at 65% 40%, #dce6d0 0 5px, #cdddc0 6px 7px);
}

.terrain-preview i {
  position: absolute;
  width: 45px;
  border-top: 2px solid white;
  transform: rotate(-35deg);
}

.terrain-preview i:nth-child(1) { left: -8px; top: 21px; }
.terrain-preview i:nth-child(2) { right: -8px; top: 17px; transform: rotate(44deg); }
.terrain-preview i:nth-child(3) { left: 19px; top: 7px; border-color: var(--green); }

.satellite-preview {
  background: linear-gradient(135deg, #44573f, #617458 45%, #2d4436);
}

.contour-preview {
  background:
    repeating-radial-gradient(ellipse at 35% 62%, transparent 0 4px, rgba(92, 122, 70, 0.42) 5px 6px),
    linear-gradient(145deg, #dce8c8, #b9d29d);
}

.contour-preview i {
  position: absolute;
  width: 54px;
  border-top: 2px solid rgba(255, 255, 255, 0.9);
  transform: rotate(-28deg);
}

.contour-preview i:nth-child(1) { top: 10px; left: -8px; }
.contour-preview i:nth-child(2) { top: 23px; left: 13px; transform: rotate(35deg); }
.contour-preview i:nth-child(3) { top: 30px; left: -4px; border-color: var(--green); }

.satellite-preview i {
  position: absolute;
  inset: 4px 15px;
  border: 1px solid rgba(212, 227, 179, 0.4);
  border-radius: 50%;
  transform: rotate(25deg);
}

.satellite-preview i:last-child {
  inset: 12px 2px;
  transform: rotate(-20deg);
}

.color-row,
.range-row {
  min-height: 32px;
  color: #697176;
  font-size: 9px;
}

.color-options {
  display: flex;
  gap: 7px;
}

.color-choice {
  position: relative;
  width: 17px;
  height: 17px;
  padding: 0;
  border: 2px solid white;
  border-radius: 50%;
  outline: 1px solid transparent;
  background: var(--choice);
  cursor: pointer;
}

.color-choice.active {
  outline-color: var(--choice);
}

.range-row input {
  width: 90px;
  accent-color: var(--green);
}

.range-row output {
  min-width: 27px;
  text-align: right;
  font-size: 8px;
}

.selected-point-card {
  background: #f7faf8;
}

.delete-point-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  color: #c44545;
  border: 1px solid rgba(211, 83, 83, 0.22);
  border-radius: 9px;
  background: rgba(255, 242, 242, 0.9);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.delete-point-button svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.9;
}

.delete-point-button:hover:not(:disabled) {
  color: #a92f2f;
  border-color: rgba(196, 69, 69, 0.38);
  background: #ffe7e7;
  transform: translateY(-1px);
}

.delete-point-button:active:not(:disabled) {
  transform: translateY(0);
}

.delete-point-button:disabled {
  color: #a5ada9;
  border-color: #e0e5e2;
  background: #f2f5f3;
  cursor: default;
  opacity: 0.72;
}

.point-name-editor {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  color: #737c80;
  font-size: 8px;
}

.point-name-editor[hidden] {
  display: none;
}

.point-name-editor input {
  width: 100%;
  height: 30px;
  padding: 0 9px;
  color: #303638;
  border: 1px solid #dce3e0;
  border-radius: 8px;
  outline: none;
  background: white;
  font-size: 9px;
}

.point-name-editor input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.point-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid #e1e8e4;
  border-radius: 9px;
  background: white;
}

.point-grid div {
  display: flex;
  min-height: 41px;
  flex-direction: column;
  justify-content: center;
  padding: 0 10px;
  border-right: 1px solid #edf0ef;
  border-bottom: 1px solid #edf0ef;
}

.point-grid div:nth-child(2n) { border-right: 0; }
.point-grid div:nth-child(n + 3) { border-bottom: 0; }

.point-grid span {
  color: var(--muted);
  font-size: 7px;
}

.point-grid strong {
  margin-top: 2px;
  font-size: 10px;
}

.right-footer {
  padding: 4px 12px 12px;
}

.elevation-source {
  margin: 0 2px;
  color: #98a0a3;
  font-size: 7px;
  line-height: 1.45;
  text-align: center;
}

.stats-panel {
  --stats-summary-width: 365px;
  position: relative;
  z-index: 15;
  display: grid;
  grid-template-columns: var(--stats-summary-width) 1fr;
  min-height: 0;
  border-top: 1px solid #d5dadd;
  background: rgba(250, 251, 252, 0.97);
  box-shadow: 0 -8px 24px rgba(53, 64, 68, 0.06);
  backdrop-filter: blur(18px);
  overflow: hidden;
  transition: background 0.2s;
}

.stats-panel.collapsed {
  display: block;
  background: rgba(250, 251, 252, 0.98);
  box-shadow: 0 -3px 12px rgba(53, 64, 68, 0.05);
}

.stats-panel.collapsed .stats-summary {
  height: 47px;
  padding: 0 18px;
  border-right: 0;
}

.stats-panel.collapsed .summary-heading {
  width: calc(var(--stats-summary-width) - 36px);
  height: 47px;
  align-items: center;
}

.stats-panel.collapsed .summary-heading > div {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.stats-panel.collapsed .summary-heading > div > span {
  display: none;
}

.stats-panel.collapsed .metrics,
.stats-panel.collapsed .elevation-chart {
  display: none;
}

.stats-summary {
  padding: 15px 18px;
  border-right: 1px solid var(--line);
}

.summary-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.summary-heading > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.summary-heading span {
  color: var(--muted);
  font-size: 8px;
}

.summary-heading strong {
  font-size: 12px;
}

.collapse-button {
  width: 25px;
  height: 25px;
  border-radius: 7px;
}

.collapse-button:hover {
  background: #e9edee;
}

.collapse-button svg {
  width: 14px;
  transition: transform 0.3s;
}

.collapsed .collapse-button svg {
  transform: rotate(180deg);
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 13px;
}

.metric {
  display: flex;
  min-height: 56px;
  flex-direction: column;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid #e3e7e8;
  border-radius: 11px;
  background: white;
}

.metric.primary {
  border-color: #cde9de;
  background: #f0faf6;
}

.metric span {
  color: var(--muted);
  font-size: 8px;
}

.metric strong {
  margin-top: 2px;
  font-size: 17px;
  letter-spacing: -0.04em;
}

.metric.primary strong {
  color: var(--green-dark);
}

.metric small {
  color: #7c858a;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0;
}

.elevation-chart {
  min-width: 0;
  padding: 13px 18px 10px;
}

.chart-head {
  display: flex;
  height: 27px;
  align-items: center;
  justify-content: space-between;
}

.chart-tabs {
  display: flex;
  gap: 4px;
}

.chart-tabs button {
  padding: 5px 10px;
  color: var(--muted);
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 8px;
  cursor: pointer;
}

.chart-tabs button.active {
  color: var(--green-dark);
  background: var(--green-soft);
  font-weight: 700;
}

.chart-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 8px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.chart-wrap {
  position: relative;
  height: 157px;
  margin-left: 33px;
}

#elevationSvg {
  position: absolute;
  inset: 0 0 17px;
  width: 100%;
  height: calc(100% - 17px);
  overflow: visible;
}

.chart-waypoint-layer {
  position: absolute;
  z-index: 4;
  inset: 0 0 17px;
  pointer-events: none;
}

.chart-waypoint-marker {
  position: absolute;
  display: grid;
  width: 34px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: white;
  border: 0;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  pointer-events: auto;
  cursor: pointer;
  transform: translate(-50%, -100%);
}

.chart-waypoint-marker::before {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 24px;
  height: 24px;
  border: 3px solid white;
  border-radius: 8px 8px 8px 2px;
  background: #f2a32b;
  box-shadow: 0 3px 8px rgba(42, 48, 44, 0.28);
  content: "";
  transform: translateX(-50%) rotate(-45deg);
}

.chart-waypoint-marker span {
  position: absolute;
  z-index: 1;
  top: 17px;
  left: 50%;
  transform: translateX(-50%);
}

.chart-waypoint-marker::after {
  position: absolute;
  bottom: 44px;
  left: 50%;
  max-width: 150px;
  overflow: hidden;
  padding: 5px 8px;
  color: #303638;
  border: 1px solid #d8dddf;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 4px 12px rgba(35, 43, 40, 0.15);
  content: attr(data-label);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateX(-50%);
  transition: opacity 0.15s;
}

.chart-waypoint-marker:hover::after,
.chart-waypoint-marker:focus-visible::after {
  opacity: 1;
}

.chart-waypoint-marker.selected {
  outline: 0;
}

.chart-waypoint-marker.selected::before {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green), 0 4px 12px rgba(28, 54, 44, 0.32);
}

.chart-waypoint-marker,
.chart-tooltip,
.chart-cursor,
.chart-point {
  transition: opacity 0.15s;
}

.chart-waypoint-marker.collision,
.chart-tooltip.collision,
.chart-cursor.collision,
.chart-point.collision {
  opacity: 0.55;
}

.leaflet-tooltip.map-chart-indicator-label {
  padding: 5px 8px;
  color: white;
  border: 0;
  border-radius: 7px;
  background: rgba(34, 42, 43, 0.86);
  box-shadow: 0 3px 10px rgba(26, 35, 36, 0.2);
  font-size: 11px;
  font-weight: 700;
}

.leaflet-tooltip.map-chart-indicator-label::before {
  border-top-color: rgba(34, 42, 43, 0.86);
}

.chart-lines line {
  stroke: #e7eaea;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.elevation-area {
  fill: url(#elevationGradient);
  stroke: none;
}

.elevation-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-cursor {
  stroke: rgba(25, 168, 115, 0.5);
  stroke-dasharray: 3 3;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-point {
  fill: white;
  stroke: var(--green);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.y-axis {
  position: absolute;
  top: 0;
  bottom: 24px;
  left: -34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #9aa1a4;
  font-size: 7px;
}

.x-axis {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  color: #9aa1a4;
  font-size: 7px;
}

.chart-tooltip {
  position: absolute;
  top: 30px;
  left: 62.7%;
  display: flex;
  flex-direction: column;
  padding: 8px 11px;
  color: white;
  border-radius: 7px;
  background: rgba(39, 46, 47, 0.86);
  font-size: 12px;
  line-height: 1.25;
  pointer-events: none;
  transform: translateX(-50%);
}

.chart-tooltip span {
  color: #cdd3d4;
  font-size: 11px;
}

.menu-popover {
  position: fixed;
  z-index: 1400;
  min-width: 170px;
  padding: 5px;
  border: 1px solid #d8dddf;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.menu-popover button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 8px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}

.menu-popover button:hover {
  background: #edf1f2;
}

.menu-popover kbd {
  color: #a0a7aa;
  font-size: 8px;
}

.toast {
  position: fixed;
  z-index: 1500;
  bottom: 232px;
  left: 50%;
  padding: 9px 14px;
  color: white;
  border-radius: 9px;
  background: rgba(34, 42, 43, 0.9);
  box-shadow: var(--shadow);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: bottom 0.28s ease, opacity 0.22s, transform 0.22s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.help-dialog-backdrop {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(35, 43, 45, 0.34);
  backdrop-filter: blur(8px);
}

.help-dialog-backdrop[hidden] {
  display: none;
}

.file-dialog-backdrop {
  position: fixed;
  z-index: 2100;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(35, 43, 45, 0.34);
  backdrop-filter: blur(8px);
}

.file-dialog-backdrop[hidden] {
  display: none;
}

.restore-dialog-backdrop {
  position: fixed;
  z-index: 2200;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(35, 43, 45, 0.38);
  backdrop-filter: blur(9px);
}

.restore-dialog-backdrop[hidden] {
  display: none;
}

.restore-dialog {
  width: min(460px, 100%);
  padding: 26px;
  border: 1px solid rgba(213, 219, 221, 0.96);
  border-radius: 22px;
  background: rgba(252, 253, 253, 0.99);
  box-shadow: 0 26px 70px rgba(31, 43, 46, 0.26);
}

.restore-dialog > span {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.restore-dialog h2 {
  margin: 6px 0 12px;
  font-size: 23px;
}

.restore-dialog p {
  margin: 0;
  color: #616b6e;
  font-size: 14px;
  line-height: 1.65;
}

.restore-dialog p strong {
  color: #283234;
}

.restore-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

.restore-dialog-actions button {
  min-width: 104px;
  min-height: 44px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.restore-dialog-actions .secondary {
  color: #596366;
  border: 1px solid #d6dcde;
  background: white;
}

.restore-dialog-actions .primary {
  color: white;
  border: 1px solid var(--green);
  background: var(--green);
}

.file-dialog {
  width: min(440px, 100%);
  padding: 22px;
  border: 1px solid rgba(213, 219, 221, 0.96);
  border-radius: 20px;
  background: rgba(252, 253, 253, 0.99);
  box-shadow: 0 26px 70px rgba(31, 43, 46, 0.24);
}

.file-dialog header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}

.file-dialog header span {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
}

.file-dialog h2 {
  margin: 4px 0 0;
  font-size: 22px;
}

.file-dialog-close {
  width: 40px;
  height: 40px;
  color: #697275;
  border: 0;
  border-radius: 12px;
  background: #edf1f2;
  font-size: 26px;
  cursor: pointer;
}

.file-dialog > label {
  display: block;
  margin-bottom: 8px;
  color: #555f62;
  font-size: 13px;
  font-weight: 700;
}

.file-name-field {
  display: flex;
  height: 48px;
  align-items: center;
  overflow: hidden;
  border: 1px solid #cfd7d9;
  border-radius: 12px;
  background: white;
}

.file-name-field:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.file-name-field input {
  min-width: 0;
  height: 100%;
  flex: 1;
  padding: 0 4px 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
}

.file-name-field span {
  padding: 0 14px 0 5px;
  color: #7d878a;
  font-size: 14px;
}

.file-dialog > p {
  min-height: 20px;
  margin: 8px 2px 20px;
  color: #7a8487;
  font-size: 12px;
}

.file-dialog > p.error {
  color: #c65338;
}

.file-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.file-dialog-actions button {
  min-width: 88px;
  min-height: 42px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.file-dialog-actions .secondary {
  color: #596366;
  border: 1px solid #d6dcde;
  background: white;
}

.file-dialog-actions .primary {
  color: white;
  border: 1px solid var(--green);
  background: var(--green);
}

.help-dialog {
  width: min(680px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid rgba(213, 219, 221, 0.96);
  border-radius: 20px;
  background: rgba(252, 253, 253, 0.98);
  box-shadow: 0 26px 70px rgba(31, 43, 46, 0.24);
}

.help-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.help-dialog-header span {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
}

.help-dialog-header h2 {
  margin: 4px 0 0;
  font-size: 22px;
}

.help-dialog-close {
  width: 40px;
  height: 40px;
  color: #697275;
  border: 0;
  border-radius: 12px;
  background: #edf1f2;
  font-size: 26px;
  cursor: pointer;
}

.help-dialog-content {
  max-height: calc(min(720px, 100vh - 48px) - 91px);
  overflow: auto;
  padding: 20px 24px 26px;
}

.shortcut-section + .shortcut-section,
.guide-section + .guide-section {
  margin-top: 22px;
}

.shortcut-section h3,
.guide-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.shortcut-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  margin: 0;
}

.shortcut-list div {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f2f5f5;
}

.shortcut-list dt {
  font-size: 13px;
  font-weight: 600;
}

.shortcut-list dd {
  margin: 0;
}

.shortcut-list kbd {
  display: inline-flex;
  min-width: 30px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  color: #505a5d;
  border: 1px solid #d4dbdd;
  border-bottom-width: 2px;
  border-radius: 7px;
  background: white;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.guide-section p,
.guide-section li {
  color: #555f62;
  font-size: 14px;
  line-height: 1.65;
}

.guide-section p {
  margin: 0;
}

.guide-section ol,
.guide-section ul {
  margin: 0;
  padding-left: 20px;
}

.about-product {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 0 22px;
  border-bottom: 1px solid var(--line);
}

.about-product-mark {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  color: white;
  border-radius: 17px;
  background: linear-gradient(145deg, #22b57f, #13885e);
  box-shadow: 0 8px 20px rgba(25, 168, 115, 0.24);
}

.about-product-mark svg {
  width: 35px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.about-product h3 {
  margin: 0;
  font-size: 20px;
}

.about-product p {
  margin: 4px 0;
  color: #596366;
  font-size: 13px;
  line-height: 1.5;
}

.about-product span {
  color: #8a9396;
  font-size: 12px;
}

.about-section {
  padding-top: 20px;
}

.about-section + .about-section {
  margin-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.about-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.about-section p,
.about-section li {
  color: #555f62;
  font-size: 13px;
  line-height: 1.65;
}

.about-section p {
  margin: 4px 0;
}

.about-section a {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
}

.about-section a:hover {
  text-decoration: underline;
}

.about-section ul {
  margin: 0;
  padding-left: 20px;
}

.about-section .about-note {
  margin-top: 10px;
  color: #879093;
  font-size: 12px;
}

.app-shell.stats-collapsed .toast {
  bottom: 64px;
}

@media (max-width: 1100px) {
  body {
    width: 100%;
    min-width: 0;
    height: 100dvh;
    min-height: 100dvh;
    overscroll-behavior: none;
  }

  .app-shell,
  .app-shell.stats-collapsed {
    position: fixed;
    inset: 0;
    grid-template-rows: 104px minmax(0, 1fr) 58px;
    width: 100%;
    height: auto;
    min-height: 0;
  }

  .app-shell:not(.stats-collapsed) {
    grid-template-rows: 104px minmax(180px, 1fr) clamp(280px, 42dvh, 390px);
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 58px 46px;
    gap: 0 8px;
    padding: 0 10px;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
  }

  .brand > div:last-child {
    min-width: 0;
  }

  .brand strong {
    font-size: 16px;
  }

  .brand span {
    max-width: min(38vw, 170px);
    font-size: 11px;
  }

  .menu-bar {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: stretch;
    justify-content: space-around;
    border-top: 1px solid var(--line-soft);
  }

  .menu-item {
    min-width: 64px;
    min-height: 40px;
    padding: 7px 12px;
    font-size: 14px;
  }

  .top-actions {
    gap: 3px;
  }

  .sync-status {
    display: none;
  }

  #undoButton,
  #redoButton {
    position: fixed;
    z-index: 720;
    right: 10px;
    display: grid;
    width: 44px;
    height: 44px;
    border: 1px solid #d7dcde;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 7px 18px rgba(48, 59, 62, 0.12);
    backdrop-filter: blur(14px);
  }

  #undoButton {
    top: 114px;
    border-radius: 12px 12px 4px 4px;
  }

  #redoButton {
    top: 160px;
    border-radius: 4px 4px 12px 12px;
  }

  .mobile-panel-button {
    display: grid;
    width: 40px;
    height: 40px;
  }

  .mobile-panel-button[aria-expanded="true"] {
    color: var(--green-dark);
    background: var(--green-soft);
  }

  .save-button {
    width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0;
    border-radius: 11px;
  }

  .save-button span,
  .language-button span:nth-child(2),
  .language-button span:last-child {
    display: none;
  }

  .save-button svg {
    width: 18px;
  }

  .language-button {
    min-width: 40px;
    width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0;
    font-size: 17px;
  }

  .language-menu {
    position: fixed;
    top: 60px;
    right: 10px;
    width: min(220px, calc(100vw - 20px));
  }

  .workspace,
  .workspace.left-collapsed,
  .workspace.right-collapsed,
  .workspace.left-collapsed.right-collapsed {
    display: block;
    min-width: 0;
  }

  .map-area {
    position: absolute;
    inset: 0;
  }

  .panel {
    position: fixed;
    z-index: 1250;
    top: 104px;
    bottom: 58px;
    width: min(86vw, 350px);
    max-width: none;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    background: rgba(250, 251, 252, 0.98);
    box-shadow: 0 16px 42px rgba(27, 39, 43, 0.22);
    transition: transform 0.24s ease, visibility 0.24s;
    visibility: visible;
  }

  .left-panel {
    left: 0;
    border-right: 1px solid var(--line);
    transform: translateX(0);
  }

  .right-panel {
    right: 0;
    border-left: 1px solid var(--line);
    transform: translateX(0);
  }

  .left-panel.collapsed {
    transform: translateX(-105%);
    visibility: hidden;
  }

  .right-panel.collapsed {
    transform: translateX(105%);
    visibility: hidden;
  }

  .panel.collapsed {
    overflow: auto;
  }

  .panel.collapsed > :not(.panel-heading) {
    display: initial;
  }

  .panel.collapsed .panel-heading {
    justify-content: space-between;
    padding: 0 15px;
  }

  .panel.collapsed .panel-heading > span {
    display: initial;
  }

  .left-panel.collapsed .mini-button svg,
  .right-panel.collapsed .mini-button svg {
    transform: none;
  }

  .panel-heading {
    position: sticky;
    z-index: 2;
    top: 0;
    height: 54px;
    background: rgba(250, 251, 252, 0.97);
    font-size: 15px;
    backdrop-filter: blur(16px);
  }

  .mini-button {
    width: 38px;
    height: 38px;
  }

  .mini-button svg {
    width: 18px;
  }

  .mobile-panel-backdrop {
    position: fixed;
    z-index: 1200;
    inset: 104px 0 58px;
    display: block;
    border: 0;
    background: rgba(27, 37, 39, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    backdrop-filter: blur(2px);
  }

  body.mobile-panel-open .mobile-panel-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .tool-group {
    padding: 14px 12px 10px;
  }

  .group-label {
    margin-bottom: 8px;
    font-size: 11px;
  }

  .tool-item {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    min-height: 58px;
    gap: 10px;
    padding: 8px 10px;
  }

  .tool-icon {
    width: 38px;
    height: 38px;
  }

  .tool-item strong {
    font-size: 15px;
  }

  .tool-item small {
    font-size: 12px;
  }

  .tool-item kbd {
    display: none;
  }

  .floating-search {
    top: 10px;
    left: 10px;
    width: calc(100% - 74px);
    height: 46px;
    transform: none;
  }

  .floating-search input {
    font-size: 16px;
  }

  .floating-search kbd {
    display: none;
  }

  .search-submit {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }

  .search-result {
    min-height: 52px;
  }

  .search-result-text strong {
    font-size: 13px;
  }

  .search-result-text small,
  .search-empty {
    font-size: 11px;
  }

  .zoom-control {
    right: 10px;
    bottom: 16px;
  }

  .zoom-control button {
    width: 44px;
    height: 44px;
  }

  .coordinates {
    right: 62px;
    bottom: 16px;
    font-size: 10px;
  }

  .map-scale {
    bottom: 20px;
    font-size: 10px;
  }

  .stats-panel,
  .stats-panel.collapsed {
    --stats-summary-width: auto;
    z-index: 1150;
    display: block;
    overflow: auto;
    padding-bottom: env(safe-area-inset-bottom);
    border-top-color: #cfd6d9;
  }

  .stats-panel:not(.collapsed) {
    display: flex;
    flex-direction: column;
  }

  .stats-panel.collapsed {
    overflow: hidden;
  }

  .stats-panel.collapsed .stats-summary,
  .stats-summary {
    height: auto;
    padding: 10px 14px;
    border-right: 0;
  }

  .stats-panel.collapsed .stats-summary {
    height: 57px;
  }

  .stats-panel.collapsed .summary-heading,
  .summary-heading {
    width: 100%;
    min-height: 37px;
    align-items: center;
  }

  .stats-panel.collapsed .summary-heading > div {
    flex-direction: row;
    gap: 8px;
  }

  .stats-panel.collapsed .summary-heading > div > span {
    display: none;
  }

  .summary-heading strong {
    font-size: 15px;
  }

  .collapse-button {
    width: 40px;
    height: 40px;
  }

  .collapse-button svg {
    width: 19px;
  }

  .metrics {
    grid-template-columns: repeat(4, minmax(132px, 1fr));
    gap: 9px;
    overflow-x: auto;
    margin-top: 10px;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

  .metrics::-webkit-scrollbar {
    display: none;
  }

  .metric {
    min-height: 62px;
  }

  .metric span {
    font-size: 11px;
  }

  .metric strong {
    font-size: 19px;
  }

  .elevation-chart {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    padding: 0 14px 12px;
  }

  .chart-tabs button {
    min-height: 36px;
    padding: 6px 13px;
    font-size: 12px;
  }

  .chart-meta {
    display: none;
  }

  .chart-wrap {
    min-height: 132px;
    height: auto;
    flex: 1;
    margin-left: 38px;
  }

  .y-axis,
  .x-axis {
    font-size: 9px;
  }

  .toast,
  .app-shell.stats-collapsed .toast {
    bottom: 72px;
    max-width: calc(100vw - 24px);
    font-size: 13px;
    text-align: center;
  }

  .menu-popover {
    z-index: 1500;
    right: 10px;
    left: 10px !important;
    width: auto;
    max-height: calc(100dvh - 170px);
    overflow: auto;
  }

  .menu-popover button {
    min-height: 46px;
    padding: 10px 12px;
    font-size: 14px;
  }

  .menu-popover kbd {
    font-size: 11px;
  }

  .help-dialog-backdrop,
  .file-dialog-backdrop,
  .restore-dialog-backdrop {
    padding: 12px;
  }

  .help-dialog,
  .file-dialog,
  .restore-dialog {
    width: min(100%, 520px);
    max-height: calc(100dvh - 24px);
  }
}

@media (max-width: 430px) {
  .topbar {
    padding: 0 7px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand span {
    max-width: 92px;
    font-size: 9px;
  }

  .top-actions {
    gap: 1px;
  }

  .mobile-panel-button,
  .save-button,
  .language-button {
    width: 37px;
    height: 37px;
  }

  .menu-item {
    min-width: 0;
    flex: 1;
    padding-right: 6px;
    padding-left: 6px;
  }

  .floating-search {
    width: calc(100% - 66px);
  }

  .coordinates {
    display: none;
  }

  .chart-wrap {
    margin-left: 34px;
  }

  .chart-tooltip {
    padding: 6px 8px;
  }
}

@media (max-width: 720px) {
  .shortcut-list {
    grid-template-columns: 1fr;
  }
}

.map-area.style-satellite {
  background:
    radial-gradient(circle at 65% 28%, rgba(112, 133, 89, 0.7), transparent 28%),
    radial-gradient(circle at 30% 60%, rgba(90, 113, 79, 0.9), transparent 34%),
    linear-gradient(145deg, #324a39, #59684b 50%, #273d31);
}

.map-area.style-satellite .leaflet-tile-pane {
  filter: saturate(1.08) contrast(1.04);
}

#mapArea .map-badge {
  display: none;
}

.map-area.style-satellite .map-label,
.map-area.style-satellite .peak-label {
  color: rgba(255, 255, 255, 0.68);
}

.map-area.style-satellite .terrain {
  border-color: rgba(222, 235, 199, 0.18);
  background: repeating-radial-gradient(ellipse at 45% 50%, transparent 0 9px, rgba(222, 235, 199, 0.09) 10px 11px);
}

@media (min-width: 1101px) and (max-height: 740px) {
  .app-shell {
    grid-template-rows: 54px minmax(340px, 1fr) 190px;
  }

  .app-shell.stats-collapsed {
    grid-template-rows: 54px minmax(340px, 1fr) 48px;
  }

  .toast {
    bottom: 206px;
  }

  .app-shell.stats-collapsed .toast {
    bottom: 64px;
  }

  .stats-panel {
    --stats-summary-width: 330px;
  }

  .stats-summary {
    padding-top: 10px;
  }

  .metric {
    min-height: 48px;
  }

  .chart-wrap {
    height: 135px;
  }
}

/* Accessibility sizing */
.brand strong {
  font-size: 16px;
}

.brand span,
.sync-status {
  font-size: 11px;
}

.menu-item,
.save-button {
  font-size: 14px;
}

.menu-item {
  padding: 9px 13px;
}

.icon-button,
.save-button {
  min-height: 38px;
}

.panel-heading {
  height: 50px;
  font-size: 13px;
}

.group-label,
.section-title {
  font-size: 11px;
}

.tool-item {
  min-height: 48px;
  padding: 8px;
}

.tool-item strong {
  font-size: 13px;
}

.tool-item small,
.tool-item kbd,
.track-card-head small,
.import-button,
.style-card strong,
.color-row,
.range-row,
.point-name-editor,
.point-grid strong,
.summary-heading span,
.metric span,
.metric small,
.chart-tabs button,
.chart-meta {
  font-size: 10px;
}

.track-card-head strong,
.summary-heading strong {
  font-size: 13px;
}

.import-button {
  min-height: 40px;
}

.floating-search {
  width: min(390px, 52%);
  height: 44px;
}

.floating-search input {
  font-size: 13px;
}

.floating-search kbd,
.search-submit {
  font-size: 10px;
}

.search-result-text strong {
  font-size: 12px;
}

.search-result-text small,
.search-empty {
  font-size: 10px;
}

.style-preview {
  height: 46px;
}

.style-card {
  min-height: 72px;
}

.point-name-editor input {
  height: 36px;
  font-size: 12px;
}

.point-grid div {
  min-height: 48px;
}

.point-grid span,
.elevation-source {
  font-size: 9px;
}

.metric {
  min-height: 62px;
}

.metric strong {
  font-size: 20px;
}

.chart-tabs button {
  padding: 7px 12px;
  font-size: 12px;
}

.y-axis,
.x-axis,
.map-scale,
.coordinates,
.leaflet-control-attribution {
  font-size: 12px !important;
}

.chart-meta {
  font-size: 12px;
}

.chart-tooltip {
  font-size: 14px;
}

.chart-tooltip span {
  font-size: 11px;
}

.menu-popover button {
  min-height: 38px;
  font-size: 12px;
}

.menu-popover kbd {
  font-size: 10px;
}

.toast {
  padding: 11px 16px;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .panel-heading {
    height: 54px;
    font-size: 15px;
  }

  .tool-item {
    min-height: 58px;
    padding: 8px 10px;
  }

  .tool-item strong {
    font-size: 15px;
  }

  .tool-item small {
    font-size: 12px;
  }

  .floating-search {
    width: calc(100% - 74px);
    height: 46px;
  }

  input,
  textarea,
  select,
  .point-name-editor input,
  .file-name-field input {
    font-size: 16px !important;
  }

  .search-submit {
    font-size: 12px;
  }

  .coordinates,
  .map-scale {
    font-size: 10px !important;
  }

  .summary-heading strong {
    font-size: 15px;
  }

  .metric span {
    font-size: 11px;
  }

  .metric strong {
    font-size: 19px;
  }

  .toast {
    font-size: 13px;
  }
}

@media (max-width: 430px) {
  .floating-search {
    width: calc(100% - 66px);
  }

  .coordinates {
    display: none;
  }
}
