:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-subtle: #f6f7f8;
  --surface-raised: #fbfcfc;
  --text: #202426;
  --text-muted: #697176;
  --border: #dfe3e5;
  --border-strong: #c8ced1;
  --shadow: 0 8px 24px rgba(20, 28, 31, 0.12);
  --route-a: #e6383c;
  --route-b: #04a9b5;
  --route-c: #f2a412;
  --summit: #e52b32;
  --supply: #2fa854;
  --water: #2586d8;
  --withdraw: #e47a18;
  --lodging: #7256c8;
  --transport: #1674c8;
  --risk: #d33c34;
  --photo: #2d85c8;
  --text-marker: #697176;
  --header-height: 52px;
  --elevation-height: 252px;
  --left-width: 282px;
  --right-width: 370px;
  font-family: Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #1683d8;
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  grid-template-rows: var(--header-height) minmax(0, 1fr) var(--elevation-height);
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-width: 0;
  min-height: 0;
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 290px;
}

.brand-block h1 {
  margin: 0;
  overflow: hidden;
  font-size: 17px;
  font-weight: 680;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-title {
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-left: auto;
}

.segmented-control {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-subtle);
}

.segmented-control button {
  min-width: 48px;
  padding: 0 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.segmented-control button.is-active {
  background: #2d3235;
  color: #ffffff;
}

.toolbar-group {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 34px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.tool-button,
.icon-button,
.secondary-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.tool-button {
  height: 34px;
  padding: 0 9px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 560;
  white-space: nowrap;
}

.weather-page-link {
  flex: 0 0 auto;
  border-radius: 4px;
  text-decoration: none;
}

.tool-button:hover,
.tool-button.is-active,
.icon-button:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.tool-button svg,
.icon-button svg,
.secondary-button svg,
.primary-button svg,
.autosave-status svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.icon-button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 4px;
}

.icon-button.compact {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
}

.marker-filter-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.filter-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}

.filter-button .filter-swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--filter-color);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.filter-button.is-active {
  border-color: var(--border);
  background: var(--surface-subtle);
  color: var(--text);
}

.filter-button:not(.is-active) .filter-swatch {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--filter-color);
}

.autosave-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #2e8c4d;
  font-size: 11px;
  white-space: nowrap;
}

.workspace {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--left-width) minmax(0, 1fr) var(--right-width);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

.workspace.is-inspector-collapsed {
  grid-template-columns: var(--left-width) minmax(0, 1fr) 0;
}

.route-panel,
.inspector-panel {
  position: relative;
  z-index: 5;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: var(--surface);
}

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

.inspector-panel {
  border-left: 1px solid var(--border);
  opacity: 1;
  transition: opacity 130ms ease, transform 180ms ease;
}

.workspace.is-inspector-collapsed .inspector-panel {
  visibility: hidden;
  overflow: hidden;
  border-left: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.panel-heading-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.panel-heading h2,
.elevation-heading h2,
.dialog-heading h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 680;
}

.panel-heading p,
.elevation-heading p,
.dialog-heading p,
.field-help {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.route-list {
  min-height: 0;
  flex: 0 1 auto;
  overflow-y: auto;
}

.route-row {
  position: relative;
  padding: 13px 14px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.route-row:hover {
  background: #fafbfb;
}

.route-row:focus-visible {
  outline: 2px solid #1683d8;
  outline-offset: -2px;
}

.route-row.is-active {
  background: #f6f8f8;
}

.route-row.is-active::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--route-color);
  content: "";
}

.route-row-header {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 46px 28px;
  align-items: center;
  gap: 8px;
}

.route-visibility {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--route-color);
}

.route-title {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-line-swatch {
  height: 3px;
  border-radius: 2px;
  background: var(--route-color);
}

.route-delete-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.route-delete-button:hover {
  background: #fff0f0;
  color: #c53434;
}

.route-delete-button svg {
  width: 15px;
  height: 15px;
}

.route-action-placeholder {
  width: 28px;
}

.route-source-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  margin: 7px 0 0 28px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
}

.route-source-line span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-source-line span:first-child {
  flex: 1;
}

.route-origin-tag {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  color: #4e585c;
}

.route-stats {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  margin-top: 9px;
  color: var(--text-muted);
  font-size: 11px;
}

.route-stats dd,
.route-stats dt {
  margin: 0;
}

.route-stats dd {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.comparison-section {
  min-height: 0;
  flex: 1 1 150px;
  padding: 12px 14px;
  overflow: auto;
}

.mobile-route-tools {
  display: none;
}

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

.section-title-row h3,
.inspector-block h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 680;
}

.comparison-content {
  margin-top: 8px;
}

.comparison-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.comparison-list li {
  position: relative;
  padding-left: 12px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.55;
}

.comparison-list li::before {
  position: absolute;
  top: 7px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #454c50;
  content: "";
}

.map-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #edf0f1;
}

.map-canvas {
  width: 100%;
  height: 100%;
}

.map-loading {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(247, 249, 249, 0.92);
  color: var(--text-muted);
  font-size: 12px;
}

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

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #ccd2d5;
  border-top-color: #31383b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.map-notice,
.add-mode-banner {
  position: absolute;
  z-index: 8;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 5px;
  background: rgba(34, 39, 42, 0.9);
  box-shadow: var(--shadow);
  color: #ffffff;
  font-size: 12px;
}

.map-notice {
  max-width: min(520px, calc(100% - 32px));
  padding: 9px 12px;
  text-align: center;
}

.add-mode-banner {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  cursor: pointer;
}

.add-mode-banner svg {
  width: 16px;
  height: 16px;
}

.inspector-content {
  min-height: 0;
  padding: 14px;
  overflow: auto;
}

.pace-summary-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: -14px -14px 16px;
  border-bottom: 1px solid #cfd8d4;
  background: #edf3f0;
}

.pace-summary-band > div {
  min-width: 0;
  padding: 12px 9px 11px;
  text-align: center;
}

.pace-summary-band > div + div {
  border-left: 1px solid #d5deda;
}

.pace-summary-band span,
.pace-summary-band small {
  display: block;
  overflow: hidden;
  color: #62706a;
  font-size: 9px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pace-summary-band strong {
  display: block;
  margin: 3px 0 2px;
  color: #1f2925;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-weight: 740;
  line-height: 1.1;
}

.pace-settings-block {
  margin-top: 0;
}

.pace-parameter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 11px;
}

.pace-parameter-grid label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.pace-parameter-grid label > span:first-child {
  color: var(--text-muted);
  font-size: 10px;
}

.pace-parameter-wide {
  grid-column: 1 / -1;
}

.pace-input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.pace-input-with-unit {
  position: relative;
  display: block;
}

.pace-input-with-unit .pace-input {
  padding-right: 42px;
}

.pace-input-with-unit small {
  position: absolute;
  top: 50%;
  right: 8px;
  color: var(--text-muted);
  font-size: 9px;
  pointer-events: none;
  transform: translateY(-50%);
}

.pace-equivalent {
  color: var(--text-muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.pace-equivalent strong {
  color: var(--text);
  font-size: 10px;
  font-weight: 720;
}

.pace-plan-notice {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin-top: 11px;
  padding: 9px 10px;
  border-left: 3px solid #4c8067;
  background: #f1f6f3;
  color: #46554e;
  font-size: 11px;
  line-height: 1.45;
}

.pace-plan-notice.is-danger {
  border-left-color: #c93f36;
  background: #fff2f0;
  color: #7a332e;
}

.pace-plan-notice.is-warning {
  border-left-color: #d58a24;
  background: #fff7e9;
  color: #79521d;
}

.pace-plan-notice svg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.pace-weather-actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.pace-weather-actions .icon-button {
  color: var(--text-muted);
}

.pace-weather-actions .is-spinning svg {
  animation: weather-spin 0.9s linear infinite;
}

.pace-weather-state {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.45;
}

.pace-weather-state.is-error {
  border-color: #e5b980;
  background: #fff8ed;
  color: #87500c;
}

.pace-weather-state svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.pace-weather-state small {
  color: inherit;
  font-size: 8px;
}

.pace-weather-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid #c8ced1;
  border-top-color: #2d3336;
  border-radius: 50%;
  animation: weather-spin 0.8s linear infinite;
}

.pace-weather-overview {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 10px;
  border-left: 3px solid #4c8067;
  background: #f1f6f3;
  color: #40544a;
}

.pace-weather-overview.is-watch {
  border-left-color: #c79b2c;
  background: #fff9e9;
  color: #735919;
}

.pace-weather-overview.is-warning {
  border-left-color: #d97816;
  background: #fff5ea;
  color: #7d4c18;
}

.pace-weather-overview.is-danger {
  border-left-color: #c93f36;
  background: #fff2f0;
  color: #7a332e;
}

.pace-weather-overview > svg {
  width: 18px;
  height: 18px;
}

.pace-weather-overview strong,
.pace-weather-overview span {
  display: block;
}

.pace-weather-overview strong {
  font-size: 11px;
  line-height: 1.4;
}

.pace-weather-overview span {
  margin-top: 3px;
  color: currentColor;
  font-size: 8px;
  line-height: 1.4;
  opacity: 0.8;
}

.pace-weather-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.pace-weather-metrics > div {
  min-width: 0;
  padding: 8px 7px;
}

.pace-weather-metrics > div + div {
  border-left: 1px solid var(--border);
}

.pace-weather-metrics span,
.pace-weather-metrics strong,
.pace-weather-metrics small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pace-weather-metrics span,
.pace-weather-metrics small {
  color: var(--text-muted);
  font-size: 8px;
}

.pace-weather-metrics strong {
  margin: 3px 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pace-weather-source-warning {
  margin-top: 6px;
  color: #9a5b0e;
  font-size: 8px;
  line-height: 1.4;
}

.pace-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pace-section-heading p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.45;
}

.pace-target-chip {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid #cbd4d0;
  border-radius: 3px;
  background: #f4f7f6;
  color: #4f6158;
  font-size: 9px;
  font-weight: 680;
}

.pace-segment-list {
  margin: 10px 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.pace-segment-list li {
  border-bottom: 1px solid var(--border);
}

.pace-segment-button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 104px 16px;
  width: 100%;
  min-height: 70px;
  align-items: center;
  gap: 8px;
  padding: 9px 2px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.pace-segment-button:hover {
  background: #f7f9f8;
}

.pace-segment-button > svg {
  width: 15px;
  height: 15px;
  color: #8b9490;
}

.pace-segment-index {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid #cfd6d3;
  border-radius: 50%;
  color: #66716c;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.pace-segment-main,
.pace-segment-result {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.pace-segment-title {
  overflow-wrap: anywhere;
  font-size: 11px;
  font-weight: 680;
  line-height: 1.35;
}

.pace-segment-context {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.4;
}

.pace-hard-cut {
  width: max-content;
  margin-top: 4px;
  padding: 1px 4px;
  border-radius: 2px;
  background: #eef4ef;
  color: #39704f;
  font-size: 8px;
  font-weight: 700;
}

.pace-hard-cut.is-tight {
  background: #fff3df;
  color: #965b13;
}

.pace-hard-cut.is-late {
  background: #ffe8e5;
  color: #ad352e;
}

.pace-weather-chip {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  min-height: 18px;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 2px 5px;
  border: 1px solid #cbd9d1;
  border-radius: 3px;
  background: #f1f6f3;
  color: #3f6f56;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 680;
  line-height: 1.2;
}

.pace-weather-chip.is-watch {
  border-color: #e4c986;
  background: #fff9e9;
  color: #8b6614;
}

.pace-weather-chip.is-warning {
  border-color: #e2b57e;
  background: #fff5ea;
  color: #97560e;
}

.pace-weather-chip.is-danger {
  border-color: #e3aaa6;
  background: #fff2f0;
  color: #a23a33;
}

.pace-weather-chip svg {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
}

.pace-weather-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pace-segment-result {
  align-items: flex-end;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pace-segment-result strong {
  font-size: 12px;
  font-weight: 740;
  white-space: nowrap;
}

.pace-segment-result span {
  margin-top: 3px;
  color: #555f5b;
  font-size: 9px;
  white-space: nowrap;
}

.pace-segment-result small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 8px;
  white-space: nowrap;
}

.inspector-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: var(--text-muted);
  text-align: center;
}

.inspector-empty svg {
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  stroke-width: 1.4;
}

.inspector-block + .inspector-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.detail-list {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 9px 12px;
  margin: 11px 0 0;
  font-size: 12px;
}

.detail-list dt,
.detail-list dd {
  margin: 0;
}

.detail-list dt {
  color: var(--text-muted);
}

.detail-list dd {
  min-width: 0;
  word-break: break-word;
}

.marker-type-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.marker-type-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--marker-color);
}

.note-box {
  margin-top: 11px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: #444b4e;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.photo-grid a {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 5px;
  background: var(--surface-subtle);
}

.photo-grid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inspector-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.elevation-panel {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.elevation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--border);
}

.elevation-heading p {
  margin-top: 2px;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.elevation-heading > div {
  min-width: 0;
}

.elevation-controls {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}

.toggle-control input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #32383b;
}

.elevation-chart {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.elevation-scrubber {
  display: none;
}

@keyframes weather-spin {
  to {
    transform: rotate(360deg);
  }
}

.editor-dialog {
  width: min(440px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 22px 72px rgba(17, 22, 24, 0.22);
  color: var(--text);
}

.editor-dialog::backdrop {
  background: rgba(20, 26, 28, 0.36);
}

.editor-dialog form {
  display: flex;
  flex-direction: column;
  padding: 18px;
  overflow: auto;
}

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

.field-label {
  margin: 11px 0 6px;
  font-size: 12px;
  font-weight: 650;
}

.text-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
}

textarea.text-input {
  resize: vertical;
}

.dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.dialog-spacer {
  flex: 1;
}

.secondary-button,
.primary-button {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 620;
}

.secondary-button {
  border: 1px solid var(--border-strong);
  background: #ffffff;
}

.secondary-button:hover {
  background: var(--surface-subtle);
}

.primary-button {
  background: #2d3336;
  color: #ffffff;
}

.primary-button:hover {
  background: #15191b;
}

.danger-text {
  color: #c53434;
}

.toast-region {
  position: fixed;
  z-index: 80;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: 340px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  background: rgba(38, 44, 47, 0.94);
  box-shadow: var(--shadow);
  color: #ffffff;
  font-size: 12px;
  line-height: 1.45;
}

.maplibregl-ctrl-group {
  overflow: hidden;
  border: 1px solid rgba(30, 36, 38, 0.15);
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(20, 25, 27, 0.12);
}

.maplibregl-ctrl-group button {
  width: 32px;
  height: 32px;
}

.location-control-button {
  display: grid;
  place-items: center;
  color: #3f484c;
}

.location-control-button svg {
  width: 18px;
  height: 18px;
}

.location-control-button.is-locating svg {
  color: #1683d8;
  animation: location-icon-pulse 1s ease-in-out infinite;
}

.location-control-button.has-location {
  color: #0d72c2;
}

.location-control-button.has-error {
  color: #b93c35;
}

@keyframes location-icon-pulse {
  50% { opacity: 0.38; }
}

.current-location-marker {
  position: relative;
  z-index: 20;
  width: 26px;
  height: 26px;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(14, 64, 103, 0.42));
}

.current-location-pulse,
.current-location-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.current-location-pulse {
  width: 26px;
  height: 26px;
  background: rgba(22, 131, 216, 0.28);
  animation: current-location-pulse 1.8s ease-out infinite;
}

.current-location-dot {
  width: 16px;
  height: 16px;
  border: 3px solid #ffffff;
  background: #1683d8;
  box-shadow: 0 0 0 2px #0d72c2;
}

.current-location-label {
  position: absolute;
  top: 50%;
  left: 32px;
  width: max-content;
  padding: 3px 6px;
  border: 1px solid rgba(13, 114, 194, 0.28);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.94);
  color: #075f9f;
  font-size: 10px;
  font-weight: 760;
  line-height: 1.2;
  transform: translateY(-50%);
}

@keyframes current-location-pulse {
  0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.6); }
  75%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.55); }
}

.maplibregl-popup-content {
  padding: 10px 12px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 12px;
}

.summit-marker {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.32));
}

.summit-marker.label-left,
.route-endpoint-marker.label-left {
  flex-direction: row-reverse;
}

.summit-marker-shape {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--summit);
  color: #ffffff;
}

.summit-marker-shape svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke-width: 1.6;
}

.summit-marker-label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 3px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.9);
  color: #202426;
  line-height: 1.15;
  white-space: nowrap;
}

.summit-marker-label strong {
  font-size: 11px;
  font-weight: 720;
}

.summit-marker-label small {
  margin-top: 2px;
  color: #697176;
  font-size: 9px;
  font-weight: 560;
}

.route-endpoint-marker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.28));
  pointer-events: none;
}

.route-endpoint-dot {
  width: 14px;
  height: 14px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #2f9b58;
}

.route-endpoint-marker.is-finish .route-endpoint-dot {
  background: #d93c3c;
}

.route-endpoint-pair {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.route-endpoint-dot.is-finish-dot {
  background: #d93c3c;
}

.route-endpoint-label {
  padding: 3px 5px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.94);
  color: #202426;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.route-direction-marker {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--guidance-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  color: #ffffff;
  pointer-events: none;
}

.route-direction-marker svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke-width: 1.5;
}

.profile-cursor-marker {
  width: 14px;
  height: 14px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--cursor-color, #222222);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.mobile-only {
  display: none;
}

.desktop-only {
  display: inline-flex;
}

@media (max-width: 1540px) {
  .tool-button {
    width: 34px;
    padding: 0;
  }

  .tool-button span {
    display: none;
  }
}

@media (max-width: 1320px) {
  :root {
    --left-width: 258px;
    --right-width: 338px;
  }

  .filter-button span:last-child,
  .tool-button span,
  .autosave-status span {
    display: none;
  }

  .filter-button {
    width: 28px;
    justify-content: center;
    padding: 0;
  }
}

@media (max-width: 980px) {
  :root {
    --header-height: 50px;
    --elevation-height: 220px;
  }

  .mobile-only {
    display: inline-flex;
  }

  .desktop-only {
    display: none;
  }

  .app-shell {
    grid-template-rows: var(--header-height) minmax(0, 1fr) var(--elevation-height);
  }

  .topbar {
    padding-right: calc(8px + env(safe-area-inset-right));
    padding-left: calc(8px + env(safe-area-inset-left));
  }

  .brand-block {
    min-width: 0;
    flex: 1;
  }

  .brand-block h1 {
    font-size: 14px;
  }

  .desktop-title {
    display: none;
  }

  .mobile-title {
    display: inline;
  }

  .marker-filter-bar,
  .toolbar-group,
  .autosave-status {
    display: none;
  }

  .mobile-route-tools {
    display: block;
    flex: 0 0 auto;
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-raised);
  }

  .mobile-tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .mobile-tool-button {
    display: inline-flex;
    min-width: 0;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 5px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 11px;
  }

  .mobile-tool-button.is-active {
    border-color: #2d3336;
    background: #2d3336;
    color: #ffffff;
  }

  .mobile-tool-button svg {
    width: 16px;
    height: 16px;
  }

  .mobile-filter-heading {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 650;
  }

  .mobile-marker-filter-bar {
    display: flex;
    gap: 5px;
    margin: 7px -12px -2px;
    padding: 0 12px 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mobile-marker-filter-bar::-webkit-scrollbar {
    display: none;
  }

  .mobile-marker-filter-bar .filter-button {
    height: 36px;
    flex: 0 0 auto;
    padding: 0 9px;
    border-color: var(--border);
    background: var(--surface);
  }

  .workspace {
    display: block;
  }

  .map-stage {
    width: 100%;
    height: 100%;
  }

  .route-panel,
  .inspector-panel {
    position: absolute;
    z-index: 30;
    top: 0;
    bottom: 0;
    width: min(88vw, 340px);
    box-shadow: 0 0 40px rgba(18, 24, 26, 0.22);
    transition: transform 180ms ease;
  }

  .route-panel {
    left: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(-105%);
  }

  .route-panel .panel-heading {
    position: sticky;
    z-index: 2;
    top: 0;
    flex: 0 0 auto;
    background: var(--surface);
  }

  .route-panel .comparison-section {
    flex: 0 0 auto;
    overflow: visible;
  }

  .route-panel .route-list {
    flex: 0 0 auto;
    overflow: visible;
  }

  .route-panel.is-open {
    transform: translateX(0);
  }

  .inspector-panel {
    right: 0;
    left: 0;
    top: auto;
    width: 100%;
    height: min(62%, 420px);
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--border);
    border-left: 0;
    border-radius: 7px 7px 0 0;
    transform: translateY(105%);
  }

  .inspector-panel.is-open {
    transform: translateY(0);
  }

  .elevation-heading {
    padding-inline: 10px;
  }

  .elevation-panel {
    grid-template-rows: 44px minmax(0, 1fr) 32px;
  }

  .elevation-scrubber {
    display: block;
    width: calc(100% - 24px);
    height: 32px;
    margin: 0 12px;
    accent-color: #2d3336;
    cursor: ew-resize;
  }

  .map-notice,
  .add-mode-banner {
    top: 8px;
  }

  .toast-region {
    right: 10px;
    bottom: calc(var(--elevation-height) + 10px + env(safe-area-inset-bottom));
    left: 10px;
  }

  .toast {
    max-width: none;
  }

  .maplibregl-ctrl-group button {
    width: 40px;
    height: 40px;
  }

  .route-direction-marker {
    width: 22px;
    height: 22px;
  }
}

@media (max-width: 560px) {
  :root {
    --elevation-height: 196px;
  }

  .segmented-control button {
    min-width: 38px;
    padding: 0 6px;
  }

  .topbar-actions {
    gap: 3px;
  }

  .toggle-control span {
    display: none;
  }

  .elevation-controls {
    gap: 9px;
  }

  .elevation-heading p {
    max-width: 270px;
    font-size: 10px;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }

  .summit-marker {
    gap: 3px;
  }

  .summit-marker-shape {
    width: 24px;
    height: 24px;
  }

  .summit-marker-label {
    padding: 2px 4px;
  }

  .summit-marker-label strong {
    font-size: 9px;
  }

  .summit-marker-label small {
    display: none;
  }

  .route-endpoint-label {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
