:root {
  --bg: #f7f9f8;
  --surface: #ffffff;
  --surface-soft: #eef5f1;
  --text: #17211c;
  --muted: #65736c;
  --faint: #8b9891;
  --border: #dbe4df;
  --green: #1f8a5b;
  --green-dark: #146943;
  --green-soft: #dff2e9;
  --blue: #1676d2;
  --orange: #f08a24;
  --shadow: 0 18px 52px rgba(24, 42, 35, 0.08);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 22px;
  background: #fbfcfb;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--green);
  color: #fff;
}

.brand-mark svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.brand h1,
.brand p,
.topbar h2,
.panel h3 {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
  line-height: 1.15;
}

.brand p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.upload-card {
  min-height: 178px;
  padding: 22px;
  border: 1.5px dashed #b9c9c0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff 0%, #f1f8f4 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.upload-card.compact {
  min-height: 146px;
  padding: 18px;
}

.upload-card.dragging {
  border-color: var(--green);
  background: #edf9f2;
  transform: translateY(-1px);
}

.upload-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.upload-card strong {
  color: var(--text);
  font-size: 16px;
}

.upload-card span {
  font-size: 14px;
  line-height: 1.45;
}

.upload-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--green-soft);
  color: var(--green);
}

.upload-icon.coros {
  background: #e9f0ff;
  color: var(--blue);
}

.upload-icon svg,
.nav-item svg,
.ghost-button svg,
.primary-button svg,
.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-state {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.state-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  color: var(--muted);
  font-size: 13px;
}

.state-row strong {
  color: var(--text);
  text-align: right;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-button,
.primary-button,
.icon-button,
.chip {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  min-height: 38px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.ghost-button {
  width: 100%;
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 650;
}

.ghost-button:hover,
.icon-button:hover,
.chip:hover {
  border-color: #aec4b7;
  background: #f4faf6;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}

.nav-item.active,
.nav-item:hover {
  background: #eef6f2;
  color: var(--green-dark);
}

.workspace {
  min-width: 0;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.section-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.topbar h2 {
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

.toolbar,
.map-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  width: 42px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 750;
}

.primary-button:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
  min-height: 126px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.metric-card strong {
  margin-top: 12px;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: 0;
}

.metric-card small {
  margin-top: 8px;
  color: var(--faint);
  font-size: 13px;
}

.metric-card.accent {
  background: linear-gradient(180deg, #1d8a5c 0%, #176b48 100%);
  border-color: #176b48;
  color: #fff;
}

.metric-card.accent span,
.metric-card.accent small {
  color: rgba(255, 255, 255, 0.78);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}

.panel h3 {
  font-size: 18px;
  line-height: 1.2;
}

.chip {
  min-height: 32px;
  padding: 0 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chip.active {
  background: var(--green-soft);
  border-color: #b8dec9;
  color: var(--green-dark);
}

.map-canvas {
  position: relative;
  padding: 16px;
  background: #f5f8f6;
}

.route-map {
  width: 100%;
  aspect-ratio: 1.65;
  border-radius: var(--radius);
  overflow: hidden;
  background: #dfe9e4;
  z-index: 0;
}

.route-map .leaflet-control-zoom a {
  color: var(--text);
}

.route-map .leaflet-control-attribution {
  max-width: calc(100% - 16px);
  color: #4d5b54;
  font-size: 10px;
  line-height: 1.25;
}

.route-map .leaflet-control-attribution a {
  color: #245f93;
}

.map-status {
  position: absolute;
  top: 28px;
  left: 28px;
  z-index: 650;
  display: none;
  max-width: min(320px, calc(100% - 56px));
  padding: 9px 11px;
  border: 1px solid rgba(207, 218, 212, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  box-shadow: 0 8px 22px rgba(24, 42, 35, 0.12);
}

.map-status.show {
  display: block;
}

.map-status.error {
  border-color: #efc6bd;
  background: #fff6f3;
  color: #9d2d1f;
}

.map-legend {
  position: absolute;
  right: 28px;
  bottom: 28px;
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(207, 218, 212, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  backdrop-filter: blur(10px);
  z-index: 650;
  pointer-events: none;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-start {
  background: var(--green);
}

.legend-end {
  background: var(--orange);
}

.legend-route {
  background: var(--blue);
}

.detail-panel {
  display: flex;
  flex-direction: column;
}

.detail-list {
  margin: 0;
  padding: 8px 18px 4px;
}

.detail-list div {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: 0;
}

.detail-list dd {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.quality-box {
  margin: auto 18px 18px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  border: 1px solid #d2e5da;
}

.quality-box strong {
  display: block;
  margin-bottom: 7px;
}

.quality-box p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
}

.pacing-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 20px;
}

.fueling-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
}

.injury-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
  gap: 20px;
}

.baseline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.baseline-card {
  min-height: 104px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfcfb;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.baseline-card span,
.strategy-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.baseline-card strong {
  font-size: 26px;
  line-height: 1.05;
}

.baseline-card small {
  color: var(--faint);
  font-size: 12px;
}

.coros-hint {
  margin: 0 18px 18px;
  padding: 14px 15px;
  border-radius: var(--radius);
  border: 1px solid #d0dbe4;
  background: #f2f7fd;
}

.coros-hint strong {
  display: block;
  margin-bottom: 6px;
}

.coros-hint p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.strategy-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.strategy-summary div {
  padding: 15px;
  border-radius: var(--radius);
  background: #f7faf8;
  border: 1px solid var(--border);
}

.strategy-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 21px;
  line-height: 1.1;
}

.strategy-table-wrap {
  max-height: 320px;
  border-top: 1px solid var(--border);
}

.strategy-note {
  margin: 0;
  padding: 14px 18px 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.fuel-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.fuel-controls label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.fuel-controls input,
.fuel-controls select {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.fuel-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px 18px;
}

.fuel-metrics div {
  min-height: 104px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.fuel-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.fuel-metrics strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
  line-height: 1.08;
}

.fuel-metrics small {
  display: block;
  margin-top: 8px;
  color: var(--faint);
  font-size: 12px;
}

.fuel-note {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.fuel-table-wrap {
  max-height: 300px;
}

.evidence-box {
  margin: 16px 18px 18px;
  padding: 14px 15px;
  border: 1px solid #d9e2dd;
  border-radius: var(--radius);
  background: #f7faf8;
}

.evidence-box strong {
  display: block;
  margin-bottom: 6px;
}

.evidence-box p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.injury-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.injury-status {
  min-height: 116px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfcfb;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.injury-status span,
.advice-label,
.physiology-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.injury-status strong {
  display: block;
  margin-top: 10px;
  font-size: 22px;
  line-height: 1.08;
}

.injury-status small {
  display: block;
  margin-top: 8px;
  color: var(--faint);
  font-size: 12px;
}

.injury-advice-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px 18px;
}

.injury-card {
  min-height: 232px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.injury-card.priority-high {
  border-color: #efc6bd;
  background: linear-gradient(180deg, #fff 0%, #fff6f3 100%);
}

.advice-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.advice-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #eef6f2;
  color: var(--green-dark);
}

.injury-card.priority-high .advice-icon {
  background: #ffe6de;
  color: #bd432f;
}

.advice-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.advice-label {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef5f1;
  color: var(--green-dark);
  white-space: nowrap;
}

.injury-card.priority-high .advice-label {
  background: #ffe6de;
  color: #9d2d1f;
}

.injury-card h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.injury-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.injury-card p strong {
  color: var(--text);
}

.physiology-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 18px;
}

.physiology-stage {
  min-height: 440px;
  padding: 14px;
  align-self: start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f7faf8;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.anatomy-view-labels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.physiology-image {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  border: 1px solid #e0e8e4;
  border-radius: var(--radius);
  background: #f8fafc;
}

.anatomy-image-wrap {
  position: relative;
  width: 100%;
  isolation: isolate;
}

.anatomy-hotspots {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.anatomy-hotspot {
  position: absolute;
  left: var(--hotspot-left);
  top: var(--hotspot-top);
  width: var(--hotspot-width);
  height: var(--hotspot-height);
  min-width: 24px;
  min-height: 28px;
  padding: 0;
  border: 1.5px solid transparent;
  border-radius: 44%;
  background: transparent;
  cursor: help;
  transform: rotate(var(--hotspot-rotate, 0deg));
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.anatomy-hotspot::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  z-index: 4;
  width: max-content;
  max-width: 150px;
  padding: 5px 8px;
  border-radius: 4px;
  background: #14231b;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px) rotate(var(--hotspot-counter-rotate, 0deg));
  transition: opacity 120ms ease, transform 120ms ease;
}

.anatomy-hotspot:hover,
.anatomy-hotspot:focus-visible,
.anatomy-hotspot.is-selected {
  outline: none;
  border-color: var(--hotspot-color);
  background: var(--hotspot-fill);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8), 0 4px 14px rgba(25, 38, 31, 0.18);
}

.anatomy-hotspot:hover::after,
.anatomy-hotspot:focus-visible::after,
.anatomy-hotspot.is-selected::after {
  opacity: 1;
  transform: translate(-50%, 0) rotate(var(--hotspot-counter-rotate, 0deg));
}

.anatomy-hotspot[data-system="muscle"] {
  --hotspot-color: #b94639;
  --hotspot-fill: rgba(217, 103, 86, 0.26);
}

.anatomy-hotspot[data-system="bone"] {
  --hotspot-color: #907142;
  --hotspot-fill: rgba(200, 177, 138, 0.3);
}

.anatomy-hotspot[data-system="tendon"] {
  --hotspot-color: #a97914;
  --hotspot-fill: rgba(216, 167, 62, 0.3);
}

.anatomy-hotspot[data-system="joint"] {
  --hotspot-color: #3475ae;
  --hotspot-fill: rgba(95, 148, 200, 0.28);
}

.anatomy-detail {
  display: grid;
  grid-template-columns: minmax(145px, 0.55fr) minmax(0, 1.45fr);
  gap: 14px;
  padding: 12px 0 2px;
  border-top: 1px solid var(--border);
}

.anatomy-detail-heading {
  min-width: 0;
}

.anatomy-detail-heading span {
  display: block;
  margin-bottom: 4px;
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.anatomy-detail-heading strong {
  display: block;
  color: var(--text);
  font-size: 17px;
  line-height: 1.25;
}

.anatomy-detail dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.anatomy-detail dl div {
  min-width: 0;
}

.anatomy-detail dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.anatomy-detail dd {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.anatomy-caption {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.anatomy-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.anatomy-key {
  min-width: 0;
  min-height: 30px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 750;
  transition: opacity 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.anatomy-key i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
}

.muscle-key i {
  background: #d96756;
}

.bone-key i {
  background: #c8b18a;
}

.tendon-key i {
  background: #d8a73e;
}

.joint-key i {
  background: #5f94c8;
}

.nerve-key i {
  background: #7755cc;
}

.thermo-key i {
  background: #d94d3b;
}

.physio-zone.is-muted {
  opacity: 0.42;
}

.physio-zone.is-active {
  opacity: 1;
  border-color: #9bc8ae;
  background: #eef8f2;
  color: var(--green-dark);
}

.physio-zone.is-inspected {
  opacity: 1;
  border-color: #6cab89;
  background: #e4f4eb;
  color: #145635;
  box-shadow: inset 0 0 0 1px rgba(31, 138, 91, 0.08);
}

.physiology-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.physiology-item {
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.physiology-item.active {
  border-color: #b8dec9;
  background: #f2faf5;
}

.physiology-item strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
}

.physiology-item p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.injury-evidence {
  margin-top: 0;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.source-links a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #cfdad4;
  border-radius: var(--radius);
  color: var(--green-dark);
  background: #fff;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.source-links a:hover {
  border-color: #a9c3b7;
  background: #f4faf6;
}

.chart-wrap {
  height: 280px;
  padding: 18px;
}

.chart-wrap svg {
  width: 100%;
  height: 100%;
}

.axis {
  stroke: #cbd8d1;
  stroke-width: 1.5;
}

.chart-area {
  fill: rgba(31, 138, 91, 0.14);
}

.chart-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.table-wrap {
  max-height: 280px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

td {
  color: var(--text);
  font-weight: 650;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #15211b;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  box-shadow: 0 18px 40px rgba(12, 18, 15, 0.25);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid,
  .bottom-grid,
  .pacing-grid,
  .fueling-grid,
  .injury-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: relative;
    height: auto;
    padding: 18px;
  }

  .workspace {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    width: 100%;
  }

  .primary-button {
    flex: 1;
    justify-content: center;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .baseline-grid,
  .strategy-summary,
  .fuel-controls,
  .fuel-metrics,
  .injury-status-grid,
  .injury-advice-list,
  .physiology-list {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 108px;
  }

  .topbar h2 {
    font-size: 24px;
  }

  .metric-card strong {
    font-size: 26px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-controls {
    width: 100%;
  }

  .chip {
    flex: 1;
  }

  .map-legend {
    position: static;
    margin-top: 12px;
    justify-content: space-between;
  }

  .physiology-stage {
    min-height: 0;
  }

  .anatomy-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .anatomy-detail {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .anatomy-detail dl {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .anatomy-hotspot {
    min-width: 20px;
    min-height: 24px;
  }

  .anatomy-hotspot::after {
    max-width: 110px;
    white-space: normal;
  }
}
