.city-phone-content {
  --city-enter-x: 7px;
  --city-ease: cubic-bezier(.2,.7,.3,1);
}

.city-phone-content[data-direction="back"] { --city-enter-x: -7px; }

[data-screen="overview"] .city-screen-body {
  padding-block: clamp(8px,3.9cqw,17px) 8px;
  overflow: visible;
}

[data-screen="overview"] .city-result-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  align-items: center;
  gap: clamp(5px,2cqw,11px);
  margin: 0 0 8px;
  padding: clamp(5px,3cqw,12px);
}

.city-distance-ring {
  display: grid;
  place-items: center;
  width: min(100%,40cqw,140px);
  aspect-ratio: 1;
  justify-self: center;
  font-variant-numeric: tabular-nums;
}

.city-distance-ring > * { grid-area: 1 / 1; }
.city-distance-ring svg { display: block; width: 100%; overflow: visible; }
.city-distance-ring circle { fill: none; stroke-width: 11px; }
.city-distance-ring .city-ring-track { stroke: var(--app-soft,#ecf4fd); }

.city-phone [data-pace-zone="faster"] { --pace-color: var(--app-data-deep); --ring-delay: 90ms; --ring-index: 0; }
.city-phone [data-pace-zone="steady"] { --pace-color: var(--app-data-mid); --ring-delay: 155ms; --ring-index: 1; }
.city-phone [data-pace-zone="slower"] { --pace-color: var(--app-data-light); --ring-delay: 220ms; --ring-index: 2; }

.city-ring-segment {
  /* Three 1.2-unit gaps reserve 3.6% of the circle. Round caps add 3.37 units. */
  --ring-arc: max(0,calc(var(--pace-share,0) * .964 - 3.37));
  stroke: var(--pace-color);
  stroke-linecap: round;
  stroke-opacity: clamp(0,var(--pace-share,0),1);
  stroke-dasharray: var(--ring-arc) 100;
  stroke-dashoffset: calc(var(--pace-offset,0) * .964 - var(--ring-index) * 1.2 - 2.285);
  transform: rotate(-90deg);
  transform-origin: center;
}

.city-distance-ring > div { display: grid; justify-items: center; gap: 4px; text-align: center; }
.city-distance-ring strong { color: var(--app-text); font-size: clamp(14px,8cqw,26px); line-height: .95; letter-spacing: -.055em; }
.city-distance-ring strong small { margin-inline-start: 1px; color: var(--app-muted); font-size: clamp(7px,3.6cqw,10px); font-weight: 700; letter-spacing: 0; }
.city-distance-ring > div > span { color: var(--app-muted); font-size: 9px; line-height: 1.25; }

[data-screen="overview"] .city-result-card dl {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: clamp(6px,3cqw,11px);
  padding: 0 0 0 clamp(7px,3.3cqw,12px);
  margin: 0;
  border: 0;
  border-inline-start: 1px solid var(--app-line);
}

[data-screen="overview"] .city-result-card dt { color: var(--app-muted); font-size: 10px; line-height: 1.2; }
[data-screen="overview"] .city-result-card dd { margin: 2px 0 0; color: var(--app-text); font-size: clamp(14px,7cqw,23px); line-height: 1; letter-spacing: -.045em; white-space: nowrap; font-variant-numeric: tabular-nums; }
[data-screen="overview"] .city-result-card dl > div + div dd { font-size: clamp(11px,4.8cqw,15px); letter-spacing: -.02em; }

.city-pace-breakdown { grid-column: 1 / -1; border-top: 1px solid var(--app-line); padding-top: clamp(4px,2cqw,8px); }
.city-pace-breakdown > p { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; margin: 0 0 6px; color: var(--app-text); font-size: 11px; font-weight: 700; line-height: 1.2; }
.city-pace-breakdown > p small, .city-pace-legend small { color: var(--app-muted); font-size: clamp(8px,3.3cqw,10px); font-weight: 400; }
.city-pace-legend { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(3px,2cqw,7px); margin: 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.city-pace-legend button {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-content: center;
  justify-items: start;
  gap: 3px;
  width: 100%;
  min-height: 55px;
  padding: 5px clamp(3px,2.3cqw,8px);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: var(--app-bg);
  text-align: left;
  line-height: 1.1;
}
.city-pace-legend button:hover { background: var(--app-action-hover); }
.city-pace-legend button > * { white-space: nowrap; }
.city-pace-name { display: inline-flex; align-items: center; gap: 4px; font-size: clamp(9px,3.3cqw,11px); font-weight: 700; }
.city-pace-name i { width: 7px; height: 7px; border-radius: 50%; background: var(--pace-color); }
.city-pace-legend b { grid-column: 1; grid-row: 2; font-size: clamp(12px,5cqw,16px); }
.city-pace-legend small { grid-column: 1; grid-row: 3; }
.city-pace-arrow { grid-column: 2; grid-row: 1; color: var(--app-blue); font-size: 10px; }

.city-review-tools { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(4px,2cqw,8px); }
.city-review-tools .city-app-row { min-height: 44px; padding: 5px clamp(5px,2.8cqw,10px); }
.city-review-tools .city-app-row strong { font-size: clamp(10px,3.5cqw,12px); line-height: 1.2; }
.city-review-tools .city-app-row > span { font-size: 11px; }

@container (max-width:230px) {
  [data-screen="overview"] .city-screen-body { padding-block: 6px 0; }
  [data-screen="overview"] h3 { font-size: 18px; margin-block: 0 4px; }
  [data-screen="overview"] .city-result-card { margin-bottom: 3px; padding-block: 4px; row-gap: 3px; }
  .city-distance-ring { width: min(100%,30.4cqw); }
  .city-distance-ring > div { gap: 2px; }
  .city-distance-ring > div > span { font-size: 8px; }
  .city-distance-ring strong { font-size: 12px; }
  .city-distance-ring strong small { font-size: 7px; }
  .city-pace-breakdown > p { margin-bottom: 3px; }
  .city-pace-legend button { min-height: 44px; padding-block: 3px; gap: 2px; font-size: 9px; }
  .city-pace-name { gap: 2px; }
  .city-pace-name i { width: 4px; height: 4px; }
  .city-pace-arrow { grid-row: 2; font-size: 8px; }
  .city-review-tools .city-app-row { min-height: 31px; padding-block: 3px; }
}

.city-phone .city-chart {
  margin-top: 14px;
  padding: 13px 9px 7px;
  background: var(--app-card,#fff);
  border-color: var(--app-line);
  border-radius: 15px;
}

.city-phone .city-chart-key { margin: 0 3px 9px; }
.city-chart-key > span:last-child { display: flex; align-items: center; gap: 4px; }
.city-chart-key > span:first-child, .city-chart-key strong { color: var(--app-text); }
.city-chart-key strong { font-variant-numeric: tabular-nums; font-weight: 700; }
.city-chart-key i { border-color: var(--app-accent,#456b9a); }

.city-phone .city-chart-plot { --city-chart-height: clamp(76px,46cqw,148px); height: var(--city-chart-height); grid-template-columns: repeat(var(--split-count,14),minmax(0,1fr)); }
.city-phone .city-chart-plot::before {
  inset: 0 1px 23px;
  background: repeating-linear-gradient(to top,var(--app-line) 0 1px,transparent 1px 25%);
  border-top-color: var(--app-line);
}

.city-phone .city-chart-plot::after {
  bottom: calc(23px + (var(--city-chart-height) - 23px) * var(--average-level,.515));
  inset-inline: 1px;
  border-color: var(--app-accent,#456b9a);
  opacity: .62;
}

.city-phone .city-split-bar {
  grid-template-rows: 1fr 23px;
  color: var(--app-muted);
  font: 10px/17px Arial,sans-serif;
  font-variant-numeric: tabular-nums;
}

.city-phone .city-split-bar::before {
  width: min(63%,14px);
  height: calc((var(--city-chart-height) - 23px) * var(--bar-level,.5));
  border-radius: 99px;
  background: linear-gradient(to top,color-mix(in srgb,var(--city-bar-color,var(--app-data-mid)),var(--app-text) 14%),var(--city-bar-color,var(--app-data-mid)));
  transform-origin: center bottom;
  transition: filter 150ms ease,opacity 150ms ease;
}

.city-split-bar { --city-bar-color: var(--pace-color,var(--app-data-mid)); }
.city-chart-plot:has(.is-in-band) .city-split-bar:not(.is-in-band):not(:hover):not(:focus-visible) { --city-bar-color: color-mix(in srgb,var(--pace-color),var(--app-card) 35%); }
.city-phone .city-split-bar[aria-pressed="true"] { z-index: 3; }
.city-phone .city-split-bar[aria-pressed="true"]::before { background: var(--pace-color,var(--app-data-mid)); box-shadow: 0 0 0 1px var(--app-text); }

.city-split-bar::after {
  content: "";
  position: absolute;
  bottom: calc(27px + (var(--city-chart-height) - 23px) * var(--bar-level,.5));
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--app-accent,#215ab9);
  opacity: 0;
  transform: translate(-50%,3px);
  transition: opacity 130ms ease,transform 170ms ease;
  pointer-events: none;
}

.city-split-bar[aria-pressed="true"]::after { opacity: 1; transform: translate(-50%,0); }
.city-split-tick { display: block; min-width: 17px; border-radius: 99px; text-align: center; }
.city-split-bar:not(:nth-child(3n)):not(:last-child):not([aria-pressed="true"]) .city-split-tick { visibility: hidden; }
.city-split-bar[aria-pressed="true"] .city-split-tick { color: var(--app-accent,#215ab9); background: var(--app-soft,#e7f1fd); }
.city-phone .city-split-bar:focus-visible { outline-offset: -2px; }
.city-phone .city-split-result { margin: 10px 0 0; padding: 7px 0; border-block: 1px solid var(--app-line); }
.city-split-result > div { min-width: 0; }
.city-phone .city-split-result small { margin-top: 2px; }
.city-phone .city-split-result strong { margin-block: 4px; }
.city-split-heading { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 7px; }
.city-split-zone { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; }
.city-split-zone::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pace-color); }
[data-screen="splits"] .city-chart { margin-top: 8px; }

@container (max-width:250px) {
  [data-screen="splits"] .city-screen-body { padding-block: 7px 2px; }
  [data-screen="splits"] h3 { font-size: 19px; margin-block: 0 4px; }
  [data-screen="splits"] .city-chart { margin-top: 0; padding: 5px 4px 2px; }
  .city-phone .city-chart-key { margin: 0 1px 4px; font-size: 8px; }
  .city-phone .city-split-bar { font-size: 8px; }
  .city-split-tick { min-width: 12px; }
  .city-phone .city-split-result { margin-top: 4px; padding-block: 2px; }
  .city-split-result { grid-template-columns: 25px minmax(0,1fr) 25px; gap: 0; }
  .city-split-result .city-icon-btn { width: 25px; }
  .city-split-heading { gap: 1px 5px; }
  .city-split-heading .city-app-label { font-size: 8px; line-height: 1.2; }
  .city-split-zone { gap: 3px; font-size: 8px; white-space: nowrap; }
  .city-split-zone::before { width: 5px; height: 5px; }
  .city-phone .city-split-result strong { font-size: 17px; margin-block: 2px; }
  .city-phone .city-split-result small { font-size: 8px; }
  [data-screen="splits"] .city-screen-action { padding-block: 3px 7px; }
  [data-screen="splits"] .city-screen-action .city-app-primary { min-height: 36px; }
}

@container (max-width:210px) {
  .city-phone .city-chart-plot { --city-chart-height: 62px; }
  .city-split-result { display: block; position: relative; }
  .city-split-result .city-icon-btn { position: absolute; inset-block-start: 11px; height: 28px; }
  .city-split-result .city-icon-btn:first-child { inset-inline-start: 0; }
  .city-split-result .city-icon-btn:last-child { inset-inline-end: 0; }
}

.city-phone button, .city-preview button { touch-action: manipulation; }
.city-phone .city-app-primary, .city-preview .city-app-primary,
.city-phone .city-app-row, .city-phone .city-icon-btn, .city-style-picks button, .city-photo-button, .city-phone-nav button {
  transition: background-color 170ms ease,border-color 170ms ease,color 170ms ease,transform 160ms var(--city-ease,ease),box-shadow 170ms ease;
}

.city-phone .city-app-primary { box-shadow: 0 1px 2px color-mix(in srgb,var(--app-primary),transparent 70%); }
.city-phone .city-app-primary:active, .city-preview .city-app-primary:active,
.city-phone .city-app-row:active, .city-phone .city-icon-btn:enabled:active,
.city-style-picks button:active, .city-photo-button:active { transform: scale(.975); }

.city-app-primary > span, .city-app-row > span:last-child, .city-phone-nav svg, .city-steps button > span:last-child, .city-reset svg {
  display: block;
  transition: transform 180ms var(--city-ease,ease);
}

.city-phone-nav button[aria-current] svg { transform: translateY(-2px); }
.city-phone-nav button:active svg { transform: translateY(1px) scale(.92); }
.city-reset:active svg { transform: rotate(-24deg); }

@media (hover:hover) {
  .city-app-primary:hover > span, .city-app-row:hover > span:last-child, .city-steps button:hover > span:last-child { transform: translateX(3px); }
  .city-phone .city-split-bar:hover::before { filter: saturate(1.3) contrast(1.07); }
}

@keyframes city-screen-in {
  from { opacity: .42; transform: translateX(var(--city-enter-x)); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes city-route-draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes city-ring-draw { from { stroke-dasharray: 0 100; opacity: 0; } to { stroke-dasharray: var(--ring-arc) 100; opacity: 1; } }
@keyframes city-bar-rise { from { transform: scaleY(.05); opacity: .2; } to { transform: scaleY(1); opacity: 1; } }
@keyframes city-data-fade { from { opacity: 0; } }

@media (prefers-reduced-motion:no-preference) {
  .city-phone-content[data-direction] .city-phone-screen:not([hidden]) { animation: city-screen-in 240ms var(--city-ease) both; }
  .city-phone-screen:not([hidden]) .city-ring-segment { animation: city-ring-draw 570ms var(--ring-delay) var(--city-ease) both; }
  .city-phone-screen:not([hidden]) .city-distance-ring > div { animation: city-data-fade 320ms 120ms ease-out both; }
  .city-phone-screen:not([hidden]) .city-split-bar::before { animation: city-bar-rise 415ms calc(55ms + var(--bar-order) * 17ms) var(--city-ease) both; }
  .city-finish:not([hidden]) [data-finish-route], .city-finish:not([hidden]) [data-finish-check], .city-phone-screen:not([hidden]) [data-heart-trace] { stroke-dasharray: 100; animation: city-route-draw 760ms var(--city-ease) both; }
  .city-finish:not([hidden]) [data-finish-check] { animation-duration: 330ms; animation-delay: 165ms; }
  .city-phone-screen:not([hidden]) [data-heart-area] { animation: city-data-fade 500ms 185ms ease-out both; }
}

@media (prefers-reduced-motion:reduce) {
  .city-phone button, .city-phone button > span, .city-steps button > span:last-child,
  .city-preview button, .city-preview button > span, .city-phone-nav svg, .city-reset svg,
  .city-phone .city-split-bar::before, .city-split-bar::after { transition: none; }
  .city-phone .city-app-primary:active, .city-preview .city-app-primary:active,
  .city-phone .city-app-row:active, .city-phone .city-icon-btn:enabled:active,
  .city-style-picks button:active, .city-photo-button:active, .city-reset:active svg,
  .city-phone-nav button:active svg, .city-phone-nav button[aria-current] svg,
  .city-app-primary:hover > span, .city-app-row:hover > span:last-child, .city-steps button:hover > span:last-child { transform: none; }
}

.city-phone .city-return-visit [data-heart-trace],.city-phone .city-return-visit [data-heart-area]{animation:none;stroke-dashoffset:0}
