/* Road trip calculator */
.page-hero:has(+ [data-trip-tool]) { padding-block: clamp(22px, 4vw, 50px); }
[data-trip-tool] { margin-top: clamp(16px, 3vw, 32px); }
.trip-grid { display: grid; grid-template-columns: minmax(0, 1.24fr) minmax(0, 1fr); align-items: start; gap: clamp(14px, 2.4vw, 28px); }
.trip-panel { border: 1px solid var(--concept-line); border-radius: clamp(16px, 2.2vw, 24px); background: #fff; }
.trip-form { padding: clamp(15px, 3vw, 30px); box-shadow: 0 8px 24px #183a6c0c; }
.trip-heading { display: flex; gap: 11px; align-items: center; }
.trip-heading h2 { font-size: clamp(1.23rem, 2.5vw, 1.65rem); line-height: 1.2; }
.trip-icon { display: grid; width: 42px; height: 42px; place-items: center; flex: 0 0 auto; border-radius: 13px; background: var(--ice); color: var(--blue); }
.trip-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: end; }
.trip-heading + .trip-fields { margin-top: 21px; }
.trip-field { display: grid; min-width: 0; align-self: start; gap: 6px; }
/* Fields side by side share their rows (label · input · error): a label on two lines never pushes
   its input below the neighbouring one. */
@supports (grid-template-rows: subgrid) {
  .trip-fields { row-gap: 14px; }
  .trip-field { grid-row: span 3; grid-template-rows: subgrid; row-gap: 6px; align-self: stretch; }
  .trip-field > label { grid-row: 1; align-self: end; }
  .trip-field > input { grid-row: 2; }
  .trip-field > .errorlist { grid-row: 3; margin-top: 0; }
}
.trip-field label { font-size: .87rem; font-weight: 800; line-height: 1.35; }
.trip-field label span { color: var(--muted); font-size: .79rem; }
.trip-field input { min-height: 48px; width: 100%; min-width: 0; padding: 9px 12px; border: 1px solid #bccde4; border-radius: 11px; background: #fbfdff; color: var(--ink); font-size: 1rem; }
.trip-field input::placeholder { color: #64758c; }
.trip-field input[aria-invalid="true"] { border-color: #b5392d; }
.trip-form .errorlist { padding: 0; margin: 3px 0 0; list-style: none; color: #9b2d21; font-size: .84rem; }
.trip-toggle { display: flex; align-items: center; gap: 11px; margin: 16px 0 21px; padding: 10px 12px; border-radius: 12px; background: var(--concept-paper); cursor: pointer; }
.trip-toggle input { width: 19px; height: 19px; margin: 0; accent-color: var(--blue); flex: none; }
.trip-toggle small { display: block; color: var(--muted); font-size: .81rem; }
.trip-fuels { min-inline-size: 0; margin: 0 0 18px; padding: 0; border: 0; }
.trip-fuels legend { padding: 0; font-weight: 800; }
.trip-hint { color: var(--muted); font-size: .84rem; }
.trip-fuel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 9px; }
.trip-fuel { display: flex; align-items: flex-start; gap: 6px; min-width: 0; padding: 10px 8px; border: 1px solid #c8d6e9; border-radius: 12px; cursor: pointer; }
.trip-fuel:has(input:checked:not(:disabled)) { background: #eaf3ff; border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.trip-fuel:has(input:disabled) { background: #f5f7fa; color: var(--muted); cursor: not-allowed; }
.trip-fuel input { width: 15px; height: 15px; margin: 2px 0 0; flex: none; accent-color: var(--blue); }
.trip-fuel strong, .trip-fuel small { display: block; line-height: 1.35; overflow-wrap: anywhere; }
.trip-fuel strong { font-size: .88rem; }
.trip-fuel small { margin-top: 4px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .8rem; }
.trip-options { border-block: 1px solid var(--concept-line); }
:is(.trip-options, .trip-method) summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; font-weight: 800; font-size: .91rem; }
:is(.trip-options, .trip-method) summary::-webkit-details-marker { display: none; }
:is(.trip-options, .trip-method)[open] summary .icon { transform: rotate(180deg); }
.trip-options .trip-fields { padding-bottom: 14px; }
.trip-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 17px; }
.trip-actions .button { min-height: 48px; }
.trip-actions .button:disabled { opacity: .6; cursor: not-allowed; }
.trip-warning { margin-top: 9px; padding: 9px 11px; border: 1px solid #f0d5a9; border-radius: 10px; background: #fff7e8; color: #644516; font-size: .85rem; }
:is(#trip-outcome, #trip-form) { scroll-margin-top: 120px; }
.trip-result { overflow: hidden; }
.trip-result-head { padding: clamp(16px, 3vw, 28px); background: linear-gradient(125deg, #12469e, #195fc9); color: #fff; }
.trip-result-success { border-color: #b9dfcd; }
.trip-result-success .trip-result-head { background: linear-gradient(125deg, #07523b, #087458); }
.trip-result-head .trip-icon { color: #fff; background: #ffffff24; }
.trip-result-intro { margin-top: 13px; max-width: 43ch; color: #edf5ff; }
.trip-result-body { padding: clamp(14px, 2.7vw, 24px); }
.trip-total { margin-top: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.trip-total strong { font-size: clamp(2.45rem, 5.4vw, 3.85rem); line-height: 1.04; letter-spacing: -.055em; }
.trip-total small { color: #edf5ff; font-size: .98rem; font-weight: 800; }
.trip-result-success .trip-total small { color: #e5fff2; }
.trip-result dl { margin: 0; }
.trip-result dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.trip-result dd small { font-size: .76rem; font-weight: 700; }
.trip-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.trip-metrics div { padding: 9px 11px; border-radius: 10px; background: var(--concept-paper); }
.trip-metrics dt { font-size: .79rem; color: var(--muted); }
.trip-metrics dd { font-size: 1.16rem; color: var(--blue-deep); }
.trip-breakdown div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-block: 8px; border-bottom: 1px solid var(--concept-line); font-size: .9rem; }
.trip-breakdown dd { text-align: end; }
.trip-price-used { margin-top: 12px; font-size: .87rem; color: var(--muted); }
.trip-price-used strong { color: var(--ink); }
.trip-edit { display: none; }
.trip-checked { margin-top: 9px; }
.trip-checked .icon { width: 15px; height: 15px; color: var(--blue); }
.trip-method { margin-top: 13px; padding: 0 clamp(14px, 2.5vw, 22px); background: var(--concept-paper); }
.trip-method p { margin-block: 0 8px; color: var(--muted); }
.trip-method-links { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-bottom: 12px; }
@media (max-width: 760px) {
  .trip-grid { grid-template-columns: minmax(0, 1fr); }
  .trip-result-success { grid-row: 1; }
  :is(#trip-outcome, #trip-form) { scroll-margin-top: 108px; }
  .trip-edit { display: inline-block; margin-top: 8px; }
}
@media (max-width: 410px) {
  .trip-fields { grid-template-columns: minmax(0, 1fr); }
  .trip-fuel { flex-direction: column; }
  .trip-actions .button { width: 100%; }
}