/* The swim screens' own styles: Swim Detail, the watch face (SwimSummaryCard) and the Swim Timeline. */
:root { --indigo: #5856d6; --gold: #e8ad00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --indigo: #5e5ce6; } }
:root[data-theme="dark"] { --indigo: #5e5ce6; }

.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { border: 0; border-top: 0.5px solid var(--separator); margin: 0; width: 100%; }
.text-button { color: var(--aqua); text-align: left; align-self: flex-start; min-height: 30px; }
.link-button { color: var(--aqua); display: inline-flex; align-items: center; gap: 2px; }
.link-button svg { width: 11px; height: 11px; }

/* The toolbar: Share and Edit in one glass capsule. */
.nav-group { display: flex; align-items: center; border-radius: 22px; background: var(--glass); box-shadow: 0 1px 6px rgba(0,0,0,0.1);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); padding: 0 6px; }
.nav-group .navbtn.edit { padding: 0 10px; }

/* Swim Detail. */
.detail-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--xs) var(--s); padding-top: var(--s); }
.detail-header .eyebrow { flex: 1 1 auto; }
.adjusted-button { flex: none; }
.hero-distance { display: flex; align-items: baseline; gap: var(--xs); }
.hero-distance .hero { font-size: 52px; line-height: 58px; letter-spacing: -0.5px; }
.hero-figures { display: flex; gap: var(--l); flex-wrap: wrap; }
.baseline-line { display: flex; gap: 8px; align-items: flex-start; }
.baseline-line svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.analyse { width: 100%; min-height: 60px; font-size: 20px; gap: 10px; }
.analyse svg { width: 24px; height: 24px; }
.target-tiles { display: flex; flex-direction: column; gap: var(--m); }
.target-tile { display: flex; gap: var(--s); align-items: flex-start; padding: var(--m); border-radius: var(--radius-control); background: var(--background); }
.target-tile svg { width: 20px; height: 20px; flex: none; }
.outcome-label .status svg { width: 19px; height: 19px; }
.target-ring { display: flex; flex-direction: column; align-items: center; gap: var(--xs); }
.target-ring .ring { position: relative; width: 44px; height: 44px; display: grid; place-items: center; }
.target-ring .ring > svg:first-child { position: absolute; inset: 0; }
.target-ring .ring span svg { width: 13px; height: 13px; }
.limit-row { display: flex; align-items: center; gap: var(--s); }
.limit-row .mark svg { width: 15px; height: 15px; }
.detail-strip svg { width: 100%; }
.length-figures { display: flex; }
.length-figures > * { flex: 1; }
.chart .target-label { fill: var(--positive); font-size: 11px; font-weight: 600; }
.story-card { display: flex; flex-direction: column; gap: var(--xs); }
.story-card .status svg { width: 20px; height: 20px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s); }
.stroke-mix-bar { display: flex; gap: 1px; height: 14px; border-radius: 4px; overflow: hidden; }
.mix-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.small-arrow svg { width: 11px; height: 11px; }
.list-header.history { text-transform: none; font-size: 17px; font-weight: 600; }
.length-row { display: flex; align-items: center; gap: var(--m); width: 100%; padding: 6px var(--xs); border-radius: 6px; }
.length-row .number { min-width: 28px; }
.length-row.current { background: color-mix(in srgb, var(--aqua) 12%, transparent); }
.length-list { gap: 0; }
.length-list .length-row + .length-row { border-top: 0.5px solid var(--separator); border-radius: 0; }
.length-list .length-row.current + .length-row, .length-list .length-row + .length-row.current { border-radius: 6px; }

/* SwimSummaryCard: the watch face. */
.summary-card { background: var(--surface); border-radius: 30px; padding: 22px; display: flex; flex-direction: column; gap: 18px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06); height: 100%; cursor: pointer; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; transition: box-shadow 0.2s; position: relative; }
.summary-card.comparing { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--aqua) 50%, transparent), 0 6px 16px rgba(0, 0, 0, 0.06); }
.summary-icon svg { width: 30px; height: 30px; }
.summary-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 15px; font-weight: 500;
  background: color-mix(in srgb, currentColor 10%, transparent); white-space: nowrap; }
.summary-pill svg { width: 15px; height: 15px; }
.summary-pill.secondary { color: var(--secondary); }
.watch-face { display: flex; align-items: center; justify-content: center; gap: 8px; }
.complications { display: flex; flex-direction: column; gap: 30px; flex: none; }
.complication { display: flex; flex-direction: column; gap: 3px; white-space: nowrap; }
.complication-icon svg { width: 22px; height: 22px; }
.complication .title3 { font-size: 20px; }
.goal-dial { position: relative; flex: 1 1 auto; min-width: 150px; max-width: 240px; aspect-ratio: 1; container-type: inline-size; }
.dial-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.dial-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2cqw; text-align: center; }
.dial-distance { display: flex; align-items: baseline; gap: 2px; font-family: var(--rounded); font-weight: 700; font-size: 13.5cqw; line-height: 1.1; }
.dial-unit { font-family: var(--font); font-weight: 400; font-size: 8cqw; color: var(--secondary); }
.dial-lengths { font-weight: 700; font-size: 9.5cqw; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 2px; }
.dial-divider { width: 36cqw; border-top: 0.5px solid var(--separator); }
.dial-goal { font-size: 6.8cqw; color: var(--secondary); white-space: nowrap; }
.dial-percent { font-weight: 700; font-size: 8.5cqw; padding: 0.4cqw 5cqw; border-radius: 999px; font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--aqua) 12%, transparent); }
.dial-percent.over { background: color-mix(in srgb, var(--positive) 12%, transparent); }
.summary-detail { display: flex; flex-direction: column; gap: 18px; transition: opacity 0.2s; }
.summary-detail.set-back { opacity: 0.3; }
.pace-per-length { display: flex; flex-direction: column; gap: 8px; }
.pace-bars { width: 100%; height: 58px; }
.milestones { display: flex; flex-direction: column; gap: 8px; }
.milestone-track { position: relative; height: 16px; }
.milestone-bar { position: absolute; left: 0; right: 0; top: 6px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--aqua) 25%, transparent); }
.milestone-bar.final { background: color-mix(in srgb, var(--aqua) 45%, transparent); }
.milestone-bar.final.achieved { background: color-mix(in srgb, var(--positive) 50%, transparent); }
.milestone-dot { position: absolute; top: 1px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); }
.milestone-labels { position: relative; display: flex; justify-content: space-between; min-height: 52px; }
.milestone-label { display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.milestone-label:not(.first):not(.last) { position: absolute; top: 0; transform: translateX(-50%); align-items: center; }
.milestone-label.last { align-items: flex-end; margin-left: auto; }
.summary-pager-wrap { display: flex; flex-direction: column; gap: var(--s); }
.summary-pager { display: flex; gap: var(--m); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 20px 0; margin: -20px 0;
  overscroll-behavior-x: contain; }
.summary-pager::-webkit-scrollbar { display: none; }
.summary-page { flex: 0 0 100%; scroll-snap-align: start; display: flex; }
.summary-page > .summary-card { flex: 1; }
.pager-status { position: relative; display: flex; justify-content: center; align-items: center; min-height: 20px; }
.page-dots { display: flex; gap: 6px; }
.page-dots span { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--secondary) 50%, transparent); }
.page-dots span.on { background: var(--aqua); }
.latest { position: absolute; right: 0; display: inline-flex; align-items: center; gap: 3px; }
.latest svg { width: 10px; height: 10px; }
.latest[hidden] { display: none; }

/* The Swim Timeline. */
.timeline > .segmented { margin-top: var(--xs); }
.race-player { gap: var(--m); }
.player-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s); }
.player-header .trailing { align-items: flex-end; }
.player-time { font-size: 34px; line-height: 41px; }
.status-pill-holder:empty { display: none; }
.status-pill { --pill: var(--aqua); display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; color: var(--pill);
  background: color-mix(in srgb, var(--pill) 12%, transparent); }
.status-pill svg { width: 18px; height: 18px; }
.pool { display: grid; grid-template-columns: 26px 1fr 66px; gap: 6px; padding: 4px 0; }
.pool-column .cell { height: 46px; display: flex; align-items: center; }
.pool-column .cell.gap { margin-top: 6px; }
.place { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--secondary) 30%, transparent); color: var(--label); }
.place.you { background: var(--aqua); color: #fff; }
.place.first { background: var(--gold); color: #fff; }
.place.you.first { box-shadow: inset 0 0 0 2px var(--aqua); }
.tally { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; width: 100%; }
.tally-count { display: inline-flex; align-items: center; gap: 2px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.tally-count.secondary { color: var(--secondary); }
.tally-count svg { width: 9px; height: 9px; }
.pool-water { position: relative; border-radius: 12px; overflow: hidden; background: linear-gradient(#8cd9f2, #54b8e0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6); }
.wall { position: absolute; top: 0; bottom: 0; width: 5px; background: rgba(255, 255, 255, 0.85); z-index: 2; }
.wall.left { left: 0; } .wall.right { right: 0; }
.lane .rope { height: 6px; background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='54' height='6'><ellipse cx='7.5' cy='3' rx='3.5' ry='3' fill='%23fff'/><ellipse cx='16.5' cy='3' rx='3.5' ry='3' fill='%23fff'/><ellipse cx='25.5' cy='3' rx='3.5' ry='3' fill='%23fff'/><ellipse cx='34.5' cy='3' rx='3.5' ry='3' fill='%230d66bf'/><ellipse cx='43.5' cy='3' rx='3.5' ry='3' fill='%230d66bf'/><ellipse cx='52.5' cy='3' rx='3.5' ry='3' fill='%230d66bf'/></svg>") 0 0 / 54px 6px repeat-x; }
.lane-water { position: relative; height: 46px; }
.lane-marking { position: absolute; left: 26px; right: 26px; top: 50%; height: 3px; margin-top: -1.5px; background: rgba(26, 77, 115, 0.45); }
.lane-marking::before, .lane-marking::after { content: ""; position: absolute; top: -7.5px; width: 3px; height: 18px; background: inherit; }
.lane-marking::before { left: -1.5px; } .lane-marking::after { right: -1.5px; }
.swimmer { --swimmer: var(--aqua); position: absolute; left: 0; top: 50%; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--swimmer); box-shadow: inset 0 0 0 2px #fff, 0 0 6px color-mix(in srgb, var(--swimmer) 60%, transparent); color: #fff; z-index: 1;
  will-change: transform; }
.swimmer.ghost { background: rgba(255, 255, 255, 0.55); box-shadow: none; border: 1.5px dashed var(--reference); color: var(--reference); }
.swimmer .flip { display: grid; }
.swimmer svg { width: 18px; height: 18px; }
.wake { position: absolute; left: 0; top: 50%; width: 40px; height: 9px; border-radius: 5px; will-change: transform;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.55)); }
.wake.ghost { background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.25)); }
.lane-tag { position: absolute; left: 8px; top: 2px; z-index: 3; font-size: 10px; font-weight: 600; color: #fff; padding: 1px 5px; border-radius: 999px;
  background: rgba(13, 64, 102, 0.55); white-space: nowrap; }
.transport { display: flex; flex-direction: column; gap: var(--xs); }
.transport .speed { min-width: 44px; text-align: right; }
.transport-buttons { display: flex; align-items: center; justify-content: space-between; }
.transport-buttons .end { min-width: 44px; min-height: 44px; display: grid; place-items: center; color: var(--aqua); }
.transport-buttons .end svg { width: 24px; height: 24px; }
.transport-buttons .round { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--aqua);
  background: color-mix(in srgb, var(--aqua) 12%, transparent); }
.transport-buttons .round svg { width: 18px; height: 18px; }
.transport-buttons .round[disabled] { opacity: 0.4; }
.transport-buttons .play { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--aqua); }
.transport-buttons .play svg { width: 26px; height: 26px; }
.time-slider { --progress: 0%; flex: 1; -webkit-appearance: none; appearance: none; height: 28px; background: none; margin: 0; cursor: pointer; }
.time-slider::-webkit-slider-runnable-track { height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--aqua) var(--progress), var(--fill) var(--progress)); }
.time-slider::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--aqua) var(--progress), var(--fill) var(--progress)); }
.time-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 38px; height: 24px; margin-top: -9px; border-radius: 12px; background: #fff;
  box-shadow: 0 0.5px 4px rgba(0, 0, 0, 0.12), 0 6px 13px rgba(0, 0, 0, 0.12); }
.time-slider::-moz-range-thumb { width: 38px; height: 24px; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 0.5px 4px rgba(0, 0, 0, 0.12), 0 6px 13px rgba(0, 0, 0, 0.12); }
.chart .lead-label { font-size: 11px; font-weight: 600; }
.chart .lead-label.ahead { fill: var(--positive); }
.chart .lead-label.behind { fill: var(--attention); }
.chart .section-label { font-size: 11px; fill: var(--secondary); }
.trailing-metric .metric { align-items: flex-start; }
.events-button { padding: 0 var(--xs); font-size: 17px; }
.moments { display: flex; flex-direction: column; }
.moment { display: flex; gap: var(--m); align-items: stretch; text-align: left; width: 100%; }
.moment-rail { display: flex; flex-direction: column; align-items: center; flex: none; }
.moment-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.moment-icon svg { width: 15px; height: 15px; }
.bg-aqua { background: var(--aqua); } .bg-positive { background: var(--positive); } .bg-attention { background: var(--attention); }
.moment-line { width: 2px; flex: 1; background: var(--quaternary); }
.moment-text { display: flex; flex-direction: column; gap: 2px; padding: 5px 0 var(--l); flex: 1; min-width: 0; }
.moment:last-child .moment-text { padding-bottom: 0; }
.moment-play { padding-top: 3px; }
.moment-play svg { width: 24px; height: 24px; }
.endurance-bar { display: flex; flex-direction: column; gap: 3px; }
.bar-track { height: 10px; border-radius: 5px; background: var(--quaternary); overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: 5px; }
.figure-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--m); }
.figure-tile { display: flex; align-items: center; gap: var(--s); min-width: 0; }
.figure-icon { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; color: var(--aqua);
  background: color-mix(in srgb, var(--aqua) 12%, transparent); }
.figure-icon svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .summary-detail, .summary-card { transition: none; } }
.length-chart { display: flex; flex-direction: column; gap: var(--m); }
.outcome-label { flex: none; white-space: nowrap; }
