/* ── Header ── */
.profile-chip {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--glass);
  border: 1px solid var(--gb);
  border-radius: 100px;
  padding: .35rem 1rem .35rem .35rem;
  cursor: pointer;
  transition: all .2s;
  font-size: .84rem;
  color: var(--mist);
}

.profile-chip:hover {
  border-color: var(--tide);
  color: var(--foam);
}

.avatar {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tide), var(--kelp));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--deep);
  flex-shrink: 0;
}

/* ── Journey card ── */
.journey-top {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.total-km {
  font-family: 'Instrument Serif', serif;
  font-size: 1.6rem;
  color: var(--foam);
  line-height: 1;
}

.leg-dot-row {
  display: flex;
  align-items: baseline;
  overflow: hidden;
  margin-bottom: .5rem;
}

.leg-city-inline {
  font-family: 'Instrument Serif', serif;
  font-size: .88rem;
  color: var(--foam);
  white-space: nowrap;
}

.leg-dot-fill {
  flex: 1;
  min-width: 1rem;
}

.leg-km-away {
  font-family: 'DM Mono', monospace;
  font-size: .67rem;
  color: var(--mist);
  white-space: nowrap;
}

.journey-view-link {
  display: block;
  width: 100%;
  margin-top: .9rem;
  padding: 0;
  background: none;
  border: none;
  font-family: 'DM Mono', monospace;
  font-size: .63rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--mist);
  text-align: right;
  cursor: pointer;
  transition: color .15s;
}

.journey-view-link:hover {
  color: var(--tide);
}

/* ── City timeline ── */
.timeline-wrap {
  margin-bottom: 1rem;
}

.timeline-scroll {
  overflow-x: auto;
  padding-top: 10px;
  padding-bottom: .6rem;
}

.timeline {
  display: flex;
  align-items: flex-start;
  min-width: max-content;
}

.tl-city {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 78px;
}

.tl-seg {
  display: flex;
  align-items: center;
  padding-top: 13px;
}

.tl-line {
  height: 2px;
  min-width: 24px;
  flex: 1;
  background: rgba(255, 255, 255, .07);
}

.tl-line.done {
  background: linear-gradient(90deg, var(--kelp), var(--tide));
}

.tl-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .13);
  background: var(--deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  flex-shrink: 0;
  transition: all .3s;
}

.tl-dot.done {
  background: linear-gradient(135deg, var(--kelp), var(--tide));
  border-color: var(--tide);
}

.tl-dot.here {
  border-color: var(--tide);
  box-shadow: 0 0 0 4px rgba(79, 195, 247, .18);
  animation: glow 2s infinite;
}

.tl-dot.origin {
  background: linear-gradient(135deg, var(--kelp), var(--tide));
  border-color: var(--kelp);
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 4px rgba(79, 195, 247, .18) }
  50%       { box-shadow: 0 0 0 8px rgba(79, 195, 247, .05) }
}

.tl-name {
  font-family: 'DM Mono', monospace;
  font-size: .53rem;
  color: var(--mist);
  text-align: center;
  margin-top: .3rem;
  max-width: 74px;
  line-height: 1.3;
  word-break: break-word;
}

.tl-name.hi {
  color: var(--tide);
}

.tl-km {
  font-family: 'DM Mono', monospace;
  font-size: .47rem;
  color: rgba(255, 255, 255, .22);
  text-align: center;
}

/* ── Leg progress ── */
.leg-block {
  padding-top: .9rem;
}

.leg-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .3rem;
}

.leg-lbl {
  font-family: 'DM Mono', monospace;
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--mist);
}

.leg-pct-txt {
  font-family: 'DM Mono', monospace;
  font-size: .68rem;
  color: var(--tide);
}

.leg-cities {
  font-family: 'Instrument Serif', serif;
  font-size: 1.05rem;
  color: var(--foam);
  margin-bottom: .4rem;
}

.leg-cities b {
  color: var(--tide);
}

.pbar-wrap {
  height: 6px;
  background: rgba(255, 255, 255, .06);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: .32rem;
}

.pbar {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--kelp), var(--tide));
  transition: width .7s cubic-bezier(.34, 1.56, .64, 1);
}

.pbar-rows {
  display: flex;
  justify-content: space-between;
  font-family: 'DM Mono', monospace;
  font-size: .67rem;
  color: var(--mist);
}

/* ── Per-sport stats boxes ── */
.stats-grid {
  display: grid;
  gap: .6rem;
  margin-top: 1rem;
}

.stat-box {
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--gb);
  border-radius: 10px;
  padding: .7rem .9rem;
}

.stat-lbl {
  font-family: 'DM Mono', monospace;
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--mist);
  margin-bottom: .22rem;
}

.stat-val {
  font-family: 'Instrument Serif', serif;
  font-size: 1.25rem;
  color: var(--foam);
  line-height: 1;
}

.stat-u {
  font-family: 'DM Mono', monospace;
  font-size: .58rem;
  color: var(--mist);
  margin-left: .1rem;
}

@media (max-width: 580px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .tl-city {
    min-width: 64px;
  }
}
