/* ══════════════════════════════════════════
   COMPONENTS — activity list, calendar, bubble
══════════════════════════════════════════ */

/* Activity list */
.act-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  flex: 1;
  max-height: 420px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.act-list::-webkit-scrollbar { width: 3px; }
.act-list::-webkit-scrollbar-track { background: transparent; }
.act-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.act-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  gap: 10px;
  border-left: 3px solid transparent;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}

.act-row:hover { border-left-color: var(--orange); background: var(--surface3); }

.act-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.act-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.act-right { text-align: right; flex-shrink: 0; }
.act-dist { font-size: 13px; font-weight: 700; }
.act-time { font-size: 11px; color: var(--muted); }

/* Activity detail modal */
.act-modal { max-width: 600px; gap: 14px; }
#actModalBody { display: flex; flex-direction: column; gap: 14px; }
.actd-map {
  width: 100%; height: 240px; display: block;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden;
}
.actd-map .leaflet-container { width: 100%; height: 100%; background: var(--surface2); }
.actd-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.actd-date { font-size: 12px; color: var(--muted); }
.actd-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px 9px;
}
.actd-loc { font-size: 12px; color: var(--muted); margin-top: -4px; }
.actd-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.actd-stat {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 10px; text-align: center;
}
.actd-stat-val { font-size: 18px; font-weight: 800; color: var(--text); }
.actd-stat-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 3px; }
.actd-strava { text-decoration: none; text-align: center; padding: 11px; }
@media (max-width: 520px) { .actd-grid { grid-template-columns: repeat(2, 1fr); } }

/* Segment big-map modal */
.segmap-modal { max-width: 900px; gap: 14px; }
.segmap-wrap {
  width: 100%; height: 55vh; min-height: 320px;
  border-radius: 12px; overflow: hidden; border: 1px solid var(--border);
}
#segMapBig { width: 100%; height: 100%; background: var(--surface2); }
.segmap-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 13px; }

.type-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .05em;
  background: var(--surface3);
  color: var(--muted);
  margin-right: 5px;
}

.type-pill.ride { color: var(--orange); background: var(--orange-dim); }

/* Contain Leaflet's internal z-index (panes/controls up to ~1000) so a map can
   never paint above the mobile sidebar drawer or modals */
.leaflet-container { isolation: isolate; }

/* Calendar heatmap */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
}

.cal-month-name {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 5px;
}

.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-cell { aspect-ratio: 1; border-radius: 2px; background: var(--surface2); }
.cal-cell.l1 { background: rgba(252, 76, 2, .18); }
.cal-cell.l2 { background: rgba(252, 76, 2, .42); }
.cal-cell.l3 { background: rgba(252, 76, 2, .68); }
.cal-cell.l4 { background: #FC4C02; }

/* Calendar — contribution graph */
.cal2-stats { display: flex; flex-wrap: wrap; gap: 18px 26px; margin-bottom: 18px; font-size: 13px; color: var(--muted); }
.cal2-stats b { color: var(--text); font-size: 19px; font-weight: 800; margin-right: 5px; }
.cal2-scroll { overflow-x: auto; padding-bottom: 6px; }
.cal2-months { display: flex; margin-bottom: 5px; }
.cal2-m { width: 16px; flex: 0 0 16px; font-size: 9px; font-weight: 700; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.cal2-grid { display: flex; gap: 3px; }
.cal2-week { display: flex; flex-direction: column; gap: 3px; }
.cal2-cell { width: 13px; height: 13px; border-radius: 3px; aspect-ratio: auto; }
.cal2-cell.empty { background: transparent; }
.cal2-legend { display: flex; align-items: center; gap: 4px; margin-top: 16px; font-size: 11px; color: var(--muted); }
.cal2-legend .cal2-cell { display: inline-block; }

/* Bubble chart */
#bubbleWrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-end;
  justify-content: center;
  padding: 8px 0;
  min-height: 160px;
}

.bubble {
  border-radius: 50%;
  background: var(--orange-dim);
  border: 1px solid var(--orange-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: background .2s, transform .15s;
  cursor: default;
}

.bubble:hover { background: rgba(252, 76, 2, .25); transform: scale(1.06); }

.bubble span {
  font-size: 9px;
  font-weight: 700;
  color: var(--orange);
  line-height: 1.2;
  text-align: center;
  padding: 2px;
}

/* segmented picker — used in the Save Image modal */
.seg-pick { display: flex; gap: 8px; }
.seg-pick button {
  flex: 1;
  padding: 9px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.seg-pick button:hover { border-color: var(--border-hover); color: var(--text); }
.seg-pick button.active {
  background: var(--orange-dim);
  border-color: var(--orange-mid);
  color: var(--orange);
}

/* small inline icons (replace decorative emoji in text), sized to the text */
.ic { width: 1em; height: 1em; vertical-align: -0.14em; display: inline-block; flex-shrink: 0; }
