/* GO 4 RUN — visual system */

:root {
  --bg: #0a0a0c;
  --bg-elev: #15151a;
  --bg-elev-2: #1d1d24;
  --border: #2a2a32;
  --text: #f5f5f7;
  --text-muted: #8a8a96;
  --text-dim: #5a5a64;
  --accent: #ff7a3d;
  --accent-soft: rgba(255, 122, 61, 0.18);
  --accent-2: #4fb6ff;
  --green: #4ade80;
  --yellow: #facc15;
  --red: #f87171;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 20px rgba(0,0,0,0.35);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC',
          'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

body {
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

#app {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 80px;
  overflow-x: hidden;
}

/* ---------- Mock data badge ---------- */
.mock-badge {
  position: fixed;
  bottom: 80px;
  right: 12px;
  z-index: 60;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 3px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  pointer-events: none;
}

/* ---------- Top bar ---------- */
.topbar {
  padding: 18px 18px 6px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.topbar h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.5px;
}
.topbar .greeting {
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- Section spacing ---------- */
.section {
  padding: 14px 18px 4px;
}
.section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin: 0 0 10px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

/* ---------- Readiness + race card ---------- */
.readiness-card {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, var(--bg-elev) 0%, var(--bg-elev-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.1s;
}
.readiness-card:active { transform: scale(0.99); }
.readiness-left { flex: 1; }
.readiness-score {
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.readiness-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.green { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-dot.yellow { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.status-dot.red { background: var(--red); box-shadow: 0 0 8px var(--red); }

.readiness-right {
  border-left: 1px solid var(--border);
  padding-left: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: right;
  min-width: 110px;
}
.race-days {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.race-name {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- VDOT banner card ---------- */
.vdot-banner {
  margin: 12px 18px 0;
  background: linear-gradient(135deg, var(--bg-elev) 0%, var(--bg-elev-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.1s;
}
.vdot-banner:active { transform: scale(0.99); }
.vdot-banner .vdot-left { flex: 1; }
.vdot-banner .vdot-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.vdot-banner .vdot-num {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-top: 2px;
}
.vdot-banner .vdot-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}
.vdot-banner .vdot-chev {
  color: var(--text-dim);
  font-size: 20px;
}
.vdot-banner .vdot-spark {
  width: 80px;
  height: 40px;
}

/* ---------- 2x2 overview grid ---------- */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 18px;
}
.overview-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
}
.overview-card .label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.overview-card .big-num {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
.overview-card .big-num .unit {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 3px;
}
.overview-card .sub-line {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.overview-card .heatmap-grid {
  display: grid;
  grid-template-columns: repeat(53, 1fr);
  gap: 1px;
  margin-top: 10px;
}
.overview-card .progress-pair {
  margin-top: 8px;
}
.overview-card .progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.overview-card .progress-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 6px;
  overflow: hidden;
}
.overview-card .progress-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent-2);
}
.overview-card .progress-fill.time { background: var(--accent); }

/* ---------- VDOT trend page ---------- */
.vdot-hero {
  margin: 4px 18px 16px;
  padding: 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.vdot-hero .label {
  font-size: 14px;
  color: var(--text-muted);
}
.vdot-hero .num {
  font-size: 56px;
  font-weight: 700;
  color: var(--accent-2);
  letter-spacing: -1.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.vdot-trend-wrap {
  margin: 0 18px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.vdot-trend-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.vdot-trend-head .title {
  font-size: 14px;
  font-weight: 600;
}
.vdot-trend-tabs {
  display: flex;
  background: var(--bg-elev-2);
  padding: 3px;
  border-radius: 8px;
}
.vdot-trend-tabs button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}
.vdot-trend-tabs button.active {
  background: var(--accent-2);
  color: white;
}
.vdot-chart-canvas {
  height: 240px;
  position: relative;
}
.vdot-legend {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  justify-content: center;
}
.vdot-legend .swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.train-zone-card {
  margin: 0 18px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.train-zone-card .head {
  padding: 14px 16px 8px;
  font-size: 14px;
  font-weight: 600;
}
.train-zone-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--bg-elev-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.train-zone-row .ztype {
  display: flex;
  align-items: center;
  gap: 8px;
}
.train-zone-row .zletter {
  color: var(--accent);
  font-weight: 700;
  min-width: 14px;
}

/* ---------- HealthKit-style stacked metric charts ---------- */
.hk-chart-block {
  margin: 0 18px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.hk-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.hk-chart-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
.hk-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.hk-chart-avg {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.hk-chart-avg strong { color: var(--text); font-weight: 600; }
.hk-chart-canvas {
  height: 110px;
  position: relative;
}

/* ---------- Old scroll-card kept (only for legacy if needed) ---------- */
.scroll-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 18px 14px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-card {
  min-width: 280px;
  scroll-snap-align: start;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.scroll-card .label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.scroll-card .big-num {
  font-size: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
.scroll-card .big-num .unit {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 4px;
}
.scroll-card .sub-line {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

/* Pacing progress bars */
.progress-pair {
  margin-top: 12px;
}
.progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent-2);
}
.progress-fill.time { background: var(--accent); }

/* PB table */
.pb-list {
  margin-top: 12px;
  font-size: 13px;
}
.pb-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-variant-numeric: tabular-nums;
}
.pb-row .dist { color: var(--text-muted); }
.pb-row .time { font-weight: 600; }

/* ---------- Yearly heatmap ---------- */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(53, 1fr);
  gap: 2px;
  margin-top: 12px;
}
.heatmap-cell {
  aspect-ratio: 1;
  background: var(--bg-elev-2);
  border-radius: 2px;
}
.heatmap-cell.l1 { background: rgba(255, 122, 61, 0.25); }
.heatmap-cell.l2 { background: rgba(255, 122, 61, 0.45); }
.heatmap-cell.l3 { background: rgba(255, 122, 61, 0.70); }
.heatmap-cell.l4 { background: var(--accent); }

/* ---------- Calendar grid ---------- */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 18px 8px;
}
.calendar-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.calendar-nav {
  display: flex;
  gap: 4px;
}
.calendar-nav button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.calendar {
  margin: 0 18px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar .dow {
  text-align: center;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1px;
  padding-bottom: 4px;
}
.cal-cell {
  aspect-ratio: 1;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  cursor: default;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 4px;
}
.cal-cell.future {
  background: transparent;
  border: 1px dashed var(--border);
}
.cal-cell.future::after {
  content: '?';
  color: var(--text-dim);
  font-size: 11px;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-cell.rest {
  opacity: 0.6;
}
.cal-cell.rest::after {
  content: '0';
  color: var(--text-dim);
  font-size: 12px;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-cell.has-run {
  cursor: pointer;
}
.cal-cell .km {
  position: relative;
  z-index: 2;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.cal-cell .trace {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.4;
}
.cal-cell.today { border-color: var(--accent); }
.cal-cell .date-num {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 9px;
  color: var(--text-dim);
}

/* ---------- Run Detail ---------- */
.detail-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 12px 16px 4px;
  font-size: 15px;
}
.detail-nav button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 15px;
  padding: 4px 8px;
  font-family: inherit;
}

.hero-section {
  padding: 4px 18px 16px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.hero-main { flex: 1; }
.hero-distance {
  font-size: 48px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1.5px;
  line-height: 1;
}
.hero-distance .unit {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 4px;
}
.hero-meta {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-muted);
}
.hero-meta strong { color: var(--text); font-variant-numeric: tabular-nums; }
.mini-map {
  width: 110px;
  height: 110px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mini-map svg { width: 100%; height: 100%; }

.device-line {
  padding: 0 18px 8px;
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}
.device-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* Metric matrix */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 18px 16px;
}
.metric-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.1s;
}
.metric-card:active { transform: scale(0.97); }
.metric-card .m-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.metric-card .m-value {
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.metric-card .m-unit {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 3px;
}
.metric-card.threshold .m-value {
  text-shadow: 0 0 8px var(--accent-soft);
  color: var(--accent);
}

/* Tag (qualitative label) */
.tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 600;
  vertical-align: middle;
}
.tag.green { background: rgba(74,222,128,0.18); color: var(--green); }
.tag.yellow { background: rgba(250,204,21,0.18); color: var(--yellow); }
.tag.red { background: rgba(248,113,113,0.18); color: var(--red); }

/* Chart */
.chart-wrap {
  padding: 0 18px 14px;
}
.chart-controls {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  align-items: center;
}
.chart-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-elev);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.chart-tabs button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}
.chart-tabs button.active {
  background: var(--accent);
  color: white;
}
.chart-tabs.zones button.active {
  background: var(--bg-elev-2);
  color: var(--text);
}
.chart-canvas-wrap {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  height: 200px;
  position: relative;
}

/* Zone bars */
.zone-bars {
  padding: 0 18px 14px;
}
.zone-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
}
.zone-name {
  min-width: 70px;
  color: var(--text-muted);
}
.zone-track {
  flex: 1;
  height: 14px;
  background: var(--bg-elev);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.zone-fill {
  height: 100%;
  border-radius: 4px;
}
.zone-pct {
  min-width: 38px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.zone-fill.z1 { background: #4fb6ff; }
.zone-fill.z2 { background: #4ade80; }
.zone-fill.z3 { background: #facc15; }
.zone-fill.z4 { background: #fb923c; }
.zone-fill.z5 { background: #f87171; }

/* Splits table */
.splits-table {
  padding: 0 18px 16px;
}
.splits-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.splits-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}
.splits-table td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--bg-elev);
}
.splits-table .pace-bar {
  display: inline-block;
  background: var(--accent-soft);
  height: 4px;
  border-radius: 2px;
  vertical-align: middle;
  margin-left: 6px;
}

/* Shoe footer */
.shoe-footer {
  margin: 0 18px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.shoe-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #ff5722 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.shoe-info { flex: 1; }
.shoe-name { font-size: 13px; font-weight: 600; }
.shoe-status { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.wear-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.wear-fill { height: 100%; background: var(--green); border-radius: 2px; }
.wear-fill.warn { background: var(--yellow); }
.wear-fill.danger { background: var(--red); }

/* ---------- Settings ---------- */
.settings-list {
  margin: 0 18px;
}
.settings-group {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}
.settings-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  gap: 12px;
  min-height: 50px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row .row-label {
  color: var(--text);
  flex-shrink: 0;
}
.settings-row .row-value {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  text-align: right;
}
.settings-row.clickable { cursor: pointer; }
.settings-row.clickable::after {
  content: '›';
  color: var(--text-dim);
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}
.settings-row > .row-block {
  flex: 1;
  min-width: 0;
}
.toggle {
  width: 42px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle.on::after { transform: translateX(18px); }

.zone-list {
  padding: 12px 16px;
  font-size: 12px;
}
.zone-list-row {
  display: grid;
  grid-template-columns: 60px 1fr 1fr;
  padding: 6px 0;
  border-bottom: 1px solid var(--bg-elev-2);
  font-variant-numeric: tabular-nums;
}
.zone-list-row:last-child { border-bottom: none; }
.zone-list-row .zname { color: var(--accent); font-weight: 600; }

/* Shoe cards in settings */
.shoe-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 18px;
}
.shoe-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: transform 0.1s;
}
.shoe-card:active { transform: scale(0.98); }
.shoe-card.retired { opacity: 0.55; }
.shoe-thumb {
  height: 80px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 10px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.shoe-thumb.has-photo { font-size: 0; }
.shoe-card .name { font-size: 13px; font-weight: 600; margin-bottom: 2px; line-height: 1.3; }
.shoe-card .nickname { font-size: 11px; color: var(--accent); margin-bottom: 4px; }
.shoe-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}
.shoe-card .meta .km { color: var(--text); font-weight: 600; }
.shoe-card .meta .wear-pct { font-weight: 600; }

/* "Add new" card */
.shoe-card.add-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  min-height: 160px;
}
.shoe-card.add-card .plus {
  font-size: 36px;
  color: var(--accent);
  margin-bottom: 6px;
  line-height: 1;
}

/* Form */
.form-page {
  padding: 0 18px 24px;
}
.form-field {
  margin-bottom: 16px;
}
.form-field label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-field label .req {
  color: var(--accent);
  font-weight: 600;
}
.form-field label .opt {
  color: var(--text-dim);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.form-field input[type=text],
.form-field input[type=number],
.form-field input[type=date] {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  padding: 12px;
  font-family: inherit;
  -webkit-appearance: none;
}
.form-field input:focus {
  outline: none;
  border-color: var(--accent);
}
.form-field .hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.preview-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.preview-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.preview-thumb.has-photo { font-size: 0; }
.preview-info { flex: 1; min-width: 0; }
.preview-info .pname { font-size: 14px; font-weight: 600; line-height: 1.3; }
.preview-info .pnick { font-size: 11px; color: var(--accent); margin-top: 2px; }
.preview-info .pmeta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Color swatches */
.color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.1s;
}
.color-swatch.active {
  border-color: var(--text);
  transform: scale(1.1);
}
.color-swatch.custom {
  background: linear-gradient(135deg, #ff7a3d, #4fb6ff, #a78bfa, #4ade80);
  position: relative;
  overflow: hidden;
}
.color-swatch.custom input[type=color] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
}

/* Emoji input — compact */
.emoji-input {
  width: 80px !important;
  text-align: center;
  font-size: 24px !important;
}

/* Photo controls */
.photo-controls {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.photo-controls button {
  flex: 1;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.photo-controls button.remove { color: var(--red); }
.photo-controls input[type=file] {
  display: none;
}

/* Form action bar */
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.form-actions button {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.form-actions .save-btn {
  background: var(--accent);
  color: white;
}
.form-actions .cancel-btn {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
}
.form-actions .delete-btn {
  background: rgba(248,113,113,0.15);
  color: var(--red);
  border: 1px solid rgba(248,113,113,0.3);
  flex: 0.6;
}

/* ---------- Bottom tab nav ---------- */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(15,15,18,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  z-index: 50;
}
.tab-bar-inner {
  width: 100%;
  max-width: 430px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: 6px;
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 24px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 11px;
}
.tab-item .tab-icon { font-size: 22px; }
.tab-item.active { color: var(--accent); }

/* ---------- Page transitions ---------- */
.page {
  animation: slideIn 0.25s ease-out;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- Run list (Lifetime archive) ---------- */
.run-list-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--bg-elev-2);
  font-size: 13px;
}
.run-list-row .left .date { font-weight: 600; }
.run-list-row .left .type { color: var(--text-muted); font-size: 11px; }
.run-list-row .right { text-align: right; font-variant-numeric: tabular-nums; }
.run-list-row .right .dist { font-weight: 600; }
.run-list-row .right .pace { color: var(--text-muted); font-size: 11px; }
