/* «Де моє авто» (/track/): src/track.js + public/js/track.js. Tokens and .card/.field/.btn — site.css. */
.trk-head { padding-bottom: 20px; }
.trk { display: grid; gap: 20px; padding-bottom: 96px; }
.trk-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 18px; border: 1px dashed #c9ccd1; border-radius: var(--r-md); color: var(--muted); font-size: 14px; }
.trk-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.trk .card { padding: clamp(18px, 2.2vw, 28px); }
.trk-h { margin-bottom: 14px; font-size: 18px; }
.trk-fine { color: var(--muted); font-size: 12px; }

/* the form */
.trk-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 12px 16px; }
.trk-form .btn { min-height: 52px; }
.trk-form input[name="code"] { text-transform: uppercase; }
.trk-form input[name="code"]::placeholder { text-transform: none; }
.trk-form__hint, .trk-form .lead__error { grid-column: 1 / -1; }
.trk-form__hint { color: var(--muted); font-size: 13px; }

/* the answer: car, date and stages on the left; map, ship, documents and the manager on the right */
.trk-res { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; gap: 20px; }
.trk-res__main, .trk-res__side { display: grid; gap: 20px; }

.trk-car { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; }
.trk-car__code { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.trk-car__code span { white-space: nowrap; }
.trk-car__code b[data-o="code"] { color: var(--ink); letter-spacing: 0.06em; }
.trk-car__name { margin-top: 6px; font-size: clamp(24px, 2.6vw, 34px); line-height: 1.15; }
.trk-car__name:focus { outline: none; }
.trk-car__info { margin-top: 4px; color: var(--muted); font-size: 14px; }
.trk-car__img { flex: none; width: clamp(140px, 14vw, 200px); filter: drop-shadow(0 14px 10px rgba(0, 0, 0, 0.16)); }

.trk-eta { display: grid; gap: 14px; }
.trk-eta__top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 20px; }
.trk-eta small { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.trk-eta strong { display: block; font-size: clamp(26px, 3vw, 38px); font-weight: 600; line-height: 1.15; }
.trk-eta__days { text-align: right; }
.trk-eta__days b { display: block; font-size: clamp(36px, 4vw, 52px); line-height: 1; font-variant-numeric: tabular-nums; }
.trk-bar { position: relative; height: 8px; border-radius: 999px; background: var(--mist-2); overflow: hidden; }
.trk-bar i { position: absolute; inset: 0; border-radius: inherit; background: var(--graphite); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1); }

.trk-stages li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 14px; padding-bottom: 22px; }
.trk-stages li:last-child { padding-bottom: 0; }
.trk-stages li::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--line); }
.trk-stages li.is-done::before { background: var(--graphite); }
.trk-stages li:last-child::before { display: none; }
.trk-dot { position: relative; display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid var(--line); border-radius: 50%; background: #fff; }
.trk-dot svg { width: 14px; height: 14px; }
.is-done .trk-dot { border-color: var(--graphite); background: var(--graphite); color: #fff; }
.is-now .trk-dot { border-color: var(--graphite); }
.is-now .trk-dot::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--graphite); }
.is-now .trk-dot::before { content: ""; position: absolute; inset: -2px; border: 2px solid var(--graphite); border-radius: 50%; animation: trk-ping 1.8s ease-out infinite; }
@keyframes trk-ping { to { transform: scale(1.9); opacity: 0; } }
.trk-stages h3 { font-size: 15px; font-weight: 600; line-height: 1.35; }
.trk-stages .is-next h3 { color: var(--muted); font-weight: 500; }
.trk-stages p { margin-top: 2px; color: var(--muted); font-size: 13px; }
.trk-stages time { color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.trk-stages .is-now time { color: var(--ink); }

/* the map: land, Ukraine (with Crimea), the route behind and ahead, the ship. --k = map units per screen pixel (track.js):
   lines, labels and the ship keep their size on any screen */
.trk-map { display: grid; gap: 12px; }
.trk-map__svg { --k: 1; display: block; width: 100%; height: auto; border-radius: var(--r-md); background: #eef2f6; }
.trk-map__land { fill: #dce1e7; }
.trk-map__ua { fill: #c3cad3; stroke: #fff; stroke-width: calc(1px * var(--k)); }
.trk-map__ahead { fill: none; stroke: #8f96a0; stroke-width: calc(2px * var(--k)); stroke-dasharray: calc(3px * var(--k)) calc(6px * var(--k)); stroke-linecap: round; stroke-linejoin: round; }
.trk-map__done { fill: none; stroke: var(--graphite); stroke-width: calc(3px * var(--k)); stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.trk-map__port { r: calc(4px * var(--k)); fill: #fff; stroke: var(--graphite); stroke-width: calc(2px * var(--k)); }
.trk-map__label { font: 600 calc(11px * var(--k)) var(--font); fill: var(--graphite); paint-order: stroke; stroke: #eef2f6; stroke-width: calc(4px * var(--k)); stroke-linejoin: round; translate: calc(14px * var(--k)) calc(4px * var(--k)); }
.trk-map__label[text-anchor="end"] { translate: calc(-14px * var(--k)) calc(4px * var(--k)); }
.trk-map__mark { transform-box: fill-box; transform-origin: center; transform: scale(var(--k)); }
.trk-map__mark circle { fill: var(--graphite); stroke: #fff; stroke-width: 3; }
.trk-map__mark path { fill: #fff; }
.trk-map__ship.is-done path { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.trk-map__mark .trk-map__halo { fill: var(--graphite); stroke: none; opacity: 0.14; transform-box: fill-box; transform-origin: center; animation: trk-halo 2.4s ease-in-out infinite; }
@keyframes trk-halo { 50% { transform: scale(1.6); opacity: 0.04; } }
.trk-where { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; font-size: 14px; }
.trk-where b { font-weight: 700; }
.trk-where span { color: var(--muted); }

.trk-dl { display: grid; gap: 8px; margin-bottom: 16px; font-size: 14px; }
.trk-dl div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.trk-dl dt { color: var(--muted); }
.trk-dl dd { font-weight: 600; text-align: right; overflow-wrap: anywhere; }

.trk-docs__list { display: flex; flex-wrap: wrap; gap: 6px; }
.trk-docs__list li { padding: 6px 12px; border: 1px dashed #c9ccd1; border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 600; }
.trk-docs__list li.is-ready { border: 0; background: var(--mist-2); color: var(--ink); }
.trk-docs__list span { font-weight: 500; }

.trk-help p { color: var(--muted); font-size: 14px; }
.trk-help__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.trk-demo { display: grid; gap: 8px; padding: 14px 16px; border: 1px dashed #c9ccd1; border-radius: var(--r-md); color: var(--muted); font-size: 13px; }
.trk-demo input { width: 100%; accent-color: var(--graphite); }

@media (max-width: 960px) {
  .trk-res { grid-template-columns: minmax(0, 1fr); }
  /* phones: car, date, map (and the demo slider), ship, stages, documents, help */
  .trk-res__main, .trk-res__side { display: contents; }
  .trk-car { order: 1; } .trk-eta { order: 2; } .trk-map { order: 3; } .trk-demo { order: 4; }
  .trk-ship { order: 5; } .trk-steps { order: 6; } .trk-docs { order: 7; } .trk-help { order: 8; }
}
@media (max-width: 640px) {
  .trk-form { grid-template-columns: minmax(0, 1fr); }
  .trk-car__img { width: 120px; }
  .trk-help__cta .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .is-now .trk-dot::before, .trk-map__mark .trk-map__halo { animation: none; }
  .trk-bar i { transition: none; }
}
