body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}
.hero {
  border-radius: 20px;
  padding: 18px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(18, 66, 110, 0.2);
}
.panel {
  border-radius: 16px;
  padding: 16px;
}
.panel h2,
.panel h3 {
  margin-top: 0;
  color: var(--brand-blue);
}
label {
  display: block;
  font-weight: 700;
  color: var(--brand-blue);
  margin-bottom: 6px;
}
input[type="text"],
input[type="number"],
input[type="file"],
select {
  width: 100%;
  border: 1px solid #bfd3ea;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}
input[type="file"] {
  padding: 7px 10px;
}
input[type="text"]::placeholder {
  color: #6783a1;
}

.gpx-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.gpx-tab-btn {
  border: 1px solid #c7daf2;
  background: #edf5ff;
  color: #1f4f7f;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}
.gpx-tab-btn.active {
  background: var(--brand-orange);
  border-color: var(--brand-orange);
  color: #fff;
}
.gpx-pane {
  display: none;
}
.gpx-pane.active {
  display: block;
}
.gpx-mode-head {
  margin-bottom: 12px;
}
.gpx-mode-head h2 {
  margin-bottom: 6px;
}
.gpx-step-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.gpx-step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #c9dbf2;
  background: #f2f8ff;
  border-radius: 12px;
  padding: 8px 10px;
  color: #1f4f7f;
  font-weight: 700;
}
.gpx-step-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #1f6fb2;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}
.gpx-subcard {
  border: 1px solid #d7e4f2;
  background: #fbfdff;
  border-radius: 14px;
  padding: 12px;
  margin-top: 12px;
}
.gpx-verdict-card {
  background: linear-gradient(145deg, #f8fcff 0%, #eef5ff 100%);
  border-color: #c8ddf3;
}
.gpx-verdict-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.gpx-verdict-title {
  margin: 0;
  color: #173e68;
  font-weight: 800;
  font-size: 1.03rem;
}
.gpx-verdict-sub {
  margin: 4px 0 0;
  color: #436389;
  font-size: 0.9rem;
}
.gpx-score-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  border-radius: 999px;
  border: 1px solid #c2d9f2;
  background: #ffffff;
  color: #14456f;
  padding: 6px 12px;
  font-weight: 800;
}
.gpx-verdict-metrics {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.gpx-verdict-metric {
  border: 1px solid #d7e4f2;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
}
.gpx-verdict-metric .k {
  color: #5f7a99;
  font-size: 0.8rem;
  font-weight: 700;
}
.gpx-verdict-metric .v {
  margin-top: 3px;
  color: #123f68;
  font-size: 1.03rem;
  font-weight: 800;
}
.gpx-verdict-summary {
  margin-top: 10px;
  color: #2d5278;
  font-size: 0.9rem;
  line-height: 1.4;
}
.gpx-verdict-notes {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}
.gpx-impact-note {
  border: 1px solid #dce8f6;
  border-radius: 10px;
  background: #ffffff;
  padding: 7px 9px;
  color: #335b84;
  font-size: 0.85rem;
}
.gpx-impact-badge {
  font-weight: 800;
  color: #184a79;
}
.gpx-subcard > h3 {
  margin-bottom: 8px;
}
.gpx-mode-footer {
  margin-top: 12px;
}
.gpx-km-block {
  margin-top: 10px;
}
.gpx-km-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.gpx-km-input {
  width: min(320px, 100%) !important;
}
.gpx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.gpx-grid-compare {
  align-items: start;
}
.gpx-import-list {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}
.gpx-import-row {
  background: #f9fbff;
  border: 1px solid #d8e5f7;
  border-radius: 12px;
  padding: 11px;
}
.gpx-import-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.gpx-import-title {
  color: var(--brand-blue);
  font-weight: 800;
}
.gpx-import-meta {
  margin-top: 6px;
  font-size: 0.86rem;
  color: #476586;
}
.gpx-import-name {
  margin-top: 8px;
}
.gpx-import-color {
  margin-top: 8px;
}
.gpx-import-color select {
  width: 100%;
}
.gpx-drop-zone {
  margin-top: 10px;
  border: 2px dashed #b7cde8;
  border-radius: 12px;
  background: #eef6ff;
  color: #244f7b;
  font-weight: 700;
  text-align: center;
  padding: 18px 12px;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.gpx-drop-zone.dragover {
  border-color: #4f87bf;
  background: #e4f0ff;
  transform: scale(1.01);
}
.gpx-map {
  height: 420px;
  border: 1px solid #d7e4f2;
  border-radius: 14px;
  background: #f5f9ff;
  margin-top: 6px;
}
.gpx-map-controls {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  align-items: end;
}
.gpx-subcard #compare-hover-readout {
  min-height: 28px;
}
.gpx-zoom-controls {
  display: grid;
  gap: 6px;
}
.gpx-zoom-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.gpx-zoom-buttons .gpx-btn {
  min-width: 42px;
}
.gpx-map:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  margin: 0;
}
.gpx-profile-wrap {
  margin-top: 8px;
  border: 1px solid #d7e4f2;
  border-radius: 12px;
  background: #ffffff;
  min-height: 200px;
  padding: 8px;
}
.gpx-profile-wrap svg {
  width: 100%;
  height: 230px;
  display: block;
}
.gpx-profile-stack {
  margin-top: 8px;
  display: grid;
  gap: 12px;
}
.gpx-profile-overlay-card {
  border: 1px solid #d7e4f2;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}
.gpx-profile-overlay-graph {
  border: 1px solid #dce8f6;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.gpx-profile-overlay-graph svg {
  width: 100%;
  height: 300px;
  display: block;
}
.gpx-profile-overlay-empty {
  padding: 12px;
  color: #5a7390;
  font-size: 0.9rem;
}
.gpx-track-surfaces {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.gpx-track-surface-card {
  border: 1px solid #d7e4f2;
  border-radius: 10px;
  background: #fbfdff;
  padding: 8px;
}
.gpx-track-surface-card .gpx-surface-wrap {
  margin-top: 6px;
}
.gpx-track-surface-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #143f68;
  font-weight: 800;
  font-size: .92rem;
}
.gpx-track-surface-head .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.gpx-profile-hover-line {
  stroke: #2f5478;
  stroke-width: 1.2;
  stroke-dasharray: 5 4;
  opacity: 0.8;
}
.gpx-profile-hover-dot {
  stroke: #fff;
  stroke-width: 1.6;
}
.gpx-track-profile-card {
  border: 1px solid #d7e4f2;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}
.gpx-track-profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.gpx-track-profile-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #123b64;
  font-weight: 800;
}
.gpx-track-profile-title .dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
}
.gpx-track-profile-meta {
  color: #537091;
  font-size: 0.84rem;
  font-weight: 700;
}
.gpx-track-profile-graph {
  border: 1px solid #dce8f6;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.gpx-track-profile-graph svg {
  width: 100%;
  height: 240px;
  display: block;
}
.gpx-track-profile-empty {
  padding: 10px;
  color: #5a7390;
  font-size: 0.9rem;
}
.gpx-surface-wrap {
  margin-top: 10px;
  border: 1px solid #dce8f6;
  border-radius: 10px;
  background: #f9fcff;
  padding: 9px;
}
.gpx-surface-status {
  color: #4f6d8f;
  font-size: 0.84rem;
  font-weight: 700;
}
.gpx-surface-bar {
  margin-top: 8px;
  width: 100%;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #cfddf0;
  display: flex;
  background: #eaf2fb;
}
.gpx-surface-seg {
  height: 100%;
}
.gpx-surface-seg-road { background: #4e5f78; }
.gpx-surface-seg-gravel { background: #d08c4a; }
.gpx-surface-seg-dirt { background: #996134; }
.gpx-surface-seg-rocky { background: #bf4720; }
.gpx-surface-seg-unknown { background: #7d94af; }
.gpx-surface-summary {
  margin-top: 8px;
  color: #2a4f74;
  font-size: 0.83rem;
  font-weight: 700;
}
.gpx-surface-grid {
  margin-top: 8px;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}
.gpx-surface-chip {
  border: 1px solid #d6e5f7;
  border-radius: 10px;
  background: #fff;
  padding: 7px 8px;
}
.gpx-surface-chip .k {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2b4f74;
  font-size: 0.8rem;
  font-weight: 700;
}
.gpx-surface-chip .k::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--surface-color, #7d94af);
}
.gpx-surface-chip .v {
  margin-top: 4px;
  color: #0e4e8c;
  font-size: 0.92rem;
  font-weight: 800;
}
.gpx-profile-legend {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.gpx-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d8e5f7;
  border-radius: 999px;
  padding: 5px 10px;
  background: #f8fbff;
  color: #1f4f7f;
  font-size: 0.84rem;
  font-weight: 700;
}
.gpx-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.gpx-table-wrap {
  overflow: auto;
  margin-top: 8px;
}
.gpx-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
  border-radius: 12px;
  overflow: hidden;
}
.gpx-table th,
.gpx-table td {
  border-bottom: 1px solid #e0ebf7;
  padding: 9px 8px;
  text-align: left;
  vertical-align: middle;
}
.gpx-impact-inline {
  color: #355b84;
  font-size: 0.83rem;
  margin-top: 3px;
}
.gpx-table th {
  background: #edf5ff;
  color: var(--brand-blue);
}
.gpx-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.gpx-btn {
  border: 1px solid #c7daf2;
  border-radius: 999px;
  background: #eff6ff;
  color: #1f4f7f;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}
.gpx-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.gpx-btn.primary {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}
.gpx-btn.is-active {
  background: #ffb84d;
  border-color: #f59e0b;
  color: #173a62;
}
.gpx-segments {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.gpx-segment-card {
  border: 1px solid #d7e4f2;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.gpx-segment-rename {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}
.gpx-segment-rename label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #2a507e;
}
.gpx-segment-title {
  margin: 0 0 6px;
  color: var(--brand-blue);
  font-weight: 800;
}
.gpx-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0;
}
.gpx-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cfe1f5;
  border-radius: 999px;
  background: #f4f9ff;
  color: #245380;
  padding: 4px 9px;
  font-size: 0.82rem;
  font-weight: 700;
}
.gpx-compress-summary {
  margin-top: 8px;
  display: grid;
  gap: 10px;
}
.gpx-compress-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}
.gpx-compress-metric {
  border: 1px solid #d7e4f2;
  border-radius: 12px;
  padding: 8px 10px;
  background: #fff;
}
.gpx-compress-metric .k {
  color: #5f7a99;
  font-size: 0.82rem;
}
.gpx-compress-metric .v {
  margin-top: 3px;
  color: #184a79;
  font-weight: 800;
  font-size: 1rem;
}
.gpx-compress-note {
  color: #3f5f82;
  font-size: 0.9rem;
  line-height: 1.35;
}
.gpx-hint {
  margin: 4px 0 0;
  color: var(--brand-muted);
  font-size: 0.92rem;
  line-height: 1.35;
}
.gpx-error {
  margin-top: 8px;
  color: #8a2424;
  font-weight: 700;
}
.gpx-splits-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.gpx-split-chip {
  border: 1px solid #d8e5f7;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.gpx-split-chip button {
  border: 1px solid #f1b7b7;
  background: #fff2f2;
  color: #9f2f2f;
  border-radius: 999px;
  padding: 4px 8px;
  cursor: pointer;
  font-weight: 700;
}
.gpx-pending-popup {
  min-width: 180px;
  display: grid;
  gap: 6px;
}
.gpx-pending-popup .title {
  font-weight: 800;
  color: #1f4f7f;
}
.gpx-pending-popup .meta {
  color: #45698d;
  font-size: 0.9rem;
}
.gpx-pending-popup .actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.gpx-popup-btn {
  border: 1px solid #c7daf2;
  border-radius: 999px;
  background: #eff6ff;
  color: #1f4f7f;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.gpx-popup-btn.primary {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
}
@media (max-width: 700px) {
  .panel {
    padding: 12px;
  }
  .gpx-map {
    height: 330px;
  }
  .gpx-profile-wrap svg,
  .gpx-track-profile-graph svg,
  .gpx-profile-overlay-graph svg {
    height: 230px;
  }
  .gpx-map-controls {
    grid-template-columns: 1fr;
  }
  .gpx-step-list {
    grid-template-columns: 1fr;
  }
  .gpx-km-row {
    flex-direction: column;
    align-items: stretch;
  }
  .gpx-km-input {
    width: 100% !important;
  }
  .gpx-subcard {
    padding: 10px;
  }
}
