/* Recording a ski day on the map (tracking-map.js): the record button, the live panel with the speed, distance,
   vertical and the piste you're on, the track drawn on the map, and the summary when the day is finished.
   Colours, type and motion from design/tokens.css; buttons from friends.css; the panel sits first in the map's chips
   column (map.css .chips), so the accuracy chip and the others line up under it. */

.control.record svg circle { fill: var(--sos); stroke: var(--sos); transition: transform var(--dur) var(--ease); transform-origin: center; }
.control.record[data-recording="true"] svg circle { animation: rec-pulse 1.6s var(--ease) infinite; }
.control.record[data-recording="true"][data-paused="true"] svg circle { animation: none; fill: var(--caution-strong); stroke: var(--caution-strong); }
@keyframes rec-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.72); opacity: .55; } }

/* The live panel */
.track-hud {
  width: min(300px, calc(100vw - 2 * var(--gutter)));
  padding: 10px 14px 12px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  z-index: 2;
}
/* Nearly opaque, so the muted text keeps 4.5:1 over dark ground and photos (on --glass it fell to about 2.7:1) */
.glass.track-hud { background: var(--glass-solid); }
.track-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.track-top .track-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sos); flex: none; animation: rec-pulse 1.6s var(--ease) infinite; }
.track-hud[data-paused="true"] .track-dot { background: var(--caution-strong); animation: none; }
.track-hud[data-gps="poor"] .track-top { color: var(--caution-strong); }
/* "Recording" (the status, announced) and "· GPS ±5 m" beside it (not announced, tracking-map.js) */
.track-top #track-status { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-top .track-gps { flex: 1; min-width: 0; margin-left: -4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-top .track-gps:not(:empty)::before { content: "· "; }
.track-speed { display: flex; align-items: baseline; gap: 5px; margin-top: 2px; font-family: var(--font-display); }
.track-speed #track-speed { font-size: 46px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }
.track-speed small { font-size: 15px; font-weight: 500; color: var(--muted); }
/* Cells as wide as their figures, sharing what's left, and a cell that doesn't fit goes onto a second row rather than
   being cut: equal columns cut "36 km/h" to "36 k…" in iOS Safari at 402 px, and wider fonts (Linux, other languages)
   cut columns sized to fit Apple's; tools/verify/smoke/track-hud.smoke.mjs */
.track-stats { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 0; }
.track-stats div { flex: 1 1 auto; padding: 6px 8px; border-radius: var(--radius-sm); background: rgb(var(--navy-rgb) / .06); }
.track-stats dt { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.track-stats dd { margin: 1px 0 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-on { margin: 8px 0 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; min-height: 18px; }
.track-on:empty { display: none; }
.track-on .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1.5px #fff; }
.track-on .dot.green { background: var(--piste-green); }
.track-on .dot.blue { background: var(--piste-blue); }
.track-on .dot.red { background: var(--piste-red); }
.track-on .dot.black { background: var(--piste-black); }
.track-on .dot.offpiste { background: var(--piste-offpiste); }
.track-on .dot.other { background: var(--piste-unknown); }
.track-on .dot.lift { background: var(--lift); border-radius: 2px; }
.track-on strong { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-actions { display: flex; gap: 8px; margin-top: 10px; }
.track-actions .btn { flex: 1; }
.track-note { margin: 8px 0 0; font-size: 12px; line-height: 1.35; color: var(--muted); }
.track-note:empty { display: none; }

/* A stored day shown on the map (map.html?track=<id>) */
.chip.track-chip { display: flex; align-items: center; gap: 8px; padding-right: 6px; }
.chip.track-chip button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--separator-soft); color: var(--text); font-size: 15px; line-height: 1; cursor: pointer; }

/* The summary when the day is finished */
.track-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 0; border: 0;
  background: var(--glass-solid); color: var(--text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sheet);
  font-family: var(--font);
}
.track-dialog::backdrop { background: rgb(var(--navy-rgb) / .35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.track-dialog form { padding: var(--space-5); }
.track-dialog h2 { margin: 0; font-family: var(--font-display); font-size: var(--text-title); letter-spacing: var(--tracking-title); }
.track-dialog .track-sub { margin: 2px 0 var(--space-4); color: var(--muted); font-size: 14px; }
.track-dialog .track-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.track-dialog .track-grid div { padding: 10px 10px 8px; border-radius: var(--radius-sm); background: var(--fill); }
.track-dialog .track-grid dt { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.track-dialog .track-grid dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.track-dialog .track-grid dd small { font-size: 12px; font-weight: 500; color: var(--muted); }
.track-dialog .track-pistes { margin: var(--space-4) 0 0; font-size: 14px; color: var(--muted); line-height: 1.45; }
.track-dialog .track-pistes strong { color: var(--text); }
.track-dialog .track-where { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.track-dialog-actions { display: flex; gap: 8px; margin-top: var(--space-5); flex-wrap: wrap; }
.track-dialog-actions .btn { flex: 1 1 auto; white-space: nowrap; }
.track-dialog-actions .btn.danger[data-sure="true"] { background: var(--sos); color: #fff; }

@media (max-width: 699px) {
  /* Leaves the controls column on the right (44 px plus its gaps) uncovered */
  .track-hud { width: min(300px, calc(100vw - 2 * var(--gutter) - 72px)); padding: 8px 12px 10px; }
  .track-stats div { padding: 5px 6px; }
  .track-speed #track-speed { font-size: 40px; }
  .track-dialog .track-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .control.record[data-recording="true"] svg circle, .track-top .track-dot { animation: none; }
}
