.landing-elevation-demo {
  margin: 2rem auto 0;
  max-width: 1400px;
}

.led-card {
  background: var(--white-color, #fff);
  border: 1px solid rgba(35,47,62,0.08);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.06);
  padding: 1.25rem;
  position: relative; /* enable loader overlay positioning */
}

.led-head { margin-bottom: .5rem; }
.led-title {
  margin: 0 0 .25rem 0;
  font-size: 1.15rem;
  color: var(--primary-color, #232F3E);
  font-weight: 700;
}
.led-subtitle {
  margin: 0;
  font-size: .9rem;
  color: #6b7280;
}

/* Graph container (match plan’s sizing/spacing) */
.elevation-graph-canvas-wrapper {
  position: relative;
  height: 400px;
  width: 100%;
  background: #ffffff;
  border-radius: 8px;
  border: none;
  padding: 10px;
  z-index: 1;
  overflow: visible;
}
.elevation-graph-canvas {
  width: 100% !important;
  height: 100% !important;
  position: relative;
  z-index: 2;
}

/* Segment Controls (copied/adapted from plan) */
.segment-controls { }

.segment-buttons {
  display: flex;
  gap: 1px;
  margin-bottom: 8px;
  width: 100%;
  align-items: stretch;
  position: relative;
  box-sizing: border-box;
}

.entire-race-container {
  margin-bottom: 20px;
  position: relative;
  box-sizing: border-box;
}

.segment-button {
  padding: 6px 2px;
  border: 1px solid var(--divider-color, rgba(0,0,0,0.12));
  border-radius: 4px;
  background: var(--white-color, #fff);
  color: var(--font-color, #232F3E);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  min-width: 0;
  flex-shrink: 0;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
}

.segment-button:hover {
  border-color: var(--tertiary-color, #05A0D1);
  color: var(--tertiary-color, #05A0D1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15), 0 2px 3px rgba(0,0,0,0.1);
}

.segment-button.active {
  background: var(--primary-color, #232F3E);
  color: var(--white-color, #fff);
  border-color: var(--primary-color, #232F3E);
  box-shadow: 0 2px 4px rgba(35,47,62,0.25), 0 2px 3px rgba(35,47,62,0.2);
}

.entire-race-button {
  /* width was auto; make it fill its container (container is sized to chart area in JS) */
  width: 100%;
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 16px;
  box-sizing: border-box;
}

/* Icon-based stats row (distance / gain / loss) */
.eg-segment-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  line-height: 1;
  color: var(--primary-color, #232F3E);
  margin: 10px 0 8px 0;
}
.eg-segment-info .eg-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  font-weight: 600;
}
.eg-segment-info .eg-stat svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* Loader overlay */
.led-loader {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(255,255,255,0.85);
  z-index: 20;
}
.led-card.loading .led-loader { display: flex; }

.led-loader .spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(35,47,62,0.15);
  border-top-color: var(--primary-color, #232F3E);
  border-radius: 50%;
  animation: led-spin 0.9s linear infinite;
}
.led-loader .label {
  font-size: 0.9rem;
  color: var(--primary-color, #232F3E);
  font-weight: 600;
}

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

@media (max-width: 768px) {
  .hide-on-mobile {
    display: none;
  }
  .led-subtitle { font-size: .85rem; }
  .elevation-graph-canvas-wrapper { height: 320px; }
}
