@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/Lato-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/Lato-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/Lato-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/Lato-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/static/fonts/Lato-Regular.ttf") format("truetype");
}

:root {
  --base-accent: #00FF41;
  --base-core: #1C1C1C;

  --accent: var(--base-accent);
  --accent-2: var(--accent);
  --warn: var(--accent);
  --danger: color-mix(in srgb, var(--accent) 70%, var(--base-core));

  --bg: color-mix(in srgb, white 96%, var(--accent));
  --panel: #FFFFFF;
  --panel-solid: #FFFFFF;
  /* Design note: cards stay white in light mode and dark gray in dark mode. */
  --text: color-mix(in srgb, var(--base-core) 95%, white);
  --muted: color-mix(in srgb, var(--base-core) 72%, white);
  --stroke: color-mix(in srgb, var(--base-core) 16%, var(--bg));

  --on-accent: color-mix(in srgb, white 98%, var(--base-core));
  --btn-accent-end: color-mix(in srgb, var(--accent) 72%, var(--base-core));
  --chart-surface-top: color-mix(in srgb, white 99%, var(--base-core));
  --chart-surface-bottom: color-mix(in srgb, white 96%, var(--base-core));
  --map-bg: color-mix(in srgb, white 97%, var(--base-core));

  --photo-paper: color-mix(in srgb, white 99%, var(--base-core));
  --photo-paper-alt: color-mix(in srgb, white 95%, var(--base-core));
  --photo-frame: color-mix(in srgb, var(--base-core) 14%, transparent);
  --photo-frame-inner: color-mix(in srgb, var(--base-core) 10%, transparent);
  --photo-fill: color-mix(in srgb, white 94%, var(--base-core));
  --photo-ink: color-mix(in srgb, var(--base-core) 88%, white);

  --overlay-bg: color-mix(in srgb, var(--base-core) 96%, transparent);
  --overlay-border: color-mix(in srgb, white 35%, transparent);
  --overlay-surface: color-mix(in srgb, white 10%, transparent);
  --overlay-text: color-mix(in srgb, white 92%, var(--base-core));

  --series-power: var(--accent);
  --series-cadence: color-mix(in srgb, var(--text) 78%, var(--bg));
  --series-hr: color-mix(in srgb, var(--text) 62%, var(--bg));
  --series-elevation: color-mix(in srgb, var(--text) 46%, var(--bg));
  --series-grid: color-mix(in srgb, var(--text) 20%, transparent);
  --series-elevation-fill: color-mix(in srgb, var(--text) 10%, transparent);
  --training-ctl: var(--series-power);
  --training-atl: color-mix(in srgb, var(--text) 90%, var(--bg));
  --training-tsb: color-mix(in srgb, var(--accent) 34%, var(--text));

  --map-track: var(--accent);
  --map-start: color-mix(in srgb, var(--accent) 84%, var(--base-core));
  --map-end: color-mix(in srgb, var(--accent) 70%, white);
  --map-marker-stroke: color-mix(in srgb, white 92%, var(--base-core));
  --map-marker-text: color-mix(in srgb, white 98%, var(--base-core));
  --map-marker-halo: color-mix(in srgb, var(--base-core) 86%, white);
  --map-start-text: color-mix(in srgb, white 98%, var(--base-core));
  --map-end-text: color-mix(in srgb, white 98%, var(--base-core));
  --map-hover-stroke: color-mix(in srgb, white 98%, var(--base-core));

  --body-radial-1: color-mix(in srgb, white 99%, var(--accent));
  --body-radial-2: color-mix(in srgb, white 99%, var(--base-core));
  --glow-1: color-mix(in srgb, var(--accent) 18%, transparent);
  --glow-2: color-mix(in srgb, var(--accent) 10%, transparent);
  --glow-3: color-mix(in srgb, var(--accent) 10%, transparent);
  --glow-4: color-mix(in srgb, var(--base-core) 8%, transparent);

  --shadow: 0 8px 16px color-mix(in srgb, var(--base-core) 12%, transparent);

  --space-1: 4px;
  --space-1_5: 6px;
  --space-2: 8px;
  --space-2_5: 10px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;

  --fs-2xs: 11px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-body: 16px;
  --fs-xl: 20px;

  --theme-transition: 220ms cubic-bezier(0.2, 0, 0, 1);
}

[data-theme="dark"] {
  --bg: var(--base-core);
  --accent: var(--base-accent);
  --accent-2: var(--accent);
  --warn: var(--accent);
  --danger: color-mix(in srgb, var(--accent) 70%, white);

  --panel: #2A2A2A;
  --panel-solid: #2A2A2A;
  --text: color-mix(in srgb, white 92%, var(--base-core));
  --muted: color-mix(in srgb, white 78%, var(--base-core));
  --stroke: color-mix(in srgb, white 18%, var(--panel));

  --on-accent: color-mix(in srgb, white 98%, var(--base-core));
  --btn-accent-end: color-mix(in srgb, var(--accent) 68%, var(--base-core));
  --chart-surface-top: color-mix(in srgb, var(--base-core) 90%, white);
  --chart-surface-bottom: color-mix(in srgb, var(--base-core) 84%, white);
  --map-bg: color-mix(in srgb, var(--base-core) 82%, white);

  --photo-paper: color-mix(in srgb, white 92%, var(--base-core));
  --photo-paper-alt: color-mix(in srgb, white 88%, var(--base-core));
  --photo-frame: color-mix(in srgb, var(--base-core) 28%, transparent);
  --photo-frame-inner: color-mix(in srgb, var(--base-core) 22%, transparent);
  --photo-fill: color-mix(in srgb, white 86%, var(--base-core));
  --photo-ink: color-mix(in srgb, var(--base-core) 90%, white);

  --overlay-bg: color-mix(in srgb, var(--base-core) 97%, transparent);
  --overlay-border: color-mix(in srgb, white 28%, transparent);
  --overlay-surface: color-mix(in srgb, white 12%, transparent);
  --overlay-text: color-mix(in srgb, white 90%, var(--base-core));

  --series-power: var(--accent);
  --series-cadence: color-mix(in srgb, white 86%, var(--base-core));
  --series-hr: color-mix(in srgb, white 72%, var(--base-core));
  --series-elevation: color-mix(in srgb, white 58%, var(--base-core));
  --series-grid: color-mix(in srgb, white 20%, transparent);
  --series-elevation-fill: color-mix(in srgb, white 12%, transparent);
  --training-ctl: var(--series-power);
  --training-atl: color-mix(in srgb, white 92%, var(--base-core));
  --training-tsb: color-mix(in srgb, var(--accent) 48%, white);

  --map-start: color-mix(in srgb, white 96%, #d7e2f0);
  --map-end: color-mix(in srgb, var(--accent) 82%, white);
  --map-marker-stroke: color-mix(in srgb, #0d1118 92%, var(--base-core));
  --map-marker-text: color-mix(in srgb, #0d1118 96%, var(--base-core));
  --map-marker-halo: color-mix(in srgb, white 90%, #0d1118);
  --map-start-text: color-mix(in srgb, #0d1118 96%, var(--base-core));
  --map-end-text: color-mix(in srgb, #0d1118 96%, var(--base-core));
  --map-hover-stroke: color-mix(in srgb, white 98%, var(--base-core));

  --body-radial-1: color-mix(in srgb, var(--base-core) 96%, white);
  --body-radial-2: color-mix(in srgb, var(--base-core) 95%, white);
  --glow-1: color-mix(in srgb, var(--accent) 14%, transparent);
  --glow-2: color-mix(in srgb, var(--accent) 10%, transparent);
  --glow-3: color-mix(in srgb, var(--accent) 8%, transparent);
  --glow-4: color-mix(in srgb, white 6%, transparent);

  --shadow: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--text);
  background: radial-gradient(1200px 600px at 20% -10%, var(--body-radial-1) 0%, transparent 42%), radial-gradient(1000px 520px at 90% 10%, var(--body-radial-2) 0%, transparent 48%), var(--bg);
  min-height: 100vh;
}

body.photo-overlay-open,
body.profile-overlay-open,
body.likes-overlay-open,
body.login-overlay-open,
body.edit-profile-overlay-open,
body.activity-upload-overlay-open,
body.activity-edit-overlay-open,
body.share-overlay-open,
body.confirm-overlay-open,
body.route-overlay-open,
body.workout-overlay-open {
  overflow: hidden;
}

body:is(
  .photo-overlay-open,
  .profile-overlay-open,
  .likes-overlay-open,
  .login-overlay-open,
  .edit-profile-overlay-open,
  .activity-upload-overlay-open,
  .activity-edit-overlay-open,
  .share-overlay-open,
  .confirm-overlay-open,
  .route-overlay-open,
  .workout-overlay-open
) :is(.bg-blur, .topbar, .layout) {
  filter: grayscale(1) saturate(0.04);
}

body,
.topbar,
.brand,
.brand-mark,
.tagline,
.panel,
.hbox,
.btn,
.feed-link,
.metric-box,
.training-chart-wrap,
#trainingChart,
.analysis-chart,
.chart-tooltip,
.panel-title,
.title,
.desc,
.summary-label,
.summary-item strong,
.visibility,
.sport-pill,
.like-btn,
.like-count,
.comment-item,
.comment-input,
.comment-submit,
.activity-avatar,
.comment-avatar,
.compose-avatar,
.photo-card,
.photo-caption,
.photo-strip-wrap::after,
.maplibregl-map,
.bg-blur {
  transition:
    background-color var(--theme-transition),
    color var(--theme-transition),
    border-color var(--theme-transition),
    box-shadow var(--theme-transition),
    filter var(--theme-transition),
    opacity var(--theme-transition);
}

:root.app-booting *,
:root.app-booting *::before,
:root.app-booting *::after {
  transition: none !important;
}

.bg-blur {
  position: fixed;
  filter: blur(120px);
  border-radius: 999px;
  z-index: -1;
  opacity: 0.14;
}
.bg-1 { width: 560px; height: 560px; top: -140px; right: -120px; background: var(--glow-1); }
.bg-2 { width: 520px; height: 520px; bottom: -170px; left: -130px; background: var(--glow-2); }
.bg-3 { width: 600px; height: 600px; top: 32%; right: 28%; background: var(--glow-3); }
.bg-4 { width: 640px; height: 640px; top: -240px; left: 24%; background: var(--glow-4); }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--stroke);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  z-index: 40;
}

.brand-wrap { display: flex; align-items: center; gap: var(--space-3); }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  font-weight: 700;
  letter-spacing: 0.03em;
}
.brand { font-weight: 700; letter-spacing: 0.02em; color: var(--accent); }
.tagline { font-size: var(--fs-xs); color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; justify-content: flex-end; }
.top-user-menu {
  position: relative;
}
.top-avatar-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  background: var(--panel-solid);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--neu-raised-sm);
}
.top-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--stroke));
  background: color-mix(in srgb, var(--accent) 18%, var(--panel-solid));
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.top-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.top-avatar-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.top-user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 248px;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  background: var(--panel-solid);
  box-shadow: var(--neu-raised-sm);
  display: grid;
  gap: var(--space-1_5);
  z-index: 45;
}
.top-user-menu-panel[hidden] {
  display: none;
}
.top-user-menu-handle {
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.2;
  padding: 2px var(--space-2) var(--space-1);
}
.top-user-menu-label {
  font-size: 10px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 2px var(--space-2) 0;
}
.top-user-menu-item {
  width: 100%;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  padding: 7px var(--space-2);
  cursor: pointer;
}
.top-user-menu-item:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-solid));
}
.top-user-menu-item-tags {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.top-user-menu-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--muted) 30%, var(--stroke));
  background: color-mix(in srgb, var(--muted) 12%, var(--panel-solid));
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.top-user-menu-item:focus-visible,
.top-avatar-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 2px;
}
.top-user-menu-accent-picker {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  padding: var(--space-1) var(--space-2) var(--space-1_5);
  padding-left: calc(var(--space-2) + 8px);
  flex-wrap: wrap;
  gap: var(--space-1_5);
}
.top-user-menu-divider {
  height: 1px;
  width: 100%;
  margin: 2px 0;
  background: color-mix(in srgb, var(--stroke) 76%, transparent);
}
.session-pill {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-solid));
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1;
  padding: 7px 10px;
}
.accent-picker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1_5);
  padding: 0 var(--space-1);
}
.accent-swatch {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--text) 20%, var(--bg));
  background: var(--swatch-color, var(--accent));
  padding: 0;
  cursor: pointer;
  position: relative;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.accent-swatch:hover {
  transform: scale(1.06);
}
.accent-swatch:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--text) 32%, var(--bg));
  outline-offset: 2px;
}
.accent-swatch.selected {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px color-mix(in srgb, var(--text) 38%, var(--bg));
}
.top-user-menu-panel .top-user-menu-accent-picker {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: var(--space-1_5);
  padding: 0 var(--space-2);
}
.top-user-menu-panel .top-user-menu-accent-picker .accent-swatch.selected {
  box-shadow:
    inset 0 0 0 2px var(--bg),
    0 0 0 1px color-mix(in srgb, var(--text) 34%, var(--bg));
}

.btn {
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, var(--accent), var(--btn-accent-end));
  color: var(--on-accent);
  font-size: var(--fs-sm);
  line-height: 1.2;
  font-weight: 700;
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
}
.btn.secondary {
  background: var(--panel-solid);
  color: var(--text);
  border: 1px solid var(--stroke);
}

.layout {
  display: grid;
  grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
  gap: var(--space-6);
  padding: var(--space-4);
  position: relative;
}

.panel,
.activity-card,
.hbox {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel { padding: var(--space-4); }
.left-panel {
  position: sticky;
  top: 78px;
  align-self: start;
  max-height: none;
  overflow: visible;
}
.panel-title {
  font-size: var(--fs-sm);
  line-height: 1.35;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.spacer { margin-top: var(--space-6); }
.feed-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  margin-top: var(--space-2);
}
.feed-link-collection-start {
  margin-top: calc(var(--space-2) + 8px);
}
.feed-link.active,
.feed-link:hover {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
}
.feed-main {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.feed-label {
  font-size: var(--fs-sm);
  color: var(--text);
}
.feed-count {
  font-size: var(--fs-xs);
  color: var(--muted);
}
.feed-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--stroke));
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  line-height: 1;
  color: var(--accent);
}
.feed-icon {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.feed-link[data-rss-url] .feed-symbol {
  cursor: pointer;
  position: relative;
}
.feed-link[data-rss-url] .feed-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center center;
  transition: opacity 180ms ease, transform 210ms ease;
}
.feed-link[data-rss-url] .feed-icon-default {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.feed-link[data-rss-url] .feed-icon-rss {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.72) rotate(-8deg);
}
.feed-link[data-rss-url]:hover .feed-icon-rss,
.feed-link[data-rss-url]:focus-visible .feed-icon-rss,
.feed-link[data-rss-url]:focus-within .feed-icon-rss {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}
.feed-link[data-rss-url]:hover .feed-icon-default,
.feed-link[data-rss-url]:focus-visible .feed-icon-default,
.feed-link[data-rss-url]:focus-within .feed-icon-default {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.72) rotate(8deg);
}
@media (prefers-reduced-motion: reduce) {
  .feed-link[data-rss-url] .feed-icon {
    transition: none;
  }
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-5);
}
.metric-box {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  text-align: center;
  background: var(--panel-solid);
}
.metric-box .label { font-size: var(--fs-2xs); color: var(--muted); }
.metric-box .value { font-size: var(--fs-xl); font-weight: 700; margin-top: var(--space-1); color: var(--text); }
.ctl .value { color: var(--text); }
.atl .value { color: var(--text); }
.tsb .value { color: var(--text); }

.training-chart-wrap {
  margin-top: 0;
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0;
  background: transparent;
}
#trainingChart {
  width: 100%;
  height: 130px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--chart-surface-top), var(--chart-surface-bottom));
}
[data-theme="dark"] #trainingChart {
  background: linear-gradient(180deg, var(--chart-surface-top), var(--chart-surface-bottom));
}
.training-legend {
  margin-top: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  color: var(--muted);
  font-size: var(--fs-2xs);
}
.training-legend span { display: inline-flex; align-items: center; gap: var(--space-1); }
.training-legend i { width: var(--space-2); height: var(--space-2); border-radius: 999px; display: inline-block; }
.ctl-dot { background: var(--training-ctl); }
.atl-dot { background: var(--training-atl); }
.tsb-dot {
  background: transparent;
  border: 2px solid var(--training-tsb);
}
.training-legend small { margin-left: auto; }

.private-training-head {
  margin-top: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.fitness-edit-toggle {
  margin-top: var(--space-5);
  width: 100%;
  padding: var(--space-1_5) var(--space-3);
  font-size: var(--fs-xs);
}
.unit-switch {
  margin-top: var(--space-2);
  display: inline-flex;
  gap: var(--space-1_5);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 2px;
  background: var(--panel-solid);
}
.unit-option {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
}
.unit-option.active {
  background: color-mix(in srgb, var(--accent) 20%, var(--panel-solid));
  color: var(--text);
}


.body-metrics { margin-top: var(--space-5); display: grid; gap: var(--space-2); }
.body-metrics div { display: flex; justify-content: space-between; font-size: var(--fs-sm); }
.body-metrics span { color: var(--muted); }
.yearly-progress {
  margin-top: var(--space-5);
  display: grid;
  gap: var(--space-2);
}
.yearly-progress-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--panel-solid);
}
.yearly-progress-table th,
.yearly-progress-table td {
  padding: 6px var(--space-2);
  border-bottom: 1px solid var(--stroke);
  font-size: var(--fs-xs);
}
.yearly-progress-table tbody tr:last-child td {
  border-bottom: 0;
}
.yearly-progress-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 700;
}
.yearly-progress-table td:last-child,
.yearly-progress-table th:last-child {
  text-align: right;
}
.yearly-progress-empty {
  text-align: center;
  color: var(--muted);
}
.debug-reset-btn {
  margin-top: var(--space-4);
  width: 100%;
}

.upload-actions-bar {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  position: sticky;
  top: 78px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  z-index: 30;
}

.timeline {
  display: grid;
  gap: var(--space-6);
  min-width: 0;
  justify-items: start;
  align-content: start;
  grid-auto-rows: max-content;
  grid-column: 2;
  grid-row: 1;
}
.timeline-head {
  width: 100%;
  max-width: 640px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.timeline-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.timeline-empty {
  width: 100%;
  max-width: 640px;
  padding: var(--space-4);
  border: 1px dashed var(--stroke);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: var(--muted);
  font-size: var(--fs-sm);
}
.activity-card {
  padding: var(--space-3);
  transition: border-color var(--theme-transition), max-width 220ms ease;
  cursor: default;
  min-width: 0;
  width: 100%;
  max-width: 640px;
}
.activity-card.feed-hidden {
  display: none;
}
.activity-card.show-insights,
.activity-card.is-collapsing {
  max-width: 100%;
  width: 100%;
}
.activity-card:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--stroke));
}

.routes-view,
.workouts-view {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: var(--space-3);
  grid-column: 2;
  grid-row: 1;
  align-content: start;
}
.routes-head,
.workouts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.routes-actions,
.workouts-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.workout-recommendation-kicker {
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.1;
  display: inline-block;
}
.workout-recommendation-rationale {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.routes-grid,
.workouts-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
  align-items: start;
}
.route-card {
  width: 100%;
  border: 0;
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: grid;
  grid-template-rows: 180px auto;
  gap: var(--space-2);
  cursor: pointer;
  color: var(--text);
  text-align: left;
  background: var(--neu-surface);
  box-shadow: var(--neu-raised-sm);
}
.route-card:hover {
  box-shadow: var(--neu-raised-hover);
}
.route-card-map {
  width: 100%;
  min-height: 180px;
  height: 180px;
  max-height: 180px;
  flex: 0 0 180px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  background: var(--map-bg);
  border: 1px solid color-mix(in srgb, var(--stroke) 68%, transparent);
}
.route-card .route-card-map {
  height: 180px;
  min-height: 180px;
  max-height: 180px;
}
.route-card-map .maplibregl-ctrl-top-right,
.route-card-map .maplibregl-ctrl-bottom-right,
.route-card-map .maplibregl-ctrl-bottom-left,
.route-card-map .leaflet-control-zoom,
.route-card-map .leaflet-control-attribution {
  display: none !important;
}
.workout-card-preview {
  width: 100%;
  min-height: 180px;
  height: 180px;
  max-height: 180px;
  border-radius: var(--radius-sm);
  background: var(--neu-surface);
  box-shadow: var(--neu-inset);
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: var(--space-1_5);
  overflow: hidden;
}
.workout-card-preview .workout-interval-bar {
  border-radius: 5px 5px 3px 3px;
}
.workout-recommendation-card .workout-card-preview {
  min-height: 180px;
}
.workout-recommendation-card .route-card-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.workout-interval-bar {
  flex: 0 0 auto;
  min-width: 2px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--stroke));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 72%, white), color-mix(in srgb, var(--accent) 88%, var(--base-core)));
  min-height: 12px;
  position: relative;
}
.workout-interval-bar span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1px;
  color: color-mix(in srgb, var(--on-accent) 94%, var(--base-core));
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}
.route-card-info {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--neu-surface) 92%, var(--panel));
  box-shadow: var(--neu-inset);
}
.route-card-title {
  display: block;
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.25;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.route-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}
.route-card-meta-item {
  display: inline-grid;
  gap: 2px;
  padding: 0;
}
.route-card-meta-item small {
  font-size: var(--fs-2xs);
  color: var(--muted);
  letter-spacing: 0.01em;
}
.route-card-meta-item strong {
  font-size: var(--fs-sm);
  color: var(--text);
}
.route-empty {
  width: 100%;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--stroke);
  color: var(--muted);
  font-size: var(--fs-sm);
}
.workout-empty {
  width: 100%;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--stroke);
  color: var(--muted);
  font-size: var(--fs-sm);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
}
.head-main { min-width: 0; }
.head-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}
.activity-actions-menu {
  position: relative;
}
.activity-actions-toggle {
  height: 30px;
  width: 30px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-solid));
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.activity-actions-toggle:hover {
  background: color-mix(in srgb, var(--accent) 18%, var(--panel-solid));
}
.activity-menu-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}
.activity-actions-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 198px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  padding: 4px;
  z-index: 8;
  display: grid;
  gap: 2px;
}
.activity-actions-dropdown[hidden] {
  display: none;
}
.activity-menu-item {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  border-radius: var(--radius-xs);
  padding: 7px 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.activity-menu-item:hover {
  background: color-mix(in srgb, var(--accent) 11%, var(--panel-solid));
}
.activity-menu-item:disabled {
  opacity: 0.58;
  cursor: wait;
}
.activity-menu-export {
  display: grid;
  gap: 2px;
  padding: 2px 0 0;
}
.activity-menu-export-label {
  font-size: var(--fs-2xs);
  color: var(--muted);
  padding: 2px 9px 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.activity-export-link {
  text-decoration: none;
}
.activity-menu-divider {
  height: 1px;
  background: color-mix(in srgb, var(--text) 16%, transparent);
  margin: 2px 4px;
}
.activity-menu-item-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.activity-menu-item.danger {
  color: var(--danger);
}
.activity-menu-item.danger:hover {
  background: color-mix(in srgb, var(--danger) 10%, var(--panel-solid));
}
.author-row {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.author-profile-btn {
  border: 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.author-meta {
  display: inline-grid;
  justify-items: start;
  align-content: center;
  gap: 2px;
  min-width: 0;
}
.follow-btn {
  border: 1px solid color-mix(in srgb, var(--accent) 44%, var(--stroke));
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-solid));
  color: var(--text);
  border-radius: 999px;
  font-size: var(--fs-xs);
  line-height: 1.2;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
}
.follow-btn:hover {
  background: color-mix(in srgb, var(--accent) 22%, var(--panel-solid));
}
.follow-btn[disabled] {
  opacity: 0.65;
  cursor: wait;
}
.mutual-pill {
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--stroke));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--muted);
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.2;
  padding: 3px 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.activity-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 24%, var(--panel-solid));
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--stroke));
}
.activity-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.author { font-weight: 700; line-height: 1.1; }
.handle {
  color: var(--muted);
  font-weight: 500;
  margin-left: 0;
  line-height: 1.1;
  display: block;
}
.title { margin-top: 0; font-size: var(--fs-xl); line-height: 1.2; letter-spacing: -0.01em; font-weight: 700; color: var(--accent); }
.title a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.title code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: var(--radius-xs);
  padding: 0 4px;
}
.desc-wrap {
  margin-top: 3px;
  display: grid;
  justify-items: start;
  gap: var(--space-1);
}
.desc {
  margin: 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: calc(var(--fs-body) - 1px);
  line-height: 1.55;
  white-space: normal;
  overflow: hidden;
  max-height: var(--desc-collapsed-max-height, calc(1.55em * 4));
  transition: max-height 220ms ease;
}
.desc a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.desc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9em;
  color: var(--text);
  background: color-mix(in srgb, var(--text) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 18%, transparent);
  border-radius: var(--radius-xs);
  padding: 0 4px;
}
.activity-card.desc-expanded .desc {
  max-height: var(--desc-expanded-max-height, 1200px);
}
.desc-toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 400;
  line-height: 1.2;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.desc-toggle[hidden] {
  display: none;
}
.desc-toggle-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform-origin: 50% 55%;
  transition: transform 140ms ease;
}
.activity-card.desc-expanded .desc-toggle-indicator {
  transform: rotate(180deg);
}

.visibility {
  text-transform: capitalize;
  border-radius: 999px;
  font-size: var(--fs-2xs);
  padding: var(--space-1_5) var(--space-2);
  font-weight: 700;
}
.visibility.public { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text); }
.visibility.followers { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); }
.visibility.private { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text); }

.live-pill {
  border-radius: 999px;
  padding: var(--space-1_5) var(--space-2_5);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  background: color-mix(in srgb, var(--text) 10%, transparent);
}
.live-pill.active {
  color: color-mix(in srgb, var(--accent) 88%, var(--text));
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.sport-pill {
  border-radius: 999px;
  padding: var(--space-1_5) var(--space-2_5);
  background: var(--panel-solid);
  border: 1px solid var(--stroke);
  font-size: var(--fs-xs);
}

.summary-strip {
  margin-top: var(--space-4);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: var(--space-2) var(--space-3);
  width: min(100%, 616px);
  align-self: start;
  max-height: 420px;
  opacity: 1;
  transform: translateY(0);
  overflow: visible;
  transition:
    max-height 200ms ease,
    opacity 180ms ease,
    transform 200ms ease,
    margin-top 200ms ease;
}
.activity-card.show-insights .summary-strip,
.activity-card.is-collapsing .summary-strip {
  overflow: hidden;
}
.activity-card.show-insights:not(.is-collapsing) .summary-strip {
  max-height: 0;
  opacity: 0;
  transform: translateY(-10px);
  margin-top: 0;
  pointer-events: none;
}
.summary-item {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.summary-label {
  font-size: 10px;
  line-height: 1.1;
  color: color-mix(in srgb, var(--text) 52%, var(--bg));
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.summary-item strong {
  font-size: var(--fs-md);
  line-height: 1.08;
  font-weight: 700;
  color: var(--text);
}

.trackbook-collapsed {
  display: block;
  margin-top: var(--space-3);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.activity-card.show-insights:not(.is-collapsing) .trackbook-collapsed {
  display: none;
}
.activity-card:not(.show-insights) .trackbook-collapsed,
.activity-card.is-collapsing .trackbook-collapsed {
  display: block;
}
.trackbook-collapsed-map {
  min-height: clamp(220px, 32vh, 300px);
  height: clamp(220px, 32vh, 300px);
  max-height: clamp(220px, 32vh, 300px);
  aspect-ratio: 16 / 8;
  border-radius: var(--radius-sm);
}
.trackbook-collapsed .photo-strip {
  width: calc(100% + 8px);
  max-width: calc(100% + 8px);
  margin-left: -8px;
  gap: var(--space-2);
  padding: calc(var(--space-1) + 2px) 0 calc(var(--space-2) + 8px) 8px;
}
.trackbook-collapsed-photo {
  flex: 0 0 64px;
  max-width: 64px;
  padding: 3px;
  border-radius: var(--radius-sm);
}
.trackbook-collapsed-photo img {
  filter: grayscale(1) contrast(0.92) brightness(1.04);
}
[data-theme="dark"] .trackbook-collapsed-photo img {
  filter: grayscale(1) contrast(0.95) brightness(0.92);
}
.trackbook-collapsed-photo .photo-caption {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.2;
  color: color-mix(in srgb, var(--photo-ink) 82%, var(--bg));
}
.trackbook-collapsed-photo:hover,
.trackbook-collapsed-photo:focus-visible {
  transform: translateY(-1px);
}

.pulse-collapsed {
  display: block;
  margin-top: var(--space-2);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.activity-card.show-insights:not(.is-collapsing) .pulse-collapsed {
  display: none;
}
.activity-card:not(.show-insights) .pulse-collapsed,
.activity-card.is-collapsing .pulse-collapsed {
  display: block;
}
.pulse-collapsed-row {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: var(--space-2);
}
.pulse-collapsed-leading {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.pulse-collapsed .social-actions {
  margin-left: var(--space-3);
  flex: 0 0 auto;
}
.pulse-collapsed .like-btn {
  height: 30px;
  min-width: 42px;
  padding: 0 var(--space-2);
}
.pulse-collapsed .like-icon {
  width: 16px;
  height: 16px;
}
.pulse-collapsed .like-count {
  font-size: var(--fs-sm);
}
.pulse-comment-inline {
  margin: var(--space-1) 0 0;
  min-width: 0;
  max-width: 68ch;

  color: var(--muted);
  font-size: var(--fs-2xs);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pulse-comment-inline strong {
  color: var(--text);
}
.pulse-avatars {
  display: inline-flex;
  align-items: center;
}
.pulse-avatar {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--stroke));
  background: color-mix(in srgb, var(--accent) 22%, var(--panel-solid));
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pulse-avatar + .pulse-avatar {
  margin-left: -6px;
}
.pulse-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pulse-profile-btn {
  cursor: pointer;
  padding: 0;
}
.pulse-profile-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 44%, var(--stroke));
  outline-offset: 1px;
}
.pulse-meta {
  color: var(--muted);
  font-size: var(--fs-2xs);
}

.activity-expanded {
  display: none;
  margin-top: var(--space-3);
  animation: fadeIn 160ms ease;
  transition: margin-top 200ms ease;
}
.activity-card.show-insights .activity-expanded,
.activity-card.is-collapsing .activity-expanded { display: block; }
.activity-card.show-insights:not(.is-collapsing) .activity-expanded {
  margin-top: var(--space-1);
}

.expanded-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  align-items: stretch;
}
.activity-card.show-insights .expanded-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  position: sticky;
  top: 78px;
  z-index: 4;
}
.expanded-grid > * { min-width: 0; }

.hbox {
  padding: var(--space-3);
  background: var(--panel-solid);
  border-color: color-mix(in srgb, var(--stroke) 72%, transparent);
  box-shadow: none;
  min-width: 0;
}

.map-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-bottom: var(--space-2);
}
.analysis-chart-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: nowrap;
}
.chart-zoom-back {
  height: 24px;
  padding: 0 var(--space-2);
  font-size: var(--fs-2xs);
  line-height: 1;
}
.obf-badge { color: var(--muted); font-weight: 600; font-size: var(--fs-2xs); letter-spacing: 0.01em; }
.trackbook-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 0;
}
.trackbook-title {
  color: var(--accent);
}
.insights-toggle {
  height: 32px;
  width: 32px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel-solid));
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition:
    background-color var(--theme-transition),
    border-color var(--theme-transition),
    color var(--theme-transition),
    transform 180ms ease;
}
.insights-toggle:hover {
  background: color-mix(in srgb, var(--accent) 24%, var(--panel-solid));
}
.insights-toggle-top {
  margin-left: 4px;
}
.activity-card.show-insights .insights-toggle {
  transform: rotate(180deg);
}

.map-box {
  display: grid;
  grid-template-rows: auto minmax(0, 3fr) minmax(0, 1fr);
  gap: var(--space-2);
  min-height: 430px;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

.map-box.no-photos {
  grid-template-rows: auto minmax(0, 1fr);
}

.activity-map {
  position: relative;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--stroke) 68%, transparent);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  aspect-ratio: auto;
  min-height: 0;
  min-width: 0;
  height: 100%;
  flex: none;
}
.activity-map.trackbook-collapsed-map {
  min-height: clamp(220px, 32vh, 300px);
  height: clamp(220px, 32vh, 300px);
  max-height: clamp(220px, 32vh, 300px);
  flex: 0 0 clamp(220px, 32vh, 300px);
  aspect-ratio: 16 / 8;
}
.activity-map::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: var(--neu-inset);
  pointer-events: none;
  z-index: 1;
}
.map-fit-button {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--stroke) 80%, transparent);
  background: color-mix(in srgb, var(--panel-solid) 94%, transparent);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--neu-raised-sm);
  z-index: 8;
  cursor: pointer;
  padding: 0;
  transition:
    background-color var(--theme-transition),
    color var(--theme-transition),
    transform 180ms ease;
}
.map-fit-button:hover {
  background: color-mix(in srgb, var(--accent) 18%, var(--panel-solid));
}
.map-fit-button:active {
  transform: scale(0.96);
}
.map-fit-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.route-card-map .map-fit-button {
  display: none !important;
}

.photo-strip-wrap {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  position: relative;
}

.photo-strip {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  overflow-y: visible;
  max-width: calc(100% + 8px);
  min-width: 0;
  width: calc(100% + 8px);
  margin-left: -8px;
  padding: calc(var(--space-1_5) + 2px) var(--space-1) calc(var(--space-2_5) + 8px) 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.photo-strip::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.photo-strip::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--stroke) 70%, transparent);
  border-radius: 999px;
}

.photo-card {
  flex: 0 0 clamp(86px, calc((100% - 16px) / 3.2), 116px);
  max-width: 116px;
  border: 0;
  background: var(--panel-solid);
  border-radius: var(--radius-sm);
  padding: var(--space-1_5);
  margin-bottom: 2px;
  box-shadow: none;
  cursor: pointer;
  text-align: left;
  transform: translateY(0);
  transition: transform 180ms ease, box-shadow var(--theme-transition), background-color var(--theme-transition);
  scroll-snap-align: start;
}
[data-theme="dark"] .photo-card {
  background: var(--panel-solid);
}
.photo-card:hover,
.photo-card:focus-visible {
  transform: translateY(-1px);
  outline: 0;
}
.trackbook-collapsed .photo-card:hover,
.trackbook-collapsed .photo-card:focus-visible {
  transform: translateY(-1px);
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-xs);
  border: 0;
  background: var(--photo-fill);
}
.photo-caption {
  display: none;
}
[data-theme="dark"] .photo-caption,
[data-theme="dark"] .trackbook-collapsed-photo .photo-caption {
  color: color-mix(in srgb, white 88%, var(--base-core));
}
.photo-strip-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 14px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to right, transparent, var(--panel-solid));
}

.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 85;
  display: grid;
  place-items: center;
  padding: var(--space-4);
}
.login-overlay[hidden] {
  display: none;
}
.login-sheet {
  width: min(420px, 96vw);
  background: var(--panel-solid);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: grid;
  gap: var(--space-3);
}
.icon-close-btn {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--stroke) 88%, var(--panel-solid));
  background: color-mix(in srgb, var(--panel-solid) 92%, #ffffff 8%);
  color: color-mix(in srgb, var(--text) 62%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}
.icon-close-btn svg {
  width: 11px;
  height: 11px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-close-btn:hover {
  background: color-mix(in srgb, var(--panel-solid) 76%, var(--accent) 24%);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--stroke));
  color: color-mix(in srgb, var(--text) 82%, transparent);
}
.icon-close-btn:active {
  transform: scale(0.97);
}
.icon-close-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 2px;
}
.login-close {
  justify-self: end;
}
.login-head p {
  margin: var(--space-1_5) 0 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.login-divider {
  margin-top: calc(var(--space-1_5) * -1);
  padding-top: var(--space-2);
  border-top: 1px solid var(--stroke);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.login-form {
  display: grid;
  gap: var(--space-3);
}
.login-switch-btn {
  width: 100%;
}
.login-form label {
  display: grid;
  gap: var(--space-1_5);
  font-size: var(--fs-sm);
  color: var(--muted);
}
.login-form input {
  width: 100%;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke);
  background: var(--panel-solid);
  color: var(--text);
  padding: 0 var(--space-3);
}
.login-error {
  margin: 0;
  min-height: 1.2em;
  color: var(--danger);
  font-size: var(--fs-xs);
}
.login-note {
  margin: 0;
  min-height: 1.2em;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.admin-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 92;
  display: grid;
  place-items: center;
  padding: var(--space-4);
}
.admin-overlay[hidden] {
  display: none;
}
.admin-sheet {
  width: min(920px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: var(--panel-solid);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: grid;
  gap: var(--space-3);
}
.admin-close {
  justify-self: end;
}
.admin-head p {
  margin: var(--space-1_5) 0 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.admin-error {
  margin: 0;
  min-height: 1.2em;
  color: var(--danger);
  font-size: var(--fs-xs);
}
.admin-users-wrap {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel-solid);
}
.admin-users-table th,
.admin-users-table td {
  padding: 8px var(--space-2);
  border-bottom: 1px solid var(--stroke);
  font-size: var(--fs-xs);
  text-align: left;
  vertical-align: middle;
}
.admin-users-table tbody tr:last-child td {
  border-bottom: 0;
}
.admin-users-table th {
  color: var(--muted);
  font-weight: 700;
}
.admin-users-table td:last-child,
.admin-users-table th:last-child {
  text-align: right;
}
.admin-user-label {
  display: grid;
  gap: 2px;
}
.admin-user-handle {
  color: var(--muted);
}
.admin-role-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--stroke));
  border-radius: 999px;
  padding: 2px 8px;
  font-size: var(--fs-2xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.admin-users-empty {
  text-align: center !important;
  color: var(--muted);
}
.admin-invites {
  display: grid;
  gap: var(--space-2);
}
.admin-invites-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--muted);
}
.admin-invites-summary strong {
  color: var(--text);
}
.admin-invites-table td:nth-child(2) {
  text-transform: capitalize;
}
.admin-invites-table td:nth-child(4),
.admin-invites-table th:nth-child(4) {
  text-align: right;
}

.profile-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 90;
  display: grid;
  place-items: center;
  padding: var(--space-4);
}
.profile-overlay[hidden] {
  display: none;
}
.profile-sheet {
  width: min(760px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: var(--panel-solid);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: grid;
  gap: var(--space-3);
}
.profile-close {
  justify-self: end;
}
.profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.profile-identity {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}
.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--stroke));
  background: color-mix(in srgb, var(--accent) 18%, var(--panel-solid));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: 700;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-name {
  color: var(--accent);
  font-weight: 700;
  font-size: var(--fs-md);
}
.profile-handle {
  color: var(--muted);
  font-size: var(--fs-sm);
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}
.profile-stats.profile-stats-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.profile-stat {
  min-height: 56px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke);
  background: var(--panel-solid);
  padding: 10px 12px;
  display: grid;
  gap: 5px;
  text-align: center;
  align-content: center;
  justify-items: center;
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--neu-raised-sm);
  transition:
    color var(--theme-transition),
    box-shadow var(--theme-transition),
    transform var(--theme-transition);
}
.profile-tab-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
.profile-tab-icon {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.88;
}
.profile-stat strong {
  font-size: var(--fs-sm);
  line-height: 1;
  color: var(--muted);
}
.profile-stat:hover {
  transform: translateY(-1px);
  box-shadow: var(--neu-raised-hover);
}
.profile-stat.active {
  color: var(--text);
  box-shadow: var(--neu-inset);
  transform: none;
}
.profile-list {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  min-height: 160px;
  max-height: 48vh;
  overflow: auto;
}
.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--stroke);
}
.profile-row:last-child {
  border-bottom: 0;
}
.profile-row-main {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.profile-row-text {
  min-width: 0;
}
.profile-row-name {
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-row-handle {
  color: var(--muted);
  font-size: var(--fs-xs);
}
.profile-empty {
  padding: var(--space-3);
  color: var(--muted);
  font-size: var(--fs-sm);
}

.likes-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 92;
  display: grid;
  place-items: center;
  padding: var(--space-4);
}
.likes-overlay[hidden] {
  display: none;
}
.likes-sheet {
  width: min(440px, 94vw);
  max-height: 82vh;
  overflow: auto;
  background: var(--panel-solid);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: grid;
  gap: var(--space-2);
}
.likes-close {
  justify-self: end;
}
.likes-count {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.likes-list {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  overflow: auto;
  max-height: min(52vh, 460px);
  background: var(--panel-solid);
}
.likes-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--stroke);
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-align: left;
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
}
.likes-row:last-child {
  border-bottom: 0;
}
.likes-row:hover,
.likes-row:focus-visible {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.likes-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--stroke));
  background: color-mix(in srgb, var(--accent) 14%, var(--panel-solid));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-2xs);
  font-weight: 700;
  flex: 0 0 auto;
}
.likes-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.likes-user-text {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.likes-user-text strong {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.likes-handle {
  color: var(--muted);
  font-size: var(--fs-xs);
}
.likes-empty {
  padding: var(--space-3);
  color: var(--muted);
  font-size: var(--fs-sm);
}
.likes-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-xs);
  min-height: 1.2em;
}

.activity-upload-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 89;
  display: grid;
  place-items: center;
  padding: var(--space-4);
}
.activity-upload-overlay[hidden] {
  display: none;
}
.activity-upload-sheet {
  width: min(980px, 96vw);
  max-height: 94vh;
  overflow: auto;
  background: var(--panel-solid);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: grid;
  gap: var(--space-2);
}
.activity-upload-close {
  justify-self: end;
}
.activity-upload-head {
  display: grid;
  gap: var(--space-1_5);
}
.activity-upload-meta-line {
  display: flex;
  align-items: first baseline;
  gap: var(--space-2);
  min-width: 0;
}
.activity-upload-status {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  flex: 1 1 auto;
  min-width: 0;
}
.activity-upload-source {
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--neu-surface);
  box-shadow: var(--neu-inset);
  padding: 6px 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-1_5);
  flex: 0 1 min(52%, 420px);
  min-width: 220px;
  align-self: first baseline;
}
.activity-upload-source-label {
  color: var(--muted);
  font-size: var(--fs-2xs);
  white-space: nowrap;
}
.activity-upload-source-values {
  min-width: 0;
  display: grid;
  gap: 1px;
  justify-items: end;
}
.activity-upload-source strong {
  color: var(--text);
  font-size: var(--fs-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.activity-upload-source small {
  color: var(--muted);
  font-size: var(--fs-2xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.activity-upload-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-1_5);
}
.activity-upload-metrics div {
  border: 0;
  border-radius: var(--radius-sm);
  padding: var(--space-1_5) var(--space-2);
  display: grid;
  gap: 1px;
  background: var(--neu-surface);
  box-shadow: var(--neu-raised-xs);
}
.activity-upload-metrics span {
  color: var(--muted);
  font-size: var(--fs-2xs);
}
.activity-upload-metrics strong {
  color: var(--text);
  font-size: var(--fs-sm);
}
.activity-upload-route {
  border: 0;
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  display: grid;
  gap: var(--space-2);
  min-width: 0;
  background: var(--neu-surface);
  box-shadow: var(--neu-raised-sm);
}
.activity-upload-route-equipment {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
}
.activity-upload-route-equipment-label {
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.2;
  font-weight: 600;
}
.activity-upload-route-equipment-select {
  width: 100%;
  height: 34px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--neu-surface);
  color: var(--text);
  padding: 8px 12px;
  font-size: var(--fs-sm);
  box-shadow: var(--neu-inset);
  transition: box-shadow var(--theme-transition), color var(--theme-transition), background var(--theme-transition);
}
.activity-upload-route-equipment-select:focus-visible {
  outline: 0;
  box-shadow: var(--neu-inset), var(--neu-ring);
}
.activity-upload-route-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.activity-upload-route-head small {
  color: var(--muted);
  font-size: var(--fs-2xs);
}
.activity-upload-map {
  min-height: 172px;
  aspect-ratio: 16 / 8;
  height: auto;
}
.activity-upload-intervals {
  border: 0;
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  display: grid;
  gap: var(--space-2);
  background: var(--neu-surface);
  box-shadow: var(--neu-raised-sm);
}
.activity-upload-intervals-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.activity-upload-intervals-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1_5);
  color: var(--text);
  font-size: var(--fs-sm);
}
.activity-upload-interval-chart {
  min-height: 86px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--neu-surface);
  box-shadow: var(--neu-inset);
  padding: var(--space-1_5);
  display: flex;
  align-items: flex-end;
  gap: 2px;
  overflow: hidden;
}
.activity-upload-interval-empty {
  color: var(--muted);
  font-size: var(--fs-xs);
}
.activity-upload-interval-bar {
  flex: 0 0 auto;
  width: 24px;
  border-radius: 5px 5px 3px 3px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--stroke));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 72%, white), color-mix(in srgb, var(--accent) 88%, var(--base-core)));
  min-height: 14px;
  cursor: pointer;
  position: relative;
}
.activity-upload-interval-bar.is-active {
  border-color: var(--stroke);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--stroke) 70%, transparent),
    color-mix(in srgb, var(--stroke) 86%, var(--panel-solid))
  );
  animation: interval-block-pulse 520ms ease-out;
}
.activity-upload-interval-bar span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 2px;
  color: color-mix(in srgb, var(--on-accent) 94%, var(--base-core));
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}
@keyframes interval-block-pulse {
  0% { transform: translateY(0) scaleY(0.96); opacity: 0.86; }
  45% { transform: translateY(-1px) scaleY(1.03); opacity: 1; }
  100% { transform: translateY(0) scaleY(1); opacity: 1; }
}
.activity-upload-interval-note {
  color: var(--muted);
  font-size: var(--fs-xs);
}
.activity-upload-fields {
  display: grid;
  gap: var(--space-2_5);
  align-self: start;
}
.activity-upload-fields > label {
  display: grid;
  gap: var(--space-1);
}
.activity-upload-fields > label > span {
  color: var(--muted);
  font-size: var(--fs-xs);
}
.activity-upload-fields > label > .activity-upload-field-headline {
  color: color-mix(in srgb, var(--text) 78%, var(--neu-surface));
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.activity-upload-fields > label > input,
.activity-upload-fields > label > textarea {
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--neu-surface);
  color: var(--text);
  box-sizing: border-box;
  padding: 10px 14px;
  font-size: var(--fs-sm);
  line-height: 1.35;
  box-shadow: var(--neu-inset);
  transition: box-shadow var(--theme-transition), color var(--theme-transition), background var(--theme-transition);
}
.activity-upload-fields > label > input:focus-visible,
.activity-upload-fields > label > textarea:focus-visible {
  outline: 0;
  box-shadow: var(--neu-inset), var(--neu-ring);
}
.activity-upload-fields #activity-draft-title,
.activity-upload-fields #activity-edit-title {
  min-height: 40px;
  height: 40px;
}
.activity-upload-fields textarea {
  resize: vertical;
  min-height: 76px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.activity-upload-controls-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-1_5);
  align-items: start;
}
.activity-upload-visibility-card {
  border: 0;
  border-radius: var(--radius-sm);
  padding: var(--space-1_5) var(--space-2);
  display: grid;
  gap: var(--space-1_5);
  background: var(--neu-surface);
  box-shadow: var(--neu-raised-sm);
}
.activity-upload-post-visibility {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--space-2);
}
.activity-upload-mini-label {
  color: var(--muted);
  font-size: var(--fs-xs);
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.activity-upload-post-visibility select {
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--neu-surface);
  color: var(--text);
  padding: 8px 12px;
  font-size: var(--fs-sm);
  height: 32px;
  box-shadow: var(--neu-inset);
  transition: box-shadow var(--theme-transition), color var(--theme-transition), background var(--theme-transition);
}
.activity-upload-post-visibility select:focus-visible {
  outline: 0;
  box-shadow: var(--neu-inset), var(--neu-ring);
}
.activity-upload-metric-visibility {
  border: 0;
  border-radius: 0;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.activity-upload-metric-visibility label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.activity-upload-visibility-head {
  color: color-mix(in srgb, var(--text) 80%, var(--neu-surface));
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.activity-upload-images {
  border: 0;
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  display: grid;
  gap: var(--space-2);
  align-self: start;
  background: var(--neu-surface);
  box-shadow: var(--neu-raised-sm);
}
.activity-upload-images-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.activity-upload-images-preview {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-1);
}
.activity-upload-images-preview .upload-photo-card {
  flex: 0 0 92px;
  width: 92px;
  max-width: 92px;
  border: 0;
  background: var(--neu-surface);
  border-radius: var(--radius-sm);
  padding: 6px;
  cursor: pointer;
  text-align: left;
  transform: none;
  transition: box-shadow 180ms ease, transform 180ms ease;
  box-shadow: var(--neu-raised-xs);
}
[data-theme="dark"] .activity-upload-images-preview .upload-photo-card {
  background: var(--neu-surface);
}
.activity-upload-images-preview .upload-photo-card:hover,
.activity-upload-images-preview .upload-photo-card:focus-visible {
  box-shadow: var(--neu-raised-sm), var(--neu-ring);
  transform: translateY(-1px);
  outline: 0;
}
.activity-upload-images-preview .upload-photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-xs);
  border: 1px solid var(--photo-frame-inner);
  background: var(--photo-fill);
}
.activity-upload-images-preview .upload-photo-caption {
  margin-top: var(--space-1_5);
  display: block;
  font-size: var(--fs-2xs);
  color: color-mix(in srgb, var(--text) 64%, var(--neu-surface));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-upload-note {
  margin: 0;
  min-height: 1.2em;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.activity-upload-note.error {
  color: var(--danger);
}
.activity-upload-actions {
  display: inline-flex;
  justify-self: end;
  gap: var(--space-2);
}
.activity-upload-intervals-toggle input[type="checkbox"] {
  flex: 0 0 auto;
}
.activity-edit-overlay {
  z-index: 90;
}
.activity-edit-photo-card {
  position: relative;
}
.activity-edit-photo-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--stroke));
  background: color-mix(in srgb, var(--panel-solid) 88%, var(--bg));
  color: var(--danger);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.activity-edit-photo-remove:hover {
  background: color-mix(in srgb, var(--danger) 12%, var(--panel-solid));
}
.activity-edit-photo-remove svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.edit-profile-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 88;
  display: grid;
  justify-items: center;
  align-items: center;
  padding: var(--space-4);
  overflow-y: auto;
}
.edit-profile-overlay[hidden] {
  display: none;
}
.edit-profile-sheet {
  position: relative;
  width: min(620px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: var(--panel-solid);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: grid;
  gap: var(--space-3);
  margin: 0;
}

.login-sheet,
.admin-sheet,
.profile-sheet,
.likes-sheet,
.activity-upload-sheet,
.edit-profile-sheet,
.share-sheet,
.confirm-sheet,
.route-sheet,
.workout-sheet,
.equipment-modal-sheet {
  align-self: center;
}
.edit-profile-close {
  justify-self: end;
}
.edit-profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.edit-profile-identity {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}
.edit-profile-subtitle {
  margin: var(--space-1) 0 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.edit-profile-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
.edit-profile-tab {
  min-height: 56px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke);
  background: var(--panel-solid);
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: 500;
  cursor: pointer;
  padding: 10px 16px;
  box-shadow: var(--neu-raised-sm);
  transition:
    color var(--theme-transition),
    box-shadow var(--theme-transition),
    transform var(--theme-transition);
}
.edit-profile-tab-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
.edit-profile-tab-icon {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.88;
}
.edit-profile-tab:hover {
  transform: translateY(-1px);
  box-shadow: var(--neu-raised-hover);
}
.edit-profile-tab.active {
  color: var(--text);
  box-shadow: var(--neu-inset);
  transform: none;
}
.edit-profile-tab-panel {
  display: grid;
  gap: var(--space-3);
}
.edit-profile-tab-panel[hidden] {
  display: none;
}
.avatar-prep {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  background: color-mix(in srgb, var(--accent) 4%, var(--panel-solid));
  display: grid;
  gap: var(--space-2);
}
.avatar-prep-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.avatar-prep-preview {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--stroke));
  background: color-mix(in srgb, var(--accent) 18%, var(--panel-solid));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: 600;
  flex: 0 0 auto;
}
.avatar-prep-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-prep-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.avatar-file-input {
  display: none;
}
.edit-section-title {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--accent);
}
.avatar-prep-copy {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.avatar-editor {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  background: var(--panel-solid);
  display: grid;
  gap: var(--space-2);
}
.avatar-editor[hidden] {
  display: none;
}
.avatar-editor-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--muted);
}
.avatar-editor-head span {
  color: var(--text);
  font-weight: 600;
}
.avatar-crop-wrap {
  width: 100%;
  display: grid;
  place-items: center;
}
.avatar-crop-canvas {
  width: min(320px, 100%);
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-xs);
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--accent) 4%, var(--panel-solid));
  cursor: grab;
  touch-action: none;
}
.avatar-crop-canvas.dragging {
  cursor: grabbing;
}
.avatar-zoom-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: var(--fs-2xs);
}
.avatar-zoom-label input {
  width: 100%;
}
.avatar-editor-actions {
  display: inline-flex;
  justify-self: end;
  gap: var(--space-2);
}
.avatar-prep-note {
  margin: calc(var(--space-2) * -1) 0 0;
  min-height: 1.2em;
  color: var(--muted);
  font-size: var(--fs-2xs);
}
.avatar-prep-note.error {
  color: var(--danger);
}
.fitness-edit-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}
.fitness-input-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: var(--panel-solid);
  padding: var(--space-2);
}
.fitness-input-label {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fitness-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-1_5);
  align-items: center;
}
.fitness-input-row input {
  height: 30px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--accent) 3%, var(--panel-solid));
  color: var(--text);
  padding: 0 var(--space-2);
  min-width: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.fitness-input-row input:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  outline-offset: 1px;
}
.fitness-input-row small {
  color: var(--muted);
  font-size: var(--fs-2xs);
}
.fitness-toast {
  position: absolute;
  top: var(--space-2);
  left: 50%;
  transform: translateX(-50%);
  max-width: min(320px, calc(100% - 2 * var(--space-4)));
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  border: 0;
  background: color-mix(in srgb, var(--base-core) 92%, black);
  color: color-mix(in srgb, white 94%, var(--base-core));
  font-size: var(--fs-2xs);
  font-weight: 600;
  line-height: 1.1;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--base-core) 24%, transparent);
  transition: opacity 180ms ease;
}
[data-theme="dark"] .fitness-toast {
  background: color-mix(in srgb, white 92%, var(--base-core));
  color: var(--base-core);
}
.fitness-toast.show {
  opacity: 1;
}
.fitness-toast.error {
  background: color-mix(in srgb, var(--danger) 20%, var(--base-core));
  color: color-mix(in srgb, white 94%, var(--base-core));
}
[data-theme="dark"] .fitness-toast.error {
  background: color-mix(in srgb, var(--danger) 24%, white);
  color: var(--base-core);
}
.zones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-2);
}
.zones-card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: var(--panel-solid);
  padding: var(--space-2);
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: var(--space-2);
}
.zones-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 36px;
}
.zones-head h3 {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.zones-head small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.zones-setting {
  display: grid;
  gap: 4px;
  margin-bottom: 2px;
}
.zones-setting .fitness-input-label {
  font-size: 10px;
  letter-spacing: 0.05em;
}
.zones-input-row input {
  height: 28px;
}
.zones-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid color-mix(in srgb, var(--stroke) 92%, transparent);
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: color-mix(in srgb, var(--panel-solid) 96%, var(--bg));
}
.zones-table tbody tr {
  height: auto;
}
.zones-table tbody tr + tr td {
  border-top: 1px solid color-mix(in srgb, var(--stroke) 80%, transparent);
}
.zones-table td {
  padding: 7px 8px;
  font-size: 12px;
  line-height: 1.35;
  vertical-align: top;
}
.zones-cell-label {
  width: 62%;
}
.zones-cell-zone {
  color: var(--text);
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-width: 0;
}
.zones-key {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-top: 1px;
}
.zones-name {
  color: var(--text);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.zones-cell-range {
  width: 38%;
  text-align: right;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.zones-row-empty .zones-cell-label,
.zones-row-empty .zones-cell-range {
  color: transparent;
}

.activity-upload-equipment-row {
  min-width: 220px;
}

.activity-upload-equipment-row select {
  min-width: 160px;
}

.equipment-manager {
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.equipment-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: var(--space-2);
}

.equipment-sidebar {
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--neu-surface);
  box-shadow: var(--neu-raised-sm);
  padding: var(--space-2);
  display: grid;
  gap: var(--space-2);
  align-content: space-between;
  min-height: 320px;
}

.equipment-side-list {
  display: grid;
  gap: var(--space-1_5);
  align-content: start;
}

.equipment-side-item {
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--neu-surface);
  box-shadow: var(--neu-raised-xs);
  color: var(--text);
  padding: var(--space-2) var(--space-3);
  display: grid;
  gap: 2px;
  text-align: left;
  cursor: pointer;
  transition: box-shadow var(--theme-transition), background var(--theme-transition), color var(--theme-transition), transform 120ms ease;
}

.equipment-side-item strong {
  font-size: var(--fs-xs);
  font-weight: 700;
}

.equipment-side-item small {
  color: var(--muted);
  font-size: var(--fs-2xs);
}

.equipment-side-item.active {
  background: color-mix(in srgb, var(--accent) 12%, var(--neu-surface));
  box-shadow: var(--neu-inset);
}

.equipment-side-item:hover,
.equipment-side-item:focus-visible {
  box-shadow: var(--neu-raised-sm);
}

.equipment-side-item:active {
  box-shadow: var(--neu-inset);
}

.equipment-side-add {
  width: 100%;
}

.equipment-detail {
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--neu-surface);
  box-shadow: var(--neu-raised-sm);
  padding: var(--space-2);
  min-height: 320px;
  display: grid;
  align-content: start;
  gap: var(--space-2);
}

.equipment-detail-card {
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--neu-surface);
  box-shadow: var(--neu-inset);
  padding: var(--space-3);
  display: grid;
  gap: var(--space-2);
}

.equipment-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-1_5) var(--space-2);
}

.equipment-detail-row {
  display: grid;
  gap: 1px;
}

.equipment-detail-row span {
  color: var(--muted);
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.equipment-detail-row strong {
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.equipment-mounted-wheelset {
  display: grid;
  gap: 6px;
}

.equipment-mounted-wheelset span {
  color: var(--muted);
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.equipment-mounted-wheelset select {
  width: 100%;
  min-width: 0;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 0;
  background: var(--neu-surface);
  box-shadow: var(--neu-inset);
  color: var(--text);
  padding: 0 var(--space-2);
  font-size: var(--fs-sm);
}

.equipment-parts-stack {
  display: grid;
  gap: var(--space-1_5);
  margin-top: var(--space-2);
}

.equipment-parts-stack-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}

.equipment-parts-stack-head h4 {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--text);
}

.equipment-odo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-1_5);
}

.equipment-odo-row > span {
  color: var(--muted);
  font-size: var(--fs-xs);
}

.equipment-odo-row > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-1);
  align-items: center;
}

.equipment-empty {
  color: var(--muted);
  font-size: var(--fs-xs);
  border: 0;
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  background: var(--neu-surface);
  box-shadow: var(--neu-inset);
}

.equipment-parts-cards {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-2) 0 var(--space-2_5) 0;
  margin: 0;
  min-width: 0;
  width: 100%;
  scroll-padding-inline: 0;
  scroll-padding-inline-end: var(--space-2);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.equipment-parts-cards::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.equipment-part-card {
  border: 0;
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  background: var(--neu-surface);
  box-shadow: var(--neu-raised-sm);
  transition: box-shadow var(--theme-transition), transform 140ms ease;
  flex: 0 0 clamp(228px, calc((100% - var(--space-3)) / 2.15), 332px);
  min-width: 0;
  min-height: 152px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.equipment-parts-cards > .equipment-empty {
  flex: 0 0 100%;
  max-width: 100%;
  min-height: 152px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.equipment-parts-cards > .equipment-part-card:last-child {
  margin-right: var(--space-2);
}

.equipment-part-card:hover,
.equipment-part-card:focus-within {
  box-shadow: var(--neu-raised-hover);
}

.equipment-part-card-row {
  display: grid;
  gap: 2px;
  align-content: start;
}

.equipment-part-card-row span {
  color: var(--muted);
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.equipment-part-card-row strong {
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.equipment-part-delete {
  position: absolute;
  top: var(--space-1_5);
  right: var(--space-1_5);
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: var(--neu-surface);
  color: color-mix(in srgb, var(--text) 62%, var(--neu-surface));
  box-shadow: var(--neu-raised-xs);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: box-shadow var(--theme-transition), color var(--theme-transition), transform 120ms ease;
}

.equipment-part-delete:hover,
.equipment-part-delete:focus-visible {
  color: color-mix(in srgb, #cc2b3d 74%, var(--text));
  box-shadow: var(--neu-raised-sm);
}

.equipment-part-delete:active {
  box-shadow: var(--neu-inset);
}

.equipment-part-delete-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.equipment-part-card-name {
  grid-column: 1 / -1;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.2;
  padding-right: 34px;
}

.equipment-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: var(--overlay-bg);
  display: grid;
  place-items: center;
  padding: var(--space-4);
}

.equipment-modal-overlay[hidden] {
  display: none;
}

.equipment-modal-sheet {
  position: relative;
  width: min(440px, 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  background: var(--panel-solid);
  box-shadow: var(--neu-raised-sm);
  padding: var(--space-3);
  display: grid;
  gap: var(--space-2);
}

.equipment-modal-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
}

.equipment-modal-sheet h4 {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text);
}

.equipment-modal-form {
  display: grid;
  gap: var(--space-1_5);
}

.equipment-modal-form label {
  display: grid;
  gap: 6px;
}

.equipment-modal-form label > span {
  color: var(--muted);
  font-size: var(--fs-xs);
}

.equipment-modal-form input,
.equipment-modal-form select {
  width: 100%;
  min-width: 0;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke);
  background: var(--panel-solid);
  color: var(--text);
  padding: 0 var(--space-2);
  font-size: var(--fs-sm);
}

.equipment-modal-form .equipment-odo-row input {
  height: 32px;
}

.equipment-modal-form .equipment-odo-row small {
  color: var(--muted);
  font-size: var(--fs-2xs);
}

.equipment-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-1_5);
}

.equipment-part-form .equipment-part-date,
.equipment-modal-form .equipment-part-date {
  height: 32px;
}

.equipment-part-form.is-loading-distance .equipment-part-odometer,
.equipment-modal-form.is-loading-distance #equipment-part-odometer-input {
  opacity: 0.72;
}





.photo-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--space-5);
}
.photo-overlay[hidden] {
  display: none;
}
.photo-overlay-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
}
.photo-overlay-close.icon-close-btn {
  border-color: var(--overlay-border);
  background: var(--overlay-surface);
  color: color-mix(in srgb, var(--overlay-text) 70%, transparent);
}
.photo-overlay-close.icon-close-btn:hover {
  background: color-mix(in srgb, var(--overlay-surface) 76%, var(--overlay-text) 24%);
  border-color: color-mix(in srgb, var(--overlay-text) 32%, var(--overlay-border));
  color: var(--overlay-text);
}
.photo-overlay-nav {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  transform: translateY(-50%);
}
.photo-overlay-prev {
  left: 16px;
}
.photo-overlay-next {
  right: 16px;
}
.photo-overlay-nav.icon-close-btn {
  border-color: var(--overlay-border);
  background: var(--overlay-surface);
  color: color-mix(in srgb, var(--overlay-text) 70%, transparent);
}
.photo-overlay-nav.icon-close-btn:hover {
  background: color-mix(in srgb, var(--overlay-surface) 76%, var(--overlay-text) 24%);
  border-color: color-mix(in srgb, var(--overlay-text) 32%, var(--overlay-border));
  color: var(--overlay-text);
}
.photo-overlay-nav.icon-close-btn:active {
  transform: translateY(-50%) scale(0.97);
}
.photo-overlay-nav[disabled] {
  opacity: 0.32;
  cursor: default;
  pointer-events: none;
}
.photo-overlay-figure {
  margin: 0;
  max-width: min(1400px, 96vw);
  max-height: 92vh;
  display: grid;
  gap: var(--space-3);
  justify-items: center;
}
.photo-overlay-image-stack {
  position: relative;
  width: min(1400px, 96vw);
  height: calc(92vh - 48px);
  max-width: min(1400px, 96vw);
  max-height: calc(92vh - 48px);
  border-radius: var(--radius-md);
  border: 0;
  overflow: hidden;
}
.photo-overlay-image-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 220ms ease;
  border-radius: inherit;
  box-shadow: none;
  pointer-events: none;
}
.photo-overlay-image-layer.is-visible {
  opacity: 1;
}
.photo-overlay-figure figcaption {
  color: var(--overlay-text);
  font-size: var(--fs-md);
  text-align: center;
}

.share-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 99;
  display: grid;
  place-items: center;
  padding: var(--space-4);
}
.share-overlay[hidden] {
  display: none;
}
.share-sheet {
  width: min(780px, 92vw);
  height: 60vh;
  overflow: hidden;
  background: var(--panel-solid);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  gap: 12px;
  align-items: start;
  font-family: "Lato", "Segoe UI", sans-serif;
}
.share-close {
  grid-column: 10 / -1;
  grid-row: 1;
  justify-self: end;
  align-self: center;
}
.share-preview {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-height: 0;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  justify-self: stretch;
  align-self: start;
  display: block;
  position: relative;
  background: transparent;
}
.share-preview img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: top center;
}
.share-sheet .panel-title {
  grid-column: 1 / 10;
  grid-row: 1;
  align-self: center;
  margin: 0;
  font-family: "Lato", "Segoe UI", sans-serif;
  font-weight: 700;
}
.share-preview-loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-2);
  color: var(--text);
  background: color-mix(in srgb, var(--panel-solid) 72%, transparent);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.share-overlay.is-loading .share-preview-loading {
  display: flex;
}
.share-overlay.is-loading .share-preview img {
  opacity: 0.12;
}
.share-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid color-mix(in srgb, var(--stroke) 76%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: share-spin 0.8s linear infinite;
}
@keyframes share-spin {
  to { transform: rotate(360deg); }
}
.share-actions {
  grid-column: 1 / -1;
  grid-row: 3;
  display: inline-flex;
  justify-self: end;
  gap: var(--space-2);
}
.share-actions .btn[disabled],
.share-copy-btn[disabled] {
  opacity: 0.45;
  cursor: default;
}
.share-link-row {
  grid-column: 1 / -1;
  grid-row: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
}
.share-deeplink {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  color: var(--accent);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  background: color-mix(in srgb, var(--accent) 8%, var(--panel-solid));
  font-size: var(--fs-xs);
}
.share-copy-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--accent) 8%, var(--panel-solid));
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.share-copy-btn:hover {
  background: color-mix(in srgb, var(--accent) 18%, var(--panel-solid));
}
.share-copy-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
}
.share-note {
  grid-column: 1 / -1;
  grid-row: 5;
  margin: 0;
  min-height: 1.2em;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.share-note.error {
  color: var(--danger);
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 96;
  display: grid;
  place-items: center;
  padding: var(--space-4);
}
.confirm-overlay[hidden] {
  display: none;
}
.confirm-sheet {
  width: min(440px, 92vw);
  background: var(--panel-solid);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: grid;
  gap: var(--space-3);
}
.confirm-title {
  margin: 0;
  color: var(--accent);
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.confirm-message {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-sm);
}
.confirm-message-link {
  justify-self: start;
  color: var(--accent);
  font-size: var(--fs-xs);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.confirm-message-link:hover,
.confirm-message-link:focus-visible {
  border-bottom-color: var(--accent);
}
.confirm-actions {
  display: inline-flex;
  justify-self: end;
  gap: var(--space-2);
}

.route-overlay,
.workout-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 97;
  display: grid;
  place-items: center;
  padding: var(--space-4);
}
.route-overlay[hidden],
.workout-overlay[hidden] {
  display: none;
}
.route-sheet,
.workout-sheet {
  width: min(760px, 94vw);
  max-height: 92vh;
  overflow: auto;
  background: var(--panel-solid);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: grid;
  gap: var(--space-2);
}
.route-close,
.workout-close {
  justify-self: end;
}
.route-sheet-map {
  width: 100%;
  min-height: 360px;
  height: 44vh;
  border-radius: var(--radius-sm);
}
.route-elevation-panel {
  display: grid;
  gap: var(--space-1_5);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--neu-surface);
  box-shadow: var(--neu-inset);
}
.route-elevation-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
}
.route-elevation-head > span {
  color: var(--accent);
  font-weight: 700;
  font-size: var(--fs-sm);
  letter-spacing: 0.02em;
}
.route-elevation-head > small {
  color: var(--muted);
  font-size: var(--fs-xs);
}
.route-elevation-chart-wrap {
  width: 100%;
  height: 150px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.route-elevation-chart {
  display: block;
  width: 100%;
  height: 100%;
}
.route-title-field {
  display: grid;
  gap: 6px;
}
.route-title-field > span {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.route-title-field > input {
  width: 100%;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 0;
  background: var(--neu-surface);
  color: var(--text);
  padding: 0 12px;
  font-size: var(--fs-sm);
  box-shadow: var(--neu-inset);
}
.route-visibility-field {
  justify-self: start;
  margin-top: var(--space-1);
}
.route-visibility-field > span {
  color: var(--text);
  font-size: var(--fs-sm);
}
.route-sheet-note {
  margin: 0;
  min-height: 1.2em;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.route-sheet-note.error {
  color: var(--danger);
}
.route-sheet-actions {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}
.route-sheet-delete {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--stroke));
}
.route-sheet-delete:hover {
  background: color-mix(in srgb, var(--danger) 10%, var(--neu-surface));
}
.workout-chart-panel {
  display: grid;
  gap: var(--space-1_5);
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.workout-sheet-summary {
  display: block;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.workout-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--space-2);
}
.workout-title-field {
  min-width: 0;
}
.workout-top-save {
  align-self: end;
}
.workout-sheet-footer {
  justify-content: flex-end;
}
.workout-downloads {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-1);
}
.workout-downloads-label {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.workout-downloads-links {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1_5);
}
.workout-downloads-links .btn {
  text-decoration: none;
}
.workout-downloads-links .btn[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.55;
}
.workout-sheet-chart {
  min-height: 190px;
  position: relative;
  border-radius: var(--radius-sm);
  background: transparent;
  box-shadow: none;
  padding: var(--space-1);
  display: flex;
  align-items: flex-end;
  gap: 2px;
  overflow: hidden;
}
.workout-sheet-chart .workout-interval-bar {
  border-radius: 6px 6px 4px 4px;
}
.workout-sheet-chart .workout-interval-bar.is-hover {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: -1px;
  filter: brightness(1.08);
}
.workout-sheet-tooltip {
  position: absolute;
  z-index: 2;
}
.workout-sheet-chart-empty {
  color: var(--muted);
  font-size: var(--fs-sm);
}

@media (max-width: 760px) {
  .workout-top-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }
  .workout-top-save {
    justify-self: end;
  }
  .workout-downloads {
    align-items: flex-start;
    flex-direction: column;
  }
}

:is(
  .login-overlay,
  .admin-overlay,
  .profile-overlay,
  .likes-overlay,
  .activity-upload-overlay,
  .activity-edit-overlay,
  .edit-profile-overlay,
  .photo-overlay,
  .share-overlay,
  .confirm-overlay,
  .route-overlay,
  .workout-overlay
) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 220ms ease,
    visibility 0s linear 0s;
}

:is(
  .login-overlay,
  .admin-overlay,
  .profile-overlay,
  .likes-overlay,
  .activity-upload-overlay,
  .activity-edit-overlay,
  .edit-profile-overlay,
  .photo-overlay,
  .share-overlay,
  .confirm-overlay,
  .route-overlay,
  .workout-overlay
)[hidden] {
  display: grid !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    visibility 0s linear 180ms;
}

:is(
  .login-sheet,
  .admin-sheet,
  .profile-sheet,
  .likes-sheet,
  .activity-upload-sheet,
  .activity-edit-sheet,
  .edit-profile-sheet,
  .photo-overlay-figure,
  .share-sheet,
  .confirm-sheet,
  .route-sheet,
  .workout-sheet
) {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    opacity 220ms ease,
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

:is(
  .login-overlay,
  .admin-overlay,
  .profile-overlay,
  .likes-overlay,
  .activity-upload-overlay,
  .activity-edit-overlay,
  .edit-profile-overlay,
  .photo-overlay,
  .share-overlay,
  .confirm-overlay,
  .route-overlay,
  .workout-overlay
)[hidden] :is(
  .login-sheet,
  .admin-sheet,
  .profile-sheet,
  .likes-sheet,
  .activity-upload-sheet,
  .activity-edit-sheet,
  .edit-profile-sheet,
  .photo-overlay-figure,
  .share-sheet,
  .confirm-sheet,
  .route-sheet,
  .workout-sheet
) {
  opacity: 0;
  transform: translateY(10px) scale(0.985);
}

@media (prefers-reduced-motion: reduce) {
  :is(
    .login-overlay,
    .admin-overlay,
    .profile-overlay,
    .likes-overlay,
    .activity-upload-overlay,
    .activity-edit-overlay,
    .edit-profile-overlay,
    .photo-overlay,
    .share-overlay,
    .confirm-overlay,
    .route-overlay,
    .workout-overlay
  ),
  :is(
    .login-sheet,
    .admin-sheet,
    .profile-sheet,
    .likes-sheet,
    .activity-upload-sheet,
    .activity-edit-sheet,
    .edit-profile-sheet,
    .photo-overlay-figure,
    .share-sheet,
    .confirm-sheet,
    .route-sheet,
    .workout-sheet
  ) {
    transition: none !important;
  }
}

.maplibregl-map {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: var(--map-bg);
  filter: none;
}
[class~="maplibregl-cooperative-gesture-screen"],
.maplibregl-cooperative-gesture-screen {
  z-index: 6 !important;
}
[class~="maplibregl-cooperative-gesture-screen"] .maplibregl-cooperative-gesture-screen-text,
.maplibregl-cooperative-gesture-screen .maplibregl-cooperative-gesture-screen-text {
  z-index: 7 !important;
}
[data-theme="dark"] .maplibregl-map {
  filter: none;
}
.activity-map .leaflet-container {
  width: 100%;
  height: 100%;
  background: var(--map-bg);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}
.activity-map .leaflet-tile {
  filter: grayscale(1) brightness(1.14) contrast(0.9);
}
[data-theme="dark"] .activity-map .leaflet-tile {
  filter: grayscale(0.55) brightness(0.98) saturate(0.58) contrast(1.2);
}
.activity-map .map-point-icon-wrapper {
  background: transparent;
  border: 0;
}
.activity-map .map-point-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border: 2.2px solid var(--map-marker-stroke, #FFFFFF);
  color: var(--map-marker-text, #FFFFFF);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--base-core) 52%, transparent),
    0 2px 6px color-mix(in srgb, var(--base-core) 36%, transparent);
  text-shadow: 0 1px 1px color-mix(in srgb, var(--map-marker-halo, #000000) 56%, transparent);
}
.activity-map .map-point-start {
  background: var(--map-start, #1C1C1C);
  color: var(--map-start-text, var(--map-marker-text, #FFFFFF));
}
.activity-map .map-point-end {
  background: var(--map-end, #00FF41);
  color: var(--map-end-text, var(--map-marker-text, #FFFFFF));
}

.activity-map.simple-map {
  position: relative;
  background: var(--map-bg);
}
.simple-map-root {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: var(--map-bg);
}
.simple-map-tiles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.simple-map-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  max-width: none;
  pointer-events: none;
  user-select: none;
  filter: grayscale(1) brightness(1.14) contrast(0.9);
}
[data-theme="dark"] .simple-map-tile {
  filter: grayscale(0.55) brightness(0.98) saturate(0.58) contrast(1.2);
}
.simple-map-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.simple-map-attrib {
  position: absolute;
  right: 6px;
  bottom: 6px;
  font-size: 10px;
  color: color-mix(in srgb, var(--text) 68%, var(--bg));
  background: color-mix(in srgb, var(--panel-solid) 86%, transparent);
  border: 1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
  border-radius: 4px;
  padding: 1px 4px;
  line-height: 1.2;
}
.simple-map-attrib a {
  color: inherit;
  text-decoration: none;
}
.activity-map.simple-map-no-tiles .simple-map-tiles {
  opacity: 0;
}
.activity-map.simple-map-no-tiles .simple-map-root {
  background: linear-gradient(135deg, color-mix(in srgb, var(--map-bg) 94%, var(--panel-solid)), color-mix(in srgb, var(--map-bg) 88%, var(--bg)));
}
.map-interval-segment-pulse {
  animation: map-segment-pulse 560ms ease-out;
}
@keyframes map-segment-pulse {
  0% { opacity: 0.45; }
  45% { opacity: 1; }
  100% { opacity: 0.9; }
}

.analysis-title { margin-bottom: var(--space-2); }

.insights-panel {
  display: none;
  opacity: 0;
  transform: translateX(24px);
}
.activity-card.show-insights .insights-panel,
.activity-card.is-collapsing .insights-panel {
  display: block;
  transition: opacity 220ms ease, transform 220ms ease;
}
.activity-card.show-insights .insights-panel {
  opacity: 1;
  transform: translateX(0);
}
.activity-card.is-collapsing .insights-panel {
  opacity: 0;
  transform: translateX(24px);
  pointer-events: none;
}

.activity-card.show-insights .detail-box {
  display: flex;
  flex-direction: column;
  min-height: 430px;
}
.activity-card.show-insights .detail-box .chart-wrap {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.activity-card.show-insights .detail-box .analysis-chart-wrap {
  flex: 0 0 clamp(170px, 28vh, 240px);
  height: clamp(170px, 28vh, 240px);
  min-height: 170px;
  max-height: 240px;
}
.activity-card.show-insights .detail-box .analysis-chart {
  height: 100%;
}
.metric-table {
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}
.metric-table div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid color-mix(in srgb, var(--stroke) 62%, transparent);
  font-size: var(--fs-sm);
}
.metric-table div:last-child { border-bottom: 0; }
.metric-table span { color: var(--muted); }
.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
}
.chart-toggle {
  flex: 0 0 auto;
}

.neu-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 20px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: var(--neu-surface);
  box-shadow:
    var(--neu-inset),
    inset 0 0 0 1px color-mix(in srgb, var(--stroke) 88%, transparent);
  position: relative;
  cursor: pointer;
  transition:
    box-shadow var(--theme-transition),
    background var(--theme-transition),
    opacity var(--theme-transition);
}
.neu-switch::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: color-mix(in srgb, white 78%, var(--neu-surface));
  box-shadow: var(--neu-raised-xs);
  transition: transform var(--theme-transition), background var(--theme-transition), box-shadow var(--theme-transition);
}
.neu-switch:checked {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent) 66%, white 34%),
    color-mix(in srgb, var(--accent) 84%, var(--base-core))
  );
  box-shadow:
    var(--neu-inset),
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 86%, transparent),
    0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent);
}
.neu-switch:checked::before {
  transform: translateX(14px);
  background: color-mix(in srgb, white 96%, var(--accent));
  box-shadow:
    var(--neu-raised-xs),
    0 0 0 1px color-mix(in srgb, var(--accent) 56%, transparent);
}
.neu-switch:focus-visible {
  outline: 0;
  box-shadow:
    var(--neu-inset),
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 54%, transparent),
    var(--neu-ring);
}
.neu-switch:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.chart-wrap { margin-top: var(--space-3); }
.analysis-chart-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  contain: layout paint;
}
.analysis-chart-wrap.is-brushing {
  cursor: col-resize;
}
.analysis-chart {
  display: block;
  width: 100%;
  height: 140px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--chart-surface-top), var(--chart-surface-bottom));
}
.chart-brush {
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 0;
  width: 0;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 52%, transparent);
  pointer-events: none;
  display: none;
  z-index: 2;
}
[data-theme="dark"] .analysis-chart {
  background: linear-gradient(180deg, var(--chart-surface-top), var(--chart-surface-bottom));
}
.chart-crosshair {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: color-mix(in srgb, var(--muted) 60%, transparent);
  pointer-events: none;
  display: none;
}
.chart-tooltip {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
  background: color-mix(in srgb, var(--panel-solid) 92%, var(--panel));
  font-size: var(--fs-2xs);
  line-height: 1.25;
  color: var(--text);
  pointer-events: none;
  display: none;
  min-width: 130px;
}

.social-grid {
  margin-top: var(--space-3);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
}
.activity-card.show-insights .social-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
.activity-card.show-insights.comments-sticky-enabled .comments-box {
  position: sticky;
  top: var(--comments-sticky-top, 78px);
  align-self: start;
  z-index: 3;
}
.activity-card.show-insights .laps-box {
  display: block;
  max-height: none;
}
.laps-table-wrap {
  overflow: visible;
}
.laps-table-wrap thead th {
  position: static;
}
.activity-card.show-insights .laps-table-wrap {
  max-height: clamp(180px, 42vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
}

.comments-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}
.social-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.like-btn {
  border: 1px solid var(--stroke);
  background: var(--panel-solid);
  color: var(--accent);
  border-radius: 999px;
  height: 36px;
  min-width: 48px;
  padding: 0 var(--space-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}
.like-icon {
  width: 18px;
  height: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}
.like-icon-svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.95;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.like-btn.liked .like-icon-svg {
  fill: color-mix(in srgb, var(--accent) 26%, transparent);
}
.like-btn.liked {
  background: color-mix(in srgb, var(--accent) 18%, var(--panel-solid));
  border-color: color-mix(in srgb, var(--accent) 45%, var(--stroke));
}
.like-count {
  min-width: 24px;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--muted);
}

.comments-list {
  margin-top: var(--space-2);
  display: grid;
  gap: var(--space-2);
}
.comment-item {
  border: 1px solid color-mix(in srgb, var(--stroke) 72%, transparent);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3);
  background: color-mix(in srgb, var(--panel-solid) 90%, var(--panel));
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: var(--space-2);
  align-items: start;
}
.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--stroke));
  background: color-mix(in srgb, var(--accent) 24%, var(--panel-solid));
  color: var(--text);
  font-size: var(--fs-2xs);
  font-weight: 700;
}
.comment-avatar img,
.compose-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.comment-top {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--fs-sm);
}
.comment-profile-btn.comment-avatar {
  cursor: pointer;
  padding: 0;
}
.comment-profile-btn.comment-avatar:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 44%, var(--stroke));
  outline-offset: 1px;
}
.comment-author-btn {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  cursor: pointer;
}
.comment-author-btn .comment-handle {
  margin-left: 0;
}
.comment-author-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 44%, var(--stroke));
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
.comment-handle,
.comment-time {
  color: var(--muted);
  font-size: var(--fs-xs);
}
.comment-time {
  margin-left: auto;
}
.comment-delete-btn {
  margin-left: var(--space-2);
  padding: 2px 8px;
  min-height: 24px;
  font-size: var(--fs-xs);
  line-height: 1.2;
}
.comment-body p {
  margin: var(--space-1_5) 0 0;
  max-width: 66ch;
  font-size: var(--fs-body);
  line-height: 1.55;
}

.comment-compose {
  margin-top: var(--space-4);
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: var(--space-2);
  align-items: center;
}
.compose-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--stroke));
  background: color-mix(in srgb, var(--accent) 24%, var(--panel-solid));
  color: var(--text);
  font-size: var(--fs-2xs);
  font-weight: 700;
}
.comment-input {
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--panel-solid);
  color: var(--text);
  padding: 0 var(--space-3);
  min-width: 0;
}
.comment-submit {
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--accent) 18%, var(--panel-solid));
  color: var(--text);
  padding: 0 var(--space-4);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}
.comment-login-hint {
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px dashed color-mix(in srgb, var(--accent) 34%, var(--stroke));
  color: var(--muted);
  font-size: var(--fs-sm);
}

@media (min-width: 980px) {
  .activity-upload-sheet {
    --upload-metric-gap: var(--space-1_5);
    --upload-half-card-width: calc(50% - (var(--upload-metric-gap) / 2));
    --upload-source-card-width: var(--upload-half-card-width);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "close close"
      "head head"
      "metrics metrics"
      "fields route"
      "intervals intervals"
      "images images"
      "note note"
      "actions actions";
    align-content: start;
    align-items: stretch;
  }
  .activity-edit-sheet {
    grid-template-areas:
      "close close"
      "head head"
      "metrics metrics"
      "fields route"
      "intervals intervals"
      "images images"
      "note note"
      "actions actions";
  }
  .activity-upload-close { grid-area: close; }
  .activity-upload-head { grid-area: head; }
  .activity-upload-metrics { grid-area: metrics; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .activity-upload-source {
    width: var(--upload-source-card-width);
    max-width: var(--upload-source-card-width);
    min-width: 0;
    flex: 0 0 auto;
  }
  .activity-upload-route {
    grid-area: route;
    width: 100%;
    max-width: none;
    justify-self: stretch;
    align-self: stretch;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .activity-upload-intervals { grid-area: intervals; }
  .activity-upload-fields { grid-area: fields; }
  .activity-upload-images { grid-area: images; }
  .activity-upload-note { grid-area: note; margin: 0; }
  .activity-upload-actions { grid-area: actions; margin-top: var(--space-1); }
  .activity-upload-fields textarea { min-height: 72px; }
  .activity-upload-fields {
    align-self: stretch;
  }
  .activity-upload-map {
    min-height: 0;
    height: 100%;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes insightsSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

table { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); }
th,
td { text-align: left; padding: var(--space-2) var(--space-2); border-bottom: 1px solid var(--stroke); }
th { color: var(--muted); font-weight: 700; }
.lap-highlight-row { cursor: pointer; }
.lap-highlight-row:hover td,
.lap-highlight-row:focus-visible td {
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-solid));
}
.lap-highlight-row.lap-highlight-active td {
  background: color-mix(in srgb, var(--accent) 14%, var(--panel-solid));
}
.laps-box td.lap-peak-cell {
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 1250px) {
  .map-box { grid-template-rows: auto minmax(0, 2.6fr) minmax(0, 1fr); min-height: 360px; }
  .activity-map { min-height: 220px; aspect-ratio: 16 / 8; height: auto; }
  .activity-card.show-insights .detail-box { min-height: 360px; }
}

@media (max-width: 1000px) {
  .layout {
    grid-template-columns: 124px minmax(0, 1fr);
    gap: var(--space-3);
  }
  .left-panel {
    position: sticky;
    top: 78px;
    align-self: start;
    max-height: none;
    overflow: visible;
    padding: var(--space-2);
  }
  .left-panel .panel-title {
    font-size: var(--fs-2xs);
    letter-spacing: 0.05em;
  }
  .left-panel .feed-link {
    margin-top: var(--space-1_5);
    padding: var(--space-1_5) var(--space-2);
    font-size: var(--fs-xs);
    line-height: 1.25;
    border-radius: var(--radius-sm);
  }
  .left-panel .feed-count {
    font-size: var(--fs-2xs);
  }
  .left-panel .feed-label {
    display: none;
  }
  .left-panel .feed-symbol {
    width: 24px;
    height: 24px;
  }
  .left-panel .feed-icon {
    width: 13px;
    height: 13px;
    stroke-width: 1.9;
  }
  .left-panel .spacer,
  .left-panel .private-training-head,
  .left-panel .unit-switch,
  .left-panel .metric-grid,
  .left-panel .training-chart-wrap,
  .left-panel .body-metrics {
    display: none;
  }
}

@media (max-width: 860px) {
  .topbar { position: static; }
  .expanded-grid { grid-template-columns: 1fr; }
  .social-grid { grid-template-columns: 1fr; }
  .activity-card.show-insights .expanded-grid {
    position: static;
    top: auto;
  }
  .activity-card.show-insights.comments-sticky-enabled .comments-box {
    position: static;
    top: auto;
  }
  .trackbook-head { align-items: flex-start; }
  .map-box { grid-template-rows: auto auto auto; min-height: 0; }
  .activity-map { min-height: 190px; aspect-ratio: 16 / 8; height: auto; }
  .trackbook-collapsed-map,
  .activity-map.trackbook-collapsed-map {
    min-height: 190px;
    height: 190px;
    max-height: 190px;
    flex-basis: 190px;
  }
  .photo-card { flex-basis: clamp(90px, 26vw, 122px); max-width: 122px; }
  .insights-toggle { height: 26px; width: 26px; font-size: var(--fs-xs); }
  .comment-compose { grid-template-columns: 30px 1fr; }
  .comment-submit { grid-column: span 2; }
  .training-legend small { width: 100%; margin-left: 0; }
  .avatar-prep-main {
    flex-direction: column;
    align-items: flex-start;
  }
  .avatar-prep-actions {
    width: 100%;
  }
  .avatar-editor-actions {
    justify-self: stretch;
    justify-content: flex-end;
  }
  .fitness-edit-list {
    grid-template-columns: 1fr;
  }
  .zones-grid {
    grid-template-columns: 1fr;
  }
  .equipment-layout {
    grid-template-columns: 1fr;
  }
  .equipment-part-card {
    flex: 0 0 88%;
    max-width: 88%;
  }
  .equipment-sidebar,
  .equipment-detail {
    min-height: 0;
  }
  .edit-profile-sheet {
    padding: var(--space-3);
  }
  .activity-upload-sheet {
    padding: var(--space-3);
  }
  .activity-upload-meta-line {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .activity-upload-source {
    flex: 1 1 100%;
    min-width: 0;
  }
  .activity-upload-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .activity-upload-images-head {
    flex-wrap: wrap;
  }
  .activity-upload-actions {
    justify-self: stretch;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .topbar,
  .brand,
  .brand-mark,
  .tagline,
  .panel,
  .hbox,
  .btn,
  .feed-link,
  .metric-box,
  .training-chart-wrap,
  #trainingChart,
  .analysis-chart,
  .chart-tooltip,
  .panel-title,
  .title,
  .desc,
  .summary-label,
  .summary-item strong,
  .visibility,
  .sport-pill,
  .like-btn,
  .like-count,
  .comment-item,
  .comment-input,
  .comment-submit,
  .activity-avatar,
  .comment-avatar,
  .compose-avatar,
  .photo-card,
  .photo-caption,
  .photo-strip-wrap::after,
  .maplibregl-map,
  .bg-blur {
    transition: none;
  }
}

/* Neumorphism redesign */
:root {
  --neu-bg: #f8f8f8;
  --neu-surface: #ffffff;
  --neu-shadow-dark: rgba(186, 190, 196, 0.52);
  --neu-shadow-light: rgba(255, 255, 255, 0.98);
  --neu-raised: 0 9px 20px color-mix(in srgb, var(--neu-shadow-dark) 76%, transparent), 0 -9px 20px color-mix(in srgb, var(--neu-shadow-light) 86%, transparent);
  --neu-raised-sm: 0 6px 13px color-mix(in srgb, var(--neu-shadow-dark) 72%, transparent), 0 -6px 13px color-mix(in srgb, var(--neu-shadow-light) 82%, transparent);
  --neu-raised-xs: 0 3px 8px color-mix(in srgb, var(--neu-shadow-dark) 64%, transparent), 0 -3px 8px color-mix(in srgb, var(--neu-shadow-light) 76%, transparent);
  --neu-raised-hover: 0 11px 24px color-mix(in srgb, var(--neu-shadow-dark) 82%, transparent), 0 -11px 24px color-mix(in srgb, var(--neu-shadow-light) 90%, transparent);
  --neu-inset: inset 0 6px 12px color-mix(in srgb, var(--neu-shadow-dark) 68%, transparent), inset 0 -6px 12px color-mix(in srgb, var(--neu-shadow-light) 84%, transparent);
  --neu-ring: 0 0 0 2px color-mix(in srgb, var(--accent) 42%, transparent);

  --bg: var(--neu-bg);
  --panel: var(--neu-surface);
  --panel-solid: var(--neu-surface);
  --stroke: color-mix(in srgb, var(--base-core) 5%, var(--neu-bg));
  --text: #161a21;
  --muted: #586270;
  --overlay-bg: rgba(255, 255, 255, 0.72);

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
}

[data-theme="dark"] {
  --neu-bg: #20262e;
  --neu-surface: #252c36;
  --neu-shadow-dark: rgba(9, 12, 17, 0.8);
  --neu-shadow-light: rgba(255, 255, 255, 0.05);
  --neu-raised: 0 9px 20px color-mix(in srgb, var(--neu-shadow-dark) 86%, transparent), 0 -9px 20px color-mix(in srgb, var(--neu-shadow-light) 60%, transparent);
  --neu-raised-sm: 0 6px 13px color-mix(in srgb, var(--neu-shadow-dark) 88%, transparent), 0 -6px 13px color-mix(in srgb, var(--neu-shadow-light) 56%, transparent);
  --neu-raised-xs: 0 3px 8px color-mix(in srgb, var(--neu-shadow-dark) 84%, transparent), 0 -3px 8px color-mix(in srgb, var(--neu-shadow-light) 48%, transparent);
  --neu-raised-hover: 0 11px 24px color-mix(in srgb, var(--neu-shadow-dark) 92%, transparent), 0 -11px 24px color-mix(in srgb, var(--neu-shadow-light) 62%, transparent);
  --neu-inset: inset 0 7px 14px color-mix(in srgb, var(--neu-shadow-dark) 90%, transparent), inset 0 -7px 14px color-mix(in srgb, var(--neu-shadow-light) 58%, transparent);
  --stroke: color-mix(in srgb, white 7%, var(--neu-bg));
  --text: #f0f4fa;
  --muted: #c2ccd9;
  --overlay-bg: rgba(8, 10, 14, 0.72);

  --bg: var(--neu-bg);
  --panel: var(--neu-surface);
  --panel-solid: var(--neu-surface);
}

body {
  background:
    radial-gradient(1300px 720px at -18% -24%, color-mix(in srgb, white 98%, #f0f0f0 2%) 0%, transparent 64%),
    radial-gradient(1200px 740px at 120% 122%, color-mix(in srgb, #f2f2f2 10%, var(--neu-bg)) 0%, transparent 68%),
    var(--neu-bg);
}

[data-theme="dark"] body {
  background:
    radial-gradient(1300px 720px at -18% -24%, color-mix(in srgb, white 4%, var(--neu-bg)) 0%, transparent 64%),
    radial-gradient(1200px 740px at 120% 122%, color-mix(in srgb, white 3%, var(--neu-bg)) 0%, transparent 68%),
    var(--neu-bg);
}

.bg-blur {
  display: none;
}

.topbar,
.panel,
.activity-card,
.hbox,
.login-sheet,
.admin-sheet,
.profile-sheet,
.activity-upload-sheet,
.edit-profile-sheet,
.share-sheet,
.confirm-sheet,
.route-sheet,
.workout-sheet {
  background: var(--neu-surface);
  border: 0;
  box-shadow: var(--neu-raised);
  backdrop-filter: none;
}

.timeline-empty,
.admin-users-wrap,
.activity-upload-source,
.activity-upload-metrics div,
.activity-upload-visibility-card,
.activity-upload-images,
.chart-tooltip,
.comment-item,
.profile-row,
.photo-card,
.trackbook-collapsed-photo {
  border: 0;
  background: var(--neu-surface);
  box-shadow: var(--neu-raised-sm);
}

.activity-map,
.analysis-chart-wrap,
.analysis-chart,
.training-chart-wrap,
#trainingChart,
.activity-upload-map,
.activity-upload-interval-chart,
.activity-upload-post-visibility select,
.login-form input,
.activity-upload-fields > label > input,
.activity-upload-fields > label > textarea,
.fitness-input-row input,
.comment-input,
textarea,
select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
  border: 0;
  background: var(--neu-surface);
  box-shadow: var(--neu-inset);
}

.btn,
.feed-link,
.follow-btn,
.like-btn,
.activity-actions-toggle,
.insights-toggle,
.icon-close-btn,
.desc-toggle,
.comment-submit,
.profile-tab,
.edit-profile-tab,
.unit-option,
.accent-swatch,
.activity-upload-images-preview .upload-photo-card {
  border: 0;
  background: var(--neu-surface);
  box-shadow: var(--neu-raised-sm);
}

/* Keep key color swatches visible in the picker. */
.accent-swatch {
  background: var(--swatch-color, var(--accent));
}

/* Keep description disclosure text-only (no neumorphic surface). */
.desc-toggle {
  background: transparent;
  box-shadow: none;
}

/* Keep primary buttons legible and accent-driven; secondary stays neutral. */
.btn:not(.secondary) {
  background: linear-gradient(145deg, var(--accent), var(--btn-accent-end));
  color: var(--on-accent);
}

.btn.secondary,
.comment-delete-btn.btn.secondary {
  background: var(--neu-surface);
  color: var(--text);
}

.btn:hover,
.feed-link:hover,
.follow-btn:hover,
.like-btn:hover,
.activity-actions-toggle:hover,
.insights-toggle:hover,
.icon-close-btn:hover,
.comment-submit:hover {
  filter: brightness(1.02);
}

.btn:active,
.feed-link:active,
.follow-btn:active,
.like-btn:active,
.activity-actions-toggle:active,
.insights-toggle:active,
.icon-close-btn:active,
.comment-submit:active {
  box-shadow: var(--neu-inset);
}

.btn:focus-visible,
.feed-link:focus-visible,
.follow-btn:focus-visible,
.like-btn:focus-visible,
.activity-actions-toggle:focus-visible,
.insights-toggle:focus-visible,
.icon-close-btn:focus-visible,
.comment-submit:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--neu-inset), var(--neu-ring);
}

.activity-card {
  border: 0;
}

.activity-card:hover {
  border-color: transparent;
  box-shadow: var(--neu-raised-hover);
}

.summary-strip {
  gap: var(--space-3);
}

.summary-item {
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--neu-surface);
  border: 0;
  box-shadow: var(--neu-raised-xs);
}

.summary-label {
  color: color-mix(in srgb, var(--text) 68%, var(--neu-surface));
}

.metric-table div {
  border-bottom: 0;
  border-radius: var(--radius-sm);
  margin-top: var(--space-1_5);
  background: var(--neu-surface);
  box-shadow: var(--neu-raised-xs);
}

.metric-table div:first-child {
  margin-top: 0;
}

.visibility,
.live-pill,
.sport-pill,
.mutual-pill,
.admin-role-pill {
  border: 0;
  background: color-mix(in srgb, var(--neu-surface) 88%, var(--accent) 12%);
  box-shadow: var(--neu-raised-xs);
}

.title {
  letter-spacing: -0.012em;
}

.desc {
  color: color-mix(in srgb, var(--text) 74%, var(--neu-surface));
}

.map-head,
.pulse-meta,
.comment-time,
.comment-handle,
.photo-caption,
.activity-upload-mini-label,
.activity-upload-source small,
.activity-upload-note,
.profile-row-handle,
.admin-user-handle {
  color: color-mix(in srgb, var(--text) 60%, var(--neu-surface));
}

.comment-compose,
.activity-upload-images-preview .upload-photo-card,
.activity-upload-source,
.activity-upload-route,
.activity-upload-intervals,
.activity-upload-visibility-card,
.activity-upload-images,
.fitness-input-card,
.zones-card,
.yearly-progress,
.metric-grid .metric-box {
  border: 0;
  background: var(--neu-surface);
  box-shadow: var(--neu-raised-sm);
}

.training-chart-wrap {
  margin-top: var(--space-3);
  background: transparent;
  box-shadow: none;
}

.training-legend {
  margin-top: var(--space-1);
}

.body-metrics {
  background: transparent;
  box-shadow: none;
  border: 0;
}

.body-metrics div {
  background: transparent;
  box-shadow: none;
}

.yearly-progress {
  background: transparent;
  box-shadow: none;
  border: 0;
}

.photo-card:hover,
.photo-card:focus-visible,
.trackbook-collapsed-photo:hover,
.trackbook-collapsed-photo:focus-visible {
  box-shadow: var(--neu-raised);
}

/* Flatten Pulse composer controls to avoid stacked neumorphic surfaces */
.comments-box .comment-compose {
  background: transparent;
  box-shadow: none;
}

.comments-box .compose-avatar,
.comments-box .comment-input,
.comments-box .comment-submit {
  background: transparent;
  box-shadow: none;
  border: 0;
}

.comments-box .comment-input,
.comments-box .comment-submit {
  background: var(--neu-surface);
  box-shadow: var(--neu-inset);
}

.comments-box .comment-submit {
  color: var(--text);
}

.comments-box .comment-input:focus-visible,
.comments-box .comment-submit:focus-visible {
  box-shadow: none;
  outline: 2px solid color-mix(in srgb, var(--accent) 38%, transparent);
  outline-offset: 1px;
}

/* Keep chart surfaces visually aligned with neumorphic theme, especially in dark mode */
#trainingChart,
.analysis-chart {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--neu-surface) 96%, var(--neu-bg)),
    color-mix(in srgb, var(--neu-surface) 88%, var(--neu-bg))
  );
}

[data-theme="dark"] .analysis-chart-wrap {
  background: color-mix(in srgb, var(--neu-bg) 82%, #11161d);
  box-shadow: var(--neu-inset);
}

[data-theme="dark"] #trainingChart,
[data-theme="dark"] .analysis-chart {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #121923 72%, var(--neu-surface)),
    color-mix(in srgb, #0f141c 74%, var(--neu-bg))
  );
}
