/*
 * Booking area (quote page, send wizard, confirmation, label, receipt). Object UI.
 * Loaded after site.css. Surfaces, not lines: paper panels on oat, filled fields, lichen picks,
 * dockets for money, chamfered tag cards for the speeds. No borders, no rules, no new colours.
 */

/* ---------- Shared pieces */
.bk-note { margin: 0; color: var(--fg-2); }
.bk-help { margin: 0; color: var(--ink-2); font-size: var(--small-size); line-height: 1.5; }
.bk-help a { font-weight: 600; }
.bk-help .mono { font-size: var(--data-s); color: var(--ink); }

/* Free-text route inside a docket: Auckland ●—○ Wellington */
.bk-qd__route { margin: 0 0 16px; font-size: var(--small-size); }
.bk-qd__route .od { gap: 8px; }
.bk-qd__muted dt, .bk-qd__muted dd { color: var(--ink-2); }
.bk-qd__disc > :last-child { color: var(--moss); }

/* Tracking / receipt number: caption + mono data */
.bk-tn__num { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0; }
.bk-tn__num .mono { overflow-wrap: anywhere; }
.bk-tn__cap { color: var(--fg-2); font-size: var(--small-size); }

/* Custom-size dimensions: three short fields in a row. Hidden (JS only) unless the size is "Custom". */
.bk-dims__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bk-dims__grid > .field + .field { margin-top: 0; }
.js .bk-dims[data-dims-idle] { display: none; }
@media (max-width: 640px) { .bk-dims__grid { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   Quote page: form panel | Pick a speed | quote docket
   ========================================================================== */
.bk-quote { padding-bottom: var(--s-9); }
.bk-qhead { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--s-5) 44px; align-items: end; }
.bk-qhead .page-title { max-width: none; }
.bk-qhead__cut .cutoff { border-radius: var(--r-l); padding: 16px 20px 14px; }

/* Two columns: the parcel form, and beside it the result in reading order (speeds, the quote, the business note). */
.bk-q { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 40px; align-items: start; }
.bk-q__form { padding: 28px 26px 26px; }
.bk-q__form > * + * { margin-top: 20px; }
.bk-q__form > .errsum { background: var(--oat); }
.bk-q__formtitle { margin: 0; }
.bk-q__form .form-grid { gap: 16px 14px; }
.bk-q__route { display: grid; gap: 14px; }
.bk-q__route > .field + .field { margin-top: 0; }
.bk-q__form .choices--row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bk-q__form .choice__body { min-height: 48px; padding: 10px 14px; column-gap: 10px; }
.bk-q__form .choice__title { font-size: var(--ui-size); font-weight: 600; }
.bk-q__form .choice__meta { font-size: var(--xs-size); }
.bk-q__sub { margin-bottom: -8px; font-weight: 600; font-size: var(--ui-size-s); }
.bk-q__go { margin-top: 26px !important; }

.bk-q__result { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; scroll-margin-top: var(--s-4); }
.bk-q__result > .bk-biz { margin-top: 0; }
.bk-q__cap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; margin: 0 0 12px; }
.bk-q__title { margin: 0; font-size: var(--h3-size); font-weight: 600; letter-spacing: -.015em; }
.bk-q__title:focus { outline: none; }
.bk-q__title:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
.bk-q__meta { margin: 0; color: var(--ink-2); font-size: var(--small-size); }
.bk-q__empty { margin: 0; padding: 22px 24px; border-radius: var(--r-l); background: var(--oat-deep); color: var(--ink); line-height: 1.5; }

/* Speed cards: rounded paper cards, one radio each. The picked one turns lichen. */
.bk-speeds { display: grid; gap: 8px; }
.bk-speed { display: block; padding: 16px 20px; cursor: pointer; transition: background-color .12s; }
.bk-speed__input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.bk-speed__row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.bk-speed__dot { width: 22px; height: 22px; border-radius: 50%; background: var(--slip); box-shadow: inset 0 0 0 1.6px var(--ink-2); }
.bk-speed__text { min-width: 0; }
.bk-speed__name { display: block; font-size: 1.25rem; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
.bk-speed__eta { display: block; margin-top: 2px; color: var(--ink-2); font-size: var(--small-size); }
.bk-speed__price { font-size: 1.375rem; white-space: nowrap; letter-spacing: -.02em; }
@media (hover: hover) { .bk-speed:not(.is-na):hover { background: var(--inset-2, var(--lichen)); } }
.bk-speed:has(.bk-speed__input:checked) { background: var(--lichen); }
.bk-speed:has(.bk-speed__input:checked) .bk-speed__dot { background: var(--moss); box-shadow: inset 0 0 0 2px var(--moss), inset 0 0 0 6px var(--slip); }
.bk-speed:has(.bk-speed__input:checked) .bk-speed__eta { color: var(--ink); }
.bk-speed:has(.bk-speed__input:focus-visible) .bk-speed__dot { outline: 2px solid var(--focus); outline-offset: 3px; }
.bk-speed:has(.bk-speed__input:focus-visible) .bk-speed__name { text-decoration: underline; text-underline-offset: 4px; }
.bk-speed.is-na { cursor: default; padding-block: 16px; }
.bk-speed.is-na .bk-speed__row { grid-template-columns: 22px minmax(0, 1fr) auto; cursor: default; }
.bk-speed.is-na .bk-speed__name { color: var(--ink-2); }
.bk-speed.is-na .bk-speed__dot { background: var(--oat-deep); box-shadow: inset 0 0 0 1.6px #B4B5A6; }
.bk-speed__flag { color: var(--ink-2); font-weight: 600; font-size: var(--small-size); }
.bk-speed__why { margin: 6px 0 0 36px; color: var(--ink-2); font-size: var(--small-size); line-height: 1.45; }

.bk-biz { margin-top: 28px; padding: 22px 24px; border-radius: var(--r-l); background: var(--oat-deep); }
.bk-biz__title { margin: 0; font-size: 1.125rem; font-weight: 600; }
.bk-biz p { margin: 6px 0 4px; color: var(--ink-2); line-height: 1.5; }

/* Quote docket: only the picked speed's lines, total and Book button show. Hidden until there is a price, so
   "Pick a speed" is the one place that says prices show up once the form is filled in. */
.bk-qd { margin-top: 0; }
.bk-qd:has(.bk-qd__wait) { display: none; }
.bk-qd__title { font-size: 1.5rem; letter-spacing: -.02em; margin-bottom: 14px; }
.bk-qd__opt { display: none; }
.bk-q__result:has(#speed-economy:checked) .bk-qd__opt[data-for="economy"],
.bk-q__result:has(#speed-overnight:checked) .bk-qd__opt[data-for="overnight"],
.bk-q__result:has(#speed-same_day:checked) .bk-qd__opt[data-for="same_day"] { display: block; }
.bk-qd__opt .docket__lines { gap: 10px; }
.bk-qd__opt .docket__line { font-size: var(--small-size); }
.bk-qd__book { margin-top: 18px; }
.bk-qd__amt { white-space: nowrap; }
.bk-qd__closed { margin: 16px 0 0; padding: 12px 14px; border-radius: var(--r); background: var(--oat-deep); font-size: var(--small-size); }
.bk-qd__facts { margin-top: 20px; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; font-size: var(--xs-size); }
.bk-qd__facts dd { color: var(--ink-2); }
.bk-qd__facts dt { color: var(--ink-2); }
.bk-qd__wait { margin: 0; color: var(--ink-2); font-size: var(--small-size); line-height: 1.5; }

/* Before there is a price the docket is hidden: the hint and the business note share its space, level with each other. */
@media (max-width: 1180px) {
  .bk-q { grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; }
  .bk-q__form .choices--row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .bk-qhead { grid-template-columns: minmax(0, 1fr); }
  .bk-q { grid-template-columns: minmax(0, 1fr); }
}
/* Foldables and phones held sideways (720–960px): the parcel form and its prices side by side */
@media (min-width: 720px) and (max-width: 960px) {
  .bk-q { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
  .bk-q__form { padding: 24px 20px 22px; }
}
@media (max-width: 640px) {
  .bk-q__form { padding: 22px 18px 20px; }
  .bk-q__form .form-grid { grid-template-columns: minmax(0, 1fr); }
  .bk-speed { padding: 18px; }
  .bk-speed__row { grid-template-columns: 22px minmax(0, 1fr); }
  .bk-speed__price { grid-column: 2; }
  .bk-speed.is-na .bk-speed__row { grid-template-columns: 22px minmax(0, 1fr); }
  .bk-speed.is-na .bk-speed__flag { grid-column: 2; }
  .bk-speed__why { margin-left: 0; }
}
@media (max-width: 420px) { .bk-q__form .choices--row { grid-template-columns: minmax(0, 1fr); } }
/* A half-width form column cannot hold two packaging cards a row */
@media (min-width: 720px) and (max-width: 860px) { .bk-q__form .choices--row { grid-template-columns: minmax(0, 1fr); } }
/* The narrowest phones: Book on one line; the total is printed just above it */
@media (max-width: 360px) { .bk-qd__dot, .bk-qd__amt { display: none; } }

/* ==========================================================================
   Booking wizard (steps 1–4): paper fieldsets | "Your booking" docket
   ========================================================================== */
.bk-wiz, .bk-conf, .bk-receipt { padding-bottom: var(--s-9); }
.bk-wiz__head { margin-bottom: var(--s-6); }
.bk-wiz__head .page-title { max-width: none; margin-bottom: var(--s-5); }
.bk-wiz__head .steps { margin-bottom: 0; max-width: none; }
.bk-wiz__form > * + * { margin-top: 14px; }
.bk-wiz__form > .errsum + * { margin-top: 14px; }

/* A paper fieldset: title left, a muted word right, then filled fields */
.bk-set { margin-inline: 0; margin-bottom: 0; padding: 26px 28px 28px; border: 0; min-width: 0; }
.bk-set__legend { float: left; width: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; margin: 0 0 18px; padding: 0; }
.bk-set__legend + * { clear: both; }
.bk-set__legend .panel__title { margin: 0; }
.bk-set__tag { color: var(--ink-2); font-size: var(--small-size); }
.bk-set > .field + .field, .bk-set > .field + .fieldset, .bk-set > .fieldset + .field { margin-top: 20px; }
.bk-set .form-grid { gap: 18px 14px; }
.bk-set__more { margin-top: 20px; }
.bk-set .bk-dims { margin-top: 20px; }

.bk-wiz__actions { justify-content: space-between; margin-top: 28px !important; }
.bk-wiz__actions > .btn--primary { margin-left: auto; }
/* Beside a side column the form is too narrow for two large buttons: they share the row evenly */
@media (min-width: 641px) and (max-width: 960px) {
  .bk-wiz__actions { flex-wrap: nowrap; gap: 10px; }
  .bk-wiz__actions > .btn { flex: 1 1 0; min-width: 0; padding-inline: 14px; }
  /* Step 4: the payment note, then the one button under it */
  .bk-confirm .bk-wiz__actions { flex-wrap: wrap; }
  .bk-confirm .bk-wiz__actions > .btn { flex: 1 1 100%; }
}

/* Address book picker: an oat strip at the top of the party */
.bk-pick { margin-bottom: 20px; padding: 14px 16px 16px; border-radius: var(--r); background: var(--oat); }
.bk-pick .field__label { display: block; margin-bottom: 8px; }
.bk-pick__row { display: flex; flex-wrap: wrap; gap: 10px; }
.bk-pick__row .select { flex: 1 1 260px; width: auto; background-color: var(--slip); }
.bk-pick__row .btn { flex: none; }

/* Step 3: service choices as large rounded cards (round 3: no chamfer) */
.bk-svc .choices { gap: 10px; }
.bk-svc .choices + .field__hint, .bk-svc .field__hint { margin-bottom: 12px; }
.bk-svc .fieldset__legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bk-svc .choice__body {
  min-height: 84px; padding: 18px 22px; border-radius: var(--r-l);
}
.bk-svc .choice__title { font-size: 1.375rem; font-weight: 600; letter-spacing: -.02em; }
.bk-svc .choice__price { font-family: var(--f-mono); font-size: 1.375rem; letter-spacing: -.02em; }
.bk-svc .choice__input:disabled + .choice__body { background: var(--oat-deep); }
.bk-svc .choice__input:disabled + .choice__body .choice__price { font-family: var(--f-sans); letter-spacing: 0; }
.bk-svc .choice__input:focus-visible + .choice__body { outline: 0; box-shadow: inset 0 0 0 2px var(--focus); }
/* "Choose a service" rings the speeds you can pick, not the one you cannot */
.bk-svc .fieldset.has-error .choice__input:disabled + .choice__body { box-shadow: none; }
/* Phones wide enough keep the price on the speed's own line */
@media (min-width: 361px) and (max-width: 640px) {
  .bk-svc .choice__body { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .bk-svc .choice__price { grid-column: auto; justify-self: end; }
}

/* The side column */
.bk-aside { display: grid; gap: 16px; }
.bk-aside > .docket, .bk-aside > .summary { margin-top: 0; }
@media (min-width: 961px) { .bk-aside { position: sticky; top: var(--s-4); } }
.bk-side .docket__title { margin: 0; font-size: 1.375rem; letter-spacing: -.02em; }
.bk-side .docket__head { margin-bottom: 14px; }
.bk-side > .docket__title { margin-bottom: 14px; }
.bk-side__lines { gap: 10px; }
.bk-side__lines .docket__line dd:empty { display: none; }
.bk-side__kv { grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; font-size: var(--small-size); }
.bk-side__link { margin: 12px 0 0; }
.bk-side__count { color: var(--ink-2); font-size: var(--small-size); white-space: nowrap; }
.bk-howto .slips { gap: var(--slip-gap); }
.bk-howto .slip { font-size: var(--small-size); line-height: 1.45; background: var(--oat); }
.bk-howto .slip .mono { font-size: var(--data-s); }
.bk-howto__more { margin: 14px 0 0; }
.bk-howto__more .link-go { display: inline; }
.bk-howto__more .link-go .i { display: inline-block; margin-left: 6px; vertical-align: -2px; }

/* Step 4: review panels */
.bk-rv .panel__head { align-items: center; }
.bk-change { font-weight: 600; font-size: var(--small-size); color: var(--moss); }
.bk-rv .kv { gap: 12px 24px; }
.bk-rv__sub { display: block; margin-top: 2px; color: var(--ink-2); font-size: var(--small-size); }
.bk-rv .svc + .bk-rv__sub { margin-top: 6px; }
.bk-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bk-party { padding: 16px 18px; border-radius: var(--r); background: var(--inset); overflow-wrap: anywhere; }
.bk-party__title { margin: 0 0 8px; color: var(--ink-2); font-size: var(--small-size); font-weight: 600; }
.bk-party p { margin: 0; line-height: 1.5; }
.bk-party p + p { margin-top: 8px; }
.bk-party__muted { color: var(--ink-2); }
.bk-party .mono { font-size: var(--data-s); }
@media (max-width: 640px) { .bk-parties { grid-template-columns: minmax(0, 1fr); } }
/* Beside the summary the review column is too narrow for two address cards: an email address would break mid-word */
@media (min-width: 641px) and (max-width: 860px) {
  .bk-rv .bk-parties { grid-template-columns: minmax(0, 1fr); }
  .bk-aside > .docket, .bk-aside > .summary { padding-inline: 20px; }
}
.bk-declare__intro { margin: 0; padding: 12px 16px; border-radius: var(--r); background: var(--oat); font-size: var(--small-size); }
.bk-confirm .field + .bk-declare__intro { margin-top: 18px; }
.bk-confirm .bk-wiz__actions { margin-top: 24px !important; align-items: center; }
.bk-confirm__note { flex: 1 1 16em; margin: 0; color: var(--ink-2); font-size: var(--small-size); }

/* Wizard on phones: the steps partial prints "Step 2 of 4" and a back link itself */
@media (max-width: 640px) {
  .bk-wiz__head .page-title { margin-bottom: var(--s-4); }
  .bk-wiz__head .stepm__back { display: none; }
  .bk-set { padding: 22px 18px 22px; }
  .bk-set .form-grid { grid-template-columns: minmax(0, 1fr); }
  .bk-set .form-grid > .span-2 { grid-column: auto; }
  .bk-svc .choice__body { padding: 16px; }
  .bk-wiz__actions > .btn { flex: 1 1 auto; }
}

/* ==========================================================================
   Confirmation
   ========================================================================== */
.bk-conf__head .page-title { max-width: none; }
.bk-tn { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px; margin-top: var(--s-5); padding: 20px 24px; border-radius: var(--r-l); background: var(--lichen); }
.bk-tn .bk-tn__cap { color: var(--ink); }
/* The tracking number over the query code: two facts, each once. */
@media (max-width: 640px) { .bk-tn .t-data-xl { font-size: 6.2vw; white-space: nowrap; } }
.bk-tn__ids { display: grid; gap: 6px; min-width: 0; }
.bk-conf__main > * + * { margin-top: 18px; }
.bk-next__list { gap: 8px; }
.bk-next__list .slip { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 16px 18px; }
.bk-next__n { color: var(--ink-2); font-size: var(--data-s); }
.bk-next__title { margin: 0; font-size: var(--ui-size); font-weight: 600; }
.bk-next__list p { margin: 4px 0 0; color: var(--ink-2); line-height: 1.5; }
.bk-conf__actions { margin-top: 24px !important; }
.bk-nudge .panel__body p { margin: 0 0 16px; line-height: 1.5; }

/* ==========================================================================
   Label page: the label sits on a paper surface on screen; print is untouched (site.css)
   ========================================================================== */
.bk-label { padding-bottom: var(--s-8); }
.bk-labelhead { max-width: 720px; }
.bk-labelhead .page-title { max-width: none; }
.bk-labelhead > * + * { margin-top: 14px; }
.bk-labelhead .lede { margin-top: 18px; }
.bk-labelhead__actions { margin-top: 22px !important; }
.bk-labelhead__fallback { margin: 0; color: var(--ink-2); font-size: var(--small-size); }
@media screen { .bk-label__sheet { background: var(--slip); padding: 40px 20px; } }

/* ==========================================================================
   Receipt: one wide docket
   ========================================================================== */
.bk-receipt__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; max-width: 880px; }
.bk-receipt__head .page-title { max-width: none; }
.bk-rc { max-width: 880px; padding: 40px 36px 48px; }
.bk-rc__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; margin-bottom: 22px; }
.bk-rc__top .docket__title { margin: 0; font-size: 1.5rem; letter-spacing: -.02em; }
.bk-rc__no { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; }
.bk-rc__meta { margin-top: 22px; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 28px; }
.bk-rc__items { margin-top: 26px; }
.bk-rc__totals { max-width: 400px; margin: 26px 0 0 auto; }
.bk-rc__totals .docket__lines { gap: 10px; }
.bk-rc__refund { margin-top: 14px; }
@media (max-width: 640px) {
  .bk-rc { padding: 32px 18px 40px; }
  .bk-rc .table td[data-label] { padding-left: calc(28% + 8px) !important; }
  .bk-rc .table td[data-label]::before { width: 28%; }
}
/* The receipt stays a real table when there is room for it, and always on paper (site.css stacks it up to 960px). */
@media (min-width: 641px) and (max-width: 960px), print {
  .bk-rc .table { display: table; width: 100%; }
  .bk-rc .table thead { display: table-header-group; }
  .bk-rc .table tbody { display: table-row-group; margin: 0; }
  .bk-rc .table tr { display: table-row; margin: 0; padding: 0; background: none; }
  .bk-rc .table td, .bk-rc .table td[data-label] { display: table-cell; padding: 12px 16px !important; background: var(--inset) !important; vertical-align: top; overflow-wrap: normal; }
  .bk-rc .table td.data { white-space: nowrap; }
  .bk-rc .table td.num { text-align: right; white-space: nowrap; }
  .bk-rc .table td:first-child { border-radius: var(--r) 0 0 var(--r) !important; }
  .bk-rc .table td:last-child { border-radius: 0 var(--r) var(--r) 0 !important; }
  .bk-rc .table td[data-label]::before { content: none; }
  .bk-rc .table td:first-child { padding-left: 20px !important; }
  .bk-rc .table td:last-child { padding-right: 20px !important; }
  .bk-rc .table th.num { text-align: right; white-space: nowrap; }
}

@media print {
  .bk-wiz, .bk-conf, .bk-receipt, .bk-label, .bk-quote { padding-bottom: 0; }
  .bk-rc { max-width: none; padding: 0; }
  .bk-tn { background: none; padding: 0; }
  .bk-party { background: none; padding: 0; }
}

/* A lone checkbox field: the box first, its hint and error under the label (the partial prints the hint first) */
.bk-quote .field:has(> .check), .bk-wiz .field:has(> .check) { display: flex; flex-direction: column; }
.bk-quote .field:has(> .check) > .check, .bk-wiz .field:has(> .check) > .check { order: -1; }
.bk-quote .field:has(> .check) > .field__hint, .bk-wiz .field:has(> .check) > .field__hint,
.bk-quote .field:has(> .check) > .field__error, .bk-wiz .field:has(> .check) > .field__error { margin: 4px 0 0 34px; }
.bk-rc .table th { font-family: var(--f-sans); letter-spacing: 0; }

/* Quote: a region, or a postcode that sets it. */
.bk-q__place { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: var(--s-3); align-items: start; }
.bk-q__place > .field + .field { margin-top: 0; }
