:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f7f7f7;
  --surface-card: #eef0f3;
  --surface-dark: #0a0b0d;
  --surface-dark-elevated: #16181c;
  --ink: #0a0b0d;
  --body: #5b616e;
  --muted: #7c828a;
  --muted-soft: #a8acb3;
  --line: #dee1e6;
  --line-soft: #eef0f3;
  --accent: #0052ff;
  --accent-active: #003ecc;
  --radius: 12px;
  --radius-lg: 24px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lift: 0 4px 12px rgba(0, 0, 0, 0.04);
  --container: min(1200px, calc(100% - 48px));
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
  letter-spacing: 0;
}

svg {
  display: block;
}

.tw-page-frame {
  min-height: 100vh;
}

.tw-nav-surface {
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
}

.tw-card-surface {
  background: var(--surface-card);
}

.tw-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.tw-form-stack {
  display: grid;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-weight: 600;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  overflow: hidden;
  flex: 0 0 auto;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, transform 180ms ease;
}

.button {
  min-height: 44px;
  padding: 0 20px;
}

.button-dark {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button-light,
.icon-button {
  background: var(--surface-card);
  color: var(--ink);
}

.button:hover,
.icon-button:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.button:active,
.icon-button:active {
  transform: translateY(0) scale(0.98);
}

.button:disabled,
.icon-button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.button.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  margin-right: 8px;
  animation: button-spin 800ms linear infinite;
}

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

.icon-button {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

.eyebrow {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 7px 13px;
  background: var(--surface-card);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow::before {
  content: none;
}

.site-nav,
.dashboard-nav {
  width: var(--container);
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-nav.compact {
  position: relative;
}

.nav-links,
.user-menu {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a:not(.button):hover {
  color: var(--ink);
}

.nav-links .nav-login-link {
  min-height: 38px;
  border: 1px solid currentColor;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  color: inherit;
}

.top-nav-dark .nav-links .nav-login-link {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.top-nav-dark .nav-links .nav-login-link:hover {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.user-menu form {
  margin: 0;
}

.marketing-page { overflow-x: hidden; background: var(--bg); }

.landing-hero {
  width: var(--container);
  min-height: min(760px, calc(100svh - 92px));
  margin: 0 auto;
  padding: 82px 0 62px;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(480px, 0.96fr);
  align-items: center;
  gap: clamp(40px, 6vw, 88px);
}

.hero-copy {
  max-width: 700px;
}

.hero-copy h1 {
  margin-top: 12px;
  font-size: clamp(3.3rem, 6vw, 6.1rem);
  line-height: 1.01;
}

.hero-text {
  max-width: 640px;
  margin-top: 22px;
  color: var(--body);
  font-size: 1.22rem;
  line-height: 1.7;
}

.hero-actions {
  margin-top: 28px;
}

.hero-product {
  min-width: 0;
}

.preview-window {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}

.preview-top {
  height: 44px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  background: var(--ink);
}

.preview-top span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.36);
}

.preview-body {
  min-height: 490px;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
}

.preview-rail {
  display: grid;
  align-content: start;
  gap: 14px;
  border-right: 1px solid var(--line);
  padding: 26px 18px;
  background: var(--surface-soft);
}

.preview-rail span,
.preview-reviews b {
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  background: #e8edf4;
}

.preview-rail .rail-active,
.preview-chart span {
  background: var(--accent);
}

.preview-main {
  min-width: 0;
  padding: 28px;
}

.preview-header,
.preview-reviews div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.preview-header strong {
  display: block;
  font-size: 1.08rem;
}

.preview-header small {
  color: var(--muted);
  font-weight: 800;
}

.preview-pill {
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 900;
}

.preview-chart {
  min-height: 178px;
  margin-top: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 20px;
  background: var(--surface-card);
}

.preview-chart span {
  flex: 1;
  min-height: 42px;
  border-radius: 4px 4px 0 0;
  opacity: 0.18;
}

.preview-reviews {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.preview-reviews div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
}

.preview-reviews b {
  display: inline-grid;
  flex: 0 0 28px;
  place-items: center;
  color: var(--ink);
  font-size: 0.72rem;
}

.preview-reviews span {
  min-width: 0;
  flex: 1;
}

.auth-page,
.dashboard-page {
  background: var(--surface-soft);
}

.auth-page .tw-nav-surface {
  background: var(--surface-soft);
}

.dashboard-page {
  background: var(--surface);
}

.auth-layout,
.shell {
  width: var(--container);
  margin: 0 auto;
}

.auth-layout {
  min-height: calc(100svh - 78px);
  padding: clamp(28px, 5vw, 76px) 0;
  display: grid;
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
  align-items: start;
}

.auth-card {
  border-radius: var(--radius-lg);
}

.auth-card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: clamp(26px, 4vw, 54px);
}

.auth-card h1 {
  margin-top: 16px;
  font-size: clamp(2rem, 3.4vw, 3.35rem);
  line-height: 1.05;
}

.auth-card > p:not(.eyebrow):not(.auth-alternate) {
  margin-top: 14px;
}

.legal-page {
  background: linear-gradient(180deg, #f7f8fa 0, #fff 44%);
}

.legal-layout {
  width: var(--container);
  min-height: 58svh;
  margin: 0 auto;
  padding: clamp(48px, 7vw, 104px) 0;
  display: grid;
  place-items: start center;
}

.legal-panel {
  width: min(820px, 100%);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(10, 11, 13, 0.07);
  overflow: hidden;
}

.legal-head {
  padding: clamp(30px, 5vw, 52px);
  border-bottom: 1px solid var(--line-soft);
}

.legal-kicker {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.legal-head h1 {
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 0.98;
}

.legal-head p:not(.legal-kicker) {
  margin-top: 18px;
  max-width: 520px;
  font-size: 1.05rem;
}

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

.legal-detail {
  padding: clamp(24px, 4vw, 40px);
}

.legal-detail + .legal-detail {
  border-left: 1px solid var(--line-soft);
}

.legal-detail span {
  display: block;
  margin-bottom: 14px;
  color: var(--ink);
  font-weight: 700;
}

.legal-detail p {
  margin: 0;
  color: var(--body);
  line-height: 1.75;
}

.auth-form {
  margin-top: 28px;
}

.social-auth-form {
  margin-top: 26px;
}

.google-auth-button {
  position: relative;
  width: 100%;
  min-height: 50px;
  justify-content: center;
  padding: 0 48px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
  color: #3c4043;
  font-family: Roboto, Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: none;
}

.google-auth-button:hover {
  border-color: #d2e3fc;
  background: #f8fbff;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.18), 0 1px 3px rgba(60, 64, 67, 0.12);
}

.google-auth-button:focus-visible {
  border-color: #4285f4;
  outline: 2px solid rgba(66, 133, 244, 0.22);
  outline-offset: 2px;
}

.google-auth-mark {
  position: absolute;
  left: 16px;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: var(--body);
  font-size: 0.92rem;
  font-weight: 600;
}

.auth-form input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 15px;
  background: var(--surface);
  color: var(--ink);
}

.auth-form input:focus {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
  box-shadow: none;
}

.form-errors,
.field-error {
  color: #b91c1c;
  font-size: 0.88rem;
}

.form-errors ul {
  margin: 0;
  padding-left: 18px;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-alternate {
  margin-top: 22px;
}

.auth-alternate a {
  color: var(--accent);
  font-weight: 600;
}

.auth-visual {
  overflow: hidden;
  padding: clamp(26px, 4vw, 48px);
  display: grid;
  align-content: space-between;
  gap: 28px;
  background: var(--surface-dark);
  color: #fff;
}

.auth-visual p,
.auth-visual small,
.auth-visual span {
  color: rgba(255, 255, 255, 0.68);
}

.auth-visual .brand-mark {
  background: transparent;
}

.auth-visual-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-score span,
.auth-score small {
  display: block;
  font-weight: 800;
}

.auth-score strong {
  display: block;
  margin: 12px 0;
  font-size: clamp(2.6rem, 4.5vw, 4.4rem);
  line-height: 1;
}

.auth-score small {
  max-width: 430px;
  line-height: 1.55;
}

.auth-checklist {
  display: grid;
  gap: 12px;
}

.auth-checklist div {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  display: grid;
  gap: 6px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.auth-checklist b {
  color: #fff;
  font-size: 0.98rem;
}

.auth-checklist span {
  line-height: 1.45;
}

.auth-note {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-note p {
  margin-top: 7px;
}

.dashboard-nav {
  min-height: 64px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}

.shell {
  min-height: calc(100svh - 78px);
  padding: 48px 0 64px;
}

.topbar h1 {
  margin-top: 16px;
  font-size: clamp(2.2rem, 4.4vw, 4.25rem);
  line-height: 1.02;
}

.empty-dashboard {
  min-height: min(430px, 54svh);
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  padding: clamp(24px, 5vw, 58px);
  background: var(--surface);
}

.empty-dashboard strong {
  display: block;
  margin-bottom: 10px;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
}

.empty-dashboard p {
  max-width: 560px;
  font-size: 1.04rem;
}

.app-footer { border-top: 1px solid var(--line); background: var(--surface); }

.app-footer-inner {
  width: var(--container);
  margin: 0 auto;
  padding: 42px 0;
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.app-footer h3 { color: var(--ink); }
.app-footer p, .app-footer a { color: var(--body); }

.app-footer h3 {
  margin-bottom: 12px;
  font-size: 0.95rem;
  font-weight: 800;
}

.app-footer ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.auth-page .app-footer-inner > div:last-child {
  grid-column: -2 / -1;
  justify-self: end;
  text-align: right;
}

.app-footer .brand-mark {
  background: transparent;
}

.footer-brand-line p {
  margin-top: 12px;
}

.optisplit-marketing {
  background: #fff;
}

.dark-hero-band {
  min-height: min(920px, calc(100svh - 38px));
  overflow: clip;
  position: relative;
  isolation: isolate;
  background: var(--surface-dark);
  color: #fff;
}

.dark-hero-band::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 11, 13, 0.96) 0%, rgba(10, 11, 13, 0.88) 34%, rgba(10, 11, 13, 0.42) 67%, rgba(10, 11, 13, 0.72) 100%),
    linear-gradient(180deg, rgba(10, 11, 13, 0.42) 0%, rgba(10, 11, 13, 0.1) 42%, rgba(10, 11, 13, 0.92) 100%);
}

.hero-backdrop {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.top-nav-dark {
  position: relative;
  z-index: 2;
  border-bottom-color: rgba(255, 255, 255, 0.09);
  background: transparent;
}

.top-nav-dark .brand,
.top-nav-dark .nav-links a:not(.button) { color: #fff; }

.top-nav-dark .button-light,
.dark-hero-band .button-light {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--surface-dark-elevated);
  color: #fff;
}

.coinbase-hero {
  position: relative;
  z-index: 2;
  width: var(--container);
  min-height: min(804px, calc(100svh - 102px));
  margin: 0 auto;
  padding: 72px 0 92px;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(390px, 0.8fr);
  align-items: center;
  gap: clamp(32px, 7vw, 92px);
}

.cycling-hero-copy {
  max-width: 600px;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.28);
}

.cycling-hero-copy h1 {
  margin-top: 18px;
  font-size: 5.45rem;
  font-weight: 400;
  line-height: 0.96;
}

.cycling-hero-copy h2 {
  margin-top: 30px;
  color: #fff;
  font-size: 3rem;
  font-weight: 400;
  line-height: 1.08;
}

.cycling-hero-copy p:not(.eyebrow) {
  max-width: 470px;
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.08rem;
  line-height: 1.6;
}

.dark-hero-band .hero-actions {
  margin-top: 32px;
}

.dark-hero-band .hero-actions .button {
  min-height: 52px;
  padding: 0 25px;
}

.dark-hero-band .brand-mark {
  box-shadow: 0 0 0 7px rgba(0, 82, 255, 0.15);
}

.dark-hero-band .eyebrow {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(22, 24, 28, 0.76);
  color: #fff;
}

.hero-ui-stack {
  width: min(100%, 540px);
  min-height: 570px;
  justify-self: end;
  position: relative;
}

.hero-ui-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  position: absolute;
  padding: clamp(22px, 3vw, 32px);
  background: rgba(22, 24, 28, 0.88);
  color: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.hero-ui-card header,
.hero-ui-card dl {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.hero-ui-card header span:not(.hero-preview-badge),
.hero-ui-card dt {
  color: #a8acb3;
}

.hero-ui-card dl {
  margin: 28px 0 0;
}

.hero-ui-card dt,
.hero-ui-card dd {
  margin: 0;
}

.hero-ui-card dd,
.hero-ui-card header span {
  font-family: var(--font-mono);
}

.hero-preview-badge {
  border-radius: 100px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.hero-route-card {
  top: 22px;
  right: 11%;
  left: 0;
  min-height: 390px;
  transform: rotate(-2.2deg);
}

.hero-power-card {
  right: 0;
  bottom: 46px;
  width: min(82%, 410px);
  min-height: 282px;
  transform: rotate(1.7deg);
}

.hero-elevation-chart {
  overflow: hidden;
  height: 205px;
  margin-top: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background:
    repeating-linear-gradient(0deg, transparent 0 45px, rgba(255, 255, 255, 0.055) 45px 46px),
    var(--surface-dark);
}

.hero-elevation-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-elevation-chart stop:first-child {
  stop-color: var(--accent);
  stop-opacity: 0.26;
}

.hero-elevation-chart stop:last-child {
  stop-color: var(--accent);
  stop-opacity: 0.02;
}

.hero-elevation-fill {
  fill: url("#heroElevationFill");
}

.hero-elevation-line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.hero-route-stats {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start !important;
  gap: 0 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

.hero-route-stats div {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.hero-route-stats div + div {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding-left: 16px;
}

.hero-route-stats dt {
  font-size: 0.78rem;
}

.hero-route-stats dd {
  color: #fff;
  font-size: 1rem;
  line-height: 1.4;
}

.hero-route-stats .hero-stat-accent {
  color: var(--accent);
}

.hero-power-bars {
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  height: 104px;
  margin-top: 24px;
  display: flex;
  align-items: end;
  gap: 12px;
}

.hero-power-bars i {
  flex: 1;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, #2b73ff, var(--accent));
}

.hero-power-bars i:nth-child(1) { height: 42%; }
.hero-power-bars i:nth-child(2) { height: 67%; }
.hero-power-bars i:nth-child(3) { height: 52%; }
.hero-power-bars i:nth-child(4) { height: 86%; }
.hero-power-bars i:nth-child(5) { height: 72%; }
.hero-power-bars i:nth-child(6) { height: 57%; }
.hero-power-bars i:nth-child(7) { height: 78%; }
.hero-power-bars i:nth-child(8) { height: 48%; }

.hero-power-summary {
  margin-top: 22px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 !important;
  padding-top: 18px;
}

.hero-power-summary div {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.hero-power-summary div + div {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding-left: 12px;
}

.hero-power-summary dt {
  color: #a8acb3;
  font-size: 0.68rem;
  line-height: 1.25;
}

.hero-power-summary dd {
  color: #fff;
  font-size: 0.82rem;
  line-height: 1.25;
  white-space: nowrap;
}

.hero-power-summary div:last-child dd {
  color: var(--accent);
}

.optisplit-marketing .app-footer {
  border-top-color: var(--line-soft);
}

.optisplit-marketing .app-footer-inner {
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: start;
  padding: 36px 0 44px;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-route-card {
    animation: hero-route-float 10s ease-in-out infinite;
  }

  .hero-power-card {
    animation: hero-power-float 8s ease-in-out infinite;
  }
}

@keyframes hero-route-float {
  0%,
  100% { transform: translate3d(0, 0, 0) rotate(-2.2deg); }
  50% { transform: translate3d(0, -10px, 0) rotate(-1.25deg); }
}

@keyframes hero-power-float {
  0%,
  100% { transform: translate3d(0, 0, 0) rotate(1.7deg); }
  50% { transform: translate3d(0, 8px, 0) rotate(2.4deg); }
}

.landing-band {
  width: var(--container);
  margin: 0 auto;
  padding: 96px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.landing-band div {
  min-width: 0;
  min-height: 164px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 32px;
  background: var(--surface);
}

.landing-band b {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.landing-band span {
  color: var(--body);
  font-size: 1.06rem;
  line-height: 1.45;
}

.how-it-works {
  background: var(--surface-soft);
}

.how-it-works-inner {
  width: var(--container);
  margin: 0 auto;
  padding: 96px 0;
}

.section-head {
  max-width: 720px;
}

.section-head h2 {
  margin-top: 22px;
  color: var(--ink);
  font-size: 3.25rem;
  font-weight: 400;
  line-height: 1.08;
}

.how-it-works-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.how-step {
  min-width: 0;
  min-height: 344px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 32px;
  background: var(--surface);
}

.how-step b {
  width: fit-content;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
}

.how-step h3 {
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1.18;
}

.how-step p {
  color: var(--body);
  font-size: 1rem;
  line-height: 1.6;
}

.how-refinement-panel {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--surface);
}

.how-refinement-panel article {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 28px 32px;
}

.how-refinement-panel article + article {
  border-left: 1px solid var(--line);
}

.how-refinement-panel b {
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.3;
}

.how-refinement-panel p {
  color: var(--body);
  font-size: 0.98rem;
  line-height: 1.55;
}

.pricing-band {
  background: var(--surface);
}

.pricing-inner {
  width: var(--container);
  margin: 0 auto;
  padding: 96px 0;
}

.pricing-head {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.pricing-head .eyebrow {
  margin-inline: auto;
}

.pricing-head > p:not(.eyebrow) {
  max-width: 640px;
  margin: 20px auto 0;
  color: var(--body);
  font-size: 1.06rem;
  line-height: 1.6;
}

.pricing-grid {
  width: min(100%, 920px);
  margin: 64px auto 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.pricing-tier {
  min-height: 364px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: start;
  gap: 24px;
  padding: 32px;
  background: var(--surface);
}

.pricing-tier header {
  display: grid;
  gap: 16px;
  min-height: 112px;
}

.pricing-tier h3 {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.13;
}

.pricing-tier strong {
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.pricing-tier strong span {
  font-size: clamp(2.8rem, 5vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.pricing-tier strong small {
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 500;
}

.pricing-tier ul {
  margin: 0;
  padding: 0;
  display: grid;
  align-content: start;
  gap: 16px;
  list-style: none;
}

.pricing-tier li {
  border: 0;
  padding: 0;
  color: var(--body);
  font-size: 1rem;
  line-height: 1.5;
}

.pricing-tier li b {
  color: inherit;
  font-family: var(--font-mono);
  font-weight: 500;
}

.pricing-tier > .button {
  width: 100%;
  min-height: 48px;
  margin-top: 0;
  justify-content: center;
}

.pricing-tier-featured {
  border-color: var(--surface-dark);
  background: var(--surface-dark);
  color: #fff;
  transform: translateY(0);
}

.pricing-tier-featured h3,
.pricing-tier-featured strong {
  color: #fff;
}

.pricing-tier-featured strong small,
.pricing-tier-featured li {
  color: var(--muted-soft);
}

.pricing-tier-featured li {
  border-color: rgba(255, 255, 255, 0.1);
}

.pricing-tier-featured .button-dark {
  background: var(--accent);
  color: #fff;
}

.pacing-shell {
  padding-top: 32px;
}

.dashboard-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 264px) minmax(0, 1fr);
  align-items: start;
  gap: 32px;
}

.tour-sidebar {
  position: sticky;
  top: 24px;
  min-height: min(720px, calc(100svh - 130px));
  max-height: calc(100svh - 48px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: start;
  gap: 12px;
  padding: 16px;
  background: var(--surface-soft);
  overflow: hidden;
}

.tour-sidebar-head {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 8px 8px 16px;
}

.tour-sidebar-head .eyebrow {
  margin: 0;
}

.tour-sidebar-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 24px;
}

.tour-sidebar-head strong {
  min-width: 0;
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.33;
}

.tour-count {
  width: 30px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.tour-create,
.tour-row,
.tour-item {
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--body);
  background: transparent;
}

.tour-create,
.tour-item {
  display: grid;
}

.tour-create {
  min-height: 52px;
  border-color: var(--line);
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.tour-create b {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 500;
}

.tour-list {
  display: grid;
  gap: 4px;
  align-content: start;
  grid-auto-rows: max-content;
  min-height: 0;
  margin: 0 -6px;
  padding: 0 6px 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.tour-list::-webkit-scrollbar {
  width: 8px;
}

.tour-list::-webkit-scrollbar-track {
  background: transparent;
}

.tour-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--line);
  background-clip: padding-box;
}

.tour-list p {
  border-top: 1px solid var(--line);
  margin: 4px 8px 0;
  padding-top: 14px;
  font-size: 0.92rem;
}

.tour-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 4px;
  padding: 3px;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.tour-row form {
  margin: 0;
}

.tour-item {
  gap: 4px;
  border: 0;
  padding: 8px 7px;
}

.tour-item strong,
.tour-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tour-item strong {
  color: var(--ink);
  font-weight: 600;
}

.tour-item span {
  color: var(--muted);
  font-size: 0.84rem;
}

.tour-delete-button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tour-delete-button:hover,
.tour-delete-button:focus-visible {
  background: var(--surface-strong);
  color: var(--ink);
  outline: none;
}

.tour-delete-button:active {
  transform: translateY(1px);
}

.tour-create.tour-active,
.tour-row.tour-active {
  border-color: var(--line);
  background: var(--surface);
}

.tour-row.tour-active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.tour-row.tour-active strong {
  color: var(--accent);
}

.tour-create:hover,
.tour-row:hover {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tour-workspace {
  min-width: 0;
}

.workbench-head {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-bottom: 24px;
}

.workbench-head h1 {
  max-width: 720px;
  color: var(--ink);
  font-size: 2.75rem;
  line-height: 1.1;
}

.fit-downloads {
  width: min(100%, 700px);
  display: grid;
  gap: 8px;
}

.fit-downloads h2 {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

.fit-download-item {
  position: relative;
  min-width: 0;
}

.fit-download-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-areas:
    "icon title"
    "icon desc";
  align-items: center;
  gap: 3px 10px;
  min-height: 88px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.fit-download-item.has-help .fit-download-card {
  padding-right: 46px;
}

.fit-download-card span {
  grid-area: icon;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
}

.fit-download-card strong {
  grid-area: title;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 600;
}

.fit-download-card small {
  grid-area: desc;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.fit-download-card:hover,
.fit-download-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.fit-info-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.fit-info-button:hover,
.fit-info-button:focus-visible,
.fit-info-button[aria-expanded="true"] {
  border-color: var(--accent);
  outline: none;
  background: rgba(47, 91, 255, 0.1);
  color: var(--accent);
}

.fit-help-panel {
  grid-column: 1 / -1;
  border: 1px solid rgba(47, 91, 255, 0.24);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: #f4f7ff;
  color: var(--ink);
}

.fit-help-panel strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.fit-help-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.fit-help-options h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.fit-help-panel ol {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.5;
}

.fit-help-panel[hidden] {
  display: none;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(620px, 1.18fr) minmax(360px, 0.82fr);
  align-items: start;
  gap: 24px;
}

.workbench-grid:not(.selected-tour-grid) {
  grid-template-columns: minmax(0, 920px);
}

.workbench-grid:not(.selected-tour-grid) .analysis-panel {
  display: none;
}

.selected-tour-grid {
  grid-template-columns: minmax(0, 1fr);
}

.selected-tour-grid .upload-panel {
  grid-row: 1;
}

.selected-tour-grid .analysis-panel {
  grid-row: 2;
}

.selected-tour-grid .pacing-form {
  grid-template-columns: minmax(0, 1fr);
}

.selected-tour-grid .pacing-form button {
  width: fit-content;
  min-height: 48px;
  white-space: nowrap;
}

.selected-tour-grid .setting-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.upload-panel,
.analysis-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.upload-panel {
  position: relative;
  overflow: hidden;
  padding: 32px;
}

.upload-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 32px;
  width: 72px;
  height: 4px;
  border-radius: 0 0 100px 100px;
  background: var(--accent);
}

.upload-panel h2,
.plan-title h2 {
  color: var(--ink);
  font-size: 1.75rem;
  line-height: 1.2;
}

.upload-panel > div > p {
  margin-top: 8px;
}

.pacing-form {
  margin-top: 22px;
  display: grid;
  gap: 16px;
}

.pacing-form label {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--body);
  font-size: 0.9rem;
  font-weight: 600;
}

.pacing-form input,
.pacing-form select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
}

.pacing-form select {
  appearance: none;
  padding-right: 42px;
  background-color: var(--surface);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 21px) 50%,
    calc(100% - 15px) 50%;
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
}

.pacing-form input:focus,
.pacing-form select:focus {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}

.pacing-form input[type="file"] {
  min-height: 52px;
  padding: 8px 12px;
  background: var(--surface);
  line-height: 32px;
}

.pacing-form input[type="file"]::file-selector-button {
  min-height: 34px;
  margin: 0 12px 0 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 13px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}

.field-help {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.45;
}

.field-help a {
  color: var(--accent);
  font-weight: 600;
}

.weather-window-note {
  display: none;
  grid-column: 1 / -1;
  border: 1px solid rgba(0, 82, 255, 0.16);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: rgba(0, 82, 255, 0.06);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.4;
}

.setting-grid:has([name="include_weather"]:checked) .weather-window-note {
  display: block;
}

.fuel-reminder-card {
  margin-bottom: 16px;
}

.fuel-reminder-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(140px, 0.32fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  background: var(--surface);
}

.fuel-reminder-head {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.fuel-reminder-head > span {
  color: var(--ink);
  font-weight: 700;
}

.fuel-reminder-head h2 {
  margin-top: 8px;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.2;
}

.fuel-type-control {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.fuel-type-control button {
  min-height: 34px;
  border: 0;
  padding: 0 14px;
  background: transparent;
  color: var(--body);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.fuel-type-control button + button {
  border-left: 1px solid var(--line);
}

.fuel-type-control button.is-active {
  background: var(--ink);
  color: #fff;
}

.selected-tour-grid .fuel-type-control button {
  width: auto;
  min-height: 34px;
}

.fuel-distance-field,
.fuel-note-field {
  display: grid;
  gap: 7px;
  color: var(--body);
  font-size: 0.9rem;
  font-weight: 600;
}

.fuel-distance-field {
  grid-column: 1;
}

.fuel-note-field {
  grid-column: 2;
}

.fuel-note-field input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.fuel-note-field input:focus {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}

.fuel-distance-input {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  background: var(--surface);
  transition: border-color 160ms ease, outline-color 160ms ease;
}

.fuel-distance-input:focus-within {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}

.fuel-distance-input input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 0;
  padding: 0 12px 0 14px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-family: var(--font-mono);
  font-weight: 500;
}

.fuel-distance-input input:focus {
  outline: 0;
}

.fuel-distance-input b {
  height: 28px;
  border-left: 1px solid var(--line);
  display: grid;
  place-items: center;
  padding: 0 13px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.fuel-add-button {
  min-height: 48px;
  white-space: nowrap;
}

.fuel-reminder-list {
  grid-column: 1 / -1;
  min-height: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fuel-save-button {
  grid-column: 1 / -1;
  width: fit-content;
  min-height: 44px;
}

.fuel-reminder-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 6px 5px 12px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
}

.fuel-reminder-chip b {
  font: inherit;
}

.fuel-reminder-chip span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-weight: 500;
}

.fuel-reminder-chip em {
  max-width: min(240px, 56vw);
  overflow: hidden;
  color: var(--body);
  font-style: normal;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fuel-reminder-chip button {
  width: 24px;
  height: 24px;
  min-height: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(10, 11, 13, 0.08);
  color: var(--body);
  font: 800 0.82rem/1 var(--font-ui);
  cursor: pointer;
}

.selected-tour-grid .fuel-reminder-chip button {
  width: 24px;
  min-height: 0;
}

.fuel-reminder-chip-drink {
  border-color: rgba(0, 82, 255, 0.22);
  background: rgba(0, 82, 255, 0.07);
}

.fuel-reminder-chip-eat {
  border-color: rgba(242, 169, 0, 0.28);
  background: rgba(242, 169, 0, 0.1);
}

.selected-route-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 4px;
  padding: 13px;
  background: var(--surface);
}

.selected-route-note span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

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

.setting-grid small {
  position: absolute;
  right: 13px;
  top: 39px;
  color: var(--muted);
  font-weight: 600;
}

.setting-grid label:has([name="max_power_w"]) input {
  padding-right: 70px;
}

.setting-grid label:has([name="max_normalized_power_w"]) input {
  padding-right: 70px;
}

.setting-grid label:has([name="rolling_resistance_coefficient"]) input {
  padding-right: 78px;
}

.setting-grid input {
  padding-right: 45px;
}

.setting-grid label:has([name="segment_density"]) {
  grid-column: 1 / -1;
}

.setting-grid .checkbox-setting {
  grid-column: 1 / -1;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
}

.setting-grid .checkbox-setting input {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  accent-color: var(--accent);
}

.setting-grid .checkbox-setting span {
  color: var(--ink);
  font-weight: 700;
}

.setting-grid label:has([name="weight_unit"]) {
  grid-column: span 1;
}

.setting-grid label:has([name="tour_name"]),
.setting-grid label:has([name="gpx_file"]) {
  grid-column: 1 / -1;
}

.setting-grid label:has([name="tour_date"]),
.setting-grid label:has([name="tour_time"]),
.setting-grid label:has([name="target_average_power_w"]),
.setting-grid label:has([name="max_power_w"]),
.setting-grid label:has([name="max_normalized_power_w"]),
.setting-grid label:has([name="rider_weight_kg"]),
.setting-grid label:has([name="bike_weight_kg"]),
.setting-grid label:has([name="drag_area_m2"]),
.setting-grid label:has([name="rolling_resistance_coefficient"]),
.setting-grid label:has([name="power_train_loss_percent"]) {
  grid-column: span 1;
}

.setting-grid label:has([name="tour_date"]) input,
.setting-grid label:has([name="tour_time"]) input {
  padding-right: 14px;
}

.analysis-panel {
  min-height: 690px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.analysis-empty {
  width: min(100%, 440px);
  min-height: 260px;
  border-radius: var(--radius-lg);
  display: grid;
  place-content: center;
  gap: 8px;
  justify-self: center;
  padding: 28px;
  background: var(--surface-dark);
}

.analysis-empty strong {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.2;
}

.analysis-empty p {
  max-width: 360px;
  color: var(--muted-soft);
  font-size: 0.95rem;
}

.plan-title {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 28px;
  background: var(--surface-dark);
  color: #fff;
}

.plan-title .eyebrow {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--surface-dark-elevated);
  color: #fff;
}

.plan-title h2 {
  margin-top: 12px;
  color: #fff;
  font-size: 2rem;
}

.plan-title > span {
  border-radius: 100px;
  padding: 12px 18px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  white-space: nowrap;
}

.metric-strip {
  overflow: hidden;
  margin: 16px 0 24px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
}

.time-comparison {
  overflow: hidden;
  margin: 16px 0 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--surface);
}

.time-comparison div {
  min-width: 0;
  padding: 18px;
}

.time-comparison div + div {
  border-left: 1px solid var(--line-soft);
}

.time-comparison dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
  text-transform: uppercase;
}

.time-comparison dd {
  margin: 10px 0 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 500;
  line-height: 1.15;
}

.time-comparison .time-saved {
  background: #edf4ff;
}

.time-comparison .time-saved dt,
.time-comparison .time-saved dd {
  color: var(--accent);
}

.metric-strip div {
  min-width: 0;
  min-height: 100px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
}

.metric-strip dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  text-transform: uppercase;
}

.metric-strip dd {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.125rem;
  line-height: 1.4;
}

.visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.route-figure {
  min-width: 0;
  margin: 0;
}

.route-figure figcaption {
  margin-bottom: 12px;
  color: var(--body);
  font-size: 0.88rem;
  font-weight: 600;
}

.leaflet-route-map,
.power-chart-frame {
  width: 100%;
  height: 360px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.leaflet-route-map {
  overflow: hidden;
  border-color: rgba(10, 11, 13, 0.1);
  background: #dfe9e2;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 18px 42px rgba(24, 42, 36, 0.1);
}

.leaflet-route-map .leaflet-tile-pane {
  filter: saturate(0.82) contrast(0.96) brightness(1.02);
}

.leaflet-route-map .leaflet-control-zoom {
  overflow: hidden;
  border: 1px solid rgba(10, 11, 13, 0.12);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(10, 11, 13, 0.12);
}

.leaflet-route-map .leaflet-control-zoom a {
  width: 32px;
  height: 32px;
  border-color: rgba(10, 11, 13, 0.08);
  color: var(--ink);
  font: 600 1.05rem/30px var(--font-ui);
}

.leaflet-route-map .leaflet-control-zoom a:hover,
.leaflet-route-map .leaflet-control-zoom a:focus {
  background: var(--surface-soft);
  color: var(--accent);
}

.power-chart-frame {
  padding: 16px;
}

.power-chart-frame canvas {
  width: 100% !important;
  height: 100% !important;
}

.leaflet-route-map .leaflet-control-attribution {
  margin: 0 8px 8px 0;
  padding: 3px 7px;
  border-radius: 999px 0 0 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--body);
  font-size: 0.68rem;
}

.route-marker {
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(10, 11, 13, 0.28);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.route-marker-start {
  background: #149b69;
}

.route-marker-finish {
  background: #e65337;
}

.route-marker-drink {
  background: #0052ff;
}

.route-marker-eat {
  background: #f2a900;
  color: #151515;
}

.route-marker span {
  transform: translateY(0.5px);
}

.route-marker svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: currentColor;
}

.route-tooltip {
  border: 0;
  border-radius: 10px;
  background: rgba(10, 11, 13, 0.88);
  box-shadow: 0 10px 24px rgba(10, 11, 13, 0.24);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 600;
}

.route-tooltip::before {
  border-top-color: rgba(10, 11, 13, 0.88);
}

.route-tooltip strong,
.route-tooltip span {
  display: block;
}

.route-tooltip span {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
}

.segment-table-wrap tr[data-segment-index] {
  cursor: crosshair;
}

.segment-table-wrap tr.segment-active td {
  background: rgba(0, 82, 255, 0.08);
}

.segment-table-wrap {
  max-height: 430px;
  margin-top: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.consolidate-form {
  margin-top: 24px;
  border-top: 1px solid var(--line-soft);
  padding-top: 24px;
}

.segment-table-actions {
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.segment-table-actions p {
  font-size: 0.9rem;
}

.segment-table-actions .button {
  min-height: 44px;
}

.segment-table-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.segment-power-control {
  display: grid;
  grid-template-columns: 72px auto;
  align-items: center;
  gap: 8px;
}

.segment-power-control input {
  width: 72px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-family: var(--font-mono);
}

.segment-power-control button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0 12px;
  background: var(--surface-card);
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
}

.wind-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.wind-compass {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--surface-card);
  color: var(--ink);
  vertical-align: middle;
}

.wind-compass-needle {
  width: 3px;
  height: 18px;
  border-radius: 999px;
  position: relative;
  background: currentColor;
  transform: rotate(var(--wind-deg));
  transform-origin: 50% 50%;
}

.wind-compass-needle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -4px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 8px solid currentColor;
  transform: translateX(-50%);
}

.wind-compass-calm {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.dashboard-message {
  border: 1px solid rgba(0, 82, 255, 0.18);
  border-radius: var(--radius);
  margin: -10px 0 18px;
  padding: 12px 14px;
  background: rgba(0, 82, 255, 0.07);
  color: var(--body);
  font-weight: 600;
}

.plan-stale-warning {
  border: 1px solid rgba(0, 82, 255, 0.22);
  border-radius: var(--radius);
  margin: -10px 0 18px;
  padding: 12px 14px;
  background: rgba(0, 82, 255, 0.08);
  color: var(--ink);
  font-weight: 600;
}

.plan-stale-warning.is-hidden {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

td,
.tour-item span,
.selected-route-note strong {
  font-family: var(--font-mono);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 10px;
  white-space: nowrap;
}

.segment-table-wrap tbody tr:hover td {
  background: var(--surface-soft);
}

.nav-action {
  min-height: 38px;
  border: 1px solid rgba(10, 11, 13, 0.12);
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  font-weight: 600;
  transition: border-color 180ms ease, background 180ms ease;
}

.nav-action:hover {
  border-color: rgba(0, 82, 255, 0.32);
  background: var(--surface);
}

.settings-shell {
  padding-top: clamp(28px, 5vw, 68px);
}

.settings-workspace {
  display: grid;
  grid-template-columns: minmax(250px, 0.68fr) minmax(360px, 0.82fr);
  align-items: start;
  gap: clamp(28px, 5vw, 84px);
}

.settings-intro h1 {
  margin-top: 16px;
  font-size: clamp(2rem, 3.6vw, 3.4rem);
  line-height: 1.05;
}

.settings-intro p:not(.eyebrow),
.settings-panel > div > p {
  margin-top: 12px;
}

.settings-panel-stack {
  display: grid;
  gap: 20px;
}

.settings-panel {
  border: 1px solid rgba(10, 11, 13, 0.1);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 36px);
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(10, 11, 13, 0.05);
  scroll-margin-top: 92px;
}

.settings-panel h2 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.settings-message {
  border: 1px solid rgba(20, 184, 166, 0.26);
  border-radius: var(--radius);
  margin-top: 20px;
  padding: 12px 14px;
  background: rgba(20, 184, 166, 0.1);
  color: #115e59;
  font-weight: 600;
}

.settings-form {
  margin-top: 24px;
}

.settings-profile-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px 16px;
}

.settings-profile-form label {
  position: relative;
  align-self: start;
}

.settings-profile-form label:has([name="weight_unit"]) {
  grid-column: 1 / -1;
  max-width: 180px;
}

.settings-profile-form label:has([name="drag_area_m2"]),
.settings-profile-form label:has([name="rolling_resistance_coefficient"]),
.settings-profile-form label:has([name="power_train_loss_percent"]) {
  max-width: 340px;
}

.auth-form select {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 42px 0 15px;
  appearance: none;
  background-color: var(--surface);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 21px) 50%,
    calc(100% - 15px) 50%;
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
  color: var(--ink);
}

.auth-form select:focus {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
  box-shadow: none;
}

.field-unit {
  position: absolute;
  right: 13px;
  top: 39px;
  color: var(--muted);
  font-weight: 600;
}

.settings-profile-form label:has([name="rider_weight_kg"]) input,
.settings-profile-form label:has([name="bike_weight_kg"]) input,
.settings-profile-form label:has([name="drag_area_m2"]) input,
.settings-profile-form label:has([name="rolling_resistance_coefficient"]) input,
.settings-profile-form label:has([name="power_train_loss_percent"]) input {
  padding-right: 48px;
}

.settings-profile-form label:has([name="rolling_resistance_coefficient"]) input {
  padding-right: 78px;
}

.settings-form .button {
  width: fit-content;
}

.settings-profile-form .button {
  grid-column: 1 / -1;
}

.field-help {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .landing-hero,
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    min-height: 0;
    padding-top: 56px;
  }

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

  .coinbase-hero {
    grid-template-columns: 1fr;
    gap: 18px;
    min-height: 0;
    padding-bottom: 72px;
  }

  .hero-ui-stack {
    width: min(100%, 520px);
    min-height: 500px;
    justify-self: end;
  }

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

  .cycling-hero-copy h2 {
    font-size: 2.5rem;
  }

  .section-head h2 {
    font-size: 2.8rem;
  }

  .dashboard-workspace,
  .workbench-grid,
  .settings-workspace {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workbench-head {
    display: grid;
    align-items: start;
  }

  .tour-sidebar {
    position: static;
    min-height: 0;
    max-height: min(560px, 62svh);
  }

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

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

  .settings-profile-form {
    grid-template-columns: 1fr;
  }

  .selected-tour-grid .pacing-form button {
    width: fit-content;
  }

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

  .fuel-reminder-panel {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .fuel-distance-field {
    grid-column: 1;
  }

  .fuel-note-field {
    grid-column: 1 / -1;
  }

  .fit-downloads {
    width: 100%;
  }
}

@media (max-width: 680px) {
  :root {
    --container: min(100% - 28px, 1200px);
  }

  .site-nav,
  .dashboard-nav {
    min-height: 70px;
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .shell {
    padding: 32px 0 48px;
  }

  .nav-links {
    gap: 12px;
  }

  .nav-links a:not(.button) {
    display: none;
  }

  .landing-hero {
    padding-bottom: 42px;
  }

  .coinbase-hero {
    min-height: 0;
    padding: 48px 0 64px;
  }

  .cycling-hero-copy h1 {
    font-size: 3.5rem;
    line-height: 0.98;
  }

  .cycling-hero-copy h2 {
    font-size: 2rem;
  }

  .cycling-hero-copy p:not(.eyebrow) {
    font-size: 1rem;
  }

  .hero-ui-stack {
    min-height: 312px;
    justify-self: stretch;
  }

  .hero-route-card {
    display: none;
  }

  .hero-power-card {
    inset: 0;
    width: 100%;
    min-height: 0;
    animation: none;
    transform: none;
  }

  .hero-power-bars {
    height: 118px;
    gap: 10px;
    margin-top: 22px;
  }

  .hero-power-summary dd {
    font-size: 0.78rem;
  }

  .dark-hero-band::after {
    background:
      linear-gradient(180deg, rgba(10, 11, 13, 0.68) 0%, rgba(10, 11, 13, 0.58) 40%, rgba(10, 11, 13, 0.94) 100%),
      linear-gradient(90deg, rgba(10, 11, 13, 0.8), rgba(10, 11, 13, 0.38));
  }

  .optisplit-marketing .app-footer-inner {
    grid-template-columns: 1fr;
  }

  .landing-band,
  .how-it-works-grid,
  .how-refinement-panel,
  .pricing-grid,
  .visual-grid,
  .tour-list,
  .selected-tour-grid .pacing-form,
  .selected-tour-grid .setting-grid,
  .setting-grid,
  .metric-strip,
  .time-comparison {
    grid-template-columns: 1fr;
  }

  .fuel-reminder-panel,
  .fuel-reminder-head {
    grid-template-columns: 1fr;
  }

  .fuel-reminder-head {
    display: grid;
  }

  .fuel-type-control,
  .fuel-add-button {
    width: 100%;
  }

  .fuel-type-control button {
    flex: 1;
  }

  .fuel-distance-field,
  .fuel-note-field,
  .fuel-add-button {
    grid-column: 1;
  }

  .tour-sidebar {
    max-height: min(500px, 58svh);
  }

  .segment-table-actions,
  .workbench-head {
    align-items: start;
    display: grid;
  }

  .how-refinement-panel article + article {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .workbench-head h1 {
    font-size: 2rem;
  }

  .fit-downloads {
    width: 100%;
  }

  .fit-download-list {
    grid-template-columns: 1fr;
  }

  .fit-help-options {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .time-comparison div + div {
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }

  .analysis-panel {
    min-height: 0;
  }

  .analysis-empty {
    min-height: 220px;
    padding: 24px;
  }

  .plan-title,
  .fuel-reminder-panel,
  .upload-panel {
    padding: 24px;
  }

  .leaflet-route-map,
  .power-chart-frame {
    height: 300px;
  }

  .plan-title {
    display: grid;
  }

  .hero-copy h1 {
    font-size: clamp(2.6rem, 12vw, 4rem);
  }

  .hero-text {
    font-size: 1.03rem;
  }

  .how-it-works-inner {
    padding: 72px 0;
  }

  .pricing-inner {
    padding: 72px 0;
  }

  .section-head h2 {
    font-size: 2.35rem;
  }

  .how-it-works-grid {
    margin-top: 32px;
  }

  .how-step {
    min-height: 0;
    padding: 28px;
  }

  .pricing-grid {
    margin-top: 32px;
  }

  .pricing-tier {
    gap: 20px;
    padding: 32px;
  }

  .pricing-tier header {
    display: grid;
    min-height: 0;
  }

  .preview-body {
    min-height: 420px;
    grid-template-columns: 1fr;
  }

  .preview-rail {
    display: none;
  }

  .preview-main {
    padding: 20px;
  }

  .auth-layout {
    min-height: auto;
  }

  .auth-card,
  .auth-visual {
    padding: 24px;
  }

  .legal-panel {
    border-radius: 18px;
  }

  .legal-content {
    grid-template-columns: 1fr;
  }

  .legal-detail + .legal-detail {
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }

  .user-menu {
    max-width: 100%;
    gap: 10px;
  }

  .user-menu > span {
    max-width: calc(100vw - 126px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-footer-inner {
    grid-template-columns: 1fr;
  }

  .auth-page .app-footer-inner > div:last-child {
    grid-column: auto;
    justify-self: start;
    text-align: left;
  }
}
