/* «Чи доїду без зарядки?» (/zapas-khodu/, src/trip.js). Site tokens, .card, .select, .btn from site.css.
   Desktop: choices on the left, the answer on the right. Phone: car and route → the answer → conditions. */
.trip-head { padding-bottom: 24px; }
.trip-head__kicker { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 600; }
.trip-head__kicker .i { width: 18px; height: 18px; color: var(--ok); }
.trip-head h1 { margin-top: 8px; }

.trip {
  display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  grid-template-areas: "pick result" "cond result" ". result"; grid-template-rows: auto auto 1fr;
  align-items: start; gap: 20px; padding-bottom: 56px;
}
.trip .card { min-width: 0; padding: clamp(18px, 2.2vw, 28px); }
.trip__pick { grid-area: pick; }
.trip__result { grid-area: result; }
.trip__cond { grid-area: cond; }
@media (max-width: 960px) {
  .trip { grid-template-columns: minmax(0, 1fr); grid-template-areas: "pick" "result" "cond"; grid-template-rows: none; }
}

/* ---------- choices ---------- */
.trip__field { min-width: 0; margin: 0; padding: 0; border: 0; }
.trip__field + .trip__field { margin-top: 22px; }
.trip__field legend { margin-bottom: 10px; padding: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.trip__select, .trip__select select { display: block; width: 100%; }
.trip__select select { text-overflow: ellipsis; }
.trip__car { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: 12px; margin-top: 12px; }
.trip__car img { width: 120px; height: 64px; object-fit: contain; filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.16)); }
.trip__car img.is-photo { height: 68px; border-radius: 10px; object-fit: cover; filter: none; }
.trip__car img[hidden] ~ .trip__chips { grid-column: 1 / -1; }
.trip__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.trip__chips li { padding: 4px 10px; border-radius: 999px; background: var(--mist); font-size: 12px; font-weight: 600; white-space: nowrap; }
.trip__chips li.is-gbt { background: var(--warn-bg); color: var(--warn); }
.trip__custom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.trip__custom .field input { height: 46px; }
.trip__cycle { grid-column: 1 / -1; }
.trip__cycle .select, .trip__cycle select { display: block; width: 100%; }

/* radio pills: the native radio stays (keyboard arrows, form state), the label is the pill */
.trip__opt { position: relative; display: inline-flex; min-width: 0; cursor: pointer; }
.trip__opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.trip__opt span {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 40px; padding: 8px 14px;
  border-radius: 999px; color: var(--graphite); font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.trip__opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.trip__seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--mist-2); }
.trip__seg .trip__opt { flex: 1 1 0; }
.trip__seg .trip__opt span { padding-inline: 10px; }
.trip__seg .trip__opt:hover input:not(:checked) + span { background: rgba(255, 255, 255, 0.55); }
.trip__seg input:checked + span { background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); font-weight: 600; }
.trip__routes { display: flex; flex-wrap: wrap; gap: 6px; }
.trip__opt--route span { border: 1.5px solid var(--line); background: #fff; }
.trip__opt--route:hover input:not(:checked) + span { border-color: var(--graphite); }
.trip__opt--route input:checked + span { border-color: var(--graphite); background: var(--graphite); color: #fff; }

.trip__temp { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-top: 12px; }
.trip__temp input { width: 100%; height: 32px; margin: 0; background: transparent; accent-color: var(--graphite); cursor: pointer; }
.trip__temp output { min-width: 4.4em; font-size: 20px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.trip__duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 22px 12px; margin-top: 22px; }
.trip__duo .trip__field + .trip__field { margin-top: 0; }
.trip__check { display: flex; align-items: flex-start; gap: 12px; margin-top: 22px; font-weight: 500; cursor: pointer; }
.trip__check input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--graphite); cursor: inherit; }
.trip__check small { display: block; color: var(--muted); font-size: 12px; }
.trip__fine { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.trip__fine a { color: inherit; text-underline-offset: 2px; }
.trip__echo { display: none; }
@media (max-width: 960px) {
  /* on a phone the answer is above the conditions: repeat it where the thumb is */
  .trip__echo { display: block; margin-top: 18px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--mist); font-size: 14px; font-weight: 600; }
}

/* ---------- the answer ---------- */
.trip__result { display: grid; gap: 18px; }
.trip__verdict { font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; line-height: 1.2; }
.trip__sub { margin-top: 6px; color: var(--muted); }
.trip__result.is-bad .trip__verdict { color: var(--danger); }

.trip__map { overflow: hidden; border-radius: var(--r-md); background: linear-gradient(180deg, #eef3f8, var(--mist)); }
.trip__map svg { --u: 1; display: block; width: 100%; height: auto; max-height: min(460px, 62vh); }
.trip__land { fill: #fff; stroke: #d5d8dc; stroke-width: calc(1.2px * var(--u)); stroke-linejoin: round; }
.trip__river { fill: none; stroke: #bfd5ea; stroke-width: calc(2px * var(--u)); stroke-linecap: round; stroke-linejoin: round; }
.trip__sea { fill: #7f9bb3; font: italic 500 calc(12px * var(--u)) var(--font); letter-spacing: 0.04em; }
.trip__dest circle { fill: #b5b7bb; }
.trip__dest.is-on text, .is-zoomed .trip__dest text { display: none; } /* the route layer names the destination */
.trip__label { fill: var(--muted); font: 600 12px var(--font); paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.trip__label--big { fill: var(--ink); font-size: 14px; stroke-width: 4px; }
.trip__ghost { fill: none; stroke: #c9ccd1; stroke-width: calc(3px * var(--u)); stroke-linecap: round; stroke-linejoin: round; }
.trip__line { fill: none; stroke: var(--graphite); stroke-width: calc(4px * var(--u)); stroke-linecap: round; stroke-linejoin: round; }
.trip__town { fill: #fff; stroke: #9a9da2; stroke-width: 1.5px; }
.trip__end { fill: var(--graphite); stroke: #fff; stroke-width: 2px; }
.trip__charge circle { fill: #fff; stroke: var(--ok); stroke-width: 2.5px; }
.trip__charge text { fill: var(--ok); font: 700 12px var(--font); }
.trip__charge .trip__ring { fill: none; opacity: 0; transform-box: fill-box; transform-origin: center; }
.trip__charge.is-on .trip__ring { animation: trip-ring 1.2s ease-out 2; }
@keyframes trip-ring { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(2.6); } }
.trip__car-dot { filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3)); }
.trip__car-dot circle { fill: var(--graphite); stroke: #fff; stroke-width: 3px; }
.trip__car-dot .trip__car-core { fill: #fff; stroke: none; }

.trip__batt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; }
.trip__bar { position: relative; height: 12px; overflow: hidden; border-radius: 999px; background: var(--mist-2); }
.trip__bar i { position: absolute; inset: 0; border-radius: inherit; background: var(--graphite); transform: scaleX(var(--soc, 1)); transform-origin: left; }
.trip__bar i.is-low { background: var(--danger); }
.trip__bar i.is-charging { background: var(--ok); }
.trip__batt b { min-width: 3.4em; font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; }

.trip__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--line); }
.trip__stats div { padding: 12px 16px; background: #fff; }
.trip__stats dt { color: var(--muted); font-size: 12px; }
.trip__stats dd { margin-top: 2px; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

.trip__box h3 { margin-bottom: 10px; font-size: 16px; font-weight: 700; }
.trip__charges { display: grid; gap: 8px; }
.trip__charges li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--ok-bg); }
.trip__n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--ok); font-size: 14px; font-weight: 700; }
.trip__charges b { display: block; font-size: 15px; }
.trip__charges small { display: block; color: var(--muted); font-size: 12px; }
.trip__when { text-align: right; white-space: nowrap; }
/* real stations by a charging stop (src/trip.js nearStops): the car's inlet first, the others muted */
.trip__near, .trip__near-note { grid-column: 2 / -1; }
.trip__near { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid rgba(24, 121, 78, 0.2); }
.trip__charges .trip__near li { display: block; padding: 0; border-radius: 0; background: none; font-size: 13px; line-height: 1.35; }
.trip__near a { font-weight: 600; text-underline-offset: 3px; }
.trip__near li:not(.is-fit) a { color: var(--muted); font-weight: 500; }
.trip__near-note { color: var(--warn); font-size: 12px; }

.trip__cost { display: grid; gap: 8px; }
.trip__cost-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 14px; }
.trip__meter { position: relative; height: 10px; overflow: hidden; border-radius: 999px; background: var(--mist-2); }
.trip__meter i { position: absolute; inset: 0; border-radius: inherit; transform: scaleX(var(--w, 0)); transform-origin: left; }
.trip__cost-row--ev .trip__meter i { background: var(--ok); }
.trip__cost-row--ice .trip__meter i { background: #9aa0a6; }
.trip__cost-row b { min-width: 6.5em; text-align: right; font-variant-numeric: tabular-nums; }
.trip__saving { margin-top: 2px; color: var(--ok); font-weight: 700; }

.trip__cta { display: flex; flex-wrap: wrap; gap: 10px; }
.trip__status { color: var(--ok); font-size: 14px; font-weight: 600; }
.trip__status:empty { position: absolute; } /* out of the grid while empty, but still a live region */
@media (max-width: 560px) {
  .trip-head .sec__lead { font-size: 15px; }
  .trip__stats div { padding: 10px 12px; }
  .trip__stats dd { font-size: 16px; white-space: nowrap; }
  .trip__cta .btn { flex: 1 1 100%; }
  .trip__cost-row { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .trip__cost-row b { min-width: 0; }
}

/* ---------- how we count ---------- */
.trip-how { padding-bottom: 96px; }
.trip-how > * { max-width: 880px; }
.trip-how h2 { margin-bottom: 14px; font-size: clamp(22px, 2.4vw, 28px); }
.trip-how ul { display: grid; gap: 10px; padding-left: 20px; color: #2c2e31; font-size: 15px; list-style: disc; }
.trip-how .trip__fine { margin-top: 18px; font-size: 13px; }
.trip-how .linklike { color: var(--graphite); font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* without JS the answer for the first car and Lviv stays; the choices would do nothing */
html:not(.js) .trip__pick, html:not(.js) .trip__cond, html:not(.js) [data-share] { display: none; }
html:not(.js) .trip { grid-template-columns: minmax(0, 1fr); grid-template-areas: "result"; }
