/* UH-CP — the customer portal's ONLY stylesheet.
   Deliberately separate from app.css: the portal is a second web service on its
   own hostname, shown to customers, and it does not share the ERP's chrome. A
   portal page must never load app.css and an ERP page must never load this.

   The look is "design D" (Lucas, 21-10-2026): docs/design/portal_home_design_d.html
   for the shell and Home, docs/design/portal_box_design_b.html for a box page.
   Values are lifted from those mock-ups rather than re-derived, so the built
   pages and the mock-ups cannot drift. Every colour is a token on :root. */

/* The `hidden` attribute must always win, even over class-based display rules
   — the same rule app.css opens with, for the same reason. */
[hidden] { display: none !important; }

:root {
  /* A cool light grey ground under white cards. */
  --bg: #f4f4f5;
  --panel: #ffffff;
  /* Ink is the text, the primary button, the top bar and "this is done" on a
     progress line — one near-black, used for all four. */
  --ink: #131416;
  --text: #131416;
  --muted: #6b6f7a;
  /* Blue: the step a parcel is on now, and a link under the pointer. */
  --blue: #2f56d6;
  /* Lime: ONLY the active nav tab and at most one primary button per page.
     Always with ink text on it — white on lime is unreadable. */
  --lime: #d4f23d;

  /* Rules and fills, palest last. */
  --edge: #d9dbe0;       /* outline of a secondary button or a field; a step not reached */
  --border: #e6e7eb;     /* under a table's column names; the step track */
  --hairline: #eef0f3;   /* between rows */
  --track: #ebecef;      /* progress bar track; photo tile */
  --hover: #f7f8fa;      /* a faint tint: a picked file, the current statement row */
  --row-hover: #f5fad9;  /* a list row under the pointer: soft lime (Lucas, 21-10-2026) */
  --row-press: #e9f4a6;  /* the row tapped: a firmer lime, so it shows under a finger (Lucas, 28-10-2026) */
  /* Cards have no border: a faint shadow and a 4% ring draw the edge. */
  /* The heading row every page opens with — a title, Home's date and
     greeting, or a detail page's Back — is one height, so the first card on
     every page starts at the same place (Lucas, 21-10-2026). */
  --head-h: 48px;
  --shadow: 0 1px 2px rgba(19, 20, 22, .06), 0 0 0 1px rgba(19, 20, 22, .04);
  --shadow-lift: 0 10px 30px rgba(19, 20, 22, .18);
  --scrim: rgba(19, 20, 22, .35);

  /* The dark top bar's own greys. */
  --bar-muted: #a7aab3;
  --bar-hover: #1d1f24;
  --bar-edge: #3a3d45;
  --bar-text: #d4d6db;

  /* Status pills. Blue = on its way / in progress, green = delivered /
     complete, amber = waiting (Awaiting Pickup, an open report), red =
     refunded / cancelled. That is the whole vocabulary. */
  --pill-blue-bg: #e4ebff;  --pill-blue-fg: #2240b5;
  --pill-green-bg: #e1f5e6; --pill-green-fg: #176b36;
  --green-on-dark: #6fdc95; /* Delivered on the dark band */
  --blue-on-dark: #7a96ff;  /* on its way, on the dark band */
  --red-on-dark: #ff8a7a;   /* Returned on the dark band (24-11-2026) */
  --pill-amber-bg: #fdf0cc; --pill-amber-fg: #8a4b0c;
  --pill-red-bg: #fbe9e7;   --pill-red-fg: #a3392c;

  /* The shoe glyph in a photo tile with no photo. */
  --ph-stroke: #9a9ea8;

  --error: #b42318;
  /* Focus ring: blue on the light ground, white on the dark bar. */
  --focus: #2f56d6;
  --focus-on-dark: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a { color: var(--text); }
/* Hover looks only where there is a pointer to hover with (Lucas, 28-10-2026):
   a phone keeps the last-touched row or button looking hovered after the
   finger has gone — a list row stuck lit while swiping through the app. */
@media (hover: hover) { a:hover { color: var(--blue); } }

/* One focus treatment for everything reachable by keyboard. The portal is used
   by people we cannot support over the shoulder, so focus is never removed. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
/* ...but not after a tap or a click (Lucas, 13-11-2026: a tab in the bottom
   bar "sometimes has a box around it and sometimes doesn't"). Safari draws
   the ring on a tapped tab or a pop-up's first button whenever a key (typing
   in a box counts) was the last thing pressed; portal.js marks the page
   `pointer` from the last tap until Tab is pressed, so a keyboard still gets
   it every time. */
html.pointer :focus-visible { outline: none; }

/* The display face: Archivo at width 125, weight 800, uppercase. The wordmark,
   page titles, box ids and section titles — nothing else. */
.disp, .mark, h1, .section-head h2, .card-bar h2, .box-id, .tile-fig,
.boxes-list a.row-target {
  font-family: "Archivo", system-ui, sans-serif;
  font-stretch: 125%; font-weight: 800;
  text-transform: uppercase; letter-spacing: .01em;
}

/* The small uppercase label over a figure. */
.lab { font-size: 12px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); }

/* --- top bar ------------------------------------------------------------- */

/* Dark, full width, the wordmark then the tabs, the customer on the right.
   Always at the TOP — never a sidebar (Lucas, 21-10-2026). */
.top { background: var(--ink); color: var(--panel);
  /* Under the iPhone's clock in the home-screen app (base.html); 0 elsewhere. */
  padding-top: env(safe-area-inset-top, 0px); }
.top-in { max-width: 1320px; margin: 0 auto; padding: 0 24px; height: 68px;
  display: flex; align-items: center; gap: 32px; }
.mark { font-size: 20px; line-height: 1; color: var(--panel); text-decoration: none;
  white-space: nowrap; }
@media (hover: hover) { .mark:hover { color: var(--panel); } }
.nav { display: flex; gap: 6px; }
.nav a { color: var(--bar-muted); text-decoration: none; font-weight: 600;
  padding: 9px 14px; border-radius: 999px; min-height: 40px;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
@media (hover: hover) { .nav a:hover { color: var(--panel); background: var(--bar-hover); } }
.nav a.on, .nav a.on:hover { background: var(--lime); color: var(--ink); }
/* How many boxes are on the way, on the Boxes tab. */
.nav-count { background: var(--blue); color: var(--panel); border-radius: 999px;
  font-size: 11px; padding: 1px 7px; line-height: 1.5; }
.who { margin-left: auto; font-size: 14px; color: var(--bar-muted);
  display: flex; align-items: center; gap: 14px; min-width: 0; }
.who b { color: var(--panel); font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
/* Settings, the gear (Lucas, 27-10-2026): an outlined square on the bar,
   lime while on Settings. Log out moved to that page. The word is for the
   phone's Menu panel only. */
.who-gear, .who-chat { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 38px; height: 38px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--bar-edge);
  color: var(--bar-text); text-decoration: none; flex: none; }
.who-gear svg, .who-chat svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; flex: none; }
@media (hover: hover) { .who-gear:hover, .who-chat:hover { color: var(--panel); background: var(--blue); box-shadow: none; } }  /* blue, as every button (Lucas, 21-10-2026) */
.who-gear.on, .who-gear.on:hover, .who-chat.on, .who-chat.on:hover { color: var(--ink); background: var(--lime); box-shadow: none; }
.who-gear .gear-word { display: none; }
/* UH Support's icon (portal.js section 18) is the gear's twin, just before
   it, on a phone only: the bar's own copy is phone Safari's, the one in .who
   the app's. A computer has the floating bubble instead (Lucas, 29-10-2026). */
.bar-chat, .float-chat { display: none; }
@media (min-width: 721px) {
  .who .who-chat { display: none; }
  .float-chat { display: inline-flex; position: fixed; right: 24px; bottom: 24px; z-index: 26;
    width: 56px; height: 56px; border-radius: 50%; background: var(--ink); color: var(--panel);
    box-shadow: var(--shadow-lift); }
  .float-chat svg { width: 24px; height: 24px; }
  @media (hover: hover) { .float-chat:hover { background: var(--blue); color: var(--panel); box-shadow: var(--shadow-lift); } }
  .float-chat.is-pressed { background: var(--blue); color: var(--panel); }
  .float-chat.on, .float-chat.on:hover { box-shadow: var(--shadow-lift); }
  .float-chat .close-ico, .float-chat.on .chat-ico { display: none; }
  .float-chat.on .close-ico { display: block; }
  /* Room at the foot of every page for the bubble (owner, 17-11-2026): it
     sits 24px up and is 56px tall, so the page ends 24px above its top and
     the last row of a long list is never under it. */
  .float-chat ~ .content { padding-bottom: 104px; }
}
/* On the dark bar the blue ring would be too faint. */
.top a:focus-visible, .top button:focus-visible { outline-color: var(--focus-on-dark); }

/* --- page body ----------------------------------------------------------- */

/* Every block on a page sits 24px from the next. 1320px wide so a page title
   and its search and chips sit on one line (Lucas, 21-10-2026). */
.content { max-width: 1320px; width: 100%; margin: 0 auto; padding: 32px 24px 56px;
  display: flex; flex-direction: column; gap: 24px; }
/* Every page header is one height, with or without a search or a button
   beside the title (the 44px of a .btn), so the first card always starts at
   the same place (Lucas, 21-10-2026). */
.hello { display: flex; align-items: center; justify-content: space-between; gap: 24px;
  flex-wrap: wrap; height: var(--head-h); }
h1 { margin: 0; font-size: 40px; line-height: .95; }
h2 { margin: 0; }
.back { display: inline-flex; align-items: center; gap: 6px; width: max-content;
  color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
@media (hover: hover) { .back:hover { color: var(--blue); } }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: 13px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Flash messages — the portal's only one is "Your password is set." */
/* Notices are NOTIFICATIONS, not cards: a dark toast floating at the top
   right, over the page, that the × closes (Lucas, 03-09-2026). They never push
   the page content down. */
.messages { list-style: none; margin: 0; padding: 0; position: fixed; top: 80px; right: 24px;
  z-index: 70; width: min(380px, calc(100vw - 48px)); display: flex; flex-direction: column; gap: 8px; }
.messages li { background: var(--ink); color: var(--panel); border-radius: 12px;
  padding: 12px 10px 12px 16px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lift);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.messages li.error { background: var(--error); }
/* A notice can be closed: the × at its right edge removes it (portal.js). */
.messages .dismiss { background: transparent; border: 0; color: var(--bar-muted); font-size: 20px;
  line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 6px; font-family: inherit; }
@media (hover: hover) { .messages .dismiss:hover { color: var(--panel); background: var(--bar-hover); } }

/* --- buttons, chips, pills ----------------------------------------------- */

/* Ink by default; .ghost is the white secondary; .lime is the page's ONE
   primary. Every button turns blue under the pointer. */
.btn { display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; border-radius: 10px; border: 0;
  background: var(--ink); color: var(--panel); font-family: inherit; font-weight: 600;
  font-size: 14px; text-decoration: none; cursor: pointer; text-align: center;
  white-space: nowrap; }
/* No fade on a button's hover (Lucas, 21-10-2026): lime fading to blue passes
   through a muddy grey with the text half-way between dark and white, which
   reads as a stutter. The colour swaps at once. */
.btn.ghost { background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--edge); }
.btn.lime { background: var(--lime); color: var(--ink); box-shadow: var(--shadow); }
/* On the dark band lime already stands out: no shadow there (Lucas, 21-10-2026). */
.band .btn.lime { box-shadow: none; }
@media (hover: hover) { .btn:hover, .btn.ghost:hover, .btn.lime:hover { background: var(--blue); color: var(--panel); box-shadow: none; } }
/* A smaller button inside a list (the invoice picker's Download). */
.btn.small { min-height: 36px; padding: 0 14px; font-size: 13px; }
/* A button that cannot be pressed yet: Send on the report form, until a kind
   is chosen and something is written. Dimmed and inert, never hidden — the
   actions must not move under the pointer as the form is filled in. */
.btn[disabled], .btn.is-off { opacity: .45; cursor: default; pointer-events: none; }

/* Filter chips: pills, white with a hairline edge; the chosen one is ink. */
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border: 0; border-radius: 999px; background: var(--panel); color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--edge); font-family: inherit; font-size: 14px;
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color .12s, color .12s; }
@media (hover: hover) { .chip:hover { color: var(--text); background: var(--hover); } }
.chip.on, .chip.on:hover { background: var(--ink); color: var(--panel); box-shadow: none; }

/* Status pills: a leading dot in the pill's own colour. The dot is drawn here
   so the markup stays the bare word the view gives. */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  line-height: 1.3; font-family: "Archivo", system-ui, sans-serif;
  font-stretch: 100%; text-transform: none; letter-spacing: 0; }
/* Archivo sits high in its line box, so a dot centred on the box reads about
   1px low beside the word; it is lifted to the middle of the letters
   (Lucas, 21-10-2026). */
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; flex: none; transform: translateY(-1px); }
.badge-blue   { background: var(--pill-blue-bg);  color: var(--pill-blue-fg); }
.badge-green  { background: var(--pill-green-bg); color: var(--pill-green-fg); }
/* Yellow is the older name for amber (an open report still uses it). */
.badge-amber, .badge-yellow { background: var(--pill-amber-bg); color: var(--pill-amber-fg); }
.badge-red    { background: var(--pill-red-bg);   color: var(--pill-red-fg); }

/* --- cards ---------------------------------------------------------------- */

/* White, radius 14, a faint shadow, no border. */
.card { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
/* A card's own title, in the display face, with room under it. */
.card-bar { display: flex; align-items: center; gap: 10px; padding: 18px 20px 10px; }
.card-bar h2 { font-size: 20px; }
/* A section title OUTSIDE a card, with its "All …" link at the right. */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-head h2 { font-size: 17px; }
.section-head a { font-size: 14px; font-weight: 600; }
/* Left-aligned and plain: what is absent, said once. */
.empty-card { padding: 18px 20px; color: var(--muted); }

/* --- list pages: heading, search, chips ---------------------------------- */

/* Heading line with a search box in the middle: title left, search centred,
   chips right. */
.list-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.list-tools .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.hello .list-tools { margin-left: auto; }
.hello.with-search { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.hello.with-search .search-mid { justify-self: center; width: 340px; max-width: 100%; }
.hello.with-search .list-tools { justify-self: end; margin-left: 0; }
.hello h1 { white-space: nowrap; }
/* Between a phone and a laptop the title, the 340px search and the filters
   do not fit on one line, and the filters ran off the page (721–892px). There
   the search drops to its own full-width line under the title and filters. */
@media (min-width: 721px) and (max-width: 960px) {
  .hello.with-search { grid-template-columns: 1fr auto; row-gap: 12px; height: auto; }
  .hello.with-search .search-mid { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; width: 100%; }
}
.search { width: 220px; height: 40px; border: 0; border-radius: 10px; padding: 0 14px;
  box-shadow: inset 0 0 0 1px var(--edge); background: var(--panel); color: var(--text);
  font-family: inherit; font-size: 14px; }
.search::placeholder { color: var(--muted); }

/* --- tables -------------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); padding: 12px 20px;
  border-bottom: 1px solid var(--border); white-space: nowrap; }  /* one line each (Lucas, 21-10-2026) */
td { padding: 12px 20px; vertical-align: middle; }
/* The hairline sits ABOVE a row, and only on a row that has a visible row
   before it. So whichever rows a filter hides, the first visible row meets the
   card edge cleanly and the last visible row ends without a stray rule —
   border-bottom on every row left a line under the last one whenever the true
   last row was filtered away (Lucas, 03-09-2026). */
tbody > tr:not([hidden]) ~ tr > td { border-top: 1px solid var(--hairline); }
/* Figures right-aligned in tabular digits so they line up down a column. */
td.num, th.num, .num { text-align: right; font-variant-numeric: tabular-nums; }
.date { font-weight: 600; }
td .sub { margin-top: 2px; }
td.empty { color: var(--muted); }

/* A whole row that opens something (portal.js follows its a.row-target). */
tr.link-row { cursor: pointer; }
@media (hover: hover) { tr.link-row:hover > td { background: var(--row-hover); } }
tr.link-row a.row-target { text-decoration: none; font-weight: 600; }
a.row-target.date { color: var(--text); }
@media (hover: hover) { tr.link-row:hover a.row-target { color: var(--blue); } }
/* The row tapped fades in rather than snapping (Lucas, 28-10-2026); its
   pressed look is with the others at the end of the file. */
tr.link-row > td, .order-row, .phone-item { transition: background-color .12s ease-out; }
/* A box id in the list, in the display face like everywhere else. */
.boxes-list a.row-target { font-size: 16px; white-space: nowrap; }
/* Status is the last column, so it sits flush right like the figures. */
/* Status is the last column. Its pills start on one line, so their dots sit
   in a straight column down the list (Lucas, 21-10-2026); the column
   shrinks to its widest pill, so it still hugs the right edge. */
td.status-cell { text-align: left; width: 1%; white-space: nowrap; }

/* The orders list: date hugs the left, status the right, and the three in the
   middle are centred so nothing sits against its neighbour (Lucas, 03-09-2026). */
.orders-list td:nth-child(1) { width: 16%; }
.orders-list td:nth-child(2), .orders-list td:nth-child(3) { text-align: center; }
/* Bar right-aligned in its cell, words left-aligned in the next, so the bars
   line up and the numbers line up (Lucas, 03-09-2026). */
.orders-list td.bar-cell { text-align: right; width: 250px; padding-right: 6px; }
.orders-list td.bar-cell .progress { margin-left: auto; }
/* Where an order's items come from (Lucas, 04-11-2026): each source a line, the
   same height in both cells so a bar and its words stay level. */
.src-line { display: flex; align-items: center; gap: 12px; min-height: 24px; }
.src-name { font-size: 13px; color: var(--muted); white-space: nowrap; flex: 1; text-align: right; }
.src-stack { display: flex; flex-direction: column; gap: 6px; }
.band-figs .src-name { color: var(--bar-muted); text-align: left; flex: none; width: 112px; font-size: 14px; }
.band-figs .src-stack .progress .bar { width: 120px; }
/* Number and button on the first line, the figures and bars under them, once
   they no longer fit on one. */
@media (max-width: 1240px) {
  .band-order { grid-template-columns: 1fr auto; }
  .band-order .band-figs { grid-column: 1 / -1; grid-row: 2; margin-left: 0; flex-wrap: wrap; gap: 12px 32px; }
}
/* A Singapore item on the order page: a small blue tag on the same line as
   its name (desktop), shortened to SG beside its size on a phone, where the
   word ran into Qty; everything else is Australia / NZ and carries none
   (Lucas, 11-11-2026). */
.src-tag { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  background: var(--pill-blue-bg); color: var(--pill-blue-fg); font-size: 11px;
  font-weight: 500; line-height: 1.4; white-space: nowrap; vertical-align: 1px; }
.seg-row .src-tag { margin-left: 6px; }
.orders-list td.words-cell { text-align: left; width: 150px; padding-left: 6px; white-space: nowrap; }
/* A narrow window, before the phone's rows take over: shorter bars and less
   air, so the source names still fit on a line. */
@media (max-width: 900px) {
  .orders-list td { padding-left: 8px; padding-right: 8px; }
  .orders-list td:nth-child(1) { width: auto; }
  .orders-list td.bar-cell { width: auto; }
  .orders-list td.bar-cell .progress .bar { width: 48px; }
  .orders-list .src-line { gap: 8px; }
  .orders-list td.words-cell { width: auto; }
}
/* The boxes list follows the same rule: date left, status right, the rest
   centred. */
.boxes-list td:nth-child(1) { width: 16%; }
.boxes-list td:nth-child(2), .boxes-list td:nth-child(3), .boxes-list td:nth-child(4),
.boxes-list td:nth-child(5), .boxes-list td:nth-child(6) { text-align: center; }
.boxes-list td:nth-child(4) .steps { margin: 0 auto; }
/* The tickets list: ticket number left, status right, the rest centred. */
.tickets-list td:nth-child(1) { width: 16%; }
.tickets-list td:nth-child(2), .tickets-list td:nth-child(3),
.tickets-list td:nth-child(4) { text-align: center; }

/* --- progress bar --------------------------------------------------------- */

/* Black on a pale track, the numbers in words beside or under it so the bar is
   never the only source. */
.progress { display: flex; align-items: center; gap: 10px; width: max-content; }
.progress .bar, .meter { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.progress .bar { width: 110px; flex: none; }
.progress .bar i, .meter i { display: block; height: 100%; border-radius: 4px; background: var(--ink); }
/* Everything sent: the bar turns green, as the Complete pill is (Lucas, 21-10-2026). */
.progress.done .bar i { background: var(--pill-green-fg); }
.progress-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
td.progress-cell, th.progress-head { width: 260px; }
/* "13/15": sent over ordered as one figure, the slash quieter than the numbers. */
.frac { font-variant-numeric: tabular-nums; }
.frac .of { color: var(--muted); padding: 0 1px; }

/* --- the progress line (_steps.html) ------------------------------------- */

/* Three stops along a track. A stop reached is ink; the stop the parcel is on
   now is blue with a halo; one not reached is grey. The track behind the dots
   fills half for a parcel on its way and fully once it has landed. */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); position: relative; width: 240px; }
.steps::before { content: ""; position: absolute; left: 16.6%; right: 16.6%; top: 5px;
  height: 3px; border-radius: 2px; background: var(--border); }
.steps.half::before { background: linear-gradient(90deg, var(--ink) 0 50%, var(--border) 50% 100%); }
.steps.fill::before { background: var(--ink); }
.step { position: relative; text-align: center; font-size: 12px; line-height: 1.25; color: var(--muted); }
.step i { display: block; width: 13px; height: 13px; border-radius: 50%; margin: 0 auto 6px;
  background: var(--edge); }
.step.done { color: var(--text); font-weight: 600; }
.step.done i { background: var(--ink); }
.step.now { color: var(--pill-blue-fg); }
.step.now i { background: var(--blue); box-shadow: 0 0 0 3px var(--pill-blue-bg); }
/* Delivered is green, as its pill is (Lucas, 21-10-2026). */
.steps.fill .step.now { color: var(--pill-green-fg); }
.steps.fill .step.now i { background: var(--pill-green-fg); border-color: var(--pill-green-fg);
  box-shadow: 0 0 0 3px var(--pill-green-bg); }
/* Returned is red, as its pill is (24-11-2026). */
.steps.back .step.now { color: var(--pill-red-fg); }
.steps.back .step.now i { background: var(--pill-red-fg); border-color: var(--pill-red-fg);
  box-shadow: 0 0 0 3px var(--pill-red-bg); }
.step .sub { font-weight: 400; font-size: 12px; margin-top: 2px; }
/* On a box page the line has a card of its own, across the page. */
.stops-card { padding: 24px; }
.stops-card .steps { width: 100%; }
.stops-card .step { font-size: 14px; }
.stops-card .step .sub { font-size: 13px; }

/* --- photo tiles ---------------------------------------------------------- */

/* CSS-only, so a style with no image gets a neutral tile with a shoe glyph
   rather than a broken image icon. */
.ph { background: var(--track); border-radius: 10px; position: relative; overflow: hidden; flex: none; }
.ph svg { position: absolute; inset: 0; margin: auto; width: 60%; height: 60%;
  stroke: var(--ph-stroke); fill: none; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; }
/* A drawn picture rather than a missing photo (a "Shoe boxes for" line,
   06-10-2026): white tile, inked strokes, the box filled. */
.ph.ph-icon { background: var(--panel); box-shadow: inset 0 0 0 1px var(--edge); }
.ph.ph-icon svg { stroke: var(--ink); stroke-width: 1.5; width: 64%; height: 64%; }
.ph.ph-icon svg .fill { fill: var(--track); }
/* A real photo sits in the same tile, so rows keep their rhythm either way.
   Contained, not cropped: a shoe cut off at the toe is worse than a little
   white around it. Click to magnify (portal.js binds `.ph img`). */
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  padding: 3px; background: var(--panel); border-radius: 10px; cursor: zoom-in; }
.ph-sm { width: 52px; height: 44px; }
/* The report form's item rows: smaller again, so the list stays short. */
.ph-xs { width: 36px; height: 36px; }
/* Image lightbox — click a product photo to view it enlarged, centred over a
   dimmed page. Copied from the ERP's app.css so both apps behave the same. */
.lightbox { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center;
  justify-content: center; padding: 24px; cursor: zoom-out; background: var(--scrim);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.lightbox[hidden] { display: none; }
.lightbox-card { background: var(--panel); border-radius: 14px; padding: 16px;
  box-shadow: var(--shadow-lift); max-width: min(560px, 90vw); max-height: 90vh; }
.lightbox-card img { max-width: 100%; max-height: calc(90vh - 32px); object-fit: contain; display: block; }

/* --- Home ----------------------------------------------------------------- */

/* Kept tight so the page reads at a glance (Lucas, 21-10-2026). */
.home-hello h1 { font-size: 28px; margin-top: 4px; }
.home-hello .lab { line-height: 1.2; }

/* The tiles: as many columns as fit at 150px+, so three today and a fourth
   (Owing, on another branch) drops in without a change here. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.tile { padding: 14px 18px; }
.tile-fig { font-size: 24px; line-height: 1.05; margin-top: 6px; }
/* Owing: the one dark tile, its label in lime (design D). A link to Balance. */
.tile-dark { background: var(--ink); color: var(--panel); text-decoration: none; }
@media (hover: hover) { .tile-dark:hover { color: var(--panel); background: var(--blue); } }  /* blue, as every button (Lucas, 21-10-2026) */
@media (hover: hover) { .tile-dark:hover .sub { color: var(--panel); } }
.tile-dark .lab { color: var(--lime); }
.tile-dark .sub { color: var(--bar-muted); }

/* Boxes on the way (3/5) beside the open orders (2/5). */
.home-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; align-items: stretch; }
.home-col { display: flex; flex-direction: column; gap: 12px; }
/* The two columns end level (Lucas, 21-10-2026): both stretch to the taller;
   the box cards spread their gaps, the order rows share the height. */
.home-stack { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.home-orders { flex: 1; display: flex; flex-direction: column; }
.home-orders .order-row { flex: 1; justify-content: center; }
.meter.done i { background: var(--pill-green-fg); }
.timeline li.now.ok .k { background: var(--pill-green-fg); box-shadow: 0 0 0 3px var(--pill-green-bg); }
.timeline li.now.ok b { color: var(--pill-green-fg); }
.timeline li.now.back .k { background: var(--pill-red-fg); box-shadow: 0 0 0 3px var(--pill-red-bg); }
.timeline li.now.back b { color: var(--pill-red-fg); }

/* One box: what is in it on the left, its timeline on the right. The whole
   card is the link to the box page. */
.box-card { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 16px; padding: 16px 18px;
  color: var(--text); text-decoration: none; transition: box-shadow .12s; }
@media (hover: hover) { .box-card:hover { color: var(--text); box-shadow: var(--shadow), 0 0 0 2px var(--blue); } }
.box-card-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.box-card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.box-id { font-size: 16px; line-height: 1; white-space: nowrap; }
/* A box number never breaks across lines (owner, 17-11-2026): wherever one
   is printed — a title, a list, a sentence — it stays whole and what is
   beside it wraps instead. */
.box-no { white-space: nowrap; }
.box-card .contents b { color: var(--text); }
/* The photo strip. NOT a .ph: portal.js opens a .ph photo in the lightbox,
   and on Home a click anywhere on the card must open the box. */
.strip { display: flex; gap: 8px; flex-wrap: wrap; }
.strip-tile { width: 56px; height: 48px; border-radius: 10px; background: var(--track);
  position: relative; overflow: hidden; flex: none;
  display: flex; align-items: center; justify-content: center; }
.strip-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  padding: 3px; background: var(--panel); }
.strip-tile svg { width: 60%; height: 60%; stroke: var(--ph-stroke); fill: none; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; }
.strip-tile.more { font-weight: 600; color: var(--muted); }

/* The vertical timeline: a dot per stop, joined by a rule; ink once reached,
   blue for where the parcel is now, grey still to come. Drawn as the box
   page's Packed — Shipped — Delivered line is (.steps, Lucas 27-10-2026):
   13px dots, a 3px rule running unbroken from each dot's centre to the
   next one's, under the dots. */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; align-items: flex-start; position: relative; padding-bottom: 8px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .k { width: 13px; height: 13px; border-radius: 50%; flex: none; margin-top: 3px;
  background: var(--edge); position: relative; z-index: 1; }
.timeline li::after { content: ""; position: absolute; left: 5px; top: 9px; bottom: -9px; width: 3px;
  border-radius: 2px; background: var(--border); }
.timeline li:last-child::after { content: none; }
.timeline li.done::after { background: var(--ink); }
.timeline li.done .k { background: var(--ink); }
.timeline li.now .k { background: var(--blue); box-shadow: 0 0 0 3px var(--pill-blue-bg); }
.timeline b { font-size: 13px; }
.timeline li.todo b { color: var(--muted); }

/* Open orders: one row each — reference and total, the bar, "X of Y sent". */
.order-row { display: flex; flex-direction: column; gap: 6px; padding: 12px 18px;
  border-top: 1px solid var(--hairline); color: var(--text); text-decoration: none; }
.order-row:first-child { border-top: 0; }
@media (hover: hover) { .order-row:hover { background: var(--row-hover); color: var(--text); } }
.order-row-top, .order-row-foot { display: flex; justify-content: space-between; gap: 16px; }

/* --- detail pages --------------------------------------------------------- */

/* The dark band a box, an order or a ticket opens under, as the old pages had
   it (Lucas, 21-10-2026): the id (and pill) at the left, a box's progress line
   in the middle, the buttons at the right; the facts along the second line. */
.band { background: var(--ink); color: var(--panel); border-radius: 14px; padding: 20px 24px;
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px 24px; align-items: center; }
.band h1 { color: var(--panel); font-size: 34px; }
.band .title-main { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.band-sub { color: var(--bar-muted); font-size: 14px; margin-top: 6px; }
/* The page's buttons in the band's top right corner (Lucas, 21-10-2026). */
.band .head-actions { grid-column: 3; grid-row: 1; justify-self: end; align-self: start; }
/* Buttons on the dark ground: outlined secondary, white plain, lime stays. */
.band .btn.ghost { background: transparent; color: var(--panel); box-shadow: inset 0 0 0 1px var(--bar-edge); }
.band .btn:not(.ghost):not(.lime) { background: var(--panel); color: var(--ink); }
@media (hover: hover) { .band .btn:hover { background: var(--blue); color: var(--panel); box-shadow: none; } }
.band-facts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 28px;
  font-size: 14px; color: var(--bar-muted); }
.band-facts b { color: var(--panel); font-weight: 500; margin-left: 6px; }
.band-facts b.mono { font-size: 13.5px; }
/* An order's band is one line: number, then its sent bar and total, then
   Download Invoice (Lucas, 21-10-2026). */
.band-figs { display: flex; align-items: center; gap: 32px; justify-self: center; }
.band-order { grid-template-columns: auto 1fr auto; }
.band-order .band-figs { justify-self: start; margin-left: 24px; }
.band-figs .progress .bar { width: 200px; background: var(--bar-edge); }
.band-figs .progress .bar i { background: var(--panel); }
.band-figs .progress.done .bar i { background: var(--green-on-dark); }
.band-figs .progress-label { color: var(--bar-muted); font-size: 14px; }
.band-total { font-size: 14px; color: var(--bar-muted); white-space: nowrap; }
.band-total b { color: var(--panel); font-size: 14px; font-weight: 600; margin-left: 6px;
  font-variant-numeric: tabular-nums; }
.band-order .head-actions { align-self: center; }
/* The progress line in the band's own colours. */
.band-steps { justify-self: center; }
.band-steps .steps { width: 360px; }
.band-steps .step { font-size: 13px; color: var(--bar-muted); }
.band-steps .step.done { color: var(--panel); }
.band-steps .step .sub { color: var(--bar-muted); }
/* One look for every dot on the band (Lucas, 21-10-2026): reached is white,
   not reached is grey, and the line runs right into each; where the parcel
   is NOW is blue while it is on its way and green once delivered, as its
   pill is, and stands apart in its own halo — the line stops at it. */
.band-steps .step i { background: var(--bar-edge); }
.band-steps .step.done i { background: var(--panel); }
.band-steps .step.now { color: var(--blue-on-dark); }
.band-steps .step.now i { background: var(--blue-on-dark);
  box-shadow: 0 0 0 3px #323b5c; }  /* its blue at 30% on the ink, solid */
.band-steps .steps.fill .step.now { color: var(--green-on-dark); }
.band-steps .steps.fill .step.now i { background: var(--green-on-dark);
  box-shadow: 0 0 0 3px #2f503c; }  /* its green at 30% on the ink, solid */
.band-steps .steps.back .step.now { color: var(--red-on-dark); }
.band-steps .steps.back .step.now i { background: var(--red-on-dark);
  box-shadow: 0 0 0 3px #5a3734; }  /* its red at 30% on the ink, solid */
.band-steps .steps::before { background: var(--bar-edge); }
.band-steps .steps.half::before { background: linear-gradient(90deg, var(--panel) 0 50%, var(--bar-edge) 50% 100%); }
.band-steps .steps.fill::before { background: var(--panel); }
@media (max-width: 860px) {
  .band { grid-template-columns: 1fr; }
  .band .head-actions, .band-steps, .band-figs { grid-column: auto; grid-row: auto; justify-self: start; }
  .band-figs { flex-wrap: wrap; gap: 12px 28px; }
  .band-steps .steps { width: 100%; max-width: 360px; }
}

/* The first row of every detail page: Back at the left. */
.top-line { display: flex; align-items: center; gap: 24px; height: var(--head-h); }
/* The title line: id and pill on the left, the page's buttons on the right. */
.title-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.title-main { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.title-bar h1 { font-size: 44px; }
.title-sub { color: var(--muted); font-size: 16px; margin-top: 8px; }

/* The facts, one small card each: the label, then the value under it. The
   label is the card's own text; the value is its <b>. */
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.fact { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px;
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fact span { display: block; }
.fact b { display: block; margin-top: 4px; font-size: 15px; font-weight: 600; letter-spacing: 0;
  text-transform: none; color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fact b.mono { font-size: 14px; }

/* A photo tile inside a table cell. */
td.cell-thumb { width: 72px; padding-right: 0; }
td .name { font-weight: 600; }
td .code { color: var(--muted); font-size: 13px; margin-top: 2px; }
/* What happened to these items, on an order line that was refunded in part or
   in full: "Partial refund", "Refunded · 1 item". Quiet, so it reads as a note
   about the row rather than a second product. */
td .seg-label { color: var(--muted); font-size: 13px; margin-top: 2px; }
/* A fully refunded segment: the money went back, so its figures are struck and
   the row reads muted. The units are NOT struck — those items were still sent.
   Muted, never red: this is a settled outcome, not an error. */
tr.line-refunded td { color: var(--muted); }
tr.line-refunded td.num { text-decoration: line-through; }
/* The continuation row of a split line: no photo, no repeated counts. */
td.cell-cont { padding-right: 0; }

/* "Changes to this order" and "What we did": one plain-English line per money
   move, ruled between, the figure right-aligned at the end of the row. */
.moves { padding: 4px 20px 14px; }
.card.changes .moves { padding-top: 0; }
.move { display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  padding: 12px 0; border-top: 1px solid var(--hairline); font-size: 14.5px; }
.move:first-child { border-top: 0; }
.move .what { flex: 1 1 auto; }
.move .num { flex: 0 0 auto; font-weight: 600; white-space: nowrap; }
/* Money that came BACK to the customer reads green, a charge to them amber —
   the same two meanings the status pills carry. */
.move .to-you { color: var(--pill-green-fg); }
.move .to-us { color: var(--pill-amber-fg); }
/* The money in black on the order page (Lucas, 18-09-2026). */
.card.changes .move .num { color: var(--text); }
/* The day it happened, under its sentence. */
.move .when { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }

/* What the customer told us: their words, then the items it names. */
.said { padding: 4px 20px 18px; }
.said .txt { margin: 0; font-size: 15px; line-height: 1.5; max-width: 70ch; }
.said .about { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.said .about-lbl { display: block; font-weight: 600; margin-bottom: 2px; }
.said .about ul { list-style: none; margin: 0; padding: 0; }
.said .about li { line-height: 1.6; }
/* Their photos, in the standard tile so a click opens the lightbox. */
.shots { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 20px 18px; }
.shots .ph { width: 88px; height: 88px; }

/* --- dialogs -------------------------------------------------------------- */

/* A small card in the middle of a dimmed page. Native <dialog>, so Escape
   closes it and focus is trapped for free. */
.confirm { border: 0; border-radius: 14px; padding: 24px 26px 22px; box-shadow: var(--shadow-lift);
  width: min(380px, calc(100vw - 48px)); background: var(--panel); color: var(--text); font-family: inherit; }
.confirm::backdrop { background: var(--scrim); }
.confirm h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.confirm p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.confirm .acts { display: flex; justify-content: flex-end; gap: 8px; }
.confirm form { margin: 0; }
/* The send-report one is as wide as its single sentence, no wider. */
#send-confirm { width: fit-content; max-width: calc(100vw - 48px); }
#send-confirm p { white-space: nowrap; }

/* --- the report form ------------------------------------------------------ */

/* Back and the title on one line. */
.title-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* The form inside the one card: two columns, and anything marked .full spans
   both. On a phone it collapses to one column with everything stacked. */
.form { padding: 22px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.form .full { grid-column: 1 / -1; }
/* Report a problem: What happened then Which items, one column, the form's row gap between them. */
.left-stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
/* A field's name, in the same voice as a table header and the fact labels. */
.lbl { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.photos-lbl { margin-top: 16px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
/* The note under the item list, rather than between its label and first row. */
.hint-under { margin: 8px 0 0; }
.form textarea { width: 100%; border: 0; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--edge);
  padding: 12px 14px; font: inherit; font-size: 15px; background: var(--panel);
  color: var(--text); min-height: 96px; resize: vertical; }
.form textarea::placeholder { color: var(--muted); }

/* The kinds: radio inputs dressed as chips. The input itself is hidden from
   sight but NOT from assistive tech or the keyboard — it keeps its size and
   sits under the label, so focus and :checked still work and the browser
   enforces "choose one" with no script. */
.pick-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pick { position: relative; display: inline-block; }
.pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pick span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
  border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--panel); color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--edge); transition: background-color .12s, color .12s; }
@media (hover: hover) { .pick:hover span { background: var(--hover); color: var(--text); } }
.pick input:checked + span, .pick:hover input:checked + span { background: var(--ink); color: var(--panel); box-shadow: none; }
.pick input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* The box's items as a tick list: one row each, photo and name, with a real
   checkbox drawn as a square. */
.ticks { display: flex; flex-direction: column; gap: 6px; }
.tick { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px;
  font-size: 14px; cursor: pointer; background: var(--panel); box-shadow: inset 0 0 0 1px var(--border);
  transition: background-color .12s, box-shadow .12s; }
@media (hover: hover) { .tick:not(.tick-qty):hover { background: var(--hover); box-shadow: inset 0 0 0 1px var(--edge); } }
/* A ticked row is unmistakably picked. :has() does it in CSS alone; portal.js
   also toggles .is-on for browsers without it. */
.tick:has(input:checked), .tick.is-on { background: var(--hover); box-shadow: inset 0 0 0 2px var(--ink); }
.tick input { position: absolute; opacity: 0; width: 0; height: 0; }
.tick .ck { width: 16px; height: 16px; border: 1.5px solid var(--edge); border-radius: 4px; flex: none; position: relative; }
.tick input:checked + .ck { background: var(--ink); border-color: var(--ink); }
/* The tick itself: two strokes rotated, so no image is needed. */
.tick input:checked + .ck::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
  border: solid var(--panel); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tick input:focus-visible + .ck { outline: 2px solid var(--focus); outline-offset: 2px; }
/* A line with − n + (Lucas, 13-11-2026), as on the ERP's Buying Check: the
   stepper sits at the row's right end; a row with 1 or more is picked. */
.tick-qty { cursor: default; }
.tick-qty .what { flex: 1; min-width: 0; }
.stepper { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.stepper .step { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  padding: 0; color: var(--ink); background: var(--panel); border: 1px solid var(--edge); border-radius: 8px; cursor: pointer; }
.stepper .step .ic { width: 10px; height: 10px; fill: currentColor; }
.stepper .step:disabled { color: var(--edge); cursor: default; }
@media (hover: hover) { .stepper .step:not(:disabled):hover { border-color: var(--ink); } }
.stepper .step:focus-visible, .stepper .step-n:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tick .stepper .step-n { position: static; opacity: 1; width: 40px; height: 30px; padding: 0; text-align: center;
  font: inherit; font-weight: 700; color: var(--ink); background: var(--panel); border: 1px solid var(--edge); border-radius: 8px;
  -moz-appearance: textfield; appearance: textfield; }
.stepper .step-n::-webkit-outer-spin-button, .stepper .step-n::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .step-n::placeholder { color: var(--muted); font-weight: 400; }
.tick .what { display: flex; flex-direction: column; }
.tick .name { font-weight: 600; }
.tick .sub { margin-top: 2px; }

/* The photo drop zone. A <label> for the real (hidden) file input, so clicking
   or tabbing to it opens the picker with no script; portal.js adds dragging. */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; text-align: center; cursor: pointer; border: 1.5px dashed var(--edge); border-radius: 10px;
  background: var(--bg); padding: 18px 16px; color: var(--muted); font-size: 14px;
  transition: background-color .12s, border-color .12s, color .12s; }
.drop.is-over { background: var(--hover); border-color: var(--ink); color: var(--text); }
@media (hover: hover) { .drop:hover { background: var(--hover); border-color: var(--ink); color: var(--text); } }
.drop .drop-main { font-weight: 600; }
.drop .drop-sub { font-size: 13px; }
/* Make Payment: the card is the same height whichever way they pay (Lucas,
   11-11-2026). The receipt box is trimmed to the amount part's height, and an
   empty file list takes no room. */
.pay-card .drop { padding: 12px 16px; }
.pay-card .file-names:empty { display: none; }
/* One of several receipts in the View receipt card: its number and Download. */
.receipt-each { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 12px 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.receipt-each:first-child { margin-top: 0; }
.receipt-each a { display: inline-flex; align-items: center; text-decoration: none; }
/* A PDF in a file list: a tile in place of the picture (Make Payment). */
.file-names .thumb-file { display: flex; align-items: center; justify-content: center;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--edge); color: var(--ink);
  font-size: 12px; font-weight: 700; text-decoration: none; }
/* The input is off-screen, not display:none: hidden that way it is unreachable
   by keyboard and some browsers skip it on submit. */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
/* The chosen files: a thumbnail (click to enlarge) and name per row, with a
   × to drop it again. */
.file-names { list-style: none; margin: 8px 0 0; padding: 0; color: var(--muted);
  font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.file-names:empty { margin: 0; }
.file-names li { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--hover); border-radius: 8px; padding: 4px 6px 4px 4px; }
.file-names .thumb { width: 44px; height: 44px; object-fit: cover; flex: none; border-radius: 6px;
  background: var(--panel); cursor: zoom-in; }
.file-names .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-names .rm { background: transparent; border: 0; color: var(--muted); font-size: 16px; line-height: 1;
  cursor: pointer; padding: 2px 6px; border-radius: 6px; font-family: inherit; flex: none; }
@media (hover: hover) { .file-names .rm:hover { background: var(--border); color: var(--text); } }
.photo-error { margin: 8px 0 0; }
/* Report a problem: the photos sit INSIDE the drop box as tiles (Lucas,
   13-11-2026), and the label shrinks to a + tile beside them, gone at the
   limit. Empty, the box looks exactly as before. */
.drop-photos { padding: 0; cursor: default; }
.drop-photos .drop-pick { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; align-self: stretch; padding: 18px 16px; cursor: pointer; border-radius: 10px; }
.drop-photos .drop-plus { display: none; }
.photo-tiles { display: contents; list-style: none; margin: 0; padding: 0; }
.photo-tiles li { position: relative; width: 72px; height: 72px; flex: none; }
.photo-tiles .thumb { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block;
  background: var(--panel); box-shadow: 0 0 0 1px var(--edge); cursor: zoom-in; }
.photo-tiles .rm { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 50%; background: var(--ink); color: var(--panel); font: inherit;
  font-size: 15px; line-height: 22px; text-align: center; cursor: pointer; }
.drop-photos.has-photos { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start;
  gap: 12px; padding: 12px; }
.drop-photos.has-photos .drop-pick { width: 72px; height: 72px; padding: 0; align-self: auto;
  border: 1.5px dashed var(--edge); border-radius: 8px; background: var(--panel); }
.drop-photos.has-photos .drop-main, .drop-photos.has-photos .drop-sub { display: none; }
.drop-photos.has-photos .drop-plus { display: block; font-size: 26px; line-height: 1; font-weight: 300; }
.drop-photos.is-full .drop-pick { display: none; }
@media (hover: hover) {
  .drop-photos.has-photos:hover { background: var(--bg); border-color: var(--edge); color: var(--muted); }
  .drop-photos.has-photos .drop-pick:hover { border-color: var(--ink); color: var(--text); }
}
/* Cancel and Send: directly under the drop zone, right-aligned (Lucas). */
.form .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.form .form-error { margin: 0; }

/* --- the signed-out pages ------------------------------------------------- */

/* Login / forgotten password / set password: one centred card on the ground
   with the wordmark above it. No top bar — there is no one signed in. */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 20px; padding: 40px 20px; }
.auth-wrap .mark { font-size: 26px; color: var(--ink); }
.auth-card { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow);
  padding: 28px 28px 26px; width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 30px; }
.auth-card .lede { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.auth-card .messages { position: static; width: auto; margin-top: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; margin-top: 22px; }
/* A card that is only a form (Your name, owner 17-11-2026) has no title
   above it, so no gap either. */
.auth-card > .auth-form:first-child { margin-top: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.field input { height: 44px; border: 0; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--edge);
  padding: 0 12px; font-size: 15px; font-family: inherit; background: var(--panel); color: var(--text); }
.auth-form .btn { width: 100%; }
/* The failure message sits under the field it belongs to, in plain words. */
.field-error, .form-error { color: var(--error); font-size: 13.5px; margin: 0; }
/* A required field's label: a red *. */
.req { color: var(--error); }
.auth-foot { margin: 18px 0 0; font-size: 14px; color: var(--muted); }

/* --- error pages ---------------------------------------------------------- */

.notice { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.notice p { margin: 0; color: var(--muted); font-size: 15px; max-width: 60ch; }

/* --- narrow screens ------------------------------------------------------- */

@media (max-width: 860px) {
  /* The tabs move to a row of their own under the wordmark and scroll
     sideways if they must. NEVER hidden: they are the only way around. */
  .top-in { height: auto; flex-wrap: wrap; gap: 10px 16px; padding: 12px 16px 8px; }
  .nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav a { flex: none; min-height: 44px; }
  .who b { max-width: 40vw; }
  .home-cols { grid-template-columns: 1fr; }
  .box-card { grid-template-columns: 1fr; }
}

/* Under 720px every table becomes stacked blocks. Nothing scrolls sideways: a
   customer checking a parcel on a phone should not have to drag a table around.
   Each cell keeps its column name via data-label, so a stacked row still says
   what each value is. */
@media (max-width: 720px) {
  /* ONE gap between every block on a phone page — heading, filters, search,
     cards, sections — the filters' 12px (Lucas, 22-10-2026). */
  .content { padding: 12px 16px 40px; gap: 12px; }
  /* Back keeps its 44px tap height, but the line pulls in 8px top and bottom
     so the words sit the same 12px-ish from what is around them. */
  .top-line { height: auto; margin: -8px 0; }
  .section-head { margin: -8px 0; }
  .hello { flex-direction: column; align-items: flex-start; gap: 12px; height: auto; }
  /* A page that opens with its title gives it room under the dark bar
     (owner, 17-11-2026): the 12px padding plus one more 12px gap, so the
     title sits as far from the bar as Back does on a detail page. A
     notice is fixed over the page, so it does not count as first. */
  .content > .hello:first-child, .content > .messages:first-child + .hello,
  .content > .settings:first-child, .content > .messages:first-child + .settings { margin-top: 12px; }
  h1, .title-bar h1 { font-size: 30px; }
  .home-hello h1 { font-size: 24px; }
  .tile-fig { font-size: 22px; }

  .hello.with-search { grid-template-columns: 1fr; }
  .hello.with-search .search-mid, .hello.with-search .list-tools { justify-self: stretch; width: 100%; }
  .list-tools .chips { width: 100%; }
  .list-tools .chip { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  /* On a phone the filters come before the search (Lucas, 22-10-2026). */
  .hello.with-search .list-tools { order: 2; }
  .hello.with-search .search-mid { order: 3; }
  .search { width: 100%; height: 44px; }

  table, thead, tbody, tr, td { display: block; width: 100%; }
  /* The column names have nothing to label once cells are stacked. */
  thead { display: none; }
  tr.link-row { padding: 6px 0; }
  tbody > tr:not([hidden]) ~ tr > td { border-top: 0; }
  tbody > tr:not([hidden]) ~ tr { border-top: 1px solid var(--hairline); }
  td { padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
    /* 44px tap target — a row on a phone is pressed with a thumb. */
    min-height: 44px; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-transform: uppercase;
    letter-spacing: .08em; font-weight: 600; flex: none; }
  td.num { text-align: right; }
  /* min-width, not width: the browser keeps a colspan'd cell's width to one
     column even shown as a block, and the message wrapped a word a line. */
  td.empty { display: block; min-width: 100%; }
  /* Nothing matches the filter or search: the words alone, no empty card. */
  .card:has(#no-match:not([hidden])) { background: none; box-shadow: none; }
  #no-match td.empty { padding: 4px 0; }
  /* The progress line spans the row rather than sitting in a 240px column. */
  td .steps { width: 100%; }
  td.steps-cell { display: block; }
  td.steps-cell::before { display: block; margin-bottom: 8px; }
  /* The photo leads its stacked row rather than sitting in a labelled cell. */
  td.cell-thumb { width: auto; padding-right: 16px; justify-content: flex-start; }
  td.cell-thumb::before { content: none; }

  .title-bar .head-actions { width: 100%; }
  .head-actions .btn { flex: 1 1 auto; }
  .stops-card { padding: 18px 16px; }
  .facts-grid { grid-template-columns: 1fr 1fr; }

  .form { grid-template-columns: 1fr; padding: 18px; gap: 16px; }
  .form .acts .btn { flex: 1 1 auto; }
  #send-confirm p { white-space: normal; }
}

/* Receivables statements (Lucas, 20-10-2026): a credit, money coming off what
   the customer owes, reads green; the running balance is bold. Debits stay
   in the ink colour. */
td.ar-credit { color: var(--pill-green-fg); }
td.ar-balance { font-weight: 600; }

/* The Balance page (Lucas, 21-10-2026): the statement's newest row is where
   the balance stands now, tagged Current. No row tint (Lucas, 22-10-2026). */
.tag-current { display: inline-block; margin-right: 8px; padding: 2px 8px; border-radius: 999px;
  background: var(--ink); color: var(--panel); font-size: 11px; font-weight: 600;
  letter-spacing: .04em; vertical-align: 1px; }

/* Make Payment (Lucas, 22-10-2026, design A; a placeholder until the method
   is decided): one checkout card in the middle — what is owing, the amount as
   one big field (a Full balance chip fills it), how they'll pay, Continue. */
.pay-col { width: 100%; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.pay-title { white-space: nowrap; }
.pay-card { width: 100%; padding: 24px;
  display: flex; flex-direction: column; gap: 22px; }
.pay-owing { display: flex; flex-direction: column; gap: 4px; }
.pay-owing span, .pay-label { font-size: 12px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); }
.pay-owing b { font-size: 30px; line-height: 1.05; font-stretch: 125%; font-weight: 800;
  font-variant-numeric: tabular-nums; }
.pay-step { display: flex; flex-direction: column; gap: 10px; }
.pay-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* Pay all: a small pill that puts what is owing in the amount (Lucas, 11-11-2026). */
.pay-all { min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--edge); background: var(--panel); color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pay-all.is-on, .pay-all:active { background: var(--ink); color: var(--panel); box-shadow: none; }
.pay-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-chip { position: relative; cursor: pointer; }
.pay-chip input { position: absolute; opacity: 0; pointer-events: none; }
.pay-chip span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border-radius: 999px; box-shadow: inset 0 0 0 1px var(--edge); font-size: 14px; font-weight: 600;
  background: var(--panel); }
.pay-chip input:checked + span { background: var(--ink); color: var(--panel); box-shadow: none; }
.pay-chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.pay-field { display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 16px;
  border-radius: 12px; box-shadow: inset 0 0 0 1px var(--edge); font-size: 22px; font-weight: 600;
  cursor: text; }
.pay-field:focus-within { box-shadow: inset 0 0 0 2px var(--ink); }
.pay-field span { color: var(--muted); }
.pay-field input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: none;
  font: inherit; color: var(--text); font-variant-numeric: tabular-nums; }
.pay-hows { display: flex; flex-direction: column; gap: 8px; }
.pay-how { position: relative; cursor: pointer; display: block; }
.pay-how input { position: absolute; opacity: 0; pointer-events: none; }
.pay-how > span { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px;
  border-radius: 12px; box-shadow: inset 0 0 0 1px var(--edge); background: var(--panel); }
.pay-how b { font-size: 15px; font-weight: 600; }
.pay-how small { font-size: 13px; color: var(--muted); }
.pay-how input:checked + span { box-shadow: inset 0 0 0 2px var(--ink); }
.pay-how input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.pay-ref { height: 44px; padding: 0 14px; border: 0; border-radius: 12px; outline: 0; width: 100%;
  box-shadow: inset 0 0 0 1px var(--edge); font: inherit; font-size: 16px; color: var(--text); background: var(--panel); }
.pay-ref:focus { box-shadow: inset 0 0 0 2px var(--ink); }
/* What they've sent or asked for, above the statement (Lucas, 05-11-2026). */
/* Full width, one row a payment, with its actions on the row (Lucas, 06-11-2026). */
.pay-open { margin-bottom: 16px; }
.pay-open .move { align-items: center; }
.pay-open .what { display: flex; flex-direction: column; gap: 2px; }
.pay-acts { flex: 0 0 auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
@media (min-width: 721px) {
  /* One width for every row's actions, so the amounts beside them line up. */
  .pay-acts { width: 236px; }
}
@media (max-width: 720px) {
  /* The words on the left; the amount and the actions under it on the right,
     so a row with Pay Now is no taller than its words (Lucas, 19-11-2026). */
  .pay-open .move { display: grid; grid-template-columns: 1fr auto;
    column-gap: 12px; row-gap: 8px; align-items: start; }
  .pay-open .move .what { grid-column: 1; grid-row: 1 / span 2; }
  .pay-open .move .num { grid-column: 2; text-align: right; }
  .pay-acts { grid-column: 2; justify-content: flex-end; }
}
.pay-reason { color: var(--error); font-size: 14px; }
.pay-receipt-link { font-size: 13px; color: var(--muted); }
/* Their receipt in a card over the Balance page (portal.js section 8b). */
.confirm.receipt-pop { width: min(640px, calc(100vw - 32px)); }
.receipt-view { margin: 0 0 18px; border-radius: 10px; background: var(--bg); overflow: auto;
  max-height: 64vh; display: flex; justify-content: center; }
.receipt-view img { display: block; max-width: 100%; height: auto; }
.receipt-view iframe { display: block; width: 100%; height: 64vh; border: 0; }
.pay-now { flex: 0 0 auto; }
.pay-card .btn { width: 100%; }

/* --- the phone layout (Lucas, 22-10-2026) ---------------------------------- */

/* Everything below this line is for a phone (720px and narrower) only; the
   computer's look above is untouched by it. Where a phone needs a different
   STRUCTURE the page carries both: .only-phone is the phone's own markup (the
   Menu button, Home's tiles, a detail page's cards, a list row's phone cell),
   hidden on every wider screen; .only-desk is the computer's, hidden on a
   phone. The two queries are exact complements, so each width shows one. */
@media not all and (max-width: 720px) {
  .only-phone { display: none !important; }
}

@media (max-width: 720px) {
  .only-desk { display: none !important; }

  /* The top bar: the wordmark and a Menu button. The tabs and the name /
     Log out are the panel the button opens, under the bar, in the bar's ink:
     a column of tabs, the lit one in lime text, then the name and Log out.
     portal.js toggles .menu-open; with no JS the button is a link to the nav
     and :target opens it, so nobody is left without a way around (once the
     script has marked the bar .menu-js, :target no longer counts — only the
     toggle does). */
  .top-in { padding: 10px 16px; gap: 0 12px; min-height: 64px; }
  .mark { font-size: clamp(15px, 4.9vw, 20px); }
  .menu-btn { display: inline-flex; align-items: center; gap: 8px; margin-left: auto;
    min-height: 44px; padding: 0 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--bar-edge);
    color: var(--panel); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
  @media (hover: hover) { .menu-btn:hover { color: var(--panel); background: var(--bar-hover); } }
  .menu-btn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor;
    stroke-width: 2; stroke-linecap: round; }
  .menu-btn .close-ico, .menu-btn .close-word,
  .top.menu-open .menu-btn .menu-ico, .top.menu-open .menu-btn .menu-word { display: none; }
  .top.menu-open .menu-btn .close-ico { display: block; }
  .top.menu-open .menu-btn .close-word { display: inline; }
  .nav, .who { display: none; }
  .top.menu-open .nav, .top:not(.menu-js) .nav:target { display: flex; flex-direction: column; gap: 2px;
    order: 3; width: 100%; overflow: visible; padding: 8px 0 4px; }
  .nav a { min-height: 44px; padding: 10px 12px; border-radius: 10px; }
  .nav a.on, .nav a.on:hover { background: transparent; color: var(--lime); }
  .top.menu-open .who, .top:not(.menu-js) .nav:target ~ .who { display: flex; order: 4; width: 100%; margin-left: 0;
    justify-content: space-between; padding: 12px 0 8px; border-top: 1px solid var(--bar-edge); }
  .who b { max-width: 60%; }
  /* In the panel the gear says what it is. */
  .who-gear { width: auto; height: 44px; padding: 0 14px; font-size: 14px; font-weight: 600; }
  .who-gear .gear-word { display: inline; }

  /* Headings wrap rather than run off the screen: "Good afternoon, <name>"
     at 375px, "Report a problem" at 320px. */
  .hello h1 { white-space: normal; overflow-wrap: anywhere; }
  .home-hello h1 { font-size: 22px; line-height: 1.1; }
  .home-hello > div { min-width: 0; }
  /* Make Payment beside a heading moves into the page on a phone (Home's
     under the tiles, Balance's into the dark card). */
  .hello .top-action { display: none; }
  /* Thumb-sized: Back, a section's "All …" link, a notice's ×. */
  .back, .section-head a { min-height: 44px; display: inline-flex; align-items: center; }
  .messages .dismiss { min-width: 44px; min-height: 44px; }
  /* A button the width of the screen: Make Payment, Download Invoice. */
  .phone-wide { width: 100%; white-space: normal; }

  /* Home: the computer's tiles and two columns give way to .home-phone. */
  .tiles, .home-cols { display: none; }
  .home-phone { display: flex; flex-direction: column; gap: 12px; }
  .phone-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .phone-tiles.solo { grid-template-columns: minmax(0, 1fr); }
  .phone-tile { padding: 14px; min-width: 0; }
  .phone-tile .tile-fig { font-size: clamp(16px, 5.2vw, 20px); overflow-wrap: anywhere; }
  .phone-section { display: flex; flex-direction: column; gap: 12px; }
  /* One compact row per box in one card: the id and its status on top, one
     grey line under. The whole row is the link. */
  .phone-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; min-height: 44px;
    color: var(--text); text-decoration: none; border-top: 1px solid var(--hairline); }
  .phone-item:first-child { border-top: 0; }
  @media (hover: hover) { .phone-item:hover { color: var(--text); background: var(--row-hover); } }
  .pi-top, .pr-top { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px;
    flex-wrap: wrap; }
  /* The box number stays on one line; its badge wraps under it when the two
     do not fit (owner, 17-11-2026). */
  .pi-top .box-id, .phone-row .pr-top a.box-no, .band-phone h1.box-no { white-space: nowrap; overflow-wrap: normal; }
  /* A status on a phone row is the pill's dot and word, without the pill. */
  /* Statuses keep their full pill on a phone, as on the computer (Lucas, 22-10-2026). */

  /* The lists (Orders, Boxes, Tickets): each row shows only its phone cell
     — two or three short lines — and the row still opens what it lists. */
  tr.link-row { padding: 0; }
  tr.link-row > td:not(.phone-row) { display: none; }
  td.phone-row { flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 3px; padding: 12px 16px; }
  td.phone-row::before { content: none; }
  .phone-row .pr-top a { color: var(--text); font-weight: 700; text-decoration: none;
    overflow-wrap: anywhere; min-width: 0; }
  @media (hover: hover) { tr.link-row:hover .pr-top a { color: var(--blue); } }
  .phone-row .pr-top .num { font-weight: 700; white-space: nowrap; }
  .phone-row .meter { display: block; height: 6px; margin: 4px 0 1px; }
  .phone-row .pr-src { display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; }
  .phone-row .pr-done { color: var(--pill-green-fg); }
  .phone-row .pr-foot { display: flex; justify-content: space-between; gap: 12px; }
  .phone-row .mono, .bp-facts .mono { font-size: 13px; overflow-wrap: anywhere; }

  /* A detail page's dark band as one card: everything stacked, the buttons
     across it. */
  .band-phone { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 18px 16px; }
  .band-phone h1 { font-size: 28px; overflow-wrap: break-word; min-width: 0; }
  .bp-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
  .bp-muted { color: var(--bar-muted); font-size: 14px; white-space: nowrap; }
  .bp-total { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .band-phone .band-sub { margin-top: 0; }
  /* The sent bar across the card, its words under it; green once all sent,
     as on the band above. */
  .band-phone .progress { width: 100%; flex-direction: column; align-items: stretch; gap: 6px; }
  .band-phone .progress .bar { width: 100%; background: var(--bar-edge); }
  .band-phone .progress .bar i { background: var(--panel); }
  .band-phone .progress.done .bar i { background: var(--green-on-dark); }
  /* The order band says how much has gone beside the total, so its bar has
     no words under it (Lucas, 22-10-2026). The box band has no bar. */
  .band-phone .progress-label { display: none; }
  .src-phone { display: flex; flex-direction: column; gap: 6px; }
  .band-phone .bp-done { color: var(--green-on-dark); }
  /* A box's id on one line (Lucas, 22-10-2026): smaller than the order
     number, which is shorter. */
  .band-phone > h1 { font-size: min(24px, 6.4vw); white-space: nowrap; }  /* shrinks on the smallest phones */
  .band-phone .band-steps .steps { width: 100%; max-width: none; }
  .bp-facts { display: flex; flex-direction: column; gap: 4px; color: var(--bar-muted); font-size: 14px;
    overflow-wrap: anywhere; }
  .bp-actions { display: flex; flex-direction: column; gap: 8px; }
  .bp-actions .btn { width: 100%; white-space: normal; }
  /* A band that stays as it is (a ticket): its button across it. */
  .band .head-actions { justify-self: stretch; }
  .band-order .band-figs { margin-left: 0; }
  .band .head-actions .btn { flex: 1 1 100%; white-space: normal; }

  /* One card per shoe (order and box pages): photo, name, code and price,
     then a short row per size. Fixed figure columns so they line up down
     the card. */
  .phone-shoes { display: flex; flex-direction: column; gap: 12px; }
  .shoe-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
  .shoe-head { display: flex; align-items: center; gap: 12px; }
  .shoe-head .ph-sm { width: 48px; height: 48px; }
  .shoe-head > .num { margin-left: auto; white-space: nowrap; }
  .shoe-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
  .shoe-name .name { font-weight: 600; font-size: 14px; line-height: 1.3; }  /* a touch smaller (Lucas, 22-10-2026) */
  .seg-grid { display: grid; grid-template-columns: minmax(0, 1fr) 24px 66px 80px; gap: 10px;
    align-items: center; }
  /* A size stays on one line (Lucas, 22-10-2026). */
  .seg-grid > :first-child { white-space: nowrap; }
  /* The Sent column is centred, heading and pills alike (Lucas, 22-10-2026). */
  .seg-grid > :nth-child(3) { text-align: center; justify-self: center; }
  .seg-head { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted); padding-top: 4px; }
  .seg-row, .item-row { padding-top: 8px; border-top: 1px solid var(--hairline); font-size: 14px;
    font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  /* Size, qty, the order, the line total (Lucas, 22-10-2026). */
  .item-row { display: grid; grid-template-columns: minmax(0, 1fr) 28px 88px 72px; gap: 8px; align-items: center; }
  .item-row > :first-child { white-space: nowrap; }
  .item-row a { font-size: 13px; }
  /* Qty and the order centred in their columns, so neither crowds the other. */
  .item-row > :nth-child(2), .item-row > :nth-child(3) { text-align: center; }
  .seg-row .seg-label, .item-row .seg-label { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
  .seg-row .each { display: block; color: var(--muted); font-size: 12px; }
  .sent-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
    white-space: nowrap; background: var(--hairline); color: var(--muted); }
  /* The bar's colours (Lucas, 22-10-2026): grey with nothing sent yet, blue
     part-sent, green all sent. */
  .sent-pill.some { background: var(--pill-blue-bg); color: var(--pill-blue-fg); }
  .sent-pill.done { background: var(--pill-green-bg); color: var(--pill-green-fg); }
  /* A cancelled or refunded row, as the table's tr.line-refunded: muted,
     its figures struck. */
  .seg-struck { color: var(--muted); }
  .seg-struck .num { text-decoration: line-through; }

  /* "Changes to this order" and "What we did", compact; money back to the
     customer reads green with its minus. */
  .card-bar { padding: 14px 16px 6px; }
  .card-bar h2 { font-size: 17px; }
  .said { padding-left: 16px; padding-right: 16px; }
  .shots { padding: 0 16px 16px; }
  .moves { padding: 0 16px 10px; }
  .move { padding: 10px 0; gap: 12px; font-size: 14px; }
  .card.changes .move .num.to-you { color: var(--pill-green-fg); }

  /* Balance: the dark card, then the statement a day at a time. */
  .bal-card { background: var(--ink); color: var(--panel); border-radius: 14px; padding: 18px 16px;
    display: flex; flex-direction: column; gap: 6px; }
  .bal-card .lab { color: var(--lime); }
  .bal-fig { font-size: 32px; line-height: 1.05; font-stretch: 125%; font-weight: 800;
    font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .bal-card .btn { margin-top: 10px; box-shadow: none; }
  .phone-days { display: flex; flex-direction: column; gap: 12px; }
  .day-head { margin-top: 8px; }
  .day-head:first-child { margin-top: 0; }
  .entry { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px;
    border-top: 1px solid var(--hairline); font-size: 14px; }
  .entry:first-child { border-top: 0; }
  .entry-what { min-width: 0; overflow-wrap: anywhere; }
  .entry-fig { text-align: right; white-space: nowrap; }
  .entry-fig .num { display: block; font-weight: 600; }
  .entry-fig .ar-credit { color: var(--pill-green-fg); }
  /* "Credit", as the computer's Credit column names it, never a bare minus
     (owner, 17-11-2026). */
  .entry-fig .entry-kind { font-size: 12px; font-weight: 600; }
  .entry .sub { margin-top: 2px; }
  .entry .tag-current { margin-right: 6px; }

  /* Make a payment: Back, the title and what is owing stacked; the amount
     box and Continue across the screen. */
  .pay-head { height: auto; flex-wrap: wrap; gap: 4px 16px; }
  .pay-col { gap: 12px; }
  .pay-title { white-space: normal; }
  .pay-card { padding: 18px 16px; gap: 18px; }
  /* The report form: thumb-sized choices and a long name that wraps. */
  .pick span { min-height: 44px; }
  .tick .what { min-width: 0; overflow-wrap: anywhere; }
  .file-names .rm { min-width: 44px; min-height: 44px; }
}

/* "Add UH Portal to your phone" (Lucas, 26-10-2026): the dark bar at the foot
   of the phone Home, over the page. portal.js shows it (body.app-prompt-on),
   and the page gets room at its foot so the bar never covers the last row. */
.app-prompt { position: fixed; left: 10px; right: 10px; z-index: 20;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--ink); color: var(--panel); border-radius: 16px; box-shadow: var(--shadow-lift); }
.app-prompt:has([data-app-ios]:not([hidden])) { align-items: flex-start; }
.ap-what { flex: 1; min-width: 0; font-size: 14px; }
.ap-what > b { font-weight: 600; }
.ap-what > span { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.5; color: var(--bar-muted); }
.ap-what > span b { color: var(--panel); font-weight: 500; }
.ap-share { width: 15px; height: 15px; vertical-align: -2px; fill: none; stroke: var(--panel);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ap-install { padding: 0 14px; min-height: 36px; font-size: 13px; box-shadow: none; }
.ap-close { flex: none; width: 32px; height: 32px; margin: -6px -8px -6px 0; border: 0; background: none;
  color: var(--bar-muted); font-size: 22px; line-height: 1; cursor: pointer; }
body.app-prompt-on .content { padding-bottom: 130px; }
/* On a computer ("Turn on notifications" only): a card at the bottom right,
   where the system's own notifications appear, not a bar across the page. */
@media not all and (max-width: 720px) {
  .app-prompt { left: auto; right: 24px; bottom: 24px; width: 380px; }
  body.app-prompt-on .content { padding-bottom: 40px; }
}


/* The home-screen app on a phone (Lucas, 26-10-2026): the SAME nav as a tab
   bar along the foot, an icon over each word — html.in-app is set in base.html
   before the page paints. No Menu button; Log out stays small at the top
   right, the name is left off. Balance's owing figure is too wide for a tab
   and is left off it (Balance itself shows it). Safari and computers keep the
   top nav and the Menu. */
@media (max-width: 720px) {
  html.in-app .menu-btn { display: none; }
  /* Pinned to the top: an iPhone tints the strip under its clock with what is
     pinned there, and a bar that scrolls away left it the page's light grey
     fading over the black (iOS 26; Lucas, 26-10-2026). */
  html.in-app .top { position: sticky; top: 0; z-index: 30; }
  html.in-app .top-in { flex-wrap: nowrap; }
  html.in-app .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; width: auto;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--ink); border-top: 1px solid var(--bar-edge); overflow: visible; }
  html.in-app .nav a { position: relative; flex-direction: column; justify-content: center; gap: 3px;
    min-height: 50px; padding: 4px 0; border-radius: 0; background: none;
    color: var(--bar-muted); font-size: 11px; font-weight: 600; }
  html.in-app .nav a.on, html.in-app .nav a.on:hover { background: none; color: var(--lime); }
  html.in-app .nav a::before { content: ""; width: 24px; height: 24px; background: currentColor;
    -webkit-mask: var(--tab-ico) center / contain no-repeat; mask: var(--tab-ico) center / contain no-repeat; }
  html.in-app .nav a[data-tab="home"] { --tab-ico: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 11l9-8 9 8M5 9.5V20h5v-6h4v6h5V9.5%22/%3E%3C/svg%3E"); }
  html.in-app .nav a[data-tab="orders"] { --tab-ico: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M6 3h12v18l-3-2-3 2-3-2-3 2zM9 8h6M9 12h6M9 16h3%22/%3E%3C/svg%3E"); }
  html.in-app .nav a[data-tab="boxes"] { --tab-ico: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 3l8 4.5v9L12 21l-8-4.5v-9zM4 7.5l8 4.5 8-4.5M12 12v9%22/%3E%3C/svg%3E"); }
  html.in-app .nav a[data-tab="tickets"] { --tab-ico: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 5h16v11H9l-5 4z%22/%3E%3C/svg%3E"); }
  html.in-app .nav a[data-tab="balance"] { --tab-ico: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 7h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4zM4 7l11-3v3M16 13h1%22/%3E%3C/svg%3E"); }
  html.in-app .nav-count { position: absolute; top: 2px; left: calc(50% + 6px);
    font-size: 10px; padding: 0 5px; }
  /* Balance: a plain blue dot while something is owing (Lucas, 27-10-2026) —
     the amount is too wide for a badge over the icon. The amount stays in
     the markup for screen readers; base.html only renders it while owing. */
  html.in-app .nav a[data-tab="balance"] .nav-count { top: 6px; left: calc(50% + 9px);
    width: 9px; height: 9px; padding: 0; font-size: 0; line-height: 0;
    box-shadow: 0 0 0 2px var(--ink); }
  html.in-app .who { display: flex; order: 0; width: auto; margin-left: auto; padding: 0; border: 0; }
  html.in-app .who b { display: none; }
  html.in-app .who-gear { width: 38px; height: 38px; padding: 0; }
  html.in-app .who-gear .gear-word { display: none; }
  html.in-app body { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  html.in-app .app-prompt { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
}

/* The strip under the iPhone's clock in the home-screen app (Lucas,
   26-10-2026): iOS 26.1+ paints it in the page's own colour (base.html), so
   in the app the page is ink and the content area carries the light grey,
   filling the screen between the top bar and the tabs. Phone width only: the
   Mac's app has no such strip. */
@media (display-mode: standalone) and (max-width: 720px) {
  html, body { background: var(--ink); }
  body { display: flex; flex-direction: column; min-height: 100dvh; }
  .content { flex: 1 0 auto; background: var(--bg); }
}
/* The same for an iPhone that reports the app only as navigator.standalone
   (base.html marks html.in-app). */
@media (max-width: 720px) {
  html.in-app, html.in-app body { background: var(--ink); }
  html.in-app body { display: flex; flex-direction: column; min-height: 100dvh; }
  html.in-app .content { flex: 1 0 auto; background: var(--bg); }
}

/* Between pages (Lucas, 26-10-2026): the moment a link is tapped a thin
   lime bar runs along the very top of the screen — fixed there, so it shows
   however far down the page is scrolled — and the tapped tab lights at once
   (portal.js section 12). Every page, the app, Safari and computers. No fade
   of the page: over the app's ink it turned the screen a murky grey.

   The bar lives on the page being LEFT only: the next page appearing is the
   finish. A bar that picked up again on the new page and ran to the end read
   as the new page loading a second time (Lucas, 27-10-2026). A portal page
   takes about half a second to arrive from Australia (Railway answers in
   ~0.15s, the rest is the trip), so the bar is past three quarters within
   that, then creeps on and never stops while it waits.

   It grows by transform, never by width: once a phone starts fetching the
   next page it stops laying out the old one, and a width that animated froze
   in the top-left corner. A transform keeps running on its own. */
html.in-app .top { position: sticky; }
.page-load { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: 3px;
  background: var(--lime); pointer-events: none; opacity: 0;
  transform: scaleX(0); transform-origin: left center; will-change: transform, opacity; }
body.is-leaving .page-load { opacity: 1; animation: page-load 12s linear forwards; }
@keyframes page-load {
  0%    { transform: scaleX(0.30); }   /* 0s */
  0.8%  { transform: scaleX(0.50); }   /* 0.1s */
  2.5%  { transform: scaleX(0.68); }   /* 0.3s */
  5%    { transform: scaleX(0.78); }   /* 0.6s */
  10%   { transform: scaleX(0.84); }   /* 1.2s */
  25%   { transform: scaleX(0.88); }   /* 3s */
  100%  { transform: scaleX(0.94); }   /* 12s */
}
@media (prefers-reduced-motion: reduce) {
  body.is-leaving .page-load { animation: none; transform: scaleX(.8); }
}


/* Settings (Lucas, 27-10-2026): one column of cards — their details,
   notifications on this browser, the password, Log out. */
.settings { display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 720px; margin: 0 auto; }
.settings .hello { margin-bottom: 4px; }
.st-card { padding: 20px; }
.st-card h2 { font-size: 17px; }
.st-sub { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.st-dl { margin: 14px 0 0; display: grid; grid-template-columns: 150px 1fr; gap: 12px 16px; font-size: 15px; }
.st-dl dt { color: var(--muted); }
.st-dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.st-addr { line-height: 1.45; }
.st-addr + .st-addr { margin-top: 12px; }
.st-addr b { display: block; }
.st-note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.st-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--text);
  text-decoration: underline; cursor: pointer; }
@media (hover: hover) { .st-link:hover { color: var(--blue); } }
.st-row { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
/* The login email, then a small Change button a little way after it — not
   jammed against it, not off at the card's edge (Lucas, 27-10-2026). Opens
   the form under it. No disclosure triangle. */
/* Only the button reacts: the rest of the row is plain text, not a target
   that lights the button from across the card (Lucas, 27-10-2026). */
.st-change summary { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px;
  list-style: none; pointer-events: none; }
.st-change summary .st-link { pointer-events: auto; cursor: pointer; }
.st-change summary::-webkit-details-marker { display: none; }
.st-change summary::marker { content: ""; }
/* The value takes at least a set width, so the Change buttons line up row
   to row (Lucas, 27-10-2026); a longer email simply pushes its own along. */
.st-change summary > span:first-child { min-width: 220px; max-width: 100%; overflow-wrap: anywhere; }
/* Change while shut, Cancel while open. */
.st-change .st-shut, .st-change[open] .st-open { display: none; }
.st-change[open] .st-shut { display: inline; }
.st-change summary .st-link { flex: none; font-size: 13px; font-weight: 600; text-decoration: none;
  padding: 4px 12px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--edge); color: var(--text); }
@media (hover: hover) { .st-change summary .st-link:hover { color: var(--panel); background: var(--blue); box-shadow: none; } }
.st-change .st-form { margin-top: 10px; font-weight: 400; }
.st-change .st-sub { margin: 0; }
.st-change .st-note { font-weight: 400; }
.st-row .btn { margin-left: auto; flex: none; }
.st-state { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.st-state.is-on::before, .st-state.is-off::before { content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--pill-green-fg); flex: none; }
/* Off: a red dot, as On has its green one (Lucas, 27-10-2026). */
.st-state.is-off::before { background: var(--error); }
.st-state.is-quiet { font-weight: 500; color: var(--muted); }
.st-form { display: grid; gap: 14px; margin-top: 14px; max-width: 420px; }
.st-form .btn { justify-self: start; }
/* Notifications and Log out: what it is on the left, the state and the
   button on the right, one line (Lucas, 27-10-2026). */
.st-side { display: flex; align-items: center; gap: 16px; }
.st-side .st-row { margin: 0 0 0 auto; flex: 0 1 auto; max-width: 60%; }
.st-side form { margin: 0 0 0 auto; }
@media (max-width: 719px) {
  .settings { gap: 16px; }
  /* On a phone Change stays on the email's line, at the right; a long email
     wraps rather than pushing it underneath (Lucas, 27-10-2026). */
  .st-change summary { flex-wrap: nowrap; justify-content: space-between; }
  .st-change summary > span:first-child { min-width: 0; flex: 1 1 auto; }
  .st-dl { grid-template-columns: 1fr; gap: 2px; }
  .st-dl dd { margin-bottom: 10px; }
  .st-row, .st-side { flex-wrap: wrap; }
  .st-side .st-row { flex: 1 1 100%; max-width: none; margin: 0; }
  .st-row .btn, .st-side form, .st-side .btn, .st-form .btn { width: 100%; margin-left: 0; justify-self: stretch; }
  .st-form { max-width: none; }
}

/* The phone app's tabs side by side (Lucas, 28-10-2026; portal.js section
   15). The page between the header and the tab bar becomes one strip the
   phone scrolls sideways and snaps a whole page at a time, each tab a panel
   that scrolls up and down by itself, laid out as the page itself was. The
   window itself no longer scrolls. A page's fixed parts (the app bar on
   Home, a notice) stay inside their own panel and travel with it. */
@media (max-width: 720px) {
  /* No grey flash on a row the finger only passed over while swiping. */
  html.tab-strip body { height: 100dvh; min-height: 0; overflow: hidden; }
  html.tab-strip .content { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: row; gap: 0;
    padding: 0; max-width: none; overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
  html.tab-strip .content::-webkit-scrollbar { display: none; }
  .tab-panel { flex: 0 0 100%; min-width: 0; height: 100%; overflow-y: auto; overflow-x: hidden;
    overscroll-behavior-y: contain; scroll-snap-align: start; scroll-snap-stop: always;
    contain: paint; display: flex; flex-direction: column; gap: 12px; padding: 12px 16px 40px; }
  /* A panel has a set height, so its blocks must not squash to fit it. */
  .tab-panel > * { flex-shrink: 0; }
  body.app-prompt-on .tab-panel { padding-bottom: 130px; }
  .tab-wait { margin: 40px 0; text-align: center; color: var(--muted); font-size: 14px; }
}

/* "Put UH Portal on your phone" (Lucas, 28-10-2026; app_install.html): one
   narrow column, the steps as numbered cards, each with a small drawn
   picture of what to tap. */
.app-wrap { min-height: 100vh; max-width: 480px; margin: 0 auto; padding: 28px 18px 40px;
  display: flex; flex-direction: column; gap: 16px; }
.app-wrap .mark { font-size: 22px; color: var(--ink); text-align: center; }
.app-hero { text-align: center; }
.app-ico { width: 64px; height: 64px; border-radius: 16px; background: var(--ink); color: var(--lime);
  display: grid; place-items: center; margin: 4px auto 12px; font-weight: 800; font-size: 22px; font-stretch: 125%; }
.app-hero h1 { font-size: 26px; }
.app-hero p { color: var(--muted); font-size: 15px; margin: 8px 0 0; }
.app-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.app-step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 14px; align-items: start; }
.app-n { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--lime);
  display: grid; place-items: center; font-weight: 800; }
.app-step b { display: block; font-size: 16px; margin-top: 4px; }
.app-step .sub, .app-other .sub { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.app-shot { grid-column: 2; width: 100%; max-width: 240px; height: auto; margin-top: 10px; font-family: inherit; }
.app-alert { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--pill-amber-bg);
  color: var(--pill-amber-fg); font-size: 14px; font-weight: 500; }
.app-other { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.app-other > b { font-size: 17px; }
.app-other .btn { align-self: stretch; }
.app-foot { text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0 0; line-height: 1.6; }

/* Settings over the page (Lucas, 28-10-2026; portal.js section 17): a layer
   under the top bar, on the page's own light ground, the page underneath
   left exactly as it was — never locked or scrolled, so it keeps its place;
   the layer scrolls by itself and does not pass the scroll on (overscroll-
   behavior). It slides up from the bottom like an iPhone sheet, solid — no
   fade, which let the page show through; Lucas chose this of four, 28-10-
   2026 — and drops back down to close.
   In the app it stops at the tab bar, which stays in reach. */
.settings-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--bg);
  overflow-y: auto; overscroll-behavior: contain; transform: translate3d(0, 100%, 0);
  border-radius: 16px 16px 0 0; visibility: hidden; will-change: transform;
  transition: transform .24s cubic-bezier(.4, 0, 1, 1), visibility 0s .24s;
  box-shadow: 0 -12px 32px rgba(19, 20, 22, .1); }
.settings-sheet.open { transform: none; visibility: visible;
  transition: transform .34s cubic-bezier(.22, .9, .25, 1); }
@media (prefers-reduced-motion: reduce) {
  .settings-sheet, .settings-sheet.open { transition: none; }
}
.settings-sheet-in { max-width: 1320px; margin: 0 auto; padding: 32px 24px 56px; }
/* The bar stays in view, so the gear to close it is always there. */
html.settings-open .top { position: sticky; top: 0; z-index: 30; }
@media (max-width: 720px) {
  .settings-sheet-in { padding: 12px 16px 40px; }
  html.in-app .settings-sheet { bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
}

/* Pressed (portal.js section 12; Lucas, 28-10-2026: "highlight anything that
   is clicked ... like it normally should"). A phone has no hover, so what a
   finger taps takes the look the pointer gives it on a computer (the faint
   greys a firmer lime, to show under a finger), and a plain link (a SID on
   Balance) gets a lime mark behind it. Lit under the finger,
   kept while the next page opens, gone after. Last in the file so it wins
   over each thing's own colours. The browser's grey tap flash is off: this
   replaces it. */
html { -webkit-tap-highlight-color: transparent; }
a.is-pressed { color: var(--blue); }
a[class="is-pressed"] { background: var(--row-press); box-shadow: 0 0 0 3px var(--row-press); border-radius: 3px; }
.mark.is-pressed { color: var(--panel); }
.nav a.is-pressed, .messages .dismiss.is-pressed, .menu-btn.is-pressed { color: var(--panel); background: var(--bar-hover); }
.who-gear.is-pressed, .who-chat.is-pressed, .tile-dark.is-pressed { color: var(--panel); background: var(--blue); box-shadow: none; }
.tile-dark.is-pressed .sub { color: var(--panel); }
.back.is-pressed, .st-link.is-pressed { color: var(--blue); }
.btn.is-pressed, .btn.ghost.is-pressed, .btn.lime.is-pressed, .band .btn.is-pressed,
.st-change summary.is-pressed .st-link { background: var(--blue); color: var(--panel); box-shadow: none; }
.chip.is-pressed { color: var(--text); background: var(--row-press); box-shadow: none; }
.chip.on.is-pressed { background: var(--ink); color: var(--panel); }
.pick.is-pressed span { background: var(--row-press); color: var(--text); }
.pick.is-pressed input:checked + span { background: var(--ink); color: var(--panel); }
.tick.is-pressed { background: var(--row-press); box-shadow: inset 0 0 0 1px var(--edge); }
.drop.is-pressed { background: var(--row-press); border-color: var(--ink); color: var(--text); }
.file-names .rm.is-pressed { background: var(--border); color: var(--text); }
tr.link-row.is-pressed > td, .order-row.is-pressed, .phone-item.is-pressed { background: var(--row-press); color: var(--text); box-shadow: none; }
tr.link-row.is-pressed a.row-target, tr.link-row.is-pressed .pr-top a { color: var(--blue); }
.box-card.is-pressed { color: var(--text); box-shadow: var(--shadow), 0 0 0 2px var(--blue); }


/* UH Support, the chat (Lucas, 29-10-2026; portal.js section 18). The chat
   icon in the bar drops it down over the page: on a phone a full screen under
   the bar, coming down from behind it; on a computer a 400px dropdown under
   the icon. Quiet — no badge, nothing opens by itself. Customer bubbles are
   ink, UH Support's the ground grey; an answer's links are outline pills. */
@media (max-width: 720px) {
  /* Safari on a phone: the gear lives in the Menu panel, so the chat has its
     own icon in the bar, beside Menu. The app shows the bar's gear, and the
     icon beside it. */
  html:not(.in-app) .bar-chat { display: inline-flex; margin-left: auto; width: 44px; height: 44px;
    border-radius: 999px; }
  html:not(.in-app) .bar-chat + .menu-btn { margin-left: -6px; }
  /* Wordmark, chat and Menu on one line down to 320px: the mark gives up
     what the icon takes (about 17px of type at 375px instead of 18). */
  html:not(.in-app) .top-in:has(.bar-chat) .mark { font-size: clamp(12px, calc((100vw - 184px) / 11.6), 20px); }
  html:not(.in-app) .who .who-chat { display: none; }
}
.support-drop { position: fixed; z-index: 25; background: var(--panel); visibility: hidden;
  display: flex; flex-direction: column; overscroll-behavior: contain; }
.support-drop > .sp { flex: 1; min-height: 0; }
html.support-open .top { position: sticky; top: 0; z-index: 30; }
@media (min-width: 721px) {
  /* Above the corner bubble, rising from it. */
  /* Sized to the window (Lucas, 29-10-2026: "does not fit" in a short
     one): never wider than it, and never taller than the room between the
     top bar and the bubble, which portal.js measures (--sp-room). */
  .support-drop { right: 24px; bottom: 92px; width: min(400px, calc(100vw - 48px));
    height: min(600px, var(--sp-room, calc(100vh - 172px)));
    border-radius: 14px; box-shadow: var(--shadow-lift); overflow: hidden;
    opacity: 0; transform: translate3d(0, 8px, 0); transform-origin: bottom right;
    transition: opacity .14s ease-in, transform .14s ease-in, visibility 0s .14s; }
  .support-drop.open { opacity: 1; transform: none; visibility: visible;
    transition: opacity .18s ease-out, transform .18s ease-out; }
}
@media (max-width: 720px) {
  /* In and out as the computer's does, a quick fade with a small rise (Lucas,
     04-11-2026: the drop from the top "doesnt look professional"). */
  .support-drop { left: 0; right: 0; bottom: 0; opacity: 0; transform: translate3d(0, 8px, 0);
    transition: opacity .14s ease-in, transform .14s ease-in, visibility 0s .14s; }
  .support-drop.open { opacity: 1; transform: none; visibility: visible;
    transition: opacity .18s ease-out, transform .18s ease-out; }
  html.in-app .support-drop { bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  /* Safari: the box clear of the iPhone's home bar. */
  html:not(.in-app) .support-drop .sp-form { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  html.support-open body { overflow: hidden; }
  /* The keyboard is up and the page slid anyway (portal.js section 18): the
     chat is all that shows, sized by the script to what can be seen, with the
     tab bar gone. Otherwise only the foot of the chat lifts (.lifted). */
  .support-drop.lifted .sp-form { padding-bottom: 10px; }
  html.support-typing .nav { display: none; }
  html.support-typing .support-drop { z-index: 31; transition: none; }
  html.support-typing .sp-page .sp { position: fixed; left: 0; right: 0; z-index: 31; border-radius: 0; }
  html.support-typing .support-drop .sp-form,
  html.support-typing .sp-page .sp-form { padding-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .support-drop, .support-drop.open { transition: none; }
}

.sp { position: relative; display: flex; flex-direction: column; background: var(--panel); }
/* "End this chat?" inside the chat, over its messages, wherever the chat is
   (Lucas, 02-11-2026), in the look of the portal's other confirms. */
.sp-confirm { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: var(--scrim); }
.sp-confirm[hidden] { display: none; }
.sp-confirm-card { width: min(340px, 100%); padding: 20px 20px 18px; border-radius: 14px; background: var(--panel);
  box-shadow: var(--shadow-lift); }
.sp-confirm-card h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.sp-confirm-card p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.sp-confirm-card .acts { display: flex; justify-content: flex-end; gap: 8px; }
.sp-page { max-width: 720px; margin: 0 auto; }
.sp-page .sp { height: min(720px, calc(100dvh - 140px)); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.sp-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 18px;
  border-bottom: 1px solid var(--hairline); }
.sp-head h2 { margin: 0; font-size: 16px; font-weight: 600; flex: 1; }
/* End chat: a quiet word in the header, never a button that competes. */
.sp-end { margin: 0; }
.sp-end-btn { min-height: 36px; padding: 0 10px; border: 0; border-radius: 10px; background: none;
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
@media (hover: hover) { .sp-end-btn:hover { background: var(--hover); color: var(--ink); } }
.sp-end-btn.is-pressed { background: var(--hover); color: var(--ink); }
.sp-close { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: 10px; color: var(--muted); }
.sp-close svg, .sp-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .sp-close:hover { background: var(--hover); color: var(--ink); } }
.sp-close.is-pressed { background: var(--hover); color: var(--ink); }
.sp-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.sp-msg { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 85%; }
.sp-customer { align-self: flex-end; align-items: flex-end; }
.sp-bubble { padding: 9px 13px; border-radius: 16px; font-size: 15px; line-height: 1.4;
  overflow-wrap: anywhere; background: var(--bg); color: var(--text); }
.sp-customer .sp-bubble { background: var(--ink); color: var(--panel); }
/* Not an answer: something went wrong, or it could not take the message
   (Lucas, 02-11-2026: "idk why it looked like a proper message"). A small
   centred line with no bubble; red when it failed. */
.sp-notice { align-self: center; max-width: 100%; align-items: center; }
.sp-notice .sp-bubble { padding: 2px 8px; background: none; color: var(--muted); font-size: 13px; text-align: center; }
.sp-notice-bad .sp-bubble { color: var(--error); }
.sp-links { display: flex; flex-wrap: wrap; gap: 6px; }
/* Replies under an answer (Lucas, 29-10-2026), when UH Support asks which
   box or order: outlined in ink, and on a tap they turn into the customer's
   own ink bubble. Where to go is a link inside the bubble (.sp-in). */
.sp-ask-form { display: contents; }
.sp-ask { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px;
  border: 0; border-radius: 999px; background: var(--panel); font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--ink); color: var(--ink); }
@media (hover: hover) { .sp-ask:hover { background: var(--ink); color: var(--panel); } }
.sp-ask.is-pressed { background: var(--ink); color: var(--panel); }
.sp-in { color: inherit; font-weight: 600; text-decoration: underline;
  text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
@media (hover: hover) { .sp-in:hover { color: var(--blue); } }
a.sp-in.is-pressed { color: var(--blue); background: none; box-shadow: none; }
/* UH Support is answering: three dots, for up to a minute. */
.sp-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.sp-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
  animation: sp-dot 1.2s infinite ease-in-out; }
.sp-dots i:nth-child(2) { animation-delay: .15s; }
.sp-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes sp-dot { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.sp-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--hairline); background: var(--panel); }
/* 16px, or an iPhone zooms the page in when the box is tapped. */
.sp-form textarea { flex: 1; min-width: 0; resize: none; max-height: 120px; margin: 0;
  padding: 9px 14px; border: 1px solid var(--edge); border-radius: 20px;
  font: inherit; font-size: 16px; line-height: 1.35; color: var(--text); background: var(--panel); }
.sp-form textarea:focus { outline: none; border-color: var(--blue); }
.sp-send { flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--ink); color: var(--panel); cursor: pointer; }
@media (hover: hover) { .sp-send:hover { background: var(--blue); } }
.sp-send.is-pressed { background: var(--blue); }
.sp-send:disabled { opacity: .4; cursor: default; }
/* A finger needs a bigger × on a photo tile, and a pressed + tile lights. */
@media (pointer: coarse) {
  .photo-tiles .rm { width: 28px; height: 28px; line-height: 28px; top: -10px; right: -10px; }
}
.drop-pick.is-pressed { background: var(--row-press); }
/* Report a problem: Send report keeps the card up, saying it is sending, three
   dots in place of the buttons, until the ticket page arrives (13-11-2026). */
.confirm .send-dots { display: none; }
.confirm.is-sending .send-dots { display: inline-flex; }
.confirm.is-sending .acts { display: none; }

/* --- Show More (owner, 17-11-2026) ----------------------------------------
   Orders, Boxes and the statement show 50 rows, then this reveals the next
   50 (portal.js section 2b). Hidden without script, when every row shows. */
.show-more { display: flex; justify-content: center; }
