/* The trip calculator (site/build/trip-calculator.mjs, public/js/trip-v4.js): a card on the fuel cost
   calculator page, and a bar along the bottom of the screen on car pages. Changed? Save as trip-v4.css. */
.trip{--tr-green:#3ed67c;color:var(--fg);font-size:17px;line-height:1.35}
.trip [hidden]{display:none!important}
.tr-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.tr-title{font-size:clamp(24px,2.4vw,30px);letter-spacing:-.02em;margin:0 0 16px}

/* From and to, joined by a route line like the app's drives */
.tr-route{position:relative;display:grid;grid-template-columns:18px minmax(0,1fr) 44px;gap:0 12px;align-items:center;background:var(--bg);border:1px solid var(--raised);border-radius:20px;padding:6px 8px 6px 16px}
.tr-route:focus-within{border-color:#4a4a4f}
.tr-line{display:flex;flex-direction:column;align-items:center;height:68px;justify-content:space-between;padding:7px 0}
.tr-line i{width:12px;height:12px;border-radius:50%;flex:none}
.tr-line .from{background:var(--tr-green)}
.tr-line .to{background:var(--orange)}
.tr-line b{flex:1;width:2px;margin:3px 0;background:var(--raised)}
.tr-place{position:relative}
.tr-place + .tr-place{border-top:1px solid var(--raised)}
.tr-place input{width:100%;height:50px;background:none;border:0;outline:0;color:var(--fg);font:inherit;font-size:18px;font-weight:500;padding:0}
.tr-place input::placeholder{color:var(--muted);font-weight:400}
.tr-swap{width:40px;height:40px;border-radius:50%;border:0;background:var(--raised);color:var(--fg);display:grid;place-items:center;cursor:pointer;transition:background-color .15s,transform .2s var(--ease)}
.tr-swap:hover{background:#353539}
.tr-swap:active{transform:rotate(180deg)}
.tr-swap svg{width:20px;height:20px}

/* Suggestions */
.tr-list{position:absolute;z-index:30;left:-8px;right:-52px;top:calc(100% + 8px);margin:0;padding:6px;list-style:none;background:var(--raised);border-radius:18px;max-height:min(320px,46vh);overflow-y:auto;box-shadow:0 14px 32px rgba(0,0,0,.5)}
.tr-find .tr-list{left:0;right:0}
.tr-list li{padding:9px 12px;border-radius:12px;cursor:pointer}
.tr-list li[aria-selected="true"],.tr-list li:hover{background:#3a3a3e}
.tr-list b{display:block;font-weight:600;font-size:16px;line-height:1.3}
.tr-list small{display:block;color:#b4b4b9;font-size:14px}
.tr-list .tr-empty{color:#b4b4b9;cursor:default;background:none}

/* One way, return and split */
.tr-toggles{display:flex;flex-wrap:wrap;justify-content:space-between;gap:10px;margin-top:14px}
.tr-seg{display:inline-flex;align-items:center;gap:2px;background:var(--bg);border-radius:999px;padding:3px}
.tr-seg span{color:var(--muted);font-size:15px;padding:0 8px 0 12px}
.tr-seg button{min-width:38px;height:36px;padding:0 14px;border:0;border-radius:999px;background:none;color:var(--muted);font:inherit;font-size:15px;font-weight:600;cursor:pointer;transition:background-color .15s,color .15s}
.tr-seg button:hover{color:var(--fg)}
.tr-seg button[aria-pressed="true"]{background:#fff;color:#000}

/* The finer details */
.tr-details{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin-top:18px}
.tr-field{position:relative;display:grid;gap:6px;font-size:15px;color:var(--muted);font-weight:500}
.tr-pair{display:grid;grid-template-columns:minmax(0,1fr) 112px;gap:8px}
.trip .tr-field input,.trip .tr-field select{width:100%;height:46px;border-radius:14px;border:1px solid var(--raised);background:var(--bg);color:var(--fg);font:inherit;font-size:16px;padding:0 14px;-webkit-appearance:none;appearance:none;outline:0}
.trip .tr-field select{background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);background-position:calc(100% - 20px) 20px,calc(100% - 15px) 20px;background-size:5px 5px;background-repeat:no-repeat;padding-right:34px}
.trip .tr-field input:focus,.trip .tr-field select:focus{border-color:var(--orange)}

/* The answer */
.tr-result{display:flex;flex-direction:column;gap:2px}
.tr-big{font-size:clamp(52px,6vw,76px);font-weight:700;letter-spacing:-.035em;line-height:1;font-variant-numeric:tabular-nums}
.tr-share{color:var(--orange);font-weight:600;margin-top:6px}
.tr-facts{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--raised);border-radius:16px;overflow:hidden;margin:18px 0 0}
.tr-facts div{background:#232326;padding:12px 14px}
.tr-facts dt{color:var(--muted);font-size:14px}
.tr-facts dd{margin:2px 0 0;font-size:18px;font-weight:600;font-variant-numeric:tabular-nums}
.tr-note{color:var(--muted);font-size:14px;margin:12px 0 0}
.tr-credit{grid-column:1 / -1;color:var(--muted);font-size:13px;margin:0}
.tr-credit a{color:inherit}

/* On the fuel cost calculator page */
.trip-card{background:var(--card);border-radius:28px;padding:clamp(18px,3.4vw,36px);margin-top:28px;display:grid;grid-template-columns:minmax(0,1fr);gap:24px}
@media (min-width:860px){
  .trip-card .tr-details,.trip-dock .tr-details{grid-template-columns:1fr 1fr}
  .trip .tr-wide{grid-column:1 / -1}
}
@media (min-width:1000px){
  /* Wider than the page's text column, centred on it. */
  .trip-card{width:min(1080px,calc(100vw - var(--gut) * 2));margin-left:calc(50% - min(540px,50vw - var(--gut)));grid-template-columns:minmax(0,1.25fr) minmax(300px,1fr);column-gap:clamp(32px,4vw,56px);align-items:start}
  .trip-card .tr-result{position:sticky;top:96px;background:#1f1f22;border-radius:22px;padding:24px}
}

/* On car pages: a bar along the bottom of the screen, like the app's tab bar */
.trip-dock{position:fixed;left:0;right:0;bottom:0;z-index:15;background:var(--card);border-top:1px solid var(--raised);padding-bottom:env(safe-area-inset-bottom)}
.tr-bar{display:flex;align-items:center;gap:12px;max-width:1180px;margin:0 auto;padding:9px var(--gut)}
.tr-open{flex:1;min-width:0;background:none;border:0;padding:2px 0;color:inherit;font:inherit;text-align:left;cursor:pointer;display:flex;flex-direction:column}
.tr-open-title{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tr-open-sub{color:var(--muted);font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tr-bar-cost{font-size:24px;font-weight:700;letter-spacing:-.02em;font-variant-numeric:tabular-nums;white-space:nowrap}
.tr-chev{flex:none;width:44px;height:44px;border-radius:50%;border:0;background:var(--orange);color:#000;display:grid;place-items:center;cursor:pointer;transition:background-color .15s}
.tr-chev:hover{background:#ff8526}
.tr-chev svg{width:22px;height:22px;transition:transform .25s var(--ease)}
.trip-dock.open .tr-chev{background:var(--raised);color:var(--fg)}
.trip-dock.open .tr-chev svg{transform:rotate(180deg)}
.tr-sheet{max-width:1180px;margin:0 auto;padding:6px var(--gut) 18px;display:grid;grid-template-columns:minmax(0,1fr);gap:20px;max-height:min(78vh,calc(100dvh - 150px));overflow-y:auto;overscroll-behavior:contain;animation:tr-up .24s var(--ease)}
@keyframes tr-up{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
.tr-sheet .tr-route,.tr-sheet .trip-seg{background:var(--bg)}
/* Inside the sheet a long list would be cut off, so suggestions push the fields down instead. */
.tr-sheet .tr-list{position:static;margin:2px -4px 8px;box-shadow:none;max-height:216px}
.tr-sheet .tr-result{background:#232326;border-radius:20px;padding:18px}
.tr-sheet .tr-facts div{background:#2a2a2d}
.tr-sheet .tr-facts{background:#343438}
body.has-dock{padding-bottom:calc(80px + env(safe-area-inset-bottom))}
@media (min-width:860px){
  .tr-sheet{grid-template-columns:minmax(0,1.25fr) minmax(320px,1fr);column-gap:40px;align-items:start}
}
@media (prefers-reduced-motion:reduce){.tr-sheet{animation:none}.tr-swap,.tr-chev svg{transition:none}}
/* Phones: the answer comes straight after the route, with the finer details below it. */
@media (max-width:859px){
  .trip .tr-left{display:contents}
  .trip .tr-title{order:0;margin:0}
  .trip .tr-route{order:1}
  .trip .tr-toggles{order:2;margin-top:0}
  .trip .tr-result{order:3}
  .trip .tr-details{order:4;margin-top:0}
  .trip .tr-credit{order:5}
}

/* The route on a map, and the waitlist once a trip is worked out */
.tr-map{height:220px;border-radius:16px;overflow:hidden;background:#17171a;margin-top:12px}
.tr-map .maplibregl-ctrl-attrib{font-size:11px}
.tr-ask{margin-top:14px;padding-top:14px;border-top:1px solid var(--raised)}
.tr-ask b{display:block;font-size:17px;font-weight:600;line-height:1.25}
.tr-ask p{color:var(--muted);font-size:14px;margin:4px 0 10px}
.tr-ask .wl-note{margin-left:0;font-size:14px}
.tr-ask .wl-row{padding-left:16px}

/* Share this trip */
.tr-send{align-self:flex-start;height:40px;margin-top:12px;padding:0 16px;border:0;border-radius:999px;background:var(--raised);color:var(--fg);font:inherit;font-size:15px;font-weight:600;cursor:pointer;transition:background-color .15s}
.tr-send:hover{background:#353539}
/* UK number plate lookup (calculator page, UK visitors only). The plate is drawn exactly as the app draws
   it (GarageNumberPlates.swift): 520 x 111 mm, rear yellow, the statutory character chart, the blue UK band.
   public/js/trip-v4.js paints it into the SVG from what's typed; the input sits on top, its own text hidden. */
.tr-plate-row{display:flex;gap:10px;align-items:center}
.tr-plate-box{position:relative;flex:1 1 auto;min-width:0;max-width:420px;aspect-ratio:520/111;border-radius:.96%/4.5%}
.tr-plate-art{position:absolute;inset:0;width:100%;height:100%;display:block}
.trip .tr-plate-box input{position:absolute;inset:0;width:100%;height:100%;border:0;border-radius:inherit;background:transparent;color:transparent;caret-color:transparent;font-size:16px;text-transform:uppercase;padding:0;cursor:text}
.trip .tr-plate-box input::placeholder{color:transparent}
.trip .tr-plate-box input::selection{background:transparent;color:transparent}
.trip .tr-plate-box input:focus{border:0}
.tr-plate-box:focus-within{box-shadow:0 0 0 3px var(--orange)}
.tr-plate-caret{animation:tr-blink 1.06s steps(1) infinite}
@keyframes tr-blink{50%{opacity:0}}
.tr-plate-go{flex:none;align-self:stretch;border:0;border-radius:14px;background:var(--orange);color:#000;font:inherit;font-size:16px;font-weight:700;padding:0 18px;cursor:pointer;transition:opacity .15s}
.tr-plate-go:disabled{opacity:.55;cursor:default}
.tr-plate-note{margin:0;font-size:14px;color:var(--muted);font-weight:400}
.tr-plate-note:empty{display:none}
.tr-plate-note.bad{color:#ff8a80}
@media (max-width:420px){.tr-plate-row{flex-wrap:wrap}.tr-plate-box{flex-basis:100%;max-width:none}.tr-plate-go{flex:1;height:46px}}
