:root {
  --nav-height: 72px;
  --bg: #f4f5f3;
  --panel: rgba(255, 255, 255, 0.76);
  --panel-solid: #fbfbfa;
  --line: rgba(18, 24, 31, 0.12);
  --text: #171a1d;
  --muted: #747b82;
  --cyan: #22c9dd;
  --green: #20d98f;
  --amber: #f0aa30;
  --red: #ff6b62;
  --shadow: 0 24px 70px rgba(31, 40, 50, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(34, 201, 221, 0.08), transparent 32%),
    linear-gradient(260deg, rgba(240, 170, 48, 0.1), transparent 28%),
    var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

main {
  min-height: 100vh;
}

.site-nav {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: var(--nav-height);
  padding: 14px 18px;
  border-bottom: 1px solid rgba(18, 24, 31, 0.1);
  background: rgba(248, 249, 247, 0.72);
  backdrop-filter: blur(24px);
}

.nav-brand,
.nav-tabs a {
  color: var(--text);
  text-decoration: none;
}

.nav-brand {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  padding: 0 2px;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.nav-tabs {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tabs a {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(23, 26, 29, 0.62);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.nav-tabs a[aria-current="page"] {
  border-color: rgba(18, 24, 31, 0.16);
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 28px rgba(20, 28, 34, 0.08);
}

.nav-brand:focus-visible,
.nav-tabs a:focus-visible,
.hero-cta:focus-visible {
  outline: 2px solid rgba(255, 102, 90, 0.68);
  outline-offset: 4px;
}

.page[hidden] {
  display: none;
}

.hero-page {
  position: relative;
  display: grid;
  align-items: center;
  height: 100vh;
  overflow: hidden;
  padding: calc(var(--nav-height) + 42px) clamp(30px, 7vw, 118px) 52px;
  background: #f7f6f1;
}

.hero-page::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 20% 46%, rgba(247, 246, 241, 0.96), rgba(247, 246, 241, 0.82) 25%, rgba(247, 246, 241, 0.24) 50%, transparent 72%),
    linear-gradient(90deg, rgba(247, 246, 241, 0.9), rgba(247, 246, 241, 0.24) 52%, rgba(247, 246, 241, 0.04));
  content: "";
  pointer-events: none;
}

.hero-page::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.32;
  background:
    radial-gradient(circle at 72% 34%, rgba(158, 170, 152, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 58%);
  content: "";
  pointer-events: none;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 4;
  display: grid;
  justify-items: start;
  width: min(660px, 48vw);
  gap: 18px;
}

.hero-kicker {
  margin: 0;
  color: rgba(93, 96, 90, 0.86);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 11ch;
  margin: 0;
  color: #171816;
  font-size: 7.8rem;
  font-weight: 900;
  line-height: 0.84;
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-subcopy {
  max-width: 430px;
  margin: 0;
  color: #5d605a;
  font-size: 1.18rem;
  line-height: 1.42;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.hero-cta {
  display: inline-grid;
  place-items: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid #d8d9d2;
  border-radius: 999px;
  color: #171816;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.hero-cta:hover,
.hero-cta:focus-visible {
  transform: translateY(-1px);
}

.hero-cta.primary {
  border-color: rgba(255, 102, 90, 0.45);
  color: #fff;
  background: #ff665a;
  box-shadow: 0 14px 34px rgba(255, 102, 90, 0.18);
}

.hero-cta.secondary {
  background: rgba(247, 246, 241, 0.72);
}

.hero-stats {
  position: absolute;
  right: clamp(30px, 7vw, 118px);
  bottom: 50px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(216, 217, 210, 0.94);
  border-radius: 8px;
  background: rgba(23, 24, 22, 0.1);
  box-shadow: 0 18px 52px rgba(23, 24, 22, 0.08);
}

.hero-stats div {
  min-width: 0;
  padding: 13px 15px;
  background: rgba(247, 246, 241, 0.95);
}

.hero-stats span {
  display: block;
  color: rgba(93, 96, 90, 0.78);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-stats strong {
  display: block;
  margin-top: 6px;
  color: #171816;
  font-size: 1.22rem;
}

.hero-hint {
  position: absolute;
  right: clamp(30px, 7vw, 118px);
  top: calc(var(--nav-height) + 38px);
  z-index: 2;
  color: rgba(93, 96, 90, 0.72);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body[data-page="home"] {
  overflow-x: hidden;
  background: #f7f6f1;
}

.home-only {
  display: none;
}

body[data-page="home"] .home-only {
  display: block;
}

.how-section {
  position: relative;
  min-height: 100vh;
  scroll-margin-top: var(--nav-height);
  padding: calc(var(--nav-height) + 40px) clamp(30px, 7vw, 118px) 76px;
  border-top: 1px solid rgba(37, 40, 36, 0.1);
  color: #171816;
  background:
    linear-gradient(90deg, rgba(247, 246, 241, 0.98), rgba(247, 246, 241, 0.88)),
    repeating-linear-gradient(90deg, rgba(37, 40, 36, 0.025) 0 1px, transparent 1px 78px),
    #f7f6f1;
}

.how-inner {
  display: grid;
  gap: 44px;
  max-width: 1240px;
  margin: 0 auto;
}

.how-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(320px, 420px);
  gap: clamp(48px, 10vw, 128px);
  align-items: start;
}

.how-copy {
  display: grid;
  gap: 30px;
  max-width: 560px;
}

.how-copy h2 {
  max-width: 500px;
  margin: 0;
  color: #171816;
  font-size: 4.05rem;
  font-weight: 900;
  line-height: 0.93;
}

.how-copy .eyebrow {
  margin-top: 6px;
}

.how-copy > p:not(.eyebrow) {
  max-width: 520px;
  margin: 0;
  color: #5d605a;
  font-size: 1.02rem;
  line-height: 1.55;
}

.method-visual {
  position: relative;
  align-self: start;
  width: min(100%, 420px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(216, 217, 210, 0.9);
  background: #eef3f5;
  box-shadow: 0 18px 42px rgba(23, 24, 22, 0.08);
}

.method-visual canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.pressure-label {
  position: absolute;
  color: rgba(94, 45, 115, 0.85);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-style: italic;
  font-weight: 700;
  pointer-events: none;
}

.pressure-label.low {
  left: 33%;
  bottom: 25%;
}

.pressure-label.high {
  right: 14%;
  top: 42%;
  color: rgba(72, 53, 52, 0.82);
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(216, 217, 210, 0.95);
  border-radius: 8px;
  background: rgba(37, 40, 36, 0.12);
}

.method-grid article {
  min-height: 216px;
  padding: 22px;
  background: rgba(247, 246, 241, 0.92);
}

.method-grid span {
  color: rgba(255, 102, 90, 0.9);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.method-grid h3 {
  margin: 42px 0 0;
  color: #171816;
  font-size: 1.18rem;
  line-height: 1.05;
}

.method-grid p {
  margin: 13px 0 0;
  color: #5d605a;
  font-size: 0.92rem;
  line-height: 1.45;
}

@media (max-width: 1320px) {
  .hero-copy h1 {
    font-size: 6.6rem;
  }

  .how-copy h2 {
    font-size: 3.45rem;
  }
}

@media (max-width: 1100px) {
  .hero-copy {
    width: min(590px, 57vw);
  }

  .hero-copy h1 {
    font-size: 5.7rem;
  }

  .hero-subcopy {
    font-size: 1.08rem;
  }

  .how-layout {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .method-visual {
    width: min(100%, 360px);
  }

  .method-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.optimize-page {
  min-height: 100vh;
  padding-top: var(--nav-height);
}

.placeholder-page {
  display: grid;
  min-height: 100vh;
  padding: calc(var(--nav-height) + 24px) 18px 18px;
}

.placeholder-panel {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: start;
  min-height: calc(100vh - var(--nav-height) - 42px);
  padding: clamp(28px, 7vw, 76px);
  overflow: hidden;
  border: 1px solid rgba(18, 24, 31, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(rgba(18, 24, 31, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 24, 31, 0.04) 1px, transparent 1px),
    rgba(255, 255, 255, 0.72);
  background-size: 48px 48px;
  box-shadow: var(--shadow);
}

.placeholder-panel::after {
  position: absolute;
  right: clamp(24px, 8vw, 120px);
  bottom: clamp(24px, 8vw, 100px);
  width: min(340px, 42vw);
  height: 1px;
  background: rgba(34, 201, 221, 0.55);
  content: "";
}

.placeholder-panel h1 {
  max-width: 780px;
  margin-top: 8px;
  font-size: clamp(2.2rem, 6vw, 5.4rem);
  font-weight: 900;
  line-height: 0.95;
}

.placeholder-panel p:not(.eyebrow) {
  max-width: 620px;
  margin: 18px 0 0;
  color: #596168;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.5;
}

.coming-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 1040px);
  margin-top: 34px;
}

.coming-grid article {
  min-height: 170px;
  padding: 18px;
  border: 1px solid rgba(18, 24, 31, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.coming-grid span {
  color: rgba(34, 201, 221, 0.9);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.coming-grid strong {
  display: block;
  margin-top: 42px;
  font-size: clamp(1.2rem, 2vw, 1.9rem);
  line-height: 1.05;
}

.coming-grid small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 410px);
  gap: 12px;
  min-height: calc(100vh - var(--nav-height));
  padding: 18px;
}

.map-zone,
.bike-zone {
  min-width: 0;
}

.map-zone {
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr) auto auto;
  gap: 12px;
}

.top-strip,
.elevation-card,
.control-band,
.bike-zone {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}

.top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 14px 18px;
  border-radius: 8px;
}

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

.signal-dot {
  width: 34px;
  height: 12px;
  border: 2px solid #d8ddd8;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green) 76%, transparent 76%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.status-pill {
  max-width: 48%;
  overflow: hidden;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #3b4248;
  background: rgba(255, 255, 255, 0.6);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-frame {
  position: relative;
  align-self: start;
  overflow: hidden;
  height: clamp(460px, 58vh, 680px);
  min-height: 420px;
  border: 1px solid rgba(18, 24, 31, 0.2);
  border-radius: 8px;
  background: #fdfdfa;
  box-shadow: var(--shadow);
}

.map-frame[data-map-theme="dark"] {
  border-color: rgba(210, 228, 230, 0.16);
  background: #0b0d0f;
}

#mapCanvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}

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

.map-empty strong {
  color: var(--text);
  font-size: 1.35rem;
}

.map-empty span {
  max-width: 420px;
  line-height: 1.5;
}

.map-toolbar {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
}

.map-attribution {
  position: absolute;
  right: 16px;
  bottom: 12px;
  max-width: min(48%, 420px);
  overflow: hidden;
  padding: 5px 8px;
  border: 1px solid rgba(18, 24, 31, 0.1);
  border-radius: 999px;
  color: rgba(23, 26, 29, 0.55);
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.68rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-frame[data-map-theme="dark"] .map-attribution {
  border-color: rgba(220, 235, 238, 0.14);
  color: rgba(238, 246, 246, 0.62);
  background: rgba(7, 11, 13, 0.6);
}

.icon-button,
.text-button,
.side-step {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: #1b2025;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 24px rgba(20, 28, 34, 0.1);
}

.icon-button {
  min-width: 36px;
  height: 36px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
}

.upload-button {
  margin: 0;
  gap: 0;
}

.text-button {
  min-width: 58px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  color: #1b2025;
  background: rgba(255, 255, 255, 0.86);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
}

.map-frame[data-map-theme="dark"] .icon-button,
.map-frame[data-map-theme="dark"] .text-button {
  border-color: rgba(224, 238, 240, 0.14);
  color: rgba(246, 250, 250, 0.9);
  background: rgba(10, 16, 19, 0.72);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.map-readout {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 16px 36px rgba(30, 35, 40, 0.12);
}

.map-frame[data-map-theme="dark"] .map-readout {
  border-color: rgba(224, 238, 240, 0.14);
  background: rgba(6, 9, 11, 0.72);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}

.map-readout div {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.62);
}

.map-frame[data-map-theme="dark"] .map-readout div {
  background: rgba(12, 17, 20, 0.7);
}

.map-readout span,
.result-panel span,
.physics-panel span,
.input-label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.map-readout strong,
.result-panel strong,
.physics-panel strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 1.08rem;
  letter-spacing: 0;
}

.map-frame[data-map-theme="dark"] .map-readout span {
  color: rgba(225, 236, 238, 0.6);
}

.map-frame[data-map-theme="dark"] .map-readout strong {
  color: rgba(250, 252, 252, 0.94);
}

.elevation-card {
  display: grid;
  grid-template-columns: minmax(168px, 0.22fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 130px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.elevation-card[hidden] {
  display: none;
}

.elevation-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 31, 0.08);
}

.elevation-meta div {
  min-width: 0;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.68);
}

.elevation-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.elevation-meta strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 0.98rem;
}

#profileCanvas {
  display: block;
  width: 100%;
  height: 106px;
  min-height: 106px;
  border: 1px solid rgba(18, 24, 31, 0.12);
  border-radius: 8px;
  background: #fdfdfa;
}

.control-band {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
}

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

label {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

input {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-bottom: 1px solid rgba(18, 24, 31, 0.22);
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 1rem;
}

input:focus {
  border-color: var(--cyan);
}

.file-input {
  position: relative;
}

.file-input input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.file-input strong {
  overflow: hidden;
  min-height: 38px;
  padding-top: 7px;
  border-bottom: 1px solid rgba(18, 24, 31, 0.22);
  font-size: 0.96rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.result-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.result-panel strong {
  font-size: clamp(1.3rem, 2vw, 2rem);
}

.result-panel small {
  display: block;
  min-height: 34px;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
}

.result-panel.accent {
  border-color: rgba(34, 201, 221, 0.45);
  background: linear-gradient(155deg, rgba(34, 201, 221, 0.12), rgba(32, 217, 143, 0.1));
}

.bike-zone {
  display: grid;
  align-self: start;
  grid-template-rows: auto minmax(280px, 1fr) auto auto auto;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
}

.date-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.bike-stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.94), rgba(241, 244, 243, 0.72) 62%),
    var(--panel-solid);
}

.bike-render {
  z-index: 2;
  display: grid;
  place-items: center;
  width: min(100%, 380px);
  padding: 10px 24px 34px;
  filter: drop-shadow(0 28px 28px rgba(23, 28, 34, 0.16));
}

.bike-photo {
  display: block;
  width: 100%;
  max-height: 228px;
  height: auto;
  object-fit: contain;
  user-select: none;
}

.bike-photo[src$=".png"] {
  max-height: 250px;
}

.bike-stage::after {
  position: absolute;
  right: 11%;
  bottom: 86px;
  left: 11%;
  height: 22px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(20, 28, 34, 0.18), transparent 68%);
  content: "";
  pointer-events: none;
}

.side-step {
  position: absolute;
  z-index: 4;
  top: 50%;
  width: 38px;
  height: 72px;
  border-radius: 999px;
  color: #2780ff;
  font-size: 2rem;
  transform: translateY(-50%);
}

.side-step.left {
  left: 14px;
}

.side-step.right {
  right: 14px;
}

.arc {
  position: absolute;
  width: 78%;
  max-width: 320px;
  aspect-ratio: 1;
  border-radius: 999px;
  pointer-events: none;
}

.arc-a {
  border-top: 4px solid var(--green);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  transform: rotate(-40deg);
}

.arc-b {
  border-bottom: 4px solid var(--amber);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  transform: rotate(34deg);
}

.bike-title {
  position: absolute;
  right: 18px;
  bottom: 16px;
  left: 18px;
  z-index: 3;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.bike-title span {
  color: var(--text);
  font-size: clamp(1.5rem, 2.5vw, 2.3rem);
  font-weight: 800;
}

.bike-title strong {
  max-width: 145px;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: right;
}

.bike-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.bike-tabs button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  font-weight: 800;
}

.bike-tabs button.active {
  color: var(--text);
  border-color: rgba(34, 201, 221, 0.5);
  background: rgba(34, 201, 221, 0.14);
}

.physics-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 31, 0.08);
}

.physics-panel div {
  min-width: 0;
  padding: 13px 10px;
  background: rgba(255, 255, 255, 0.68);
}

.physics-panel strong {
  font-size: 1rem;
}

.insight-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
}

.insight-panel p:last-child {
  margin: 0;
  color: #4f575e;
  line-height: 1.45;
}

@media (max-width: 1040px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .bike-zone {
    grid-template-columns: minmax(280px, 1.1fr) minmax(280px, 0.9fr);
    grid-template-rows: auto auto auto;
  }

  .date-line,
  .bike-stage {
    grid-column: 1;
  }

  .bike-tabs,
  .physics-panel,
  .insight-panel {
    grid-column: 2;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 10px;
  }

  .top-strip,
  .elevation-card,
  .control-band,
  .bike-zone {
    border-radius: 8px;
  }

  .site-nav {
    padding: 12px 10px;
  }

  .nav-brand {
    min-height: 36px;
    font-size: 0.88rem;
    letter-spacing: 0.16em;
  }

  .nav-tabs {
    gap: 4px;
  }

  .nav-tabs a {
    min-height: 34px;
    padding: 0 9px;
    font-size: 0.66rem;
  }

  .hero-page {
    padding-right: 14px;
    padding-left: 14px;
  }

  .hero-kicker {
    letter-spacing: 0.28em;
  }

  .placeholder-page {
    padding-right: 10px;
    padding-left: 10px;
  }

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

  .top-strip,
  .control-band {
    grid-template-columns: 1fr;
  }

  .top-strip {
    align-items: start;
    gap: 12px;
    flex-direction: column;
  }

  .status-pill {
    max-width: 100%;
  }

  .input-grid,
  .results-grid,
  .elevation-card,
  .bike-zone {
    grid-template-columns: 1fr;
  }

  .elevation-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bike-tabs,
  .physics-panel,
  .insight-panel,
  .date-line,
  .bike-stage {
    grid-column: auto;
  }

  .map-readout {
    right: 12px;
    left: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .map-frame {
    height: 420px;
    min-height: 420px;
  }
}
