/* Public track page — spec §4, mock ①. Fixed 400px panel, map flexes. */
:root {
  --brand-blue: #1059D5; --brand-blue-deep: #0049CE; --ink: #000;
  --text-secondary: #6B7280; --live-green: #1CC16E; --danger-red: #DC2626;
  --amber-private: #D97706; --divider: #E2E4E8; --track-grey: #E3E5E8;
  --surface: #FFF; --page-bg: #F5F6F9;
  --font: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 13px; color: var(--ink); background: var(--page-bg); }

.track-shell { display: flex; height: 100vh; height: 100dvh; }
.panel {
  width: 400px; flex: 0 0 400px; background: var(--surface);
  border-right: 1px solid var(--divider); overflow-y: auto;
  display: flex; flex-direction: column;
}
.map { flex: 1; position: relative; }

.panel-block { padding: 20px 24px; border-bottom: 1px solid var(--divider); }
.panel-block--feed { flex: 1; }

.label-caps { font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-secondary); }
.muted { color: var(--text-secondary); }

/* header */
.live-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live-green);
  display: inline-block; animation: pulse 2s infinite; }
.live-dot--inline { margin-left: 8px; vertical-align: middle; }
.live-label { color: var(--ink); }
@keyframes pulse { 50% { opacity: .45; } }
.dest { font: 700 38px/1 'Barlow Condensed', 'Arial Narrow', sans-serif;
  letter-spacing: .01em; margin: 0 0 6px; text-transform: uppercase; }
.subline { margin: 0; color: var(--text-secondary); }

/* last check-in */
.lastci { font: 700 30px/1 'Barlow Condensed', 'Arial Narrow', sans-serif; margin: 8px 0 4px; }
.status-line { margin: 0 0 14px; color: var(--text-secondary); }
.progress-ends { display: flex; justify-content: space-between; font-size: 11px;
  color: var(--text-secondary); margin-bottom: 6px; }
.progress-track { position: relative; height: 6px; border-radius: 3px; background: var(--track-grey); }
.progress-fill { position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--brand-blue); border-radius: 3px; transition: width .6s ease; }
.progress-rider { position: absolute; top: 50%; transform: translate(-50%, -55%);
  font-size: 17px; line-height: 1; color: var(--brand-blue-deep); }
.progress-rider .fi { background: #fff; border-radius: 50%; padding: 2px; box-shadow: 0 0 0 1px var(--divider); }
.progress-endcap { position: absolute; right: 0; top: -4px; width: 2px; height: 14px;
  background: var(--ink); border-radius: 1px; }
.progress-nums { text-align: center; font-size: 11px; color: var(--text-secondary); margin-top: 8px; }

/* feed rail */
.feed { list-style: none; margin: 12px 0 0; padding: 0; position: relative; }
.feed::before { content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px;
  width: 2px; background: var(--divider); }
.feed-item { position: relative; padding: 0 0 18px 26px; display: flex; gap: 12px;
  align-items: flex-start; }
.feed-dot { position: absolute; left: 0; top: 3px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--surface); border: 2px solid #C4C9D2; }
.feed-dot--latest { background: var(--brand-blue); border-color: var(--brand-blue); }
.feed-dot--private { border-color: var(--amber-private); }
.feed-time-col { flex: 0 0 64px; }
.feed-time { font-size: 16px; font-weight: 700; display: block; }
.feed-body { flex: 1; min-width: 0; }
.feed-meta { font-size: 12px; color: var(--text-secondary); }
.feed-sub { font-size: 11px; margin: 1px 0 4px; }
.feed-comment { margin: 4px 0 6px; }
.feed-photo { display: block; width: 100%; max-width: 260px; border-radius: 10px;
  margin-top: 6px; cursor: zoom-in; }
/* Portrait photos: crop to slightly-landscape 1.2:1 in the feed so one tall photo
   can't swallow the timeline. The lightbox always shows the uncropped image. */
.feed-photo--tall { aspect-ratio: 1.2 / 1; object-fit: cover; }

/* photo lightbox: comment above the large image */
dialog.photo-box { border: 0; border-radius: 14px; padding: 18px; max-width: min(920px, 92vw);
  background: var(--surface); }
dialog.photo-box::backdrop { background: rgba(12,18,27,.72); }
.pb-comment { margin: 0 28px 12px 0; font-size: 15px; font-weight: 600; }
.pb-comment:empty { display: none; }
#pbImg { display: block; max-width: 100%; max-height: 78vh; border-radius: 10px; }
.pb-close { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px;
  border: 0; border-radius: 50%; background: var(--ink); color: #fff; cursor: pointer;
  font-size: 13px; line-height: 1; }
.owner-actions { margin-top: 8px; display: flex; gap: 8px; }
.oa-btn { font: inherit; font-size: 12px; font-weight: 700; padding: 6px 10px;
  border: 1px solid var(--divider); border-radius: 8px; background: var(--surface); cursor: pointer; }
.feed-item--private .oa-btn[data-vis] { border-color: var(--amber-private); color: var(--amber-private); }
.oa-btn--danger { color: var(--danger-red); }

/* legend + footer */
.legend { display: flex; gap: 10px; align-items: flex-start; background: #F8F9FB; }
.legend-lock { font-size: 16px; color: var(--text-secondary); margin-top: 2px; }
.panel-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px; font-size: 11px; background: #F8F9FB; }
.unit-toggle { font: inherit; font-size: 11px; font-weight: 700; padding: 4px 10px;
  border: 1px solid var(--divider); border-radius: 999px; background: var(--surface); cursor: pointer; }

/* map overlays */
.map-infocard { position: absolute; left: calc(400px + 16px); bottom: 16px;
  background: var(--surface); border-radius: 10px; box-shadow: 0 2px 10px rgba(12,18,27,.12);
  padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; z-index: 5; }
.info-row { display: flex; gap: 10px; align-items: center; }
.info-ic { font-size: 16px; color: var(--brand-blue); }
.maplibregl-ctrl-top-left { top: 12px; left: 12px; }

/* map markers */
.mk-start { width: 18px; height: 18px; border-radius: 50%; background: var(--brand-blue);
  border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.mk-dest { width: 16px; height: 16px; border-radius: 50%; background: #fff;
  border: 3px solid var(--brand-blue); box-shadow: 0 1px 4px rgba(0,0,0,.3); position: relative; }
.mk-dest .fi { position: absolute; bottom: 15px; left: 50%;
  transform: translateX(-50%); font-size: 14px; color: var(--ink); }
.mk-stop { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-blue);
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.mk-cp { width: 10px; height: 10px; border-radius: 50%; background: #fff;
  border: 2px solid var(--brand-blue); cursor: pointer; }
.mk-cp--private { border-color: var(--amber-private); }
.mk-rider { position: relative; width: 40px; height: 40px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 5px rgba(0,0,0,.35); display: flex;
  align-items: center; justify-content: center; font-size: 21px; color: var(--brand-blue); }
.mk-rider .rider-pill { position: absolute; left: 105%; top: 50%; transform: translateY(-50%);
  background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; font-family: var(--font);
  padding: 4px 8px; border-radius: 6px; white-space: nowrap; }

/* mobile: panel below map */
@media (max-width: 760px) {
  .track-shell { flex-direction: column; height: auto; }
  .map { height: 46vh; min-height: 300px; order: -1; }
  .panel { width: 100%; flex: none; border-right: 0; border-top: 1px solid var(--divider); }
  .map-infocard { left: 12px; bottom: 12px; }
}

.fi { line-height: 1; display: inline-block; vertical-align: -1px; }
.feed-meta .fi { font-size: 11px; }
.oa-btn .fi { font-size: 10px; }

.mk-rider img, .progress-rider img { display:block; object-fit:contain; }


/* ---- rider identity badge (top right of the panel header) ---- */
.panel > .panel-block:first-child { position: relative; }
.rider-badge { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px;
  border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: #e8ebef; color: #9aa4ad;
  box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0,0,0,.18); }
.rider-badge img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rider-badge svg { width: 62%; height: 62%; }
.rider-badge:hover { filter: brightness(.94); }


/* ---- share row (panel header) ---- */
.share-row { display: flex; align-items: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.share-lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #98a2ae; margin-right: 4px; }
.share-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; padding: 0;
  display: grid; place-items: center; color: #1c232b; font-size: 24px; line-height: 1; cursor: pointer; text-decoration: none; }
.share-btn .fi-rr-link-alt, .share-btn .fi-rr-share { font-size: 18px; }
.share-btn:hover { color: #1059D5; }
.share-msg { font-size: 12px; color: #2e7d4f; margin-left: 4px; }

.demo-intro{padding:0 35px 14px 0;margin-bottom:18px;border-bottom:1px solid #e2e5e8;font:13px/1.6 Arial,sans-serif;color:#5b6670}.demo-intro p{margin:0 0 9px}.demo-intro strong{color:#1c232a}.demo-intro a{color:#1c232a;text-underline-offset:3px}
