/* The booking page (/book/) and the ticket page (/ticket/): what only they
   draw. site.css holds the tokens, the header, buttons, chips, messages and the
   step strip, shared with the landing page - a passenger walks from one page
   to the next and should not see the furniture change. The ticket page's
   service worker keeps both sheets for a ticket opened without a connection. */
.wrap{max-width:1080px}
main.wrap{padding-block:1rem 2.5rem;display:grid;gap:.9rem}
/* A ticket is a column to read down, not a page to fill. */
main.wrap.narrow,main.wrap.narrow + footer.foot{max-width:800px}
footer.foot{padding-block:0 2rem;color:var(--steel-text);font-size:.84rem;font-weight:600;display:flex;flex-wrap:wrap;gap:0 1.1rem}
footer.foot a{display:inline-flex;align-items:center;min-height:44px}
h1{font-size:1.5rem}
.lead{color:var(--ink-soft);font-size:.95rem;margin-top:.2rem}
.back-link{justify-self:start;display:inline-flex;align-items:center;gap:.35rem;min-height:44px;font-weight:800;font-size:.9rem;color:var(--ink-soft);text-decoration:none}
.back-link::before{content:"›";font-size:1.2rem;line-height:1}
[dir=ltr] .back-link::before{content:"‹"}
.back-link:hover{color:var(--ink);text-decoration:underline}

/* ---- the booking page: the step on one side, the trip and its total on the
   other. On a phone the trip comes first, then the step under it. */
.book-grid{display:grid;gap:.9rem;grid-template-columns:minmax(0,1fr);align-items:start}
.book-main,.book-main form{display:grid;gap:.9rem;min-width:0}
@media (min-width:900px){
  .book-grid{grid-template-columns:minmax(0,1fr) 22rem;gap:1.25rem}
  .book-main{grid-column:1;grid-row:1}
  .book-side{grid-column:2;grid-row:1;position:sticky;top:5rem}
}
.sum-title{font-size:.8rem;font-weight:800;color:var(--steel-text);margin-bottom:.5rem}
.trip-more{margin-top:.8rem;border-top:1px dashed var(--line);padding-top:.2rem}
.trip-more summary{cursor:pointer;font-weight:800;font-size:.9rem;min-height:44px;display:flex;align-items:center;gap:.4rem;color:var(--border-c)}
.trip-more .journey{margin-top:.2rem}
.sum-lines{margin-top:.8rem;border-top:1px dashed var(--line);padding-top:.8rem}
.hold{margin-top:.8rem;background:var(--raha-wash);border-radius:var(--r-sm);padding:.6rem .75rem;font-weight:700;font-size:.9rem;color:var(--raha-ink);display:flex;justify-content:space-between;gap:.75rem;align-items:center;flex-wrap:wrap}
.hold b{font-family:"IBM Plex Mono",ui-monospace,monospace;font-size:1.05rem}
.step-title{font-size:1.15rem;margin-bottom:.25rem}
.step-title:focus{outline:none}
.step-sub{color:var(--ink-soft);font-size:.92rem;font-weight:600;margin-bottom:.9rem}
.pay-note{color:var(--steel-text);font-size:.85rem;font-weight:600;margin-top:.6rem;text-align:center}
.count-row{display:flex;justify-content:space-between;align-items:center;gap:.5rem;flex-wrap:wrap;background:var(--sand);border-radius:var(--r-md);padding:.7rem .9rem;margin-bottom:.9rem}
.count-row b{font-size:1rem}

/* ---- the trip */
.trip-op{font-weight:900;font-size:1.05rem}
.trip-times{display:grid;grid-template-columns:auto 1fr auto;gap:.9rem;align-items:center;margin-top:.7rem}
.trip-when b{display:block;font-size:1.45rem;line-height:1.1}
.trip-when small{display:block;color:var(--steel-text);font-size:.8rem;font-weight:600}
.trip-span{display:grid;gap:.25rem;justify-items:center}
.trip-span small{color:var(--steel-text);font-size:.76rem;font-weight:700}
.trip-line{display:block;width:100%;height:2px;background:var(--line)}
.trip-day{margin-top:.35rem;color:var(--ink-soft);font-weight:700;font-size:.9rem}
.trip-arrives{margin-top:.2rem;color:var(--raha-ink);font-weight:700;font-size:.85rem}
.trip-report{margin-top:.6rem;background:var(--raha-wash);color:var(--raha-ink);border-radius:var(--r-sm);padding:.55rem .75rem;font-weight:700;font-size:.88rem}
.price b{font-size:1.25rem}
.price small{color:var(--steel-text);font-size:.78rem;font-weight:600;margin-inline-start:.35rem}

/* The journey, in the order the server gave it. The crossing is its own node,
   in the border's own colour, with its duration estimate (hard rule 3). */
.journey{list-style:none;margin:.9rem 0 0;padding:0;display:grid}
.journey li{display:grid;grid-template-columns:3.6rem 14px 1fr;gap:.6rem;align-items:start;padding-block:.35rem;position:relative}
.journey time{font-weight:800;font-size:.9rem;color:var(--ink-soft);text-align:end}
.journey .dot{width:12px;height:12px;border-radius:50%;border:2.5px solid var(--ink);background:var(--card);margin-top:.3rem;position:relative;z-index:1}
.journey li:not(:last-child)::before{content:"";position:absolute;inset-inline-start:calc(3.6rem + .6rem + 5px);top:1rem;bottom:-.6rem;width:2px;background:var(--line)}
.journey b{display:block;font-size:.95rem}
.journey small{display:block;color:var(--steel-text);font-size:.8rem;font-weight:600}
.journey .pass .dot{border-color:var(--steel);width:8px;height:8px;margin:.45rem 2px 0}
.journey .pass b{font-weight:700;color:var(--ink-soft)}
.journey .crossing .dot{border-color:var(--border-c);background:var(--border-c)}
.journey .crossing .at{background:var(--border-wash);border-radius:var(--r-sm);padding:.5rem .7rem}
.journey .crossing b{color:var(--border-c)}
.journey .fare{color:var(--ink-soft);font-weight:700}

/* ---- fields */
.grid{display:grid;grid-template-columns:1fr;gap:.7rem}
@media (min-width:600px){.grid.two{grid-template-columns:1fr 1fr}}
.f{display:grid;gap:.3rem;align-content:start;font-size:.82rem;font-weight:800;color:var(--ink-soft);min-width:0}
.f input,.f select{width:100%;height:48px;border:1.5px solid var(--line);border-radius:var(--r-sm);padding:0 .85rem;font:700 16px Tajawal,system-ui,sans-serif;color:var(--ink);background:var(--sand);min-width:0}
.f input:focus,.f select:focus{border-color:var(--raha-deep);box-shadow:0 0 0 3px var(--raha-wash);outline:none}
.f input[aria-invalid=true]{border-color:var(--bad)}
.f .problem{color:var(--bad);font-weight:700}
/* A number, a code or a passport is written left to right in either language. */
.f input[dir=ltr]{text-align:start}
.f input[data-field=passport]{text-transform:uppercase}
/* The code's box is narrow and reads code first, so what is cut off on a phone
   is the country's name and never the number's room. */
.phone{display:grid;grid-template-columns:minmax(0,9.75rem) minmax(0,1fr);gap:.5rem;direction:ltr}
.problem.at-field{display:block;color:var(--bad);font-weight:700;font-size:.84rem}
.pax{border:1.5px solid var(--line);border-radius:var(--r-md);padding:.9rem;display:grid;gap:.7rem}
.pax + .pax{margin-top:.7rem}
.pax-head{display:flex;justify-content:space-between;align-items:center;gap:.5rem;flex-wrap:wrap}
.pax-head b{font-size:1rem}
.seat-tag{background:var(--raha-wash);border-radius:100px;padding:.15rem .7rem;font-weight:800;font-size:.82rem}

/* A choice of one: gender, payment method. The radio is the real control. */
.choice{display:flex;gap:.5rem;flex-wrap:wrap;border:0;padding:0;margin:0;min-width:0}
.choice legend{font-size:.82rem;font-weight:800;color:var(--ink-soft);padding:0;margin-bottom:.3rem}
.choice label{flex:1 1 7rem;display:flex;align-items:center;justify-content:center;gap:.4rem;min-height:48px;border:1.5px solid var(--line);border-radius:var(--r-sm);font-weight:800;cursor:pointer;background:var(--card);padding:0 .8rem}
.choice input{position:absolute;opacity:0;pointer-events:none}
.choice label:has(input:checked){border-color:var(--ink);background:var(--raha-wash)}
.choice label:has(input:focus-visible){outline:3px solid var(--border-c);outline-offset:2px}

.stepper{display:inline-flex;align-items:center;gap:.9rem}
.stepper button{width:48px;height:48px;border-radius:50%;border:1.5px solid var(--ink);background:transparent;font-size:1.3rem;font-weight:800;cursor:pointer;line-height:1}
.stepper button:disabled{border-color:var(--line);color:var(--steel);cursor:not-allowed}
.stepper output{font-size:1.3rem;font-weight:900;min-width:1.5rem;text-align:center}

.check{display:flex;gap:.7rem;align-items:flex-start;cursor:pointer;font-weight:700}
.check input{flex:0 0 auto;width:24px;height:24px;margin:.1rem 0 0;accent-color:var(--border-c)}
.check small{display:block;font-weight:700;color:var(--steel-text);margin-top:.15rem}
.terms .check input:checked ~ span small{color:var(--good)}

/* ---- the seat map: 2 + 1, the pair on the driver's side */
.bus{max-width:300px;margin:.9rem auto 0;border:1.5px solid var(--line);border-radius:var(--r-lg);padding:.8rem .8rem 1rem;background:var(--sand)}
.bus-front{display:flex;justify-content:space-between;color:var(--steel-text);font-size:.72rem;font-weight:800;border-bottom:2px dashed var(--line);padding-bottom:.5rem;margin-bottom:.6rem}
.seat-row{display:grid;grid-template-columns:48px 48px 1fr 48px;gap:6px;align-items:center;margin-top:6px}
.seat-row .rowno{text-align:center;color:var(--steel-text);font-size:.72rem;font-weight:800}
.seat{width:48px;height:48px;border-radius:10px;border:1.5px solid var(--steel);background:var(--card);font-weight:800;font-size:.8rem;cursor:pointer;color:var(--ink);padding:0;line-height:1.1}
.seat.premium{background:var(--raha-wash);border-color:var(--raha)}
.seat.mine{background:var(--raha);border-color:var(--raha-deep)}
.seat.held{background:var(--sand-deep);border-color:var(--line);color:var(--steel-text);cursor:not-allowed}
.seat.taken{cursor:not-allowed}
.seat.taken.male{background:var(--male-wash);border-color:var(--male-line);color:var(--male-ink)}
.seat.taken.female{background:var(--female-wash);border-color:var(--female-line);color:var(--female-ink)}
.seat small{display:block;font-size:.7rem}
.legend{display:flex;flex-wrap:wrap;gap:.4rem .9rem;margin-top:.9rem;font-size:.78rem;font-weight:700;color:var(--ink-soft)}
.legend span{display:inline-flex;align-items:center;gap:.35rem}
.legend i{width:16px;height:16px;border-radius:5px;border:1.5px solid var(--steel);background:var(--card);display:inline-block}
.legend i.mine{background:var(--raha);border-color:var(--raha-deep)}
.legend i.held{background:var(--sand-deep);border-color:var(--line)}
.legend i.male{background:var(--male-wash);border-color:var(--male-line)}
.legend i.female{background:var(--female-wash);border-color:var(--female-line)}
.legend i.premium{background:var(--raha-wash);border-color:var(--raha)}

/* ---- payment methods */
.rails{display:grid;gap:.5rem;border:0;padding:0;margin:0;min-width:0}
.rail{display:grid;grid-template-columns:auto 1fr;gap:.2rem .7rem;align-items:center;border:1.5px solid var(--line);border-radius:var(--r-md);padding:.75rem .9rem;cursor:pointer}
.rail input{width:22px;height:22px;accent-color:var(--ink);grid-row:span 2;margin:0}
.rail b{font-size:.98rem}
.rail small{color:var(--steel-text);font-size:.82rem;font-weight:600;grid-column:2}
.rail:has(input:checked){border-color:var(--ink);background:var(--raha-wash)}
.rail.off{cursor:not-allowed;background:var(--sand)}
.rail.off b{color:var(--ink-soft)}

/* ---- refund terms */
.tiers{list-style:none;margin:0;padding:0;display:grid;gap:.5rem}
.tiers li{display:grid;grid-template-columns:1fr auto;gap:.15rem .75rem;align-items:start;border:1px solid var(--line);border-radius:var(--r-sm);padding:.65rem .8rem}
.tiers b{font-size:.92rem}
.tiers small{grid-column:1;color:var(--ink-soft);font-size:.84rem;font-weight:600}
.tiers .badge{grid-row:1;grid-column:2;font-size:.74rem;font-weight:800;border-radius:100px;padding:.15rem .6rem;white-space:nowrap}
.badge.full{background:var(--good-wash);color:var(--good)}
.badge.part{background:var(--raha-wash);color:var(--raha-ink)}
.badge.none{background:var(--sand-deep);color:var(--steel-text)}

/* ---- the terms, in the border's colour because they are the border's */
.terms{background:var(--border-wash);border-radius:var(--r-md);padding:1rem;display:grid;gap:.6rem}
.terms h3{color:var(--border-c);font-size:1rem}
.terms ul{margin:0;padding:0;list-style:none;display:grid;gap:.4rem}
.terms li{display:grid;grid-template-columns:8px 1fr;gap:.6rem;color:var(--ink-soft);font-size:.92rem;font-weight:600}
.terms li::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--border-c);margin-top:.55rem}
.terms .check{background:var(--card);border-radius:var(--r-sm);padding:.8rem}

/* ---- the total */
.lines{display:grid;gap:.35rem}
.lines div{display:flex;justify-content:space-between;gap:1rem;font-weight:700;color:var(--ink-soft)}
.lines .grand{border-top:1px dashed var(--line);padding-top:.5rem;margin-top:.2rem;color:var(--ink);font-size:1.2rem;font-weight:900}

/* ---- the ticket */
.status{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap}
.status .pill{font-size:.85rem;font-weight:900;border-radius:100px;padding:.25rem .8rem}
.pill.good{background:var(--good-wash);color:var(--good)}
.pill.warn{background:var(--warn-wash);color:var(--warn)}
.pill.alert{background:var(--bad-wash);color:var(--bad)}
.bcode{font-family:"IBM Plex Mono",ui-monospace,monospace;font-weight:600;direction:ltr;unicode-bidi:isolate}
.tk{border:1.5px solid var(--line);border-radius:var(--r-md);padding:1rem;display:grid;gap:.75rem;justify-items:center;text-align:center;break-inside:avoid}
.tk + .tk{margin-top:.75rem}
.tk .who{font-weight:900;font-size:1.05rem}
.tk .qr{width:min(220px,70vw);aspect-ratio:1;background:var(--card)}
.tk .qr svg{width:100%;height:100%;display:block}
/* The code a driver reads when the QR will not scan: big, spaced, selectable,
   and left to scale with the reader's own text size. */
.tk .short{font-family:"IBM Plex Mono",ui-monospace,monospace;font-size:1.9rem;font-weight:600;letter-spacing:.3em;direction:ltr;unicode-bidi:isolate;user-select:all;padding-inline-start:.3em}
.tk .unissued{color:var(--steel-text);font-weight:700;font-size:.9rem}
.wait{display:grid;justify-items:center;gap:.6rem;text-align:center;padding-block:.5rem}
.ring{width:44px;height:44px;border-radius:50%;border:4px solid var(--line);border-top-color:var(--raha-deep);animation:turn 1.1s linear infinite}
@keyframes turn{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.ring{animation:none;border-top-color:var(--line)}}
.kv{display:grid;grid-template-columns:auto 1fr;gap:.3rem 1rem;font-size:.92rem}
.kv dt{color:var(--steel-text);font-weight:700}
.kv dd{margin:0;font-weight:800;text-align:end}
.trips{list-style:none;margin:0;padding:0;display:grid;gap:.5rem}
.trips a{display:flex;justify-content:space-between;gap:1rem;border:1px solid var(--line);border-radius:var(--r-sm);padding:.7rem .85rem;text-decoration:none;font-weight:800}

/* What a booking is waiting for or has become, said large at the top of its page. */
.state{display:grid;gap:.35rem}
.state .status .pill{font-size:1rem;padding:.3rem .95rem}
.state-line{color:var(--ink-soft);font-weight:600;font-size:.95rem}
.pay-card{border-color:var(--raha-deep);border-width:1.5px}

@media print{
  .top,.no-print,footer,#t-steps{display:none !important}
  body{background:var(--card)}
  .card{box-shadow:none;border-color:var(--ink)}
}

.journey .chips{margin-top:.3rem}
/* The crossing, in the border's own colour, outside the fold of the journey. */
.trip-cross{display:grid;grid-template-columns:12px 1fr;gap:.6rem;align-items:start;margin-top:.8rem;background:var(--border-wash);border-radius:var(--r-sm);padding:.55rem .75rem}
.trip-cross .dot{width:12px;height:12px;border-radius:50%;background:var(--border-c);margin-top:.35rem}
.trip-cross b{display:block;color:var(--border-c);font-size:.92rem}
.trip-cross small{display:block;color:var(--ink-soft);font-size:.82rem;font-weight:600}
/* With the journey open the crossing is a step of it, and is not said twice. */
.trip-cross:has(+ details[open]){display:none}
