/* Northern Number Plates trade portal – styles. Designed for phones first. */

:root {
  --brand: #14233A;
  --brand-2: #1D3150;
  --accent: #F7CE1E;
  --orange: #F26D20;
  --ink: #1B2533;
  --text: #2E3A4A;
  --muted: #5D6878;
  --line: #CDD4DD;
  --line-soft: #E3E8EE;
  --field: #F5F7F9;
  --page: #F3F5F8;
  --focus: #2F6FDE;
  --error: #B42318;
  --error-bg: #FDF0EF;
  --ok: #1E6B47;
  --ok-bg: #EEF7F2;
  --info-bg: #EEF3FB;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--brand-2); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: 6px; }
.skip-link:focus { left: 8px; }

h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.2; color: var(--ink); letter-spacing: -.01em; }
.lede { margin: 0 0 24px; color: var(--muted); max-width: 62ch; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  border-radius: 6px; border: 0;
  font: inherit; font-weight: 650; font-size: 16px; line-height: 1.2;
  text-decoration: none; text-align: center;
  cursor: pointer;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-ghost { background: #fff; color: var(--brand-2); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: var(--field); }
.btn-danger { background: #fff; color: var(--error); border: 1.5px solid #E7B4AF; }
.btn-danger:hover { background: var(--error-bg); }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:active { transform: translateY(1px); }

.link-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0;
  background: none; border: 0; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 15px; color: var(--brand-2);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #9AA8BB;
}
.link-btn:hover { text-decoration-color: currentColor; }
.link-btn-light { color: #DCE4EE; text-decoration-color: rgba(220,228,238,.5); }
.inline-form { display: inline; margin: 0; }

/* ------------------------------------------------------------------ forms */
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
label, .label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 15px; color: var(--ink); }
.optional { font-weight: 400; color: var(--muted); }
.help { margin: -2px 0 8px; font-size: 14px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], input[type=date], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  font: inherit; font-size: 16px;
  color: var(--ink);
  background: var(--field);
  border: 1.5px solid var(--line);
  border-radius: 6px;
}
textarea { padding: 12px 14px; min-height: 110px; resize: vertical; line-height: 1.5; }
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, #5D6878 50%), linear-gradient(135deg, #5D6878 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px;
  background-size: 5px 5px; background-repeat: no-repeat;
}
input:hover, select:hover, textarea:hover { border-color: #AEB8C5; }
input:focus, select:focus, textarea:focus {
  outline: none; background-color: #fff;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(47,111,222,.22);
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); background-color: #fff; }
.error-msg { margin: 6px 0 0; font-size: 14px; color: var(--error); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.label-row label { margin: 0; }
.label-row .link-btn { min-height: 0; padding: 12px 0; margin: -12px 0; font-size: 14px; }

.input-wrap { position: relative; }
.has-toggle input { padding-right: 76px; }
.toggle-pw {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  min-width: 60px; height: 40px; padding: 0 10px;
  border: 0; border-radius: 4px; background: none;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--brand-2); cursor: pointer;
}
.toggle-pw:hover { background: #E7ECF2; }

.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-weight: 400; margin: 0; padding: 10px 0; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.check b { display: block; font-weight: 600; color: var(--ink); }
.check span { display: block; font-size: 14.5px; color: var(--muted); }
.check-simple { display: flex; align-items: center; gap: 10px; padding: 10px 0; margin: 0 0 16px; font-weight: 400; color: var(--text); cursor: pointer; }
.check-simple input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); flex: none; }

.grid-2 > .field { margin-bottom: 20px; }

/* ----------------------------------------------------------------- alerts */
.alert { padding: 12px 14px; border-radius: 6px; font-size: 15px; margin: 0 0 20px; border-left: 4px solid; }
.alert-error { background: var(--error-bg); color: #7A1A12; border-color: var(--error); }
.alert-ok { background: var(--ok-bg); color: #164F35; border-color: var(--ok); }
.alert-info { background: var(--info-bg); color: #1D3150; border-color: var(--focus); }
.note {
  margin-top: 14px; padding: 12px 14px; border-radius: 6px;
  background: #FFF8DB; border-left: 4px solid var(--accent);
  font-size: 15px; color: #4A3F12;
}
.summary {
  margin-bottom: 16px; padding: 14px 16px; border-radius: 8px;
  background: var(--error-bg); border-left: 4px solid var(--error); color: #7A1A12;
}
.summary h2 { margin: 0 0 6px; font-size: 16px; }
.summary ul { margin: 0; padding-left: 18px; }
.summary a { color: #7A1A12; font-weight: 600; }
/* fields jumped to from an error summary stay clear of the bars stuck to the top and bottom of the screen */
input, select, textarea, fieldset, [tabindex="-1"] { scroll-margin-top: 16px; scroll-margin-bottom: 96px; }
.page-admin input, .page-admin select, .page-admin textarea, .page-admin fieldset, .page-admin [tabindex="-1"] { scroll-margin-top: 84px; }
fieldset[tabindex="-1"]:focus, h3[tabindex="-1"]:focus { outline: none; }

/* ======================================================= sign-in layout */
.page-auth { background: #fff; border-top: 6px solid var(--accent); }
.auth-layout { min-height: 100vh; min-height: calc(100vh - 6px); }
.auth-brand { display: none; }
.auth-panel {
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: 32px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left));
}
.auth-card { width: 100%; max-width: 400px; margin: 0 auto; }
.auth-logo { display: block; width: 180px; height: auto; margin: 0 0 28px; }
.auth-card h1 { font-size: 24px; margin-bottom: 8px; }
.auth-card .lede { margin-bottom: 24px; }
.auth-card form .btn-primary { width: 100%; height: 50px; }
.auth-back { margin-top: 20px; }

@media (min-width: 861px) {
  .page-auth { border-top: 0; }
  .auth-layout { display: grid; grid-template-columns: minmax(380px, 44%) 1fr; min-height: 100vh; }
  .auth-brand {
    display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden;
    background: var(--brand); color: #E6ECF4;
    padding: 40px 48px;
  }
  .auth-brand::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--accent); }
  .auth-brand-top { margin: 0; font-size: 15px; font-weight: 600; color: #A9B6C8; }
  .auth-brand h2 { margin: 0 0 12px; font-size: 32px; line-height: 1.15; font-weight: 650; color: #fff; letter-spacing: -.01em; max-width: 16ch; }
  .auth-brand .intro { margin: 0; color: #B9C5D5; max-width: 38ch; }
  /* update 4.7.1: the picture above the heading, and the support line (whatever the picture's shape, it fits) */
  .auth-brand-mid { display: grid; gap: 28px; }
  .auth-picture { display: block; width: 100%; max-width: 420px; height: auto; max-height: 36vh; object-fit: contain; object-position: left center; }
  .auth-support { margin: 14px 0 0; color: #B9C5D5; max-width: 38ch; }
  .auth-support b { color: #fff; font-weight: 600; }
  .auth-contact { display: grid; gap: 2px; font-size: 14px; color: #A9B6C8; padding-bottom: 6px; }
  .auth-contact a { color: #E6ECF4; text-decoration: none; }
  .auth-contact a:hover { text-decoration: underline; }
  .auth-panel { justify-content: center; padding: 48px 24px; }
  .auth-logo { width: 220px; margin-bottom: 40px; }
  .auth-card h1 { font-size: 28px; }
  .auth-card .lede { margin-bottom: 32px; }
}

/* ========================================================== admin layout */
.page-admin { background: var(--page); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 8px 0 16px;
  background: var(--brand); border-bottom: 4px solid var(--accent);
}
.topbar-logo img { display: block; width: 116px; height: auto; }
.menu-btn {
  min-width: 44px; height: 44px; padding: 0 12px;
  border: 0; border-radius: 6px; background: transparent; color: #fff;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
}
.menu-btn:hover { background: rgba(255,255,255,.08); }

.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 30;
  width: min(300px, 86vw); overflow-y: auto;
  background: var(--brand); color: #DCE4EE;
  display: flex; flex-direction: column;
  padding: 20px 12px 16px;
  transform: translateX(-100%);
  transition: transform .2s ease;
  visibility: hidden;
}
.sidebar.open { transform: none; visibility: visible; box-shadow: 0 0 0 100vmax rgba(10,18,30,.45); }
.sidebar-logo img { display: block; width: 150px; height: auto; margin: 4px 12px 6px; }
.sidebar-sub { margin: 0 12px 20px; font-size: 13.5px; color: #93A2B6; }
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav a, .nav span {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px;
  border-radius: 6px; color: #DCE4EE; text-decoration: none; font-weight: 500;
}
.nav a:hover { background: rgba(255,255,255,.07); }
.nav a[aria-current="page"] { background: rgba(255,255,255,.1); color: #fff; font-weight: 650; box-shadow: inset 3px 0 0 var(--accent); }
.nav-soon span { color: #6F7F95; }
.nav-group { margin: 20px 12px 6px; font-size: 13px; color: #8392A7; }
.me { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 14px; }
.me strong { display: block; color: #fff; font-weight: 600; }
.me > span { color: #93A2B6; }
.me-links { display: flex; flex-direction: column; align-items: flex-start; margin-top: 4px; }
.me-links a { display: inline-flex; align-items: center; min-height: 44px; color: #DCE4EE; }
.me-links a[aria-current="page"] { color: #fff; font-weight: 650; }
.close-btn {
  position: absolute; top: 12px; right: 8px; width: 44px; height: 44px;
  border: 0; border-radius: 6px; background: transparent; color: #fff;
  font-size: 26px; line-height: 1; cursor: pointer;
}

.admin-main { padding: 20px 16px 48px; }
.wrap { max-width: 980px; margin: 0 auto; }
.wrap-narrow { max-width: 680px; }
.crumbs { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.crumbs a { font-weight: 600; text-underline-offset: 3px; text-decoration-color: #9AA8BB; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head .lede { margin: 4px 0 0; }

.card {
  background: #fff; border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 20px 16px; margin-bottom: 16px;
}
.card h2 { margin: 0 0 4px; font-size: 18px; color: var(--ink); }
.card .hint { margin: 0 0 18px; font-size: 15px; color: var(--muted); }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.form-actions {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; gap: 8px;
  margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--line-soft);
  box-shadow: 0 -6px 18px rgba(20,35,58,.06);
}
.form-actions .btn-primary { flex: 1; }

/* role choice (add user) */
.roles { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.role {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; margin: 0;
  border: 1.5px solid var(--line); border-radius: 8px; background: #fff;
  cursor: pointer; font-weight: 400;
}
.role input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.role b { display: block; color: var(--ink); font-weight: 650; }
.role span { display: block; font-size: 14.5px; color: var(--muted); }
.role.is-checked { border-color: var(--brand); background: #F6F8FB; box-shadow: inset 0 0 0 1px var(--brand); }
.role.is-disabled { opacity: .55; cursor: not-allowed; }
.new-company { margin-top: 12px; padding: 14px; border-radius: 8px; background: #F6F8FB; border: 1px dashed var(--line); }

.pw-row { display: flex; gap: 8px; }
.pw-row input { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.pw-row .btn { flex: none; }

/* filters above lists */
.toolbar { display: grid; gap: 8px; margin-bottom: 16px; }
.toolbar .btn { width: 100%; }

/* lists: cards on phones, a table on bigger screens */
.list { width: 100%; border-collapse: collapse; }
.list thead { display: none; }
.list tbody, .list tr, .list td { display: block; }
.list tr {
  position: relative;
  background: #fff; border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 10px;
}
.list td { padding: 2px 0; font-size: 15px; }
.list td[data-label]:not(.cell-main)::before { content: attr(data-label) ": "; color: var(--muted); }
.list .cell-main { font-size: 16px; }
.list .cell-main a { font-weight: 650; color: var(--ink); text-decoration: none; }
.list .cell-main a::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.list .cell-main a:hover { text-decoration: underline; }
.list .cell-main a:focus-visible { outline: none; }
.list tr:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.list .sub { display: block; font-size: 14px; color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.list td.cell-badges { padding-top: 6px; }
.list td.cell-empty { display: none; }
.list td.cell-badges::before { content: none !important; }
.empty { background: #fff; border: 1px dashed var(--line); border-radius: 10px; padding: 28px 20px; text-align: center; color: var(--muted); }
.empty p { margin: 0 0 14px; }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; line-height: 1.6; white-space: nowrap;
  margin: 0 4px 2px 0;
}
.badge-on { background: var(--ok-bg); color: var(--ok); }
.badge-off { background: #F1F2F4; color: #5D6878; }
.badge-role-customer { background: #EEF3FB; color: #1D3150; }
.badge-role-staff { background: #FFF4D6; color: #6B5300; }
.badge-role-dispatch { background: #E6F4EE; color: #1F5C43; }
.badge-role-admin { background: #FDEBDD; color: #8A3A08; }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 16px 0; }
.pager-info { font-size: 14px; color: var(--muted); }

dl.facts { margin: 0; display: grid; gap: 14px; }
dl.facts div { display: grid; gap: 2px; }
dl.facts dt { font-size: 14px; color: var(--muted); }
dl.facts dd { margin: 0; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

.done-head {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px; border-radius: 10px; margin-bottom: 16px;
  background: var(--ok-bg); border-left: 4px solid var(--ok);
}
.done-head h1 { font-size: 22px; margin: 0 0 2px; }
.done-head p { margin: 0; color: #164F35; overflow-wrap: anywhere; }
.done-head:focus { outline: none; }
.tick { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-weight: 800; }
.pw-show {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: 8px; background: var(--brand); color: #fff;
}
.pw-show code { font-family: inherit; font-size: 21px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pw-show .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); flex: none; }
.pw-show .btn:hover { background: rgba(255,255,255,.08); }
.done-actions { display: grid; gap: 8px; margin-top: 8px; }

.meta-line { margin: 0 0 16px; color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.user-rows { list-style: none; margin: 0 0 14px; padding: 0; }
.user-rows li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.user-rows li:last-child { border-bottom: 0; }
.user-rows a { font-weight: 600; }
.user-rows .sub { display: block; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }

.log-when { white-space: nowrap; }

/* ======================================================= customer layout */
.page-customer { background: var(--page); border-top: 6px solid var(--accent); }
.cust-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line-soft);
}
.cust-bar img { display: block; width: 130px; height: auto; }
.cust-bar-right { display: flex; align-items: center; gap: 14px; }
.cust-who { display: none; font-size: 14px; color: var(--muted); }
.cust-main { padding: 28px 16px 48px; }
.cust-wrap { max-width: 560px; margin: 0 auto; }
.welcome-card { background: #fff; border: 1px solid var(--line-soft); border-radius: 10px; padding: 28px 20px; text-align: center; }
.welcome-card h1 { font-size: 28px; }
.welcome-card p { color: var(--muted); margin: 0 0 24px; }
.welcome-actions { display: grid; gap: 8px; }
.welcome-actions .inline-form { display: block; }
.welcome-actions .btn { width: 100%; }

/* ===================================================== plain pages (errors, install) */
.page-plain { background: var(--page); border-top: 6px solid var(--accent); }
.plain-wrap { padding: 32px 16px 48px; }
.plain-card { max-width: 620px; margin: 0 auto; background: #fff; border: 1px solid var(--line-soft); border-radius: 10px; padding: 24px 18px; }
.plain-card .auth-logo { margin-bottom: 24px; }
.checks { list-style: none; margin: 0 0 20px; padding: 0; }
.checks li { display: grid; grid-template-columns: 28px 1fr; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.checks li:last-child { border-bottom: 0; }
.checks .mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; }
.checks .pass .mark { background: var(--ok); }
.checks .fail .mark { background: var(--error); }
.checks .warn .mark { background: #B7791F; }
.checks b { color: var(--ink); }
.checks .detail { grid-column: 2; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }

/* ================================================================ bigger */
@media (min-width: 600px) {
  .admin-main { padding: 32px 24px 56px; }
  .card { padding: 24px; }
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
  .roles { grid-template-columns: repeat(2, 1fr); }
  .role { flex-direction: column; gap: 8px; }
  .form-actions { position: static; margin: 8px 0 0; padding: 0; background: none; border: 0; box-shadow: none; }
  .form-actions .btn-primary { flex: none; min-width: 180px; }
  .done-actions { grid-auto-flow: column; justify-content: start; }
  .toolbar { grid-template-columns: 1fr 200px auto; align-items: end; }
  .toolbar-3 { grid-template-columns: 1fr 180px 180px auto; }
  .toolbar .btn { width: auto; }
  .cust-who { display: inline; }
  .welcome-card { padding: 40px 32px; }
  .welcome-actions { grid-auto-flow: column; justify-content: center; }
  .plain-card { padding: 32px; }
}

@media (min-width: 900px) {
  .list { background: #fff; border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; display: table; }
  .list thead { display: table-header-group; }
  .list tbody { display: table-row-group; }
  .list tr { display: table-row; border: 0; border-radius: 0; padding: 0; margin: 0; }
  .list td, .list th { display: table-cell; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
  .list tbody tr:last-child td { border-bottom: 0; }
  .list th { font-size: 13.5px; font-weight: 600; color: var(--muted); background: #FAFBFC; }
  .list td[data-label]::before { content: none !important; }
  .list td.cell-empty { display: table-cell; }
  .list .cell-main a::after { border-radius: 0; }
  .list tbody tr:hover { background: #FAFBFC; }
  .list tr:focus-within { outline-offset: -3px; }
}

@media (min-width: 960px) {
  .topbar, .close-btn { display: none; }
  .sidebar { transform: none; visibility: visible; transition: none; width: 260px; box-shadow: none; }
  .sidebar.open { box-shadow: none; }
  .admin-main { margin-left: 260px; padding: 40px 40px 56px; }
  .wrap { margin: 0; }
  h1 { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.card-gap { margin-top: 24px; }

/* ===================================================== stage 2: catalogue and pricing */
.badge-warn { background: #FFF4D6; color: #7A5200; }
.sub-inline { color: var(--muted); font-size: 14px; font-weight: 400; }
.link-btn-sm { min-height: 36px; font-size: 14px; }
.hint-last { margin-bottom: 0 !important; }
.hint-foot { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.result-count { margin: 0 0 12px; font-size: 14.5px; color: var(--muted); }
.result-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.result-bar .result-count { margin: 0; }
.field-short { max-width: 260px; }
.warn-line { display: block; margin: 4px 0 0; font-size: 14px; font-weight: 600; color: #8A4B00; }
.warn-line::before { content: "\26A0\FE0E  "; }

/* numbers with % or £ inside the box */
.input-suffix, .input-prefix { position: relative; }
.input-suffix input { padding-right: 34px; }
.input-prefix input { padding-left: 30px; }
.input-suffix span, .input-prefix span {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 600; pointer-events: none;
}
.input-suffix span { right: 14px; }
.input-prefix span { left: 14px; }

/* customer tabs in the admin: buttons that wrap on phones, a tab bar on bigger screens */
.page-head-tabs { margin-bottom: 12px; }
.tabs { margin: 0 0 20px; }
.tabs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a {
  display: flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--brand-2); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
}
.tabs a[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.tab-lede { margin-bottom: 20px; }

/* messages floating at the bottom of customer pages (only when portal.js runs, so they can be closed) */
.js .toasts {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40;
  display: grid; gap: 8px; max-width: 560px; margin: 0 auto; pointer-events: none;
}
.js .toasts .alert { position: relative; margin: 0; padding-right: 48px; pointer-events: auto; box-shadow: 0 10px 28px rgba(20,35,58,.22); transition: opacity .35s; }
.toast-close {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 40px; height: 40px;
  border: 0; border-radius: 6px; background: none; color: inherit; font-size: 24px; line-height: 1; cursor: pointer;
}
.toast-close:hover { background: rgba(0,0,0,.06); }
.toast-hide { opacity: 0; }

/* facts in a row, problems in the master list */
dl.facts-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.problems { border-top: 1px solid var(--line-soft); padding-top: 4px; }
.problems summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; color: #7A5200; }
.problems ul { margin: 4px 0 0; padding-left: 20px; font-size: 14px; display: grid; gap: 4px; }

/* price bands */
.steps { margin: 0 0 14px; padding-left: 22px; display: grid; gap: 6px; }
.steps b { color: var(--ink); font-weight: 650; }
.band-rows { list-style: none; margin: 0; padding: 0; }
.band-rows li { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.band-rows li:last-child { border-bottom: 0; }
.band-rows a:not(.btn) { font-weight: 650; color: var(--ink); }
.band-rows .sub { display: block; font-size: 14px; color: var(--muted); }

/* GP% by category */
.gp-rows { list-style: none; margin: 0 0 16px; padding: 0; }
.gp-rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.gp-rows li:last-child { border-bottom: 0; }
.gp-name { flex: 1; min-width: 0; }
.gp-name label { margin: 0; }
.gp-name .sub { display: block; font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.gp-input { flex: none; width: 100px; }
.gp-input input { text-align: right; }
.gp-input input::placeholder { color: #8C96A4; }

/* product prices for a customer */
.price-rows { list-style: none; margin: 0; padding: 0; }
.price-rows li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.price-rows li:last-child { border-bottom: 0; }
.price-main { flex: 1 1 300px; min-width: 0; overflow-wrap: anywhere; }
.price-main b { color: var(--ink); }
.price-main .sub { display: block; font-size: 14px; color: var(--muted); }
.row-actions { display: flex; gap: 8px; align-items: flex-start; }

/* regular items (customer and admin) */
.regular-rows { list-style: none; margin: 0; padding: 0; }
.regular-rows li { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.regular-rows li:first-child { padding-top: 4px; }
.regular-rows li:last-child { border-bottom: 0; }
.regular-main { flex: 1 1 260px; min-width: 0; }
.regular-main > b { display: block; color: var(--ink); font-weight: 650; font-size: 15.5px; overflow-wrap: anywhere; }
.regular-main .sub { display: block; font-size: 14px; color: var(--muted); }
.regular-main .price-line { display: block; margin-top: 2px; }
.regular-main .badge { margin-top: 4px; }
.regular-side { display: flex; align-items: flex-end; gap: 8px; }
.qty-field label { margin-bottom: 2px; font-size: 13px; color: var(--muted); }
.qty-field input { width: 92px; min-height: 44px; text-align: center; }
.list-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.list-actions .help { margin: 0; flex: 1 1 240px; }

/* prices shown to customers */
.price-line { margin: 2px 0 0; }
.price { font-size: 19px; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; }
.price-unit, .price-each { font-size: 14px; color: var(--muted); }
.price-each { white-space: nowrap; }
.price-each::before { content: "· "; }
.price-call { font-weight: 600; color: var(--brand-2); }
.on-list { margin: 0; color: var(--ok); font-weight: 600; font-size: 14.5px; }
.on-list::before { content: "\2713\00a0"; }

/* customer area: nav, headings, catalogue */
.cust-nav { background: #fff; border-bottom: 1px solid var(--line-soft); }
.cust-nav ul { list-style: none; margin: 0 auto; padding: 0 8px; display: flex; gap: 2px; max-width: 980px; overflow-x: auto; }
.cust-nav a {
  display: flex; align-items: center; min-height: 48px; padding: 0 12px;
  color: var(--muted); font-weight: 600; text-decoration: none; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.cust-nav a:hover { color: var(--ink); }
/* phones: all five links fit across (Help was added in update 4.6) */
@media (max-width: 479px) {
  .cust-nav ul { padding: 0 4px; gap: 0; justify-content: space-between; }
  .cust-nav a { padding: 0 8px; }
}
@media (max-width: 389px) {
  .cust-nav a { padding: 0 6px; font-size: 15px; }
}
@media (max-width: 339px) {
  .cust-nav a { padding: 0 4px; font-size: 14px; }
}
.cust-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.cust-main { padding-top: 24px; }
.cust-wrap-mid { max-width: 760px; }
.cust-wrap-wide { max-width: 980px; }
.cust-head { margin-bottom: 16px; }
.cust-head .lede { margin-bottom: 0; }
.cust-foot { margin: 20px 0 0; text-align: center; }
.btn-block-phone { width: 100%; }
.card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card-title .link-btn { min-height: 0; padding: 10px 0; margin: -10px 0; }
.empty-soft { background: var(--page); border-style: solid; border-color: var(--line-soft); padding: 20px 16px; }
.section-title { margin: 4px 0 10px; font-size: 18px; color: var(--ink); }

.cat-search { display: grid; gap: 8px; margin: 0 0 20px; }
.cat-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cat-grid a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 12px 16px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line-soft); color: var(--ink); text-decoration: none;
}
.cat-grid a:hover { border-color: var(--line); background: #FAFBFC; }
.cat-grid b { font-weight: 650; }
.cat-grid span { font-size: 14px; color: var(--muted); white-space: nowrap; }

.products { display: grid; gap: 10px; }
.product {
  display: flex; flex-direction: column; gap: 4px;
  background: #fff; border: 1px solid var(--line-soft); border-radius: 10px; padding: 16px;
  scroll-margin-top: 16px;
}
.product:target { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.product-name { margin: 0; font-size: 15.5px; line-height: 1.35; font-weight: 650; color: var(--ink); overflow-wrap: anywhere; }
.product-meta { margin: 0; font-size: 14px; color: var(--muted); }
.product-meta .code { font-weight: 650; color: var(--text); }
.product-actions { margin-top: auto; padding-top: 10px; }
.product .on-list { margin-top: auto; padding-top: 10px; }
.product .option-form + .on-list { padding-top: 6px; }
.option-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.option-pick { flex: 1 1 170px; }
.option-pick label { margin-bottom: 4px; font-size: 14px; }
.option-pick select { min-height: 44px; }

@media (min-width: 600px) {
  .tabs { border-bottom: 1px solid var(--line); }
  .tabs ul { flex-wrap: nowrap; gap: 2px; }
  .tabs a {
    min-height: 46px; padding: 0 12px; margin-bottom: -1px;
    border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; color: var(--muted);
  }
  .tabs a:hover { color: var(--ink); }
  .tabs a[aria-current="page"] { background: none; color: var(--ink); border-bottom-color: var(--brand); }
  .btn-block-phone { width: auto; }
  .cat-search { grid-template-columns: 1fr 230px auto; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .cust-nav ul { padding: 0 16px; }
}
@media (min-width: 900px) {
  .products { grid-template-columns: 1fr 1fr; }
  .cat-grid { grid-template-columns: 1fr 1fr 1fr; }
  .list .warn-line { font-size: 13.5px; }
}
.download-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.hint-top { margin: -4px 0 14px; }

/* ===================================================== stage 3: basket, checkout and orders */
.basket-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px 0 12px;
  border-radius: 999px; border: 1.5px solid var(--line); background: #fff;
  color: var(--brand-2); font-weight: 650; font-size: 15px; text-decoration: none; white-space: nowrap;
}
.basket-link:hover, .basket-link.is-current { border-color: var(--brand); }
.basket-count {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* the customer's Home page: six big buttons (Get help added in update 4.6), in two columns, then three */
.home-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0 0 18px; }
.home-action {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; min-height: 68px; padding: 12px 16px;
  border-radius: 10px; background: #fff; border: 1.5px solid var(--line); color: var(--ink); text-decoration: none;
}
.home-action:hover { border-color: var(--brand); }
.home-action b { font-size: 16.5px; line-height: 1.3; color: var(--brand-2); }
.home-action span { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.home-action-main { background: var(--brand); border-color: var(--brand); }
.home-action-main:hover { background: var(--brand-2); border-color: var(--brand-2); }
.home-action-main b { color: #fff; }
.home-action-main span { color: rgba(255, 255, 255, .85); }
@media (min-width: 480px) {
  .home-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 760px) {
  .home-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* saved baskets */
.save-basket { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.save-basket .sub-head { margin: 0 0 4px; font-size: 16px; }
.save-basket > .help { margin: 0 0 10px; }
.save-basket .alert { display: grid; gap: 8px; justify-items: start; }
.save-basket .alert p { margin: 0; }
.save-basket-input { display: flex; flex-wrap: wrap; gap: 8px; }
.save-basket-input input { flex: 1 1 200px; min-width: 0; }
.saved-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.saved-card { margin: 0; padding: 14px 16px; }
.saved-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.saved-main { flex: 1 1 240px; min-width: 0; }
.saved-main > b { display: block; font-size: 16.5px; color: var(--ink); overflow-wrap: anywhere; }
.saved-main .sub { display: block; font-size: 14px; color: var(--muted); }
.saved-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.saved-items { margin-top: 10px; border-top: 1px solid var(--line-soft); }
.saved-items summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 650; color: var(--brand-2); }
.saved-items ul { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 4px; font-size: 14.5px; }
.saved-items li { overflow-wrap: anywhere; }
.saved-qty { font-weight: 700; font-variant-numeric: tabular-nums; }
.ask-box { border-color: var(--brand); }
.ask-box:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.ask-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }

.list-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.buy-inline { flex-wrap: wrap; justify-content: flex-end; }
.buy-inline .link-btn { flex-basis: 100%; justify-content: flex-end; }

/* catalogue: buying */
.buy-form { display: grid; gap: 8px; }
.buy-row { display: flex; gap: 8px; align-items: center; }
.qty-input { width: 72px !important; flex: none; text-align: center; min-height: 44px !important; }
.buy-row .btn { flex: 1; }
.buy-form .link-btn { justify-self: start; }
.product .on-list + .product-actions, .char-pick + .on-list, .char-pick + .product-actions { margin-top: 0; padding-top: 6px; }

/* digits: the character picker. Tapping a character opens a panel of quantities: a sheet at the
   bottom of a phone screen, a box in the middle of bigger ones. Tapping outside it closes it. */
.char-pick { margin-top: 8px; border: 1px solid var(--line-soft); border-radius: 8px; background: #fff; }
.char-pick > summary { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; cursor: pointer; font-weight: 650; color: var(--brand-2); }
.char-pick[open] > summary { border-bottom: 1px solid var(--line-soft); }
.char-pick-body { padding: 10px 12px 12px; display: grid; gap: 10px; }
.char-pick-body > .help { margin: 0; }
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.digit > summary {
  position: relative; display: grid; place-items: center; min-height: 52px; padding: 4px;
  border: 1.5px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; list-style: none;
  font-size: 19px; font-weight: 800; color: var(--ink); text-align: center; overflow-wrap: anywhere;
}
.digit > summary::-webkit-details-marker { display: none; }
.digit > summary:hover { border-color: var(--brand); }
.digit[open] > summary { border-color: var(--brand); background: var(--field); }
.digit.is-in > summary { border-color: var(--brand); }
.digit-have {
  position: absolute; top: -8px; right: -6px; min-width: 22px; height: 20px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center; background: var(--brand); color: #fff;
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.digit[open] > summary::before {
  content: ""; position: fixed; inset: 0; z-index: 50; background: rgba(20, 35, 58, .5); cursor: default;
}
.digit-panel {
  position: fixed; z-index: 51; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow: auto;
  display: grid; gap: 14px; padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -10px 34px rgba(20, 35, 58, .28);
}
.digit-title { margin: 0; font-size: 17px; font-weight: 650; color: var(--ink); }
.digit-title b { font-size: 24px; font-weight: 800; }
.digit-title span { display: block; margin-top: 2px; font-size: 14.5px; font-weight: 400; color: var(--muted); }
.digit-qtys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.digit-qtys .btn { min-height: 48px; padding: 0 4px; font-size: 17px; }
.digit-manual label { margin-bottom: 4px; font-size: 14.5px; }
.digit-manual-row { display: flex; gap: 8px; }
.digit-manual-row input { flex: 1 1 auto; min-width: 0; min-height: 48px; }
.digit-close { justify-self: center; }
@media (min-width: 600px) {
  .digit-panel { left: 50%; right: auto; top: 50%; bottom: auto; width: 400px; transform: translate(-50%, -50%); border-radius: 12px; padding: 22px 20px 16px; }
}
.regular-rows li.has-chars { align-items: center; }
.regular-chars { flex: 1 1 100%; min-width: 0; }
.regular-chars .char-pick { margin-top: 0; }

/* basket */
.basket-rows { list-style: none; margin: 0; padding: 0; }
.basket-rows li { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 14px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.basket-rows li:first-child { padding-top: 0; }
.basket-rows li.has-problem .basket-main > b { color: var(--muted); }
.basket-main { flex: 1 1 240px; min-width: 0; }
.basket-main > b { display: block; color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.basket-main .sub { display: block; font-size: 14px; color: var(--muted); }
.basket-main .badge { margin-top: 4px; white-space: normal; }
.basket-side { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; gap: 10px; max-width: 100%; }
.basket-side .qty-field input { width: 72px; }
.basket-side .btn-sm { padding: 0 12px; }
.line-total { min-width: 64px; text-align: right; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; padding-bottom: 10px; }
.basket-foot { padding-top: 14px; display: grid; gap: 8px; }
.basket-foot .help { margin: 0; }
.free-note { color: var(--ok) !important; font-weight: 600; }
.basket-actions { display: grid; gap: 8px; margin-top: 4px; }
.empty-actions { display: grid; gap: 8px; justify-content: center; }

/* totals */
dl.totals { margin: 0; display: grid; gap: 4px; }
.totals-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.totals-row dt { color: var(--muted); }
.totals-row dd { margin: 0; font-variant-numeric: tabular-nums; color: var(--ink); }
.totals-row.is-free dd { color: var(--ok); font-weight: 700; }
.totals-grand { padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--line-soft); font-size: 18px; font-weight: 750; }
.totals-grand dt, .totals-grand dd { color: var(--ink); }

/* checkout */
.choice-list { border: 0; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; min-width: 0; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 14px;
  border: 1.5px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-weight: 400;
}
.choice input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.choice > div { flex: 1; min-width: 0; }
.choice b { display: block; color: var(--ink); font-weight: 650; }
.choice span { display: block; font-size: 14.5px; color: var(--muted); overflow-wrap: anywhere; }
.choice:has(input:checked) { border-color: var(--brand); background: #F6F8FB; box-shadow: inset 0 0 0 1px var(--brand); }
.choice-price { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.choice-price span.price-tag { display: inline; font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.price-tag.is-free { color: var(--ok) !important; }
.sub-head { margin: 18px 0 8px; font-size: 16px; color: var(--ink); }
.card > .sub-head:first-of-type { margin-top: 8px; }
.new-address { margin: 4px 0 8px; padding: 14px; border-radius: 8px; background: #F6F8FB; border: 1px dashed var(--line); }
.place-form { margin-top: 16px; }
.place-form .btn { min-height: 54px; font-size: 17px; }

/* placed orders */
.line-rows { list-style: none; margin: 0 0 14px; padding: 0; }
.line-rows li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.line-main { min-width: 0; }
.line-main b { display: block; color: var(--ink); font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.line-main .sub { display: block; font-size: 13.5px; color: var(--muted); }
.line-side { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.line-qty { font-size: 14px; color: var(--muted); }
.line-side .line-total { padding: 0; min-width: 0; }
.staff-only { color: #7A5200 !important; }
.pay-box { border-color: var(--accent); box-shadow: inset 0 4px 0 var(--accent); }
dl.bank { margin: 0 0 14px; display: grid; gap: 8px; }
dl.bank div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
dl.bank dt { color: var(--muted); }
dl.bank dd { margin: 0; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.pay-method { margin: 0 0 6px; }

.order-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.order-cards > li { border-radius: 10px; background: #fff; border: 1px solid var(--line-soft); }
.order-cards > li:hover { border-color: var(--line); }
.order-cards a { display: grid; gap: 4px; padding: 14px 16px; border-radius: 10px; color: var(--ink); text-decoration: none; }
/* the courier and tracking number of a dispatched order, with a Copy button */
.order-track {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px;
  margin: 0 16px; padding: 8px 0 10px; border-top: 1px solid var(--line-soft); font-size: 14.5px; color: var(--text);
}
.order-track-text { min-width: 0; overflow-wrap: anywhere; }
.order-track .tracking { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.order-track .btn { min-height: 40px; padding: 0 14px; }
.link-rows .order-track { margin: -6px 0 0; padding: 0 0 12px; border-top: 0; }
.order-top { display: flex; justify-content: space-between; gap: 12px; }
.order-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.order-cards .sub { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }

.badge-status-new { background: #EEF3FB; color: #1D3150; }
.badge-status-awaiting_payment { background: #FFF4D6; color: #6B5300; }
.badge-status-paid { background: var(--ok-bg); color: var(--ok); }
.badge-status-picking { background: #F1ECFB; color: #4A2F86; }
.badge-status-dispatched { background: #E6F4F7; color: #145566; }
.badge-status-sage { background: #FFE8D6; color: #8A3300; }
.badge-status-completed { background: #F1F2F4; color: #3B4552; }
.badge-status-cancelled { background: var(--error-bg); color: var(--error); }
.badge-status-expired { background: #F1F2F4; color: #7A1A12; box-shadow: inset 0 0 0 1.5px #E3B5B0; }   /* update 5.0 */

/* addresses and account */
.address-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.address-cards li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 16px; padding: 14px 16px; border-radius: 10px; background: #fff; border: 1px solid var(--line-soft); }
.address-main { flex: 1 1 240px; min-width: 0; }
.address-main b { color: var(--ink); margin-right: 6px; }
.address-main .sub { display: block; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.row-actions { flex-wrap: wrap; }
.tick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tick-list li::before { content: "\2713\00a0\00a0"; color: var(--ok); font-weight: 800; }
.link-rows { list-style: none; margin: 0; padding: 0; }
.link-rows li + li { border-top: 1px solid var(--line-soft); }
.link-rows a { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 12px 0; color: var(--ink); text-decoration: none; }
.link-rows a:hover b { text-decoration: underline; }
.link-rows span { color: var(--muted); font-size: 14px; }
.card-gap-sm { margin-top: 14px !important; }

@media (min-width: 600px) {
  .basket-actions { grid-auto-flow: column; justify-content: end; }
  .empty-actions { grid-auto-flow: column; }
}

/* admin: payment options, delivery services, order page */
.pay-checks { border: 0; margin: 0; padding: 0; min-width: 0; }
.service-rows { list-style: none; margin: 0 0 16px; padding: 0; }
.service-rows li { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.service-rows li:first-child { padding-top: 0; }
.service-rows li.has-problem { background: var(--error-bg); margin: 0 -12px; padding: 14px 12px; border-radius: 8px; }
.service-grid { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
.service-grid .field { margin-bottom: 10px; }
.service-grid .field:first-child { grid-column: 1 / -1; }
.service-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 0 18px; }
.service-flags .check-simple { margin: 0; padding: 6px 0; }
.order-grid { display: grid; gap: 0 16px; }
@media (min-width: 900px) {
  .service-grid { grid-template-columns: 2fr 1fr 1fr 80px; }
  .service-grid .field:first-child { grid-column: auto; }
  .order-grid { grid-template-columns: 1fr 1fr; }
}

/* ===================================================== stage 4: orders board, order steps, picking lists */
.tab-count {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--page); color: var(--ink); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* a product price worked out from a typed selling price, shown before it's saved */
.price-check { margin: 4px 0 0; padding: 14px 16px; border-radius: 10px; background: #F3F6FA; border: 1.5px solid #C9D3E0; }
.price-check:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.price-check .price-check-name { margin: 0 0 8px; overflow-wrap: anywhere; }
.price-check dl.facts { margin: 0; }
.price-check .help { margin: 8px 0 0; }
.price-check .warn-line { margin: 0 0 8px; }
.price-check + .card-actions { margin-top: 16px; }

/* the orders board's stages as a flow diagram: top to bottom on a phone, left to right when there's room. From With
   warehouse, deliveries go straight to Record on Sage, collections by way of Ready to collect (update 4.5). */
.flow { container-type: inline-size; margin: 0 0 18px; }
.flow-top { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.flow-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--brand-2); font-weight: 650; font-size: 15px; text-decoration: none; white-space: nowrap;
}
.flow-pill:hover { border-color: var(--brand); }
.flow-pill-tray.has-orders { border-color: #D9B44A; }
.flow-pill-tray.has-orders .tab-count { background: #FFF4D6; color: #6B5300; }
.flow-map {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 10px;
  grid-template-areas:
    "new  wait"
    "a1   a2"
    "a1   paid"
    "a1   a3"
    "gate gate"
    "a6   a6"
    "pick pick"
    "a7   a4"
    "a7   disp"
    "a7   a8"
    "sage sage"
    "a5   a5"
    "done done"
    "canc canc";
}
/* the payment check between New / Paid and Picking: a gate, not a stage, so it has no count */
.flow-gate {
  grid-area: gate; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; min-height: 44px; padding: 8px 12px;
  border: 1.5px solid #D9B44A; border-radius: 10px; background: #FFF8E3; color: #4D3C00;
}
.flow-gate .flow-name { justify-content: flex-start; }
.flow-gate .flow-note { color: #6B5300; }
.flow-box {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; min-height: 50px; padding: 8px 12px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-decoration: none;
}
.flow-box:hover { border-color: var(--brand); }
.flow-box.has-orders { border-color: #8FA3BC; }
.flow-name { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; font-weight: 650; font-size: 15px; line-height: 1.25; }
.flow-box.has-orders .tab-count { background: var(--brand); color: #fff; }
.flow-note { display: none; font-size: 13px; line-height: 1.3; color: var(--muted); }
.flow-pill[aria-current="page"], .flow-box[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.flow-pill[aria-current="page"] .tab-count, .flow-box[aria-current="page"] .tab-count { background: rgba(255,255,255,.22); color: #fff; }
.flow-box[aria-current="page"] .flow-note { color: rgba(255,255,255,.82); }
.fb-new { grid-area: new; }
.fb-wait { grid-area: wait; }
.fb-paid { grid-area: paid; }
.fb-pick { grid-area: pick; }
.fb-disp { grid-area: disp; }
.fb-sage { grid-area: sage; }
.fb-done { grid-area: done; }
.fb-canc { grid-area: canc; margin-top: 14px; border-style: dashed; }
.fa-1 { grid-area: a1; }
.fa-2 { grid-area: a2; }
.fa-3 { grid-area: a3; }
.fa-4 { grid-area: a4; }
.fa-5 { grid-area: a5; }
.fa-6 { grid-area: a6; }
.fa-7 { grid-area: a7; }
.fa-8 { grid-area: a8; }
/* arrows point down */
.flow-arrow { position: relative; display: block; min-height: 24px; }
.flow-arrow::before { content: ""; position: absolute; left: 50%; top: 3px; bottom: 9px; width: 2px; margin-left: -1px; background: #8FA3BC; }
.flow-arrow::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; margin-left: -6px;
  border: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid #8FA3BC;
}
/* the words on an arrow ("Deliveries"), sitting on its line */
.flow-arrow-label {
  position: absolute; left: 50%; top: 50%; z-index: 1; transform: translate(-50%, -50%); padding: 1px 6px;
  background: var(--page); color: var(--muted); font-size: 12.5px; font-weight: 600; line-height: 1.2; white-space: nowrap;
}
@container (min-width: 480px) {
  .flow-note { display: block; }
}
@container (min-width: 680px) {
  .flow-map {
    grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr) 18px minmax(0, .8fr) 18px minmax(0, 1fr) 18px minmax(0, 1fr) 18px minmax(0, 1fr) 18px minmax(0, 1fr);
    column-gap: 0; row-gap: 10px;
    grid-template-areas:
      "new  new new  a1 gate a6 pick a7 a7   a7 sage a5 done"
      "wait a2  paid a3 gate a6 pick a4 disp a8 sage a5 done"
      ".    .   .    .  .    .  .    .  .    .  .    .  canc";
  }
  .fb-canc { margin-top: 0; }
  .flow-box, .flow-gate { padding: 8px 6px; }
  .flow-name { font-size: 13.5px; }
  .flow-note { display: none; }
  .flow-arrow-label { padding: 1px 4px; font-size: 12px; }
  /* arrows point right */
  .flow-arrow { min-height: 0; }
  .flow-arrow::before { left: 3px; right: 9px; top: 50%; bottom: auto; width: auto; height: 2px; margin: -1px 0 0; }
  .flow-arrow::after {
    left: auto; right: 2px; top: 50%; bottom: auto; margin: -6px 0 0;
    border: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 8px solid #8FA3BC;
  }
}
@container (min-width: 780px) {
  .flow-map { grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr) 22px minmax(0, .8fr) 22px minmax(0, 1fr) 22px minmax(0, 1fr) 22px minmax(0, 1fr) 22px minmax(0, 1fr); }
  .flow-box, .flow-gate { padding: 8px 10px; }
  .flow-name { font-size: 14.5px; }
  .flow-arrow-label { padding: 1px 6px; font-size: 12.5px; }
}
@container (min-width: 940px) {
  .flow-map { grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr) 26px minmax(0, .8fr) 26px minmax(0, 1fr) 26px minmax(0, 1fr) 26px minmax(0, 1fr) 26px minmax(0, 1fr); }
  .flow-box, .flow-gate { padding: 8px 12px; }
  .flow-name { font-size: 15px; }
  .flow-note { display: block; }
}

/* a Sage invoice number that's already on another order: tick to confirm it covers this one too (update 4.5) */
.invoice-confirm { margin: 4px 0 10px; padding: 10px 14px; border: 1.5px solid #D9B44A; border-radius: 10px; background: #FFF8E3; color: #4D3C00; }
.invoice-confirm p { margin: 0 0 2px; overflow-wrap: anywhere; }
.invoice-confirm a { color: inherit; white-space: nowrap; }
.invoice-confirm .check-simple { margin: 0; color: var(--ink); font-weight: 600; }
/* marking several as on Sage: a box for each order's number */
.sage-order .field { margin: 0 0 10px; }
.sage-order .field:last-child { margin-bottom: 0; }
.sage-order .field input { max-width: 260px; }
.sage-order .invoice-confirm { margin-bottom: 0; }

/* the payment check on an order, and several orders at once */
.pay-check { margin: 4px 0 6px; padding: 12px 14px; border: 1.5px solid #D9B44A; border-radius: 10px; background: #FFF8E3; }
.pay-check legend { padding: 0 6px; margin-left: -6px; font-weight: 700; color: #4D3C00; }
.pay-check .help { margin: 0 0 6px; color: #5C4A00; }
.pay-check-option { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; margin: 0; padding: 8px 0; font-weight: 600; color: var(--ink); }
.pay-check-option input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); }
.pay-check-order { margin: 0 0 12px; padding: 14px 16px; }
.pay-check-order .pay-check-head { margin: 0; overflow-wrap: anywhere; }
.pay-check-order .sub { display: block; margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.pay-check-order:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.tray-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 14px; padding: 12px 14px; border-radius: 10px; background: #FFF4D6; color: #4D3C00; }
.tray-box p { margin: 0; flex: 1 1 260px; }
.tray-box .btn { background: #fff; }
.badge-tray { background: #FFF4D6; color: #6B5300; }
.pick-check { font-size: 14px; }

.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.bulk-label { font-size: 14.5px; color: var(--muted); }
.tick-all { margin: 0 8px 0 0; }
.list-tickable .cell-tick { position: absolute; top: 6px; right: 6px; z-index: 2; padding: 0; }
.list-tickable tr { padding-right: 56px; }
.tick-box { display: grid; place-items: center; width: 44px; height: 44px; margin: 0; cursor: pointer; }
.tick-box input { width: 22px; height: 22px; accent-color: var(--brand); }
.list-orders .cell-main .badge { margin-top: 4px; }
@media (min-width: 900px) {
  .list-tickable .cell-tick { position: relative; top: auto; right: auto; padding: 4px 0 4px 8px; width: 52px; }
  .list-tickable tr { padding-right: 0; }
  .cell-tick-head { width: 52px; }
}

.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.alert-action { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.alert-action .btn { background: #fff; }

.next-step { border-color: var(--line); }
.next-step .hint { margin-bottom: 12px; }
.step-form { margin: 0; padding: 14px 0 0; display: grid; gap: 4px; }
.step-form + .step-form, .step-form + .more-step, .more-step + .more-step, .step-form + .help { margin-top: 14px; border-top: 1px solid var(--line-soft); }
.step-form .btn { justify-self: start; }
.step-form .sub-head { margin-top: 0; }
.step-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.field-note { margin-bottom: 10px; }
.more-step { padding-top: 4px; }
.more-step summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 650; color: var(--brand-2); }
.more-step[open] summary { margin-bottom: 2px; }
.more-step .step-form { padding-top: 6px; }
.next-step > .help { margin: 14px 0 0; padding-top: 12px; }

.ship-box .facts .tracking { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.progress-list { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; gap: 0; }
.progress-list li { position: relative; padding: 0 0 12px 20px; }
.progress-list li::before { content: ""; position: absolute; left: 0; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.progress-list li::after { content: ""; position: absolute; left: 4px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.progress-list li:last-child { padding-bottom: 0; }
.progress-list li:last-child::after { content: none; }
.progress-list b { color: var(--ink); font-weight: 650; margin-right: 6px; }

/* printed orders (and the combined picking list): plain sheets, ready to print, one order per page */
.page-print { background: var(--page); }
.print-main { display: block; padding: 0 0 16px; }
.print-bar { background: #fff; border-bottom: 1px solid var(--line-soft); padding: 10px 16px; }
.print-bar-inner { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; max-width: 900px; margin: 0 auto; }
.print-bar .alert { max-width: 900px; margin: 10px auto 0; }
.print-sheet { max-width: 900px; margin: 16px auto; background: #fff; border: 1px solid var(--line-soft); border-radius: 10px; padding: 20px 16px; color: var(--ink); }
.print-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); margin-bottom: 16px; }
.print-head img { width: 140px; height: auto; }
.print-head h1, .print-head .print-title { margin: 0; font-size: 24px; text-align: right; }
.print-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); text-align: right; }
.print-sheet h2 { font-size: 16px; margin: 0 0 8px; }
.pick-orders { margin-bottom: 18px; }
.pick-order { padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 14.5px; }
.pick-order p { margin: 0 0 2px; overflow-wrap: anywhere; }
.pick-order-head { font-size: 15.5px; }
.pick-order-sheet { margin: 0 0 14px; padding: 0 0 10px; }
.pick-order-sheet .pick-order-head { font-size: 17px; }
.pick-passed { color: var(--muted); }
.pick-next { margin: 8px 0 0; padding: 8px 12px; border: 1.5px dashed var(--line); border-radius: 8px; font-size: 14px; font-weight: 600; }
.print-left-out { max-width: 900px; margin: 0 auto; padding: 0 16px; }
.pick-warn { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #FFF4D6; color: #6B5300; font-weight: 700; font-size: 13px; }
.pick-notes { font-weight: 600; }
.pick-order-lines { color: var(--muted); font-size: 13.5px; }
.pick-left-out { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.pick-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.pick-table th, .pick-table td { text-align: left; vertical-align: top; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.pick-table th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pick-table .num { text-align: right; white-space: nowrap; }
.pick-table td.num b { font-size: 17px; }
.pick-code { white-space: nowrap; font-weight: 700; }
.pick-tick { width: 26px; }
.tick-square { display: inline-block; width: 16px; height: 16px; border: 1.5px solid var(--ink); border-radius: 3px; margin-top: 2px; }
.pick-own { display: block; font-size: 12.5px; color: var(--muted); }
.pick-for { font-size: 13px; color: var(--muted); }
.pick-for span { display: block; white-space: nowrap; }
.pick-table tfoot th, .pick-table tfoot td { border-bottom: 0; border-top: 2px solid var(--ink); text-align: right; font-size: 14.5px; }
.pick-table tfoot th { text-transform: none; letter-spacing: 0; color: var(--ink); }
.pick-money { font-variant-numeric: tabular-nums; }
.pick-foot { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.pick-empty { font-size: 16px; }
@media (max-width: 599px) {
  /* no room for the columns on a phone: each product becomes a block, with the figures labelled */
  .pick-table thead { display: none; }
  .pick-table, .pick-table tbody, .pick-table tfoot, .pick-table tr, .pick-table td, .pick-table tfoot th { display: block; }
  .pick-table tbody tr { position: relative; padding: 10px 0 10px 32px; border-bottom: 1px solid var(--line); }
  .pick-table td { padding: 1px 0; border: 0; text-align: left; }
  .pick-table .num { text-align: left; }
  .pick-table td.pick-tick { position: absolute; left: 2px; top: 10px; }
  .pick-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 13.5px; }
  .pick-table .pick-for span { white-space: normal; }
  .pick-table tfoot tr { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0 0; border-top: 2px solid var(--ink); }
  .pick-table tfoot th, .pick-table tfoot td { padding: 0; border: 0; }
  .pick-table tfoot td.pick-tick, .pick-table tfoot td:empty { display: none; }
}
@media print {
  @page { size: A4; margin: 12mm; }
  .page-print { background: #fff; }
  .print-bar { display: none; }
  .print-sheet { max-width: none; margin: 0; border: 0; border-radius: 0; padding: 0; }
  .print-main { padding: 0; }
  .print-order + .print-order { break-before: page; }
  .print-left-out { display: none; }
  .pick-next { border-color: #999; }
  .pick-table { font-size: 12.5px; }
  .pick-table th, .pick-table td { padding: 6px 4px; }
  .pick-table td.num b { font-size: 15px; }
  .pick-for { font-size: 11.5px; }
  .pick-table tr, .pick-order { break-inside: avoid; }
  .pick-warn { border: 1px solid #6B5300; }
}
.list-orders .cell-main a { white-space: nowrap; }
/* between a tablet and a wide screen the sidebar leaves less room: tighter cells, and longer words may wrap */
@media (min-width: 900px) and (max-width: 1199px) {
  .list-orders td, .list-orders th { padding: 10px; }
  .list-orders .badge, .list-orders .log-when { white-space: normal; }
}

/* ===================================================== update 4.3: the Dispatch screen, for the warehouse */
.page-dispatch { border-top-color: #2F7D5B; }
.disp-who b { color: var(--ink); margin-right: 4px; }
.disp-head h1 { overflow-wrap: anywhere; }
.disp-search { margin: 0 0 20px; }
.disp-search label { display: block; font-weight: 650; color: var(--ink); margin: 0 0 6px; }
.disp-search-row { display: flex; gap: 8px; }
.disp-search-row input { flex: 1 1 auto; min-width: 0; font-size: 18px; }
.disp-search-row .btn { flex: none; }
.disp-search .help { margin: 8px 0 0; }
.disp-section { margin: 0 0 24px; }
.disp-section h2 { font-size: 18px; margin: 0 0 10px; }
.disp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.disp-card {
  display: grid; gap: 3px; padding: 14px 16px; border-radius: 10px; background: #fff; border: 1.5px solid var(--line);
  color: var(--ink); text-decoration: none; min-height: 72px;
}
.disp-card:hover { border-color: var(--brand); }
.disp-card-done { border-color: var(--line-soft); }
.disp-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.disp-number { font-size: 21px; letter-spacing: .01em; font-variant-numeric: tabular-nums; color: var(--brand-2); }
.disp-card-done .disp-number { font-size: 17px; }
.disp-company { font-weight: 650; overflow-wrap: anywhere; }
.disp-card .sub { font-size: 14.5px; color: var(--muted); overflow-wrap: anywhere; }
.disp-card .sub b { color: #8A3A08; font-weight: 700; }
.badge-send { background: #EEF3FB; color: #1D3150; }
.badge-collect { background: #E6F4EE; color: #1F5C43; }
.disp-action { border-color: var(--brand); }
.disp-action h2 { margin-bottom: 10px; }
.disp-tracking { font-size: 20px !important; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.disp-action .btn-block { min-height: 52px; font-size: 17px; margin-top: 4px; }
.disp-lines { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.disp-lines li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.disp-lines li:last-child { border-bottom: 0; }
.disp-qty { flex: none; min-width: 3.2em; font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ink); }
.disp-lines .sub-inline { display: inline-block; }
.disp-notes { font-weight: 650; }

/* ===================================================== update 4.4: barcodes, scanning labels, boxes or pallets */
/* the order number as a barcode on the printed order, for the Dispatch screen's Find box */
.order-barcode { display: block; margin: 8px 0 0 auto; max-width: 100%; }
@media print {
  .order-barcode { width: 60mm; height: 13mm; margin-top: 2mm; }
}

/* buttons that are radio buttons: the carrier, and boxes or pallets */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; margin: 0; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: 8px; background: #fff; font-weight: 600; font-size: 15.5px; color: var(--ink); cursor: pointer;
}
.pill input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); flex: none; }
.pill:has(input:checked) { border-color: var(--brand); background: #F6F8FB; box-shadow: inset 0 0 0 1px var(--brand); }

/* the scan form on the Dispatch screen */
.scan-carrier, .count-field { border: 0; margin: 0 0 20px; padding: 0; min-width: 0; }
.scan-carrier legend, .count-field legend { padding: 0; }
.scan-other { margin: 12px 0 0; }
.scan-row { display: flex; gap: 8px; }
.scan-row input { flex: 1 1 auto; min-width: 0; }
.scan-row .btn { flex: none; min-width: 84px; }
.scan-message { margin: 8px 0 0; min-height: 1.5em; font-size: 15px; font-weight: 650; color: var(--ok); overflow-wrap: anywhere; }
.scan-message.is-error { color: var(--error); }
.scan-list-box { margin: 0 0 20px; padding: 12px 14px; border-radius: 8px; background: #F6F8FB; border: 1px solid var(--line-soft); }
.scan-list-head { margin: 0 0 4px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.scan-list-box .tab-count { background: #fff; border: 1px solid var(--line); }
.scan-list { list-style: none; margin: 0; padding: 0; counter-reset: scan; }
.scan-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); counter-increment: scan; }
.scan-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.scan-list li::before { content: counter(scan) "."; flex: none; min-width: 1.8em; color: var(--muted); font-variant-numeric: tabular-nums; }
.scan-list .tracking { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-weight: 700; font-size: 17px; letter-spacing: .03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.scan-list .btn { flex: none; }
.count-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.count-row input[type=text] { width: 92px; flex: none; text-align: center; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.help-after { margin: 8px 0 0; }

/* tracking numbers listed with a Copy button each (customer and admin pages, the Dispatch screen) */
.track-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.track-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; min-height: 40px; }
.track-list .tracking { min-width: 0; overflow-wrap: anywhere; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.track-list .btn { min-height: 40px; padding: 0 14px; }
.order-track-multi { display: block; }
.order-track-multi .track-list { margin-top: 6px; }
.order-track-multi .track-list li { border-top: 1px dashed var(--line-soft); padding-top: 4px; }
.disp-action > .track-list { margin: -4px 0 10px; }
.next-step .hint, .disp-action .hint { overflow-wrap: anywhere; }   /* a long tracking number wraps rather than widening the page */
.track-more summary { display: flex; align-items: center; min-height: 40px; cursor: pointer; font-weight: 600; font-size: 14.5px; color: var(--brand-2); border-top: 1px dashed var(--line-soft); }
.track-more[open] summary { margin-bottom: 2px; }
@media (max-width: 599px) {
  .scan-list-box { padding: 10px 12px; }
  .scan-list li { gap: 8px; }
  .scan-list li::before { min-width: 1.5em; }
  .scan-list .tracking { font-size: 15.5px; letter-spacing: .01em; }
  .scan-list .btn { padding: 0 12px; }
}

/* ===================================================== update 4.6: customer support cases */
/* the menu's count of cases to look at (new, or the customer has written since we last replied) */
.nav .nav-count {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; min-height: 0; margin-left: auto; padding: 0 6px;
  border-radius: 999px; background: var(--accent); color: var(--brand); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.nav .nav-count .sr-only { min-height: 0; padding: 0; }

/* the stages of a case, and what else to know at a glance */
.badge-case-new { background: #EEF3FB; color: #1D3150; }
.badge-case-open { background: #F1ECFB; color: #4A2F86; }
.badge-case-waiting { background: #FFF4D6; color: #6B5300; }
.badge-case-closed { background: #F1F2F4; color: #3B4552; }
.badge-urgent { background: var(--error-bg); color: var(--error); }
.badge-late { background: #fff; color: #7A5200; box-shadow: inset 0 0 0 1.5px #D9B44A; }
.badge-shared { background: #E6F4EE; color: #1F5C43; }
.badge-reply { background: var(--brand); color: #fff; }
.alert-warn { background: #FFF8E3; color: #4D3C00; border-color: #D9B44A; }
.help-warn { color: #7A5200; font-weight: 600; }

/* Get help: what it's about, as tiles. Delivery problems and changes to orders first, with an orange edge. */
.help-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.help-tiles > li { display: grid; }
.help-tile {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; min-height: 68px; padding: 12px 16px;
  border-radius: 10px; background: #fff; border: 1.5px solid var(--line); color: var(--ink); text-decoration: none;
}
.help-tile:hover { border-color: var(--brand); }
.help-tile b { font-size: 16.5px; line-height: 1.3; color: var(--brand-2); }
.help-tile span { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.help-tile-delivery, .help-tile-delivery:hover { border-left: 5px solid var(--orange); padding-left: 13px; }
@media (min-width: 480px) {
  .help-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* a heading with a button beside it (Help) */
.cust-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.cust-head-row > div { flex: 1 1 300px; min-width: 0; }
.cust-head-row > .btn { flex: 1 1 100%; }
@media (min-width: 600px) {
  .cust-head-row > .btn { flex: none; }
}
.list-head { margin: 22px 0 10px; font-size: 18px; color: var(--ink); }
.cust-head + .list-head { margin-top: 4px; }

/* cases as a list */
.case-rows { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.case-row {
  display: grid; gap: 4px; padding: 14px 16px; border-radius: 10px; background: #fff; border: 1px solid var(--line-soft);
  color: var(--ink); text-decoration: none;
}
.case-row:hover { border-color: var(--line); }
.case-row:hover .case-subject { text-decoration: underline; }
.case-row-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.case-row-top b { color: var(--brand-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.case-subject { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.case-row .sub { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.case-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.case-tags .badge, .meta-line .badge { margin: 0; }

/* the office's Support page: a box for each stage */
.case-boxes-nav { margin: 0 0 14px; }
.case-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.case-box {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; min-height: 56px; padding: 8px 14px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-decoration: none;
  font-weight: 650; font-size: 15px; line-height: 1.25;
}
.case-box b { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--muted); }
.case-box:hover { border-color: var(--brand); }
.case-box.has-cases { border-color: #8FA3BC; }
.case-box.has-cases b { color: var(--ink); }
.case-box-new.has-cases { box-shadow: inset 4px 0 0 var(--focus); }
.case-box-waiting.has-cases { box-shadow: inset 4px 0 0 #D9B44A; }
.case-box[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: none; }
.case-box[aria-current="page"] b { color: #fff; }
@media (min-width: 600px) {
  .case-boxes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* a case: what the customer told us, then its messages */
@media (min-width: 600px) {
  dl.case-facts { gap: 10px; }
  dl.case-facts div { grid-template-columns: minmax(110px, 28%) minmax(0, 1fr); gap: 16px; }
}
.case-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.case-msg { min-width: 0; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line-soft); border-left: 4px solid #8FA3BC; background: #fff; }
.case-from-customer { background: #F8FAFC; }
.case-from-us { background: #EEF3FB; border-color: #D5DFEC; border-left-color: var(--brand); }
.case-note { background: #FFF8DB; border-color: #F0E2A6; border-left-color: var(--accent); }
.case-wh { background: var(--ok-bg); border-color: #CFE5D9; border-left-color: #2F7D5B; }
.case-who { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 12px; margin: 0 0 4px; font-size: 14.5px; }
.case-who b { min-width: 0; color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.case-when { font-size: 13.5px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.case-body { color: var(--ink); overflow-wrap: anywhere; }
.case-body-empty { margin: 0; color: var(--muted); }
.case-event { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 12px; padding: 0 14px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.case-event > span:first-child { min-width: 0; }
.case-event > span:first-child::before { content: "\2022\00a0\00a0"; }
.case-photos { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.case-photos a { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.case-photos a:hover { border-color: var(--brand); }
.case-photos img { display: block; width: 104px; height: 104px; object-fit: cover; }
@media (min-width: 600px) {
  .case-photos img { width: 128px; height: 128px; }
}

/* the order a case is about, at the top of the form */
.case-order-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; margin: 0; overflow-wrap: anywhere; }
.case-order-head b { color: var(--ink); }
.case-order-head .link-btn { margin: -10px 0 -10px auto; min-height: 0; padding: 10px 0; font-size: 14.5px; }
.case-order .hint { margin: 10px 0 6px; }

/* the forms: a new case, a reply, a note */
.case-form textarea { min-height: 120px; }
.case-form .choice-list { margin-bottom: 20px; }
fieldset.pills-field { border: 0; margin: 0 0 20px; padding: 0; min-width: 0; }
.pills-field legend { padding: 0; }
.field-short-wide { max-width: 440px; }
.case-note-form textarea { min-height: 84px; }
/* the order's items: tick the ones it's about, and how many (the number shows once ticked when the script runs) */
.case-lines { border: 0; margin: 0 0 20px; padding: 0; min-width: 0; }
.case-lines legend { padding: 0; }
.case-line-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.case-line-list > li { padding: 2px 14px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; }
.case-line-list > li:has(input[data-line-tick]:checked) { border-color: var(--brand); background: #F6F8FB; box-shadow: inset 0 0 0 1px var(--brand); }
.case-line-list .check { padding: 10px 0 8px; }
.case-line-list .check b { overflow-wrap: anywhere; }
.case-line-qty { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-left: 32px; }
.case-line-qty label { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.case-line-qty input { width: 88px; min-height: 44px; text-align: center; }
.case-line-qty .error-msg { flex-basis: 100%; margin: 0; }
.js .case-line-list > li.is-off { padding-bottom: 2px; }
.js .case-line-list > li.is-off .case-line-qty { display: none; }

/* adding photos: the box, then (with the script) each choice listed with a small picture and Remove */
.photo-field { min-width: 0; }
.photo-pick input[type=file] {
  display: block; width: 100%; padding: 10px; border: 1.5px dashed var(--line); border-radius: 8px;
  background: var(--field); font: inherit; font-size: 15px; color: var(--muted); cursor: pointer;
}
.photo-pick input[type=file]:hover { border-color: #AEB8C5; }
.photo-pick input[type=file][aria-invalid="true"] { border-color: var(--error); }
.photo-pick input[type=file]::file-selector-button {
  min-height: 44px; margin: 0 12px 0 0; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--brand-2); font: inherit; font-weight: 650; cursor: pointer;
}
.js .photo-pick input[type=file] { color: transparent; }   /* the list below says what's chosen */
.photo-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.photo-list li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line-soft); border-radius: 8px; background: #fff; }
.photo-thumbs { display: flex; flex-wrap: wrap; gap: 4px; flex: none; max-width: 50%; }
.photo-thumbs:empty { display: none; }
.photo-thumbs img { display: block; width: 44px; height: 44px; object-fit: cover; border-radius: 4px; background: var(--field); }
.photo-name { flex: 1 1 auto; min-width: 0; font-size: 14.5px; color: var(--ink); overflow-wrap: anywhere; }
.photo-name .sub { display: block; font-size: 13.5px; color: var(--muted); }
.photo-list .btn { flex: none; }
.photo-msg { margin: 8px 0 0; font-size: 14.5px; font-weight: 600; color: var(--ok); overflow-wrap: anywhere; }
.photo-msg:empty { margin: 0; }
.photo-msg.is-error { color: var(--error); }

/* the office's case page: the case on the left, the customer and what to do with it on the right (wide screens) */
.case-layout { display: grid; gap: 0 20px; }
.case-main, .case-side { min-width: 0; }
@media (min-width: 1100px) {
  .case-layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
}
.case-side dl.facts { gap: 10px; }
.case-side .card .hint { margin-bottom: 14px; }
.side-form { margin: 0 0 16px; }
.side-form:last-child { margin-bottom: 0; }
.side-row { display: flex; gap: 8px; }
.side-row select { flex: 1 1 auto; min-width: 0; }
.side-row .btn { flex: none; min-height: 48px; }
.side-form .help-after { margin-bottom: 0; }

/* support cases about an order, at the top of its admin page */
.order-cases p { margin: 0 0 2px; }
.order-cases ul { margin: 0; padding-left: 18px; }
.order-cases a { font-weight: 650; color: inherit; }

/* the Dispatch screen: cases the office has shared */
.disp-card-case { border-color: #2F7D5B; }
.disp-section h2 .tab-count { margin-left: 4px; vertical-align: 2px; }

/* bank holidays already gone */
.user-rows li.is-past b, .user-rows li.is-past .sub { color: var(--muted); font-weight: 500; }

/* ===================================================== update 4.7: back orders, picking details, the home screen icon */
/* NNP Trade on the home screen: a strip at the top of Home and the Dispatch screen (phones and tablets, shown by portal.js) */
.app-strip { margin: 0 0 18px; padding: 12px 14px; border-radius: 10px; background: #fff; border: 1.5px solid var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.app-strip-top { display: flex; align-items: center; gap: 12px; }
.app-strip-icon { flex: none; width: 48px; height: 48px; border-radius: 11px; border: 1px solid var(--line-soft); background: #fff; }
.app-strip-text { flex: 1 1 auto; min-width: 0; }
.app-strip-text h2 { margin: 0; font-size: 16px; line-height: 1.3; color: var(--ink); }
.app-strip-text p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.app-strip-close {
  flex: none; align-self: flex-start; width: 44px; height: 44px; margin: -8px -10px 0 0; border: 0; border-radius: 6px; background: none;
  font: inherit; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer;
}
.app-strip-close:hover { background: var(--field); color: var(--ink); }
.app-strip-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0 60px; }
.app-strip-actions:has(> [data-app-add][hidden] + [data-app-how][hidden]) { display: none; }
.app-how { margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line-soft); }
.app-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: app; }
.app-steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 4px 10px; align-items: start; counter-increment: app; font-size: 15px; color: var(--text); }
.app-steps li::before {
  content: counter(app); grid-row: 1 / span 2; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
}
.app-steps b { color: var(--ink); }
.app-pic { display: block; grid-column: 2; }
.app-pic svg { display: block; width: 160px; max-width: 100%; height: auto; }
.app-steps li > span:last-child { grid-column: 2; }
.app-how-foot { margin: 12px 0 0; }
@media (min-width: 600px) {
  .app-steps li { grid-template-columns: 30px 172px minmax(0, 1fr); align-items: center; }
  .app-steps li::before { grid-row: auto; }
  .app-pic, .app-steps li > span:last-child { grid-column: auto; }
}

/* the packing lane, and items missing, on the Dispatch screen */
.lane-field { border: 0; margin: 0 0 20px; padding: 0; min-width: 0; }
.lane-field legend { padding: 0; }
.missing-box { margin: 0 0 18px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; }
.missing-box > summary { display: flex; align-items: center; min-height: 48px; padding: 0 14px; cursor: pointer; font-weight: 650; color: var(--brand-2); }
.missing-box[open] { border-color: #D9B44A; }
.missing-box[open] > summary { border-bottom: 1px solid var(--line-soft); background: #FFF8E3; border-radius: 6px 6px 0 0; color: #4D3C00; }
.missing-body { padding: 12px 14px 14px; }
.missing-body .help { margin: 0 0 10px; }
.case-line-qty .sub-inline { white-space: nowrap; }

/* back orders: their stages, on lists and pages */
.badge-bo-owed { background: #FFF4D6; color: #6B5300; }
.badge-bo-picking { background: #F1ECFB; color: #4A2F86; }
.badge-bo-ready { background: #E6F4EE; color: #1F5C43; }
.badge-bo-done { background: #F1F2F4; color: #3B4552; }
.badge-bo-cancelled { background: var(--error-bg); color: var(--error); }
.badge-bo-removed { background: #fff; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line); }
.badge-bo-tag { background: #FFE8D6; color: #8A3300; }
.disp-badges { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.disp-card-bo { border-color: #E8B48F; }
.disp-card-bo.disp-card-done { border-color: var(--line-soft); }
.bo-rows { list-style: none; margin: 0 0 4px; padding: 0; }
.bo-rows li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.bo-rows li > div { min-width: 0; flex: 1 1 240px; }
.bo-rows a b { color: var(--brand-2); }
.bo-rows .sub { display: block; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.bo-rows .badge { margin-left: 4px; }
.bo-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-weight: 600; font-size: 15px; }
.bo-links a { display: inline-flex; align-items: center; min-height: 44px; }
.bo-value { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.bo-items { overflow-wrap: anywhere; }
.bo-line-note { color: #7A5200 !important; font-weight: 600; }
.bo-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 600px) {
  .bo-boxes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .bo-boxes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.bo-products > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-height: 44px; cursor: pointer; color: var(--brand-2); }
.bo-products[open] > summary { margin-bottom: 8px; }
.bo-qty { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ink); }
.nav .nav-count-soft { background: #FFE8D6; color: #8A3300; }

/* the customer's order page: items to follow */
.follow-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.follow-list > li { padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line-soft); background: #FAFBFC; min-width: 0; }
.follow-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 6px; }
.follow-head b { color: var(--ink); font-variant-numeric: tabular-nums; }
.follow-items { margin: 0 0 6px; padding-left: 18px; overflow-wrap: anywhere; }
.follow-list .sub { display: block; margin: 0 0 4px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.follow-list .track-list { margin: 4px 0 0; }

/* the picking box at the foot of printed orders: who, the date, the time and the lane, by hand */
.pick-box { margin: 14px 0 0; padding: 10px 12px; border: 1.5px solid var(--ink); border-radius: 6px; break-inside: avoid; }
.pick-box-head { margin: 0 0 6px; font-weight: 700; font-size: 14px; }
.pick-box-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; }
.pick-box-grid p { display: flex; align-items: flex-end; gap: 8px; margin: 0; font-size: 14px; min-width: 0; }
.pick-box-grid p > span:first-child { flex: none; color: var(--muted); }
.pick-blank { flex: 1 1 auto; min-width: 40px; height: 22px; border-bottom: 1.5px solid var(--ink); }
.pick-lanes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; margin: 12px 0 2px; font-size: 14px; }
.pick-lanes > span:first-child { color: var(--muted); }
.pick-lane { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.pick-lane .tick-square { margin-top: 0; }

/* the back order slip, for the customer's box */
.slip-for { margin: 0 0 4px; font-size: 16px; }
.slip-where { margin: 0 0 12px; color: var(--text); overflow-wrap: anywhere; }
.slip-sorry { margin: 0 0 16px; padding: 12px 14px; border-left: 4px solid var(--accent); background: #FFF8DB; font-size: 16px; font-weight: 600; color: var(--ink); }
.slip-table .pick-qty { width: 56px; }
.slip-foot { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); }
@media print {
  .order-barcode.bo-barcode { width: 72mm; }
  .slip-sorry { border: 1.5px solid #999; border-left-width: 4px; }
}

/* ======================================================= update 4.8: message templates for support replies */
.tpl-pick { padding: 12px 14px; border-radius: 8px; background: var(--field); border: 1px solid var(--line-soft); }
.tpl-pick label { display: block; }
.tpl-pick .side-row select { min-height: 48px; }
.tpl-fields-list { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 6px; }
.tpl-fields-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.tpl-chip {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--brand-2); background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; min-height: 36px; cursor: pointer;
}
.tpl-chip:hover { border-color: var(--brand); }
.tpl-chip:disabled { cursor: default; color: var(--text); background: var(--field); border-style: dashed; }
.tpl-form textarea { min-height: 180px; }
.tpl-rows { list-style: none; margin: 0; padding: 0; }
.tpl-rows > li { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.tpl-rows > li:last-child { border-bottom: 0; padding-bottom: 0; }
.tpl-rows > li.is-editing { background: #FFF8DB; margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 8px; }
.tpl-row-main { flex: 1 1 320px; min-width: 0; }
.tpl-row-main b { color: var(--ink); overflow-wrap: anywhere; }
.tpl-text { margin: 4px 0 6px; white-space: pre-line; overflow-wrap: anywhere; font-size: 15px; color: var(--text); }
.tpl-rows .sub { display: block; margin: 0; font-size: 14px; color: var(--muted); }
.tpl-row-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.tpl-note:empty { margin: 0; }

/* ======================================================= update 4.9: importing a customer's prices from a file */
.file-pick input[type=file] {
  display: block; width: 100%; padding: 10px; border: 1.5px dashed var(--line); border-radius: 8px;
  background: var(--field); font: inherit; font-size: 15px; color: var(--text); cursor: pointer;
}
.file-pick input[type=file]:hover { border-color: #AEB8C5; }
.file-pick input[type=file][aria-invalid="true"] { border-color: var(--error); }
.file-pick input[type=file]::file-selector-button {
  min-height: 44px; margin: 0 12px 0 0; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--brand-2); font: inherit; font-weight: 650; cursor: pointer;
}
.imp-read .alert { margin-bottom: 14px; }
.card > .sub-head.imp-recent-head { margin-top: 24px; }
.imp-recent { margin: 0; }
.imp-recent .badge { margin-left: 6px; vertical-align: 2px; }
.imp-who { margin: 0 0 16px; padding: 12px 14px; border-radius: 8px; font-size: 15px; overflow-wrap: anywhere; }
.imp-who.is-ok { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.imp-who.is-ok::before { content: "\2713\00a0 "; font-weight: 800; }
.imp-who.is-warn { background: #FFF8DB; border: 1px solid #E8D48A; }
.imp-who .warn-line { margin: 0; }
.imp-who .check-simple { margin: 6px 0 0; padding: 6px 0 0; font-weight: 650; color: var(--ink); }
.imp-who .error-msg { margin: 4px 0 0; }
.imp-counts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.imp-counts li { padding: 4px 10px; border-radius: 999px; font-size: 14px; background: var(--field); color: var(--text); }
.imp-counts b { color: var(--ink); }
.imp-counts .imp-count-ok { background: var(--ok-bg); }
.imp-counts .imp-count-check { background: #FFF4D6; }
.imp-group + .imp-group { margin-top: 22px; }
.imp-group .hint, .card .imp-group .hint { margin-bottom: 8px; }
.imp-all { margin: 0 0 4px; padding: 6px 0; font-weight: 600; }
.imp-rows { list-style: none; margin: 0; padding: 0; }
.imp-rows > li { border-bottom: 1px solid var(--line-soft); }
.imp-rows > li:last-child { border-bottom: 0; }
.imp-item { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 12px 0; font-weight: 400; color: var(--text); }
label.imp-item { cursor: pointer; }
.imp-item input[type=checkbox] { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.imp-mark { width: 22px; flex: none; text-align: center; font-weight: 800; color: var(--muted); }
.imp-body { flex: 1; min-width: 0; display: block; }
.imp-body > span { display: block; }
.imp-name { color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.imp-code { font-variant-numeric: tabular-nums; margin-right: 4px; }
.imp-line { font-size: 14.5px; color: var(--text); overflow-wrap: anywhere; }
.imp-line strong { color: var(--ink); font-weight: 650; }
.imp-meta { font-size: 13.5px; color: var(--muted); }
.imp-body .warn-line { margin: 2px 0 0; }
.imp-note { font-size: 14px; color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.imp-cant { margin: 10px 0 0; }
.imp-form .form-actions { margin-bottom: 16px; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.imp-ticked { flex: 1 1 260px; margin: 0; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.imp-form .form-actions .btn-primary { flex: 1 1 200px; }
#h-file, .imp-recent b { overflow-wrap: anywhere; }
.imp-cancel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.imp-back { font-weight: 600; text-underline-offset: 3px; }
.imp-form section[tabindex="-1"]:focus { outline: none; }   /* the error summary moves focus here; it isn't a control */

/* ---------------------------------------------------------------- update 4.9.1: invoice prices */
.imp-body .imp-info { font-size: 14px; color: var(--muted); }

/* ---------------------------------------------------------------- update 4.10: export for Sage */
.sage-made { border-color: var(--brand); }
.steps-list { margin: 0; padding-left: 22px; }
.steps-list li { margin: 0 0 10px; line-height: 1.5; }
.steps-list li:last-child { margin-bottom: 0; }
.sage-files .row-actions { flex-wrap: wrap; }
.board-export { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 12px; }
.next-step .step-export { margin: -4px 0 14px; font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }   /* the order page: "Adding it with Adept? Export it for Sage" under the Sage step's hint */
.imp-body .warn-line, .summary li, .error-msg { overflow-wrap: anywhere; }   /* a long unbroken name or invoice number wraps on a phone */

/* ---------------------------------------------------------------- update 4.11: alerts */
/* The sound button, in the admin top bar (phones), the admin menu (wide screens) and the Dispatch screen's header:
   orange until the page may play sounds, then green. */
.topbar-right { display: flex; align-items: center; gap: 6px; }
.sound-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 10px;
  border: 1.5px solid #F2B48C; border-radius: 999px; background: #FFF6EF; color: #9A3F0B;
  font: inherit; font-size: 13.5px; font-weight: 650; line-height: 1.1; white-space: nowrap; cursor: pointer;
}
.sound-btn .sound-icon { flex: none; }
.sound-btn.is-on { border-color: #A9CDBA; background: var(--ok-bg); color: var(--ok); }
.sound-btn.is-on .sound-slash { display: none; }
.sound-btn.is-stopped { border-color: #E7B4AF; background: var(--error-bg); color: var(--error); }
.sidebar-sound { margin: -10px 12px 16px; }
@media (max-width: 399px) {
  .topbar .sound-btn-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .topbar .sound-btn { width: 40px; padding: 0; justify-content: center; }
}
@media (max-width: 479px) {
  .disp-bar .sound-btn-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .disp-bar .sound-btn { width: 40px; padding: 0; justify-content: center; }
}

/* The pop-ups: top right (across the top on a phone), the newest first. Under the phone menu when it's open (30). */
.alert-pops {
  position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; z-index: 25;
  display: grid; gap: 8px; justify-items: end; pointer-events: none;
}
@media (min-width: 600px) { .alert-pops { left: auto; width: 380px; } }
@media (max-width: 959px) { .page-admin .alert-pops { top: calc(70px + env(safe-area-inset-top)); } }   /* below the admin top bar, so Menu stays usable */
.page-dispatch .alert-pops { top: calc(78px + env(safe-area-inset-top)); }   /* below the Dispatch header: the bell, Password and Sign out */
.alert-pop {
  position: relative; width: 100%; pointer-events: none;   /* clicks go through to the page, except on its links and button */
  padding: 10px 44px 10px 14px; border: 1px solid var(--line-soft); border-left: 4px solid var(--accent); border-radius: 8px;
  background: #fff; box-shadow: 0 12px 30px rgba(20,35,58,.24); font-size: 15px;
}
.alert-pop a, .alert-pop-close { pointer-events: auto; }
.alert-pop-title { margin: 0 0 2px; font-weight: 700; color: var(--ink); }
.alert-pop-line { margin: 0; overflow-wrap: anywhere; }
.alert-pop-note { margin: 6px 0 0; font-size: 13.5px; color: #9A3F0B; }
.alert-pop-close {
  position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; border: 0; border-radius: 6px;
  background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer;
}
.alert-pop-close:hover { background: var(--field); }
@media (max-width: 599px) {   /* smaller on a phone, so a few don't fill the screen */
  .alert-pops { gap: 6px; }
  .alert-pop { padding: 7px 40px 7px 12px; font-size: 14px; line-height: 1.4; }
  .alert-pop-close { top: 2px; right: 2px; }
  .alert-pop-note { margin-top: 4px; font-size: 13px; }
}

/* The Alerts page */
.note-list { margin: 0; padding-left: 20px; }
.note-list li { margin: 0 0 8px; }
.note-list li:last-child { margin-bottom: 0; }
.alert-kinds { list-style: none; margin: 0 0 16px; padding: 0; }
.alert-kinds li { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.alert-kinds li:first-child { border-top: 0; padding-top: 0; }
.alert-kinds label { font-weight: 650; color: var(--ink); }
.alert-kinds .help { margin: 2px 0 0; }
.alert-kind-choice { display: flex; gap: 8px; align-items: center; }
.alert-kind-choice select { flex: 1 1 auto; min-width: 0; }
.alert-kind-choice .btn { flex: none; }
@media (min-width: 600px) { .alert-kinds li { grid-template-columns: minmax(0, 1fr) 270px; align-items: center; gap: 16px; } }
@media print { .alert-pops, .sound-btn, .sidebar-sound { display: none !important; } }

/* ---------------------------------------------------------------- update 4.12: analytics */
/* The filters above everything they apply to: one row on a wide screen, one under another on a phone. */
.an-filters { display: grid; gap: 8px; margin: 0 0 8px; }
.an-filters .an-field { min-width: 0; }
.an-filters label { margin-bottom: 4px; font-size: 14px; }
.an-filters .btn { width: 100%; }
@media (min-width: 600px) {
  .an-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; }
  .an-filters .an-field { flex: 0 1 200px; }
  .an-filters .an-date { flex: 0 1 170px; }
  .an-filters .an-field-wide { flex: 1 1 220px; max-width: 320px; }
  .an-filters .btn { width: auto; }
}
.an-showing { margin: 0 0 18px; font-size: 14.5px; color: var(--muted); }
.an-showing b { color: var(--ink); font-weight: 650; }
.an-section { margin-top: 28px; }
.an-hint { margin: -4px 0 12px; font-size: 14.5px; color: var(--muted); max-width: 78ch; }
.an-note { margin: 4px 0 16px; font-size: 14px; color: var(--muted); max-width: 78ch; }
.an-line { margin: 0 0 8px; }
.an-ok { color: var(--ok); font-weight: 600; }
.an-warn { color: #8A4B00; font-weight: 600; }
.an-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.an-tags .badge { margin: 0; }
.badge-quiet { background: #FDEBDD; color: #8A3A08; }

/* Figures as tiles: what it is, the figure (proportional figures at this size), and how it compares with the period before. */
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; }
@media (min-width: 700px) { .stat-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.an-filters + .stat-tiles { margin-top: 16px; }
.stat { min-width: 0; padding: 12px 14px; background: #fff; border: 1px solid var(--line-soft); border-radius: 10px; }
.stat-label { margin: 0 0 2px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.stat-value { margin: 0; font-size: 24px; font-weight: 750; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
.stat-sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.stat-delta { margin: 4px 0 0; font-size: 13.5px; font-weight: 650; }
.stat-delta.is-good { color: var(--ok); }
.stat-delta.is-bad { color: var(--error); }
.stat-delta.is-same { color: var(--muted); font-weight: 500; }

/* Bar charts: the heading and key, the plot (drawn by portal.js), and the figures as a table under it. */
figure.chart { margin: 0 0 16px; }
.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.chart-head h2 { margin: 0; font-size: 17px; color: var(--ink); }
.chart-key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--text); }
.chart-key li { display: flex; align-items: center; gap: 6px; }
.chart-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.chart-s1 { background: #2a78d6; }
.chart-s0 { background: #C5CED9; }
.chart-plot { position: relative; height: 236px; margin: 12px 0 4px; touch-action: pan-y; }
.chart-plot svg { display: block; overflow: visible; }
.chart-plot:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
.ch-grid { stroke: #E3E8EE; stroke-width: 1; shape-rendering: crispEdges; }
.ch-base { stroke: #AEB8C5; stroke-width: 1; shape-rendering: crispEdges; }
.ch-text { fill: #5D6878; font-size: 12px; font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; }
.ch-bar.s1 { fill: #2a78d6; }
.ch-bar.s0 { fill: #C5CED9; }
.ch-bar.is-part { fill-opacity: .5; }   /* a part week, or one that isn't over: not a slump */
.chart-note { margin: 0 0 2px; font-size: 13px; color: var(--muted); }
.ch-band { fill: transparent; }
.ch-band.is-on { fill: rgba(20,35,58,.06); }
.chart-tip {
  position: absolute; top: 0; left: 0; z-index: 2; min-width: 150px; max-width: 240px; padding: 8px 10px; pointer-events: none;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 22px rgba(20,35,58,.16);
  font-size: 13.5px; line-height: 1.4; color: var(--text);
}
.chart-tip p { margin: 0; }
.chart-tip .tip-title { color: var(--muted); font-size: 12.5px; margin-bottom: 2px; }
.chart-tip .tip-main { color: var(--ink); font-weight: 700; font-size: 14.5px; }
.chart-table { margin-top: 6px; }
.chart-table summary { display: inline-flex; align-items: center; min-height: 40px; cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--brand-2); }
.fig-wrap { overflow-x: auto; }
.fig-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.fig-table th, .fig-table td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.fig-table thead th { font-size: 13px; font-weight: 600; color: var(--muted); }
.fig-table tbody th { font-weight: 500; color: var(--ink); overflow-wrap: break-word; }
.fig-table tbody tr:last-child th, .fig-table tbody tr:last-child td { border-bottom: 0; }
.fig-table tfoot th, .fig-table tfoot td { border-top: 1px solid var(--line); border-bottom: 0; font-weight: 650; color: var(--ink); }
.fig-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fig-table .sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); }

/* Small tables side by side (how customers paid; what support cases were about). */
.an-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 700px) { .an-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
.an-grid .card { margin: 0; }
.an-mini h3 { margin: 0 0 6px; font-size: 16px; color: var(--ink); }

/* The lists: figures in a column line up on a wide screen. */
.list-an .num { font-variant-numeric: tabular-nums; }
.list-an .sub-inline { font-size: 14px; }
.list .sub.an-share, .an-share { display: flex; align-items: center; gap: 6px; }
.share-bar { flex: none; }
.share-track { fill: #E3E8EE; }
.share-fill { fill: #2a78d6; }
@media (min-width: 900px) {
  .list-an td.num, .list-an th.num { text-align: right; white-space: nowrap; }
  .list-an .an-share { justify-content: flex-end; }
}
@media (min-width: 900px) and (max-width: 1199px) {
  .list-an td, .list-an th { padding: 10px 12px; }
  .list-an .log-when { white-space: normal; }
}
.an-sort { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 0 10px; font-size: 14.5px; }
.an-sort > span { color: var(--muted); margin-right: 4px; }
.an-sort a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--brand-2); font-weight: 600; text-decoration: none;
}
.an-sort a:hover { border-color: var(--brand); }
.an-sort a[aria-current] { background: var(--brand); border-color: var(--brand); color: #fff; }
.list-tools { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin: 10px 0 0; font-size: 14.5px; }
.list-tools a { font-weight: 600; text-underline-offset: 3px; }
.list-an .cell-action .link-btn { position: relative; z-index: 1; }
@media (min-width: 900px) {
  .list-an .cell-action { text-align: right; white-space: nowrap; }
  .list-an .cell-action .link-btn { min-height: 0; }
}

/* What's in a basket, opened from its row (above the row's link, so it can be opened). */
.an-items { position: relative; z-index: 1; margin-top: 6px; font-size: 14px; }
.an-items summary { display: inline-flex; align-items: center; min-height: 36px; cursor: pointer; font-weight: 600; color: var(--brand-2); }
.an-items ul { list-style: none; margin: 4px 0 0; padding: 0; }
.an-items li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid var(--line-soft); color: var(--text); font-weight: 400; overflow-wrap: anywhere; }
.an-item-value { flex: none; font-variant-numeric: tabular-nums; }

/* How the figures are worked out, at the foot of a page. */
.an-about { margin-top: 28px; padding-top: 6px; border-top: 1px solid var(--line-soft); font-size: 14.5px; }
.an-about summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; color: var(--brand-2); }
.an-about .note-list { color: var(--text); max-width: 78ch; }
@media print { .an-filters, .an-tabs, .chart-tip { display: none !important; } }
.chart-table summary::before, .an-about summary::before, .an-items summary::before {
  content: "\25B8"; display: inline-block; width: 1em; margin-right: 4px; color: var(--muted);
}
.chart-table[open] > summary::before, .an-about[open] > summary::before, .an-items[open] > summary::before { transform: rotate(90deg); }
.an-filters-list { margin: 0 0 12px; }

/* ---------------------------------------------------------------- update 4.13: own products typed in by hand */
.own-source { border: 0; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
[data-own-for] > .field:last-child { margin-bottom: 20px; }   /* the box is followed by more boxes */
.own-source legend { margin-bottom: 6px; font-weight: 600; color: var(--ink); }
.input-short { max-width: 12em; }
.own-each-warn { margin: 4px 0 14px; }
.own-preview { margin: -4px 0 12px; font-weight: 600; color: var(--ink); }

/* ---------------------------------------------------------------- update 5.0: card payments through Worldpay */
.pay-card .pay-failed { margin: 0 0 14px; }
.pay-card .pay-form { margin: 14px 0 12px; }
.pay-go, .pay-checking { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; font-size: 16px; color: var(--ink); }
.pay-done { margin: 0 0 14px; }
.spinner {
  flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%;
  border: 3px solid var(--line-soft); border-top-color: var(--brand-2); animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-top-color: var(--line); } }
.pay-reminder p { margin: 0 0 4px; }
.pay-reminder ul { margin: 0; padding-left: 20px; }
.pay-reminder li { overflow-wrap: anywhere; }
.pay-reminder a { color: inherit; font-weight: 700; }

/* the office's Card payments: each Worldpay payment page */
.card-pay-rows { list-style: none; margin: 0 0 12px; padding: 0; }
.card-pay-rows li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.card-pay-rows li:first-child { padding-top: 0; }
.card-pay-head { margin: 0 0 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.card-pay-head .badge { margin: 0; }
.card-pay-rows .sub { display: block; margin: 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.card-pay-rows .card-pay-note { color: #7A5200; font-weight: 600; }
.card-ref { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; color: var(--ink); }
.badge-card-open { background: #EEF3FB; color: #1D3150; }
.badge-card-paid { background: var(--ok-bg); color: var(--ok); }
.badge-card-failed, .badge-card-abandoned { background: #F1F2F4; color: #3B4552; }
.badge-card-mismatch, .badge-card-refunded { background: var(--error-bg); color: var(--error); }
.badge-card-test { background: #FFF4D6; color: #6B5300; }
.badge-card-waiting { background: #F1F2F4; color: #3B4552; }   /* update 5.1: a card order not paid, so not on the board */

/* Settings: the addresses to put in the Worldpay dashboard, each with a Copy button */
.copy-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 12px; margin: 0 0 12px; }
.copy-row p { margin: 0; min-width: 0; flex: 1 1 260px; }
.copy-row code { display: inline-block; margin-top: 2px; padding: 2px 6px; border-radius: 4px; background: var(--field); color: var(--ink); font-size: 14px; overflow-wrap: anywhere; word-break: break-all; }

/* ---------------------------------------------------------------- update 5.3 */

/* The orders board: New, Awaiting payment and Paid have a red border while they have orders in them (Chris: "so we can see
   the order clearly"), whichever stage is being looked at. */
.flow-box.fb-new.has-orders, .flow-box.fb-wait.has-orders, .flow-box.fb-paid.has-orders {
  border: 3px solid #D92D20; box-shadow: 0 0 0 1px rgba(217, 45, 32, .18);
}
.flow-box.fb-new.has-orders .tab-count, .flow-box.fb-wait.has-orders .tab-count, .flow-box.fb-paid.has-orders .tab-count { background: #D92D20; color: #fff; }
.flow-box.fb-new.has-orders[aria-current="page"], .flow-box.fb-wait.has-orders[aria-current="page"], .flow-box.fb-paid.has-orders[aria-current="page"] { border-color: #F04438; }
.flow-pill-problems.has-orders { border-color: #D92D20; }
.flow-pill-problems.has-orders .tab-count { background: #FDE7E5; color: #9F1C12; }

/* Ringing: New order and Order paid, until someone acknowledges them. A box across the top of every office page. */
.ring-box {
  position: fixed; z-index: 90; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; margin: 0 auto; max-width: 560px;
  border-radius: 14px; background: #B42318; color: #fff; box-shadow: 0 12px 32px rgba(20, 35, 58, .35);
  animation: ring-pulse 1.2s ease-in-out infinite alternate;
}
@keyframes ring-pulse { from { box-shadow: 0 12px 32px rgba(20, 35, 58, .35), 0 0 0 0 rgba(217, 45, 32, .5); } to { box-shadow: 0 12px 32px rgba(20, 35, 58, .35), 0 0 0 8px rgba(217, 45, 32, 0); } }
@media (prefers-reduced-motion: reduce) { .ring-box { animation: none; } }
.ring-inner { padding: 14px 16px 16px; }
.ring-title { margin: 0 0 6px; font-weight: 750; font-size: 19px; line-height: 1.25; }
.ring-list { margin: 0 0 12px; padding: 0; list-style: none; font-size: 15px; line-height: 1.4; }
.ring-list li { margin: 2px 0; overflow-wrap: anywhere; }
.ring-list a { color: #fff; font-weight: 600; }
.ring-note { margin: 0 0 10px; font-size: 14px; color: #FFE2DE; }
.ring-error { margin: 8px 0 0; font-size: 14px; color: #FFE2DE; }
.ring-ack.btn { width: 100%; min-height: 48px; background: #fff; color: #B42318; border-color: #fff; font-size: 17px; font-weight: 750; }
.ring-ack.btn:hover { background: #FFF1EF; }
.ring-ack.btn:disabled { opacity: .7; }
@media (max-width: 959px) { .page-admin .ring-box { top: calc(70px + env(safe-area-inset-top)); } }
.page-dispatch .ring-box { top: calc(78px + env(safe-area-inset-top)); }
.ring-setting { margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line-soft); }
.ring-setting .check { padding: 4px 0; }
.ring-setting .help { margin: 4px 0 0 32px; }

/* DX tracking: a delivery's state, DX's words, and its scans (customers, the office and the Dispatch screen). */
.badge.trk-sent { background: #F1F2F4; color: #3B4552; }
.badge.trk-with { background: #E6F4F7; color: #145566; }
.badge.trk-out { background: #EEF3FB; color: #1D3150; }
.badge.trk-done { background: var(--ok-bg); color: var(--ok); }
.badge.trk-problem { background: #FDE7E5; color: #9F1C12; }
.trk { margin: 10px 0 0; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--field); }
.trk.trk-is-problem, .trk.trk-is-delayed { border-color: #F3B8B2; background: #FFF6F5; }
.trk.trk-is-delivered { border-color: #BFDFCB; background: #F4FAF6; }
.trk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; }
.trk-head .badge { margin: 0; }
.trk-text { margin: 6px 0 0; color: var(--ink); }
.trk-when { color: var(--muted); font-size: 14px; }
.trk-help { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.trk-help.trk-warn { color: #9F1C12; }
.trk-events { margin: 8px 0 0; }
.trk-events summary { cursor: pointer; font-size: 14px; color: var(--brand-2); }
.trk-events ol { margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; }
.trk-events li { display: grid; grid-template-columns: 112px 1fr; gap: 2px 10px; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.trk-events li:first-child { border-top: 0; }
.trk-events .trk-ev-when { color: var(--muted); }
.trk-events .trk-ev-num { grid-column: 2; color: var(--muted); font-size: 13px; }
@media (max-width: 420px) { .trk-events li { grid-template-columns: 1fr; } .trk-events .trk-ev-num { grid-column: 1; } }
.trk-pod { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.trk-pod .btn { min-height: 36px; }
.trk-line { display: block; margin-top: 4px; }
