.member-page {
  --paper: #f3f0eb;
  --ink: #211f1e;
  --muted: #746b65;
  --line: #d9d1ca;
  --red: #c51b18;
  --fg: var(--ink);
  --bg: var(--paper);
  --border: var(--line);
  --muted-fg: #746b65;
  --secondary: #e6e3de;
  --card: #faf8f5;
  --primary-bright: var(--red);
  background: var(--paper);
  color: var(--ink);
  min-height: 100dvh;
  font-family: Manrope, system-ui, sans-serif;
}
.member-page * {
  box-sizing: border-box;
}
.member-page [hidden] {
  display: none !important;
}
.member-page button,
.member-page input,
.member-page select,
.member-page textarea {
  font: inherit;
}
.member-page button {
  cursor: pointer;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 16px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}
.member-page button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.member-page :focus-visible {
  outline: 3px solid #255baa;
  outline-offset: 3px;
}
.member-header {
  height: 76px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.member-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
  color: var(--ink);
}
.member-header nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
  font-size: 14px;
}
.member-header a {
  color: inherit;
}
.member-page main {
  max-width: 1440px;
  padding: 36px;
  margin: auto;
}
.member-auth {
  max-width: 1050px;
  margin: 4vh auto;
  display: grid;
  grid-template-columns: 1fr 440px;
  column-gap: 64px;
  align-items: start;
}
.member-auth > h1 {
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.15;
  margin: 16px 0;
  letter-spacing: -1.5px;
}
.member-auth > p {
  grid-column: 1;
  font-size: 18px;
  line-height: 1.7;
  color: var(--muted);
}
.member-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: var(--red);
}
.member-login {
  grid-column: 2;
  grid-row: 1/5;
  background: #fff;
  border: 1px solid var(--line);
  padding: 32px;
  border-radius: 24px;
  display: grid;
  gap: 16px;
}
.member-login h2,
.member-login p {
  margin: 0;
}
.member-login > p {
  line-height: 1.6;
}
.member-page .oauth-apple {
  background: #151515;
  color: white;
  border-color: #151515;
}
.member-small {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.member-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.6;
}
.member-check input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 3px;
  accent-color: var(--red);
}
.member-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.member-title h1 {
  font-size: 32px;
  margin: 8px 0 24px;
}
.member-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  overflow-x: auto;
}
.member-tabs button {
  white-space: nowrap;
  background: transparent;
  border-color: transparent;
}
.member-tabs button[aria-current="page"] {
  background: #fff;
  border-color: var(--line);
  color: var(--red);
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 24px 0 12px;
}
.section-heading h2 {
  font-size: 23px;
  margin: 0;
}
.journal-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.journal-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  display: grid;
  gap: 10px;
  align-content: start;
}
.journal-item h3,
.journal-item p {
  margin: 0;
}
.journal-item h3 {
  font-size: 19px;
}
.journal-item button {
  justify-self: start;
}
.journal-item small {
  color: var(--muted);
}
.member-map-shell {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e1e4dd;
}
.member-map {
  height: 60dvh;
  min-height: 340px;
}
.member-map-tools {
  position: absolute;
  top: 12px;
  left: 12px;
}
.map-selection {
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  margin-top: 12px;
}
.map-selection button {
  margin: 6px;
}
.planner-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 24px;
}
.planner-form {
  display: grid;
  align-content: start;
  gap: 12px;
}
.planner-form label {
  font-size: 14px;
  font-weight: 700;
}
.planner-form input:not([type="checkbox"]),
.planner-form select,
.planner-form textarea {
  width: 100%;
  min-height: 44px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  color: var(--ink);
}
.planner-form ol,
.planner-form ul {
  padding-left: 22px;
  margin: 0;
}
.planner-form li {
  font-size: 13px;
  margin: 8px 0;
}
.planner-form li button {
  min-height: 34px;
  padding: 5px 8px;
  margin-left: 5px;
  font-size: 12px;
}
.planner-form p {
  margin: 0;
}
.inline-row {
  display: flex;
  gap: 8px;
}
#plan-ready {
  display: grid;
  gap: 12px;
}
#plan-map {
  height: 76dvh;
}
.member-page .member-primary {
  background: var(--red);
  border-color: var(--red);
  color: white;
}
.member-page .member-error {
  color: #ad1515;
}
.member-footer {
  padding: 24px;
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.member-page dialog {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  max-width: 820px;
  width: calc(100vw - 32px);
  max-height: 92dvh;
  overflow: auto;
  color: var(--ink);
  background: var(--paper);
}
.member-page dialog::backdrop {
  background: #0008;
}
#close-ride {
  float: right;
  font-size: 24px;
}
#ride-map {
  height: 45dvh;
  min-height: 240px;
  margin-top: 20px;
  border-radius: 16px;
  overflow: hidden;
}
#ride-values {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
#ride-note {
  white-space: pre-wrap;
}
.member-page #journal-list {
  margin-top: 24px;
  gap: 24px 32px;
}
.member-ride-card { margin: 0; padding: 0 0 16px; }
.member-page .member-ride-card, .member-page .member-ride-card article { display: block; grid-row: auto; }
.member-ride-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted-fg); }
.member-ride-meta span { background: #e8e3de; padding: 4px 8px; border-radius: 20px; font-size: 11px; }
.member-ride-card h3 { font-size: 21px; line-height: 1.3; margin: 4px 0 8px; text-wrap: balance; }
.member-ride-card .ride-bike { font-size: 12px; margin-top: 14px; }
.member-page .journal-title-button { display: block; width: 100%; padding: 0; min-height: 32px; border: 0; border-radius: 0; background: transparent; text-align: left; font: inherit; color: var(--ink); }
.member-page .journal-cover { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: transparent; border-radius: 16px; text-align: left; }
.member-ride-card .card-metrics { font-variant-numeric: tabular-nums; margin: 10px 0 0; }
.member-ride-card .ride-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 13px; }
.member-page .journal-detail-action, .member-page .journal-preview-retry { padding: 8px 0; border: 0; background: transparent; font-size: 13px; color: var(--red); }
.member-page #ride-dialog { width: min(820px,calc(100vw - 32px)); max-width: 820px; padding: 0 24px 28px; }
.member-detail-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 12px 0; background: var(--paper); font-size: 13px; font-weight: 700; color: var(--muted-fg); }
.member-page #close-ride { float: none; width: 44px; height: 44px; padding: 0; }
#ride-title { font-size: 28px; line-height: 1.25; margin: 8px 0; text-wrap: balance; }
.member-page #ride-map { height: 300px; min-height: 220px; margin: 12px 0 24px; }
#ride-data-status, #ride-status { font-size: 13px; color: var(--muted-fg); }
#ride-data-status:empty, #ride-status:empty { display: none; }
#ride-note { margin-top: 20px; }
#ride-sections .ride-data-section { padding: 24px 0 0; margin-top: 24px; border-top: 1px solid var(--border); }
#ride-sections .section-title { font-size: 12px; letter-spacing: normal; color: var(--red); }
#ride-sections .stat-row { font-variant-numeric: tabular-nums; }
@media(max-width:680px) {
  .member-page #journal-list { gap: 22px; }
  .member-page #ride-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; max-width: none; margin: 0; border: 0; border-radius: 0; padding: env(safe-area-inset-top) 18px calc(24px + env(safe-area-inset-bottom)); }
  .member-page #ride-map { height: 240px; }
  #ride-title { font-size: 25px; }
}
.member-page .mapboxgl-popup-content {
  color: #211f1e;
}
.member-page .mapboxgl-ctrl button {
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
}
@media (max-width: 800px) {
  .member-header {
    height: auto;
    min-height: 68px;
    padding: 14px 18px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .member-header nav {
    font-size: 12px;
    gap: 12px;
  }
  .member-brand {
    font-size: 18px;
  }
  .member-page main {
    padding: 22px 16px;
  }
  .member-auth {
    display: block;
    margin: 20px auto;
    max-width: 480px;
  }
  .member-auth > h1 {
    font-size: 34px;
  }
  .member-login {
    padding: 24px;
    margin-top: 28px;
  }
  .member-title {
    align-items: flex-start;
  }
  .member-title h1 {
    font-size: 26px;
  }
  .member-title > a {
    max-width: 120px;
  }
  .member-tabs {
    gap: 2px;
  }
  .member-tabs button {
    padding: 8px 12px;
    font-size: 13px;
  }
  .planner-layout {
    display: flex;
    flex-direction: column-reverse;
    gap: 20px;
  }
  #plan-map {
    height: 43dvh;
    min-height: 300px;
  }
  .member-map {
    height: 55dvh;
    min-height: 280px;
  }
  .journal-list {
    grid-template-columns: 1fr;
  }
  .section-heading h2 {
    font-size: 20px;
  }
  .section-heading button {
    font-size: 13px;
  }
  .member-footer {
    flex-wrap: wrap;
    gap: 12px;
  }
}

.member-page main a,
.member-footer a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.member-page .skip-link:focus {
  color: #fff;
}
/* Landing-page section spacing must not apply to account tabs or nested panels. */
.member-page section {
  padding: 0;
  border-top: 0;
}
/* Native journal analysis: compact speed map and a shared distance cursor. */
.member-speed-map { height:180px; position:relative; border-radius:16px; overflow:hidden; background:#e6e4df; }
.member-analysis { margin-top:20px; min-width:0; }
.analysis-map-title { font-size:14px; font-weight:700; margin:0 0 10px; }
.member-page .analysis-hint { font-size:12px; color:var(--muted); line-height:1.55; margin:10px 0; }
.speed-legend { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; font-size:11px; margin:10px 0 18px; font-variant-numeric:tabular-nums; }
.speed-legend span { display:inline-flex; align-items:center; gap:5px; }
.speed-legend i { width:14px; height:4px; border-radius:2px; }
.analysis-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; font-size:12px; margin-bottom:14px; }
.analysis-toolbar output { font-variant-numeric:tabular-nums; }
.member-page .analysis-toolbar button { font-size:12px; padding:8px 10px; min-height:40px; flex-shrink:0; }
.member-profile { margin:14px 0 0; }
.member-profile figcaption { display:flex; justify-content:space-between; gap:8px; font-size:12px; margin-bottom:5px; font-variant-numeric:tabular-nums; }
.member-profile strong { color:var(--chart-color); letter-spacing:0.04em; }
.member-profile svg { display:block; width:100%; height:76px; touch-action:pan-y; cursor:crosshair; overflow:visible; }
.profile-line { stroke:var(--chart-color); stroke-width:2; fill:none; vector-effect:non-scaling-stroke; }
.profile-zero { stroke:#bcb7b2; stroke-width:1; stroke-dasharray:3 3; }
.profile-peak { fill:var(--chart-color); stroke:#fff; stroke-width:1.5; }
.profile-cursor { stroke:#393431; stroke-width:1; stroke-dasharray:4 3; }
.member-page .analysis-distance { width:100%; height:32px; padding:0; margin-top:8px; accent-color:var(--red); }
.analysis-axis { display:flex; justify-content:space-between; font-size:11px; color:var(--muted); }
.analysis-peaks { display:flex; gap:8px; flex-wrap:wrap; margin-top:16px; }
.member-page .analysis-peaks button { padding:8px 10px; min-height:40px; font-size:12px; border-color:var(--peak-color); color:var(--peak-color); }
.member-page .lean-peak { display:flex; flex-direction:column; align-items:center; gap:6px; border:0; background:none; padding:12px; }
.member-page .lean-peak:disabled { opacity:1; cursor:default; }
.lean-peak strong { font-size:28px; font-variant-numeric:tabular-nums; }
.lean-peak span { font-size:11px; color:var(--muted); }
.member-page .member-ride-extras { min-width:0; }
.member-page .saved-ride-point { display:block; margin:8px 0; padding:10px 12px; font-size:13px; text-align:left; }
.member-private-photos { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:12px; }
.member-private-photos img { display:block; width:100%; height:180px; object-fit:cover; border-radius:12px; }
/* The account button reset must not erase Mapbox's attribution affordance. */
.member-page .mapboxgl-ctrl-attrib-button { background:rgba(255,255,255,.9); border-radius:50%; color:#333; }
.member-page .mapboxgl-ctrl-attrib-button::after { content:'i'; display:block; font:bold 16px/24px Georgia,serif; text-align:center; }
.member-page .mapboxgl-ctrl-attrib-button { position:relative; }
.member-page .mapboxgl-ctrl-attrib-button::after { position:absolute; inset:0; }
