/* ------------------------------------------------------------
   Status Pill
   ------------------------------------------------------------ */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-family: var(--f-head);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--r-xs);
  white-space: nowrap;
  border: 1px solid transparent;
}
.status-pill__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: 0.95;
}
.status-pill--sm { font-size: 10px; padding: 2px 7px; }
.status-pill--draft    { background: var(--st-closed-bg);   color: var(--st-draft);    border-color: rgba(107,117,133,0.18); }
.status-pill--approval { background: var(--st-approval-bg); color: var(--st-approval); border-color: rgba(197,138,4,0.20); }
.status-pill--approved { background: var(--st-approved-bg); color: var(--st-approved); border-color: rgba(19,122,63,0.20); }
.status-pill--rejected { background: var(--st-rejected-bg); color: var(--st-rejected); border-color: rgba(194,22,26,0.18); }
.status-pill--printed  { background: var(--st-printed-bg);  color: var(--st-printed);  border-color: rgba(12,91,180,0.18); }
.status-pill--awaiting { background: var(--st-awaiting-bg); color: var(--st-awaiting); border-color: rgba(11,110,115,0.20); }
.status-pill--closed   { background: var(--st-closed-bg);   color: var(--st-closed);   border-color: rgba(74,82,94,0.18); }
.status-pill--reprint  { background: var(--st-reprint-bg);  color: var(--st-reprint);  border-color: rgba(91,61,203,0.18); }
.status-pill--cancelled{ background: var(--st-cancelled-bg);color: var(--st-cancelled);border-color: rgba(147,38,79,0.20); }
/* "For Approval" — the viewer's own pending decision: hot amber + a breathing dot. */
.status-pill--mine     { background: var(--st-mine-bg);     color: var(--st-mine);     border-color: rgba(154,77,0,0.24); }
.status-pill--mine .status-pill__dot { animation: pill-mine-beat 2.2s ease-in-out infinite; }
@keyframes pill-mine-beat {
  0%, 100% { opacity: 0.95; }
  50%      { opacity: 0.35; }
}
/* "Unauthorized" — in approval, but not this viewer's call: recedes to gray, and the
   dashed border whispers "fenced off" without shouting an error. */
.status-pill--unauth   { background: var(--st-closed-bg);   color: var(--st-draft);    border-style: dashed; border-color: rgba(107,117,133,0.40); }
@media (prefers-reduced-motion: reduce) {
  .status-pill--mine .status-pill__dot { animation: none; }
}

/* ------------------------------------------------------------
   Avatar
   ------------------------------------------------------------ */
.avatar { display: inline-flex; align-items: center; gap: 10px; }
.avatar__img {
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-head); font-weight: 700; color: white;
  flex-shrink: 0; letter-spacing: 0.02em;
}
.avatar__body { line-height: 1.2; }
.avatar__name { font-weight: 600; font-size: 14px; }
.avatar__sub  { font-size: 11px; color: var(--text-2); font-family: var(--f-mono); }

/* ------------------------------------------------------------
   Button
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.btn:hover { background: var(--surface-alt); box-shadow: var(--shadow-xs); }
.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-ring);
  border-color: var(--brand-red);
}
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn__icon { width: 16px; height: 16px; flex-shrink: 0; }
.btn__label { display: inline; }

.btn--primary {
  background: var(--brand-red);
  color: white;
  border-color: var(--brand-red);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn--primary:hover { background: var(--brand-red-deep); border-color: var(--brand-red-deep); }
.btn--ghost   { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.btn--dark    { background: var(--ink); color: white; border-color: var(--ink); }
.btn--dark:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn--approve { background: var(--st-approved); color: white; border-color: var(--st-approved); }
.btn--approve:hover { background: #0F6534; border-color: #0F6534; }
.btn--reject  { background: var(--st-rejected); color: white; border-color: var(--st-rejected); }
.btn--reject:hover  { background: #9F1216; border-color: #9F1216; }
.btn--sm      { height: 30px; padding: 0 10px; font-size: 13px; border-radius: var(--r-sm); }
.btn--lg      { height: 44px; padding: 0 22px; font-size: 15px; }
.btn--block   { width: 100%; }
.btn--current { background: var(--primary); color: white; border-color: var(--primary); }

/* Async/busy state — applied by BT.setButtonLoading (js/core/site.js), which
   injects .btn__spinner, sets [disabled] + aria-busy="true", and swaps the
   label. The shared .is-loading utility supplies pointer-events:none; here the
   leading icon yields to the spinner and the disabled dim is softened so the
   button reads "working", not "unavailable". */
.btn__spinner {
  display: none;
  width: 15px; height: 15px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: bt-spin 0.6s linear infinite;
}
.btn.is-loading .btn__spinner { display: inline-block; }
.btn.is-loading .btn__icon { display: none; }
.btn.is-loading:disabled { opacity: 0.85; cursor: progress; }
@keyframes bt-spin { to { transform: rotate(360deg); } }

/* Icon-only icon button */
.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid; place-items: center;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.icon-btn:hover { background: var(--surface-alt); color: var(--text); border-color: var(--border-strong); }
.icon-btn--sm { width: 28px; height: 28px; }

/* ------------------------------------------------------------
   Segmented control
   ------------------------------------------------------------ */
.segmented {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
}
.segmented__item {
  background: transparent; border: 0;
  padding: 6px 12px;
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: var(--f-body);
  transition: all var(--dur-fast);
}
.segmented__item:hover { color: var(--text); }
.segmented__item--active {
  background: white; color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------
   Tabs
   ------------------------------------------------------------ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.tabs__item {
  padding: 12px 18px;
  font-family: var(--f-head);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  cursor: pointer;
  border: 0; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.tabs__item:hover { color: var(--text); }
.tabs__item--active { color: var(--brand-red); border-bottom-color: var(--brand-red); }
.tabs__count {
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 8px;
}
.tabs__item--active .tabs__count { background: var(--brand-red-tint); color: var(--brand-red); }

/* ------------------------------------------------------------
   Form field / Input / Select / Textarea / Input Group
   ------------------------------------------------------------ */
.field { margin-bottom: 18px; }
.field__label {
  display: block;
  font-size: 11px;
  font-family: var(--f-head);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 7px;
}
.field__req   { color: var(--brand-red); margin-left: 2px; }
.field__error {
  color: var(--st-rejected);
  font-size: 13px;
  margin-top: 6px;
  display: flex; gap: 6px; align-items: center;
}
.field__icon { width: 12px; height: 12px; }
.field__help { color: var(--text-2); font-size: 13px; margin-top: 6px; line-height: 1.5; }
.field--error .input,
.field--error .select,
.field--error .textarea { border-color: var(--st-rejected); }

.input, .select, .textarea {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: white;
  font-size: 14px;
  color: var(--text);
  font-family: var(--f-body);
  outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 72px; line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-4); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-red);
  box-shadow: var(--shadow-ring);
}
.input--readonly { background: var(--surface-alt); font-weight: 700; }
.input--mono { font-family: var(--f-mono); }

.input-group {
  display: flex; align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  overflow: hidden;
  background: white;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input-group:hover { border-color: var(--ink-4); }
.input-group:focus-within { border-color: var(--brand-red); box-shadow: var(--shadow-ring); }
.input-group .input { border: 0; box-shadow: none; }
.input-group__prefix,
.input-group__suffix {
  padding: 0 12px;
  display: flex; align-items: center;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  border: 0;
  cursor: default;
}
.input-group__prefix { border-right: 1px solid var(--border); }
.input-group__suffix { border-left:  1px solid var(--border); }
button.input-group__suffix { cursor: pointer; background: white; }

/* Chip / segmented tile (used by New Request) */
.chip {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  border-radius: var(--r-xs);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--f-head);
  letter-spacing: 0.02em;
  transition: all var(--dur-fast);
}
.chip:hover { border-color: var(--ink-4); }
.chip--active {
  border: 2px solid var(--primary);
  background: var(--primary-tint);
  color: var(--primary-hover);
  padding: 7px 13px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ------------------------------------------------------------
   Card
   ------------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.card__title {
  margin: 0;
  font-family: var(--f-head);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.card__body { padding: 20px; }
.card__body--flush { padding: 0; }
.card__foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-alt);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  font-size: 13px;
  color: var(--text-2);
}
.card__form-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px;
}

/* ------------------------------------------------------------
   Modal
   ------------------------------------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14,17,22,0.45);
  display: grid;
  place-items: center;
  z-index: var(--z-modal);
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: white;
  border-radius: var(--r-lg);
  width: 100%;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.modal__head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal__title {
  margin: 0;
  font-family: var(--f-head);
  font-size: 19px; font-weight: 700;
  letter-spacing: -0.01em;
}
.modal__close {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}
.modal__body { padding: 22px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.modal__foot {
  padding: 14px 22px;
  border-top: 1px solid var(--border-soft);
  display: flex; justify-content: flex-end; gap: 10px;
  background: var(--surface-alt);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  flex-shrink: 0;
}

/* Modals that wrap .modal__body + .modal__foot in a <form> (Users
   invite/edit, the config master-data editors): the form — not the
   body — is the .modal flex child, and a plain block refuses to
   shrink below its content, so the body's overflow-y never engaged;
   tall content bled past the rounded corner and pushed the footer
   out of view. Relaying the column flex through the form (min-height
   0 is what lets it shrink) restores body scrolling and pins the
   footer. :not([hidden]) so this display can never resurrect a
   hidden form (author rules outrank the UA's [hidden] display). */
.modal > form:not([hidden]) {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Confirm dialog — compact .modal variant gating consequential row
   actions (Users: send reset link / resend activation). Three custom
   props carry the hue, which rides the SAME status color as the row
   button that opened it (reset → st-printed, activation → st-approval,
   destructive confirms → .confirm--danger on st-rejected). The dashed
   recipient slip restates exactly what the action affects, so the
   accept button stays an action verb, not "OK". */
.confirm {
  --confirm-hue: var(--st-printed);
  --confirm-tint: var(--st-printed-bg);
  --confirm-line: rgba(12,91,180,0.22);
  max-width: 420px;
  background:
    radial-gradient(130% 80% at 16% -12%, var(--confirm-tint) 0%, rgba(255,255,255,0) 52%),
    var(--surface);
}
.confirm--reset      { --confirm-hue: var(--st-printed);  --confirm-tint: var(--st-printed-bg);  --confirm-line: rgba(12,91,180,0.22); }
.confirm--activation { --confirm-hue: var(--st-approval); --confirm-tint: var(--st-approval-bg); --confirm-line: rgba(197,138,4,0.26); }
.confirm--danger     { --confirm-hue: var(--st-rejected); --confirm-tint: var(--st-rejected-bg); --confirm-line: rgba(194,22,26,0.24); }
.confirm__head {
  padding: 20px 20px 0;
  display: flex; align-items: flex-start; justify-content: space-between;
}
.confirm__badge {
  width: 44px; height: 44px;
  margin: 4px 0 0 4px;            /* clears the halo ring from the dialog edge */
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--confirm-hue);
  border: 1px solid var(--confirm-line);
  box-shadow: 0 0 0 7px var(--confirm-tint);
}
.confirm__badge svg { width: 20px; height: 20px; }
.confirm__body { padding: 16px 22px 20px; }
.confirm__title {
  margin: 0 0 6px;
  font-family: var(--f-head);
  font-size: 19px; font-weight: 700;
  letter-spacing: -0.01em;
}
.confirm__text { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.confirm__recipient {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px dashed var(--confirm-line);
  border-radius: var(--r-md);
  background: var(--surface-alt);
}
.confirm__eyebrow {
  display: block;
  margin-bottom: 8px;
  font-family: var(--f-head);
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3);
}
/* Stale-row conflict — the optimistic-concurrency variant of the confirm
   dialog (BT.staleTicket). Teal "sync" hue: the event is neither approval
   nor rejection but TIME — the row moved on while it was being looked at.
   The dashed slip becomes a version fork: the caller's invalidated view on
   the left (struck through), an arrow, and the ticket's CURRENT status pill
   on the right, so "row version mismatch" reads as a concrete "it is now X".
   The badge's rotate glyph sweeps once into place on open — a whispered
   "out of sync" — and sits still for prefers-reduced-motion. */
.confirm--stale { --confirm-hue: var(--st-awaiting); --confirm-tint: var(--st-awaiting-bg); --confirm-line: rgba(11,110,115,0.26); }
.confirm--stale .confirm__badge svg {
  animation: confirm-stale-sweep 480ms var(--ease-out) 120ms backwards;
}
@keyframes confirm-stale-sweep {
  from { transform: rotate(-160deg); opacity: 0.35; }
  to   { transform: rotate(0deg);    opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .confirm--stale .confirm__badge svg { animation: none; }
}
.confirm__fork { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.confirm__fork-code {
  font-family: var(--f-mono);
  font-weight: 600; font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--ink-2);
}
.confirm__fork-trail { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.confirm__fork-was {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--f-head);
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-3);
  text-decoration: line-through;
  text-decoration-color: rgba(138,147,162,0.6);
  text-decoration-thickness: 1px;
}
.confirm__fork-arrow { width: 14px; height: 14px; color: var(--confirm-hue); flex-shrink: 0; }
.confirm__fork-gone { font-size: 12.5px; font-weight: 600; color: var(--text-2); }

/* Pre-open row-version check: the clicked card/row dims while its version is
   verified against the server, refusing further clicks until the verdict. */
.is-checking { opacity: 0.55; pointer-events: none; transition: opacity var(--dur-med) var(--ease-out); }

.confirm__user { display: flex; align-items: center; gap: 10px; }
.confirm__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-head); font-weight: 700; font-size: 12px;
  color: white; flex-shrink: 0;
}
.confirm__who { min-width: 0; line-height: 1.3; }
.confirm__name { display: block; font-weight: 600; font-size: 13.5px; }
.confirm__email { display: block; font-family: var(--f-mono); font-size: 11px; color: var(--confirm-hue); overflow-wrap: anywhere; }
.confirm__meta  { display: block; font-family: var(--f-mono); font-size: 11px; color: var(--text-2); }

/* ------------------------------------------------------------
   Acknowledge dialog (BT.acknowledge) — the blocking verdict
   receipt. Shown AFTER a lifecycle action settles (create /
   approve / reject / cancel) stating its success or failure.
   Deliberately inescapable: no ×, no Cancel, no backdrop click,
   no Esc — the single Acknowledge button is the only way out, so
   the outcome is consciously seen before work continues. A
   blocked dismissal attempt nudges the card instead of closing.
   ------------------------------------------------------------ */
.ack {
  --ack-hue: var(--st-approved);
  --ack-tint: var(--st-approved-bg);
  --ack-line: rgba(19,122,63,0.24);
  max-width: 400px;
  text-align: center;
  background:
    radial-gradient(120% 70% at 50% -16%, var(--ack-tint) 0%, rgba(255,255,255,0) 58%),
    var(--surface);
}
.ack--success { --ack-hue: var(--st-approved);  --ack-tint: var(--st-approved-bg);  --ack-line: rgba(19,122,63,0.24); }
.ack--error   { --ack-hue: var(--st-rejected);  --ack-tint: var(--st-rejected-bg);  --ack-line: rgba(194,22,26,0.24); }
.ack--void    { --ack-hue: var(--st-cancelled); --ack-tint: var(--st-cancelled-bg); --ack-line: rgba(147,38,79,0.24); }
.ack__body { padding: 30px 26px 22px; display: flex; flex-direction: column; align-items: center; }
.ack__badge {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ack-hue);
  border: 1px solid var(--ack-line);
  box-shadow: 0 0 0 9px var(--ack-tint);
  animation: ack-badge-in 420ms var(--ease-out) backwards;
}
.ack__badge svg { width: 26px; height: 26px; }
.ack__title {
  margin: 18px 0 6px;
  font-family: var(--f-head);
  font-size: 20px; font-weight: 700;
  letter-spacing: -0.01em;
}
.ack__text { margin: 0; max-width: 42ch; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.ack__subject {
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px dashed var(--ack-line);
  border-radius: var(--r-md);
  background: var(--surface-alt);
  text-align: left;
}
.ack__eyebrow {
  display: block;
  margin-bottom: 8px;
  font-family: var(--f-head);
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3);
}
.ack__foot { padding: 0 26px 24px; }
.ack__foot .btn { width: 100%; height: 42px; }
/* A refused dismissal (backdrop / Esc) shakes its head instead of closing. */
.ack.is-nudged { animation: ack-nudge 280ms var(--ease-out); }
@keyframes ack-badge-in {
  from { transform: scale(0.55); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
@keyframes ack-nudge {
  0%, 100% { transform: translateX(0); }
  30%      { transform: translateX(-7px); }
  60%      { transform: translateX(6px); }
  80%      { transform: translateX(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .ack__badge { animation: none; }
  .ack.is-nudged { animation: none; }
}

/* ------------------------------------------------------------
   Meter / Progress
   ------------------------------------------------------------ */
.meter {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.meter__fill {
  height: 100%;
  background: var(--st-approved);
  transition: width var(--dur-med) var(--ease-out), background var(--dur-fast);
}
.meter__fill--warn   { background: var(--warning); }
.meter__fill--danger { background: var(--st-rejected); }

.meter-block { margin-bottom: 10px; }
.meter-block__head {
  display: flex; justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}
.meter-block__label {
  color: var(--text-2);
  font-family: var(--f-head);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}
.meter-block__value { font-family: var(--f-mono); }
.meter-block__max   { color: var(--text-2); }

/* ------------------------------------------------------------
   KPI Card
   ------------------------------------------------------------ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-grid--4 { grid-template-columns: repeat(4, 1fr); }

.kpi-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--dur-fast);
}
.kpi-card:hover { box-shadow: var(--shadow-sm); }
.kpi-card__label {
  font-family: var(--f-head);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
}
.kpi-card__value {
  font-family: var(--f-head);
  font-size: 32px; font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 10px;
  color: var(--ink);
}
.kpi-card__meta { font-size: 13px; color: var(--text-2); margin-top: 6px; }
.kpi-card__accent {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--brand-red);
}
.kpi-card--warn   .kpi-card__accent { background: var(--warning); }
.kpi-card--ok     .kpi-card__accent { background: var(--st-approved); }
.kpi-card--info   .kpi-card__accent { background: var(--st-printed); }
.kpi-card--purple .kpi-card__accent { background: var(--st-reprint); }
.kpi-card--teal   .kpi-card__accent { background: var(--st-awaiting); }

/* ------------------------------------------------------------
   Section Label
   ------------------------------------------------------------ */
.section-label {
  font-family: var(--f-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label__rule { flex: 1; height: 1px; background: var(--border); }
.section-label__action { margin-left: auto; font-weight: 500; }

/* ------------------------------------------------------------
   Data Table
   ------------------------------------------------------------ */
.dtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.dtable__head { background: var(--surface-alt); }
.dtable__th {
  text-align: left;
  font-family: var(--f-head);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.dtable__th--right  { text-align: right; }
.dtable__th--center { text-align: center; }
.dtable__td {
  padding: 0 14px;
  height: 48px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.dtable tbody tr { transition: background var(--dur-fast); }
.dtable tbody tr:hover { background: var(--surface-alt); cursor: pointer; }
.dtable tbody tr:last-child .dtable__td { border-bottom: 0; }
.dtable__td--mono    { font-family: var(--f-mono); font-size: 12px; }
.dtable__td--num     { font-family: var(--f-mono); text-align: right; }
.dtable__td--right   { text-align: right; }
.dtable__td--bold    { font-weight: 700; }
.dtable__td--meta    { color: var(--text-2); font-size: 11px; }
.dtable__td--ellipsis{ max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dtable__step        { font-size: 11px; color: var(--text-2); font-family: var(--f-mono); margin-top: 3px; }
.dtable__chev        { width: 14px; height: 14px; color: var(--text-3); }
.dtable__tfoot-row   { background: var(--surface-alt); }
.dtable__tfoot-row .dtable__td {
  font-family: var(--f-head); font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase; font-size: 11px;
}

/* ------------------------------------------------------------
   Stack Card (mobile)
   ------------------------------------------------------------ */
.stack-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 10px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}
.stack-card__head { display: flex; justify-content: space-between; align-items: center; }
.stack-card__code { font-family: var(--f-mono); font-weight: 700; font-size: 14px; }
.stack-card__grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 12px;
  margin: 0;
}
.stack-card__cell { }
.stack-card__label {
  font-family: var(--f-head);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-2);
}
.stack-card__val { margin: 0; }

/* ------------------------------------------------------------
   Empty State / Skeleton / Alert Banner
   ------------------------------------------------------------ */
.empty-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-2);
}
.empty-state__icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border-radius: 50%;
  color: var(--text-3);
}
.empty-state__title {
  font-family: var(--f-head);
  font-size: 16px; font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
}
.empty-state__sub { margin: 0; }
.empty-state__action { margin-top: 16px; }

.skeleton {
  background: linear-gradient(90deg, #F1F3F6 0%, #E6E8EC 50%, #F1F3F6 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: var(--r-xs);
}
@keyframes skeleton-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.is-loading { pointer-events: none; opacity: 0.85; position: relative; }

.alert-banner {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 14px;
  margin-bottom: 12px;
}
.alert-banner__icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-banner__title { display: block; font-weight: 700; }
.alert-banner__body { flex: 1; line-height: 1.5; }
.alert-banner--info    { background: var(--st-printed-bg);  color: var(--st-printed);  border-color: rgba(12,91,180,0.20); }
.alert-banner--warning { background: var(--st-approval-bg); color: var(--st-approval); border-color: rgba(197,138,4,0.30); }
.alert-banner--success { background: var(--st-approved-bg); color: var(--st-approved); border-color: rgba(19,122,63,0.25); }
.alert-banner--error   { background: var(--st-rejected-bg); color: var(--st-rejected); border-color: rgba(194,22,26,0.25); }
.alert-banner--neutral { background: var(--surface-alt);    color: var(--text-2);     border-color: var(--border); }

/* ------------------------------------------------------------
   Stepper
   ------------------------------------------------------------ */
.stepper {
  display: flex; align-items: center;
  margin: 0 0 24px;
  padding: 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  list-style: none;
}
.stepper__item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  flex: 1;
  position: relative;
}
.stepper__item:not(:last-child)::after {
  content: ""; position: absolute;
  right: -1px; top: 50%;
  width: 14px; height: 1px;
  background: var(--border-strong);
}
.stepper__num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  display: grid; place-items: center;
  font-family: var(--f-head); font-weight: 700;
  font-size: 14px;
  color: var(--text-2);
  flex-shrink: 0;
  transition: all var(--dur-fast);
}
.stepper__item--active .stepper__num {
  background: var(--brand-red); color: white; border-color: var(--brand-red);
  box-shadow: 0 0 0 4px var(--brand-red-tint);
}
.stepper__item--done .stepper__num {
  background: var(--st-approved); color: white; border-color: var(--st-approved);
}
.stepper__text {
  font-family: var(--f-head); font-size: 12px; font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stepper__item--active .stepper__text,
.stepper__item--done   .stepper__text { color: var(--text); }

/* ------------------------------------------------------------
   Pipeline Tracker
   ------------------------------------------------------------ */
.pipe { position: relative; padding-left: 8px; margin: 0; list-style: none; }
.pipe__step { position: relative; padding: 0 0 20px 32px; }
.pipe__step:last-child { padding-bottom: 0; }
.pipe__step::before {
  content: ""; position: absolute;
  left: 10px; top: 22px; bottom: -4px;
  width: 2px;
  background: var(--border-strong);
}
.pipe__step:last-child::before { display: none; }
.pipe__dot {
  position: absolute;
  left: 0; top: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--border-strong);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  color: var(--text-2);
  font-family: var(--f-head);
}
.pipe__step--approved .pipe__dot { background: var(--st-approved); border-color: var(--st-approved); color: white; }
.pipe__step--rejected .pipe__dot { background: var(--st-rejected); border-color: var(--st-rejected); color: white; }
.pipe__step--pending  .pipe__dot { background: var(--warning); border-color: var(--warning); color: white; }
.pipe__step--approved::before { background: var(--st-approved); }

.pipe__name {
  font-family: var(--f-head);
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.02em;
}
.pipe__meta {
  font-size: 12px; color: var(--text-2);
  margin-top: 2px;
  display: flex; gap: 8px; align-items: center;
}
.pipe__time { font-family: var(--f-mono); margin-left: auto; font-size: 11px; }
.pipe__remarks {
  margin-top: 8px;
  font-size: 12px;
  background: var(--surface-alt);
  padding: 9px 12px;
  border-radius: var(--r-sm);
  border-left: 2px solid var(--border-strong);
  line-height: 1.5;
}
.pipe__step--rejected .pipe__remarks {
  border-left-color: var(--st-rejected);
  background: var(--st-rejected-bg);
}
.pipe__sig { margin-top: 8px; display: flex; gap: 10px; align-items: center; }
.pipe__sig-note { font-size: 11px; color: var(--text-2); }

/* Cancellation banner above the approval trail — a fully approved ticket that a
   fleet manager later voided. Mulberry "terminated by authority", distinct from
   the rejection red, with the mandatory reason quoted beneath. */
.pipe-cancel {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border-left: 3px solid var(--st-cancelled);
  background: var(--st-cancelled-bg);
}
.pipe-cancel__head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--st-cancelled);
}
.pipe-cancel__head svg { width: 15px; height: 15px; flex-shrink: 0; }
.pipe-cancel__head strong { font-family: var(--f-head); letter-spacing: 0.01em; }
.pipe-cancel__reason {
  margin-top: 7px; padding-top: 7px;
  border-top: 1px solid rgba(147,38,79,0.18);
  font-size: 12px; line-height: 1.5; color: var(--text-2);
}

/* ------------------------------------------------------------
   Signature Thumb
   ------------------------------------------------------------ */
.sig-thumb {
  height: 32px; padding: 2px 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  font-family: "Brush Script MT", "Lucida Handwriting", cursive;
  font-size: 18px;
  color: var(--ink);
  display: inline-flex; align-items: center;
  font-style: italic;
}

/* ------------------------------------------------------------
   QR Code (placeholder)
   ------------------------------------------------------------ */
.qr-code {
  display: inline-block;
  background:
    repeating-linear-gradient(0deg,  var(--ink) 0 4px, transparent 4px 8px),
    repeating-linear-gradient(90deg, var(--ink) 0 4px, transparent 4px 8px);
  background-blend-mode: multiply;
  background-color: white;
  border: 4px solid white;
  outline: 1px solid var(--ink);
}
.qr-code__placeholder { display: none; }

/* ------------------------------------------------------------
   Nav Rail
   ------------------------------------------------------------ */
.app-shell {
  display: grid;
  /* The rail track is owned by --rail-w (declared + responsively retuned
     in core/site.css) — never hard-size it here or in a media query. */
  grid-template-columns: var(--rail-w, 248px) 1fr;
  grid-template-rows: var(--topbar-h, 60px) 1fr;
  height: 100vh;
  width: 100vw;
  transition: grid-template-columns var(--dur-med) var(--ease-out);
}
.nav-rail {
  background: var(--ink);
  color: #D8DCE3;
  grid-row: 1 / 3;
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.04);
  container: rail / inline-size;
  overflow-x: hidden;
}
.nav-rail__logo {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.nav-rail__mark {
  background: #fff;
  border-radius: var(--r-sm);
  width: 40px; height: 40px;
  padding: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-rail__mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.nav-rail__brand {
  display: flex; flex-direction: column; gap: 3px;
  flex: 1; min-width: 0; align-items: flex-start;
}
.nav-rail__title {
  font-family: var(--f-head);
  font-size: 18px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: #fff;
  line-height: 1;
}
.nav-rail__text {
  font-family: var(--f-head);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--brand-red-soft);
  line-height: 1;
}
/* Brand sweep — one light pass crawls left→right through the brand lockup
   and loops forever. Each line clips a 200%-wide gradient tile to its own
   glyphs and shifts it by exactly one tile width per cycle (-200%), so the
   loop is seamless. The band sits in the back half (64–86%) of the tile, so
   the resting frame (position-x 0) — which is also the reduced-motion and
   no-clip fallback — shows the plain brand colors.
   · title:    red band sweeping through the white glyphs, full height
   · subtitle: white band sweeping through the red glyphs, confined to a
     bottom-anchored strip 25% of the line height (layer 1, repeat-x so it
     never tiles upward) over the static red fill (layer 2). */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .nav-rail__title {
    background-image: linear-gradient(105deg,
      #fff 0%, #fff 64%,
      var(--brand-red-soft) 70%,
      var(--brand-red) 75%,
      var(--brand-red-soft) 80%,
      #fff 86%, #fff 100%);
    background-size: 200% 100%;
    background-position: 0% 0%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: bt-brand-sweep 4.5s linear infinite;
  }
  .nav-rail__text {
    background-image:
      linear-gradient(105deg,
        rgba(255,255,255,0) 0%, rgba(255,255,255,0) 64%,
        rgba(255,255,255,0.65) 70%,
        #fff 75%,
        rgba(255,255,255,0.65) 80%,
        rgba(255,255,255,0) 86%, rgba(255,255,255,0) 100%),
      linear-gradient(var(--brand-red-soft), var(--brand-red-soft));
    background-size: 200% 25%, 100% 100%;
    background-position: 0% 100%, 0% 0%;
    background-repeat: repeat-x, no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: bt-brand-sweep 4.5s linear infinite;
  }
}
@keyframes bt-brand-sweep {
  to { background-position-x: -200%; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-rail__title,
  .nav-rail__text { animation: none; }
}
.nav-rail__collapse {
  margin-left: auto;
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #9CA3AF;
  display: grid; place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-rail__collapse:hover { color: #fff; border-color: rgba(255,255,255,0.20); }
.nav-rail__collapse:focus-visible { outline: none; border-color: var(--brand-red); box-shadow: var(--shadow-ring); }
/* On touch it is the only nav toggle — give it a full-size target. */
@media (pointer: coarse) {
  .nav-rail__collapse { width: 44px; height: 44px; }
}
.nav-rail__scroll { flex: 1; overflow-y: auto; padding: 10px 0 16px; }
.nav-rail__group-label {
  font-family: var(--f-head);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: #6B7585;
  padding: 16px 20px 8px;
}
.nav-rail__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  color: #C7CCD5;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  border-left: 2px solid transparent;
  text-decoration: none;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.nav-rail__item:hover { background: rgba(255,255,255,0.03); color: white; }
.nav-rail__item--active {
  background: linear-gradient(to right, rgba(225,6,0,0.14), rgba(225,6,0,0));
  color: white;
  border-left-color: var(--brand-red);
}
.nav-rail__icon { width: 18px; height: 18px; color: #8A93A2; flex-shrink: 0; }
.nav-rail__badge {
  margin-left: auto;
  background: var(--brand-red);
  color: white;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  font-family: var(--f-mono);
}
.nav-rail__foot {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: #6B7585;
}
.nav-rail__status-dot { width: 8px; height: 8px; border-radius: 4px; background: #16A34A; }

/* ------------------------------------------------------------
   Condensed (icon-only) rail
   The rail's width is owned by the .app-shell grid track via
   --rail-w (value logic in core/site.css), and the contents
   condense to icons via a container query keyed on the rail's
   own rendered width — so the same rules serve the collapsed
   desktop rail, the tablet default, the phone strip, and the
   expanded phone flyout (248px keeps its labels) alike.
   ------------------------------------------------------------ */
.nav-rail__label, .nav-rail__group-label, .nav-rail__foot-text { white-space: nowrap; }

@container rail (max-width: 140px) {
  .nav-rail__title,
  .nav-rail__text,
  .nav-rail__foot-text,
  .nav-rail__badge { display: none; }

  .nav-rail__logo {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 8px;
  }
  .nav-rail__brand { flex: none; align-items: center; }
  .nav-rail__collapse { margin-left: 0; }

  .nav-rail__group-label {
    margin: 8px 14px 0;
    padding: 8px 0 0;
    border-top: 1px solid rgba(255,255,255,0.07);
    font-size: 0;
  }

  .nav-rail__item {
    justify-content: center;
    gap: 0;
    padding-left: 0;
    padding-right: 0;
  }
  .nav-rail__label { display: none; }

  .nav-rail__foot {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }
}

/* ------------------------------------------------------------
   Top Bar
   ------------------------------------------------------------ */
.top-bar {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  height: var(--topbar-h, 60px);
}
.top-bar__crumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.top-bar__crumb-trail   { color: var(--text-2); }
.top-bar__crumb-current { font-family: var(--f-head); font-weight: 700; font-size: 17px; color: var(--text); }
.top-bar__spacer { flex: 1; }
.top-bar__search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 7px 12px;
  width: 320px;
  color: var(--text-2);
  font-size: 14px;
}
.top-bar__search:focus-within {
  background: var(--surface); border-color: var(--brand-red);
  box-shadow: var(--shadow-ring);
}
.top-bar__search-icon  { width: 14px; height: 14px; }
.top-bar__search-input { background: transparent; border: 0; outline: none; flex: 1; font-size: 14px; }
.top-bar__search-kbd {
  font-family: var(--f-mono); font-size: 10px;
  background: white;
  border: 1px solid var(--border);
  padding: 1px 5px; border-radius: 3px;
  color: var(--text-2);
}
.top-bar__icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  display: grid; place-items: center;
  position: relative;
  cursor: pointer;
}
.top-bar__dot {
  position: absolute; top: 4px; right: 4px;
  background: var(--brand-red); color: white;
  font-family: var(--f-mono); font-size: 9px; font-weight: 700;
  border-radius: 8px; min-width: 16px; padding: 1px 4px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.top-bar__user-wrap { position: relative; }
.top-bar__user {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--r-md);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--f-body);
}
.top-bar__user:hover { background: var(--surface-alt); }
.top-bar__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ink-2); color: white;
  display: grid; place-items: center;
  font-family: var(--f-head); font-weight: 700;
  font-size: 14px;
}
.top-bar__user-info { line-height: 1.2; text-align: left; }
.top-bar__user-name { font-size: 14px; font-weight: 600; }
.top-bar__user-role {
  font-family: var(--f-head);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-2);
  display: flex; align-items: center; gap: 4px;
}
.top-bar__sig-on-file { color: var(--st-approved); }
.top-bar__chev { width: 14px; height: 14px; color: var(--text-2); }

/* ------------------------------------------------------------
   Map View
   ------------------------------------------------------------ */
.map-view {
  position: relative;
  background: #EAEEF3;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background-image:
    linear-gradient(rgba(14,17,22,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14,17,22,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}
.map-view__road { position: absolute; inset: 0; pointer-events: none; }
.map-view__pin {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.map-view__pin-badge {
  background: white;
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--r-xs);
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  font-family: var(--f-head);
}
.map-view__pin-dot {
  width: 16px; height: 16px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--brand-red);
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.map-view__pin--origin .map-view__pin-dot { background: var(--st-approved); }
.map-view__pin--dest   .map-view__pin-dot { background: var(--brand-red); }
.map-view__info {
  position: absolute; bottom: 12px; left: 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  box-shadow: var(--shadow-sm);
  display: flex; gap: 14px; align-items: center;
}
.map-view__info-label { font-size: 10px; color: var(--text-2); font-family: var(--f-head); letter-spacing: 0.08em; text-transform: uppercase; }
.map-view__info-value { font-family: var(--f-mono); font-weight: 700; font-size: 14px; }
.map-view__info-sep   { width: 1px; height: 28px; background: var(--border); }

/* ------------------------------------------------------------
   Printable Ticket
   ------------------------------------------------------------ */
.printable {
  background: white;
  padding: 32px 36px;
  width: 760px;
  margin: 0 auto;
  position: relative;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
  box-shadow: var(--shadow-md);
}
.printable--watermark::before {
  content: attr(data-watermark);
  position: absolute; inset: 0;
  font-family: var(--f-head);
  font-size: 110px; font-weight: 800;
  color: rgba(14,17,22,0.04);
  display: grid; place-items: center;
  transform: rotate(-22deg);
  pointer-events: none;
  letter-spacing: 0.04em;
}
.printable > * { position: relative; }
.printable__copy-label {
  position: absolute;
  top: 18px; right: 30px;
  background: var(--ink);
  color: white;
  font-family: var(--f-head);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em;
  padding: 4px 10px;
  border-radius: 3px;
}
.printable__hdr {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 16px;
  margin-bottom: 14px;
  position: relative;
}
.printable__hdr::after {
  content: ""; position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px; background: var(--brand-red);
}
.printable__hdr-brand { display: flex; gap: 14px; align-items: flex-start; }
.printable__logo {
  width: 52px; height: 52px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: grid; place-items: center;
  padding: 4px;
}
.printable__logo img { width: 100%; height: 100%; object-fit: contain; }
.printable__co-name {
  font-family: var(--f-head);
  font-size: 22px; font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.printable__co-addr,
.printable__co-line { margin: 0; font-size: 11px; color: var(--text-2); line-height: 1.4; }
.printable__hdr-meta { text-align: right; }
.printable__code     { font-family: var(--f-mono); font-size: 14px; font-weight: 700; }
.printable__issued   { font-size: 10px; color: var(--text-2); margin-top: 2px; }
.printable__title {
  text-align: center;
  font-family: var(--f-head);
  font-size: 18px; font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 10px 0 16px;
}
.printable__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin: 0 0 14px;
}
.printable__row {
  display: flex; gap: 8px;
  border-bottom: 1px dotted #D5D9DF;
  padding-bottom: 4px;
  margin: 0;
}
.printable__row-lbl {
  font-family: var(--f-head);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-2);
  min-width: 92px;
  margin: 0;
}
.printable__row-val { font-weight: 600; font-size: 12px; margin: 0; flex: 1; }
.printable__section-title {
  font-family: var(--f-head);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--ink); color: white;
  padding: 5px 12px;
  margin: 14px 0 8px;
  border-left: 3px solid var(--brand-red);
}
.printable__box {
  padding: 8px;
  border: 1px solid var(--border-strong);
  font-size: 12px;
  margin-bottom: 8px;
}
.printable__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-bottom: 8px;
}
.printable__table th,
.printable__table td {
  border: 1px solid var(--border-strong);
  padding: 6px 8px;
  text-align: left;
}
.printable__table th {
  background: var(--surface-alt);
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.printable__num { text-align: right; font-family: var(--f-mono); }
.printable__sigs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}

/* ------------------------------------------------------------
   Responsive — overrides whose BASE rules live in this file, so
   they must sit after them (equal specificity → later source wins).
   These previously lived in core/site.css and never applied, because
   that sheet loads before this one. See the note in core/site.css.
   Placed here (after the four bases: .kpi-grid, .stepper, .top-bar,
   .printable__sigs) rather than at EOF, which is actively growing.
   ------------------------------------------------------------ */
@media (max-width: 1279px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .stepper { flex-direction: column; align-items: stretch; }
  .stepper__item:not(:last-child)::after { display: none; }

  .printable__sigs { grid-template-columns: repeat(2, 1fr); }

  /* Top bar slims beside the rail strip: screen name only — no global
     search (a desktop affordance), and an avatar-only user chip. */
  .top-bar { padding: 0 12px; gap: 10px; }
  .top-bar__search,
  .top-bar__crumb-trail,
  .top-bar__user-info,
  .top-bar__chev { display: none; }
  .top-bar__crumb { min-width: 0; }
  .top-bar__crumb-current { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.printable__sig {
  border: 1px solid var(--border-strong);
  padding: 8px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-height: 90px;
  justify-content: space-between;
  border-radius: var(--r-xs);
}
.printable__sig-img {
  font-family: "Brush Script MT", "Lucida Handwriting", cursive;
  font-style: italic;
  font-size: 22px;
  color: var(--ink);
}
.printable__sig-blank { height: 22px; }
.printable__sig-line { width: 100%; border-top: 1px solid var(--ink); padding-top: 4px; text-align: center; }
.printable__sig-name { font-family: var(--f-head); font-size: 11px; font-weight: 700; }
.printable__sig-title { font-size: 10px; color: var(--text-2); }
.printable__sig-time  { font-size: 9px; color: var(--text-2); margin-top: 2px; font-family: var(--f-mono); }
.printable__foot {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border-strong);
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--text-2);
}
.printable__code-tiny { font-family: var(--f-mono); }

@media print {
  body > *:not(.printable) { display: none !important; }
  .printable { box-shadow: none; border: 0; }
}

/* ------------------------------------------------------------
   Top bar — user menu dropdown
   ------------------------------------------------------------ */
.top-bar__chev { transition: transform var(--dur-fast) var(--ease-out); }
.top-bar__user-wrap--open .top-bar__chev { transform: rotate(180deg); }
.top-bar__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 224px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              visibility var(--dur-fast);
}
.top-bar__user-wrap--open .top-bar__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.top-bar__menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 4px; }
.top-bar__menu-name { font-weight: 600; font-size: 14px; }
.top-bar__menu-sub {
  font-size: 10px; color: var(--text-2);
  font-family: var(--f-head); letter-spacing: 0.10em; text-transform: uppercase;
  margin-top: 2px;
}
.top-bar__menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 9px 10px;
  border: 0; background: transparent;
  border-radius: var(--r-sm);
  font-family: var(--f-body); font-size: 14px; color: var(--text);
  text-decoration: none; cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.top-bar__menu-item svg { width: 15px; height: 15px; color: var(--text-3); }
.top-bar__menu-item:hover { background: var(--surface-2); }
.top-bar__menu-item--danger { color: var(--st-rejected); }
.top-bar__menu-item--danger svg { color: var(--st-rejected); }
.top-bar__menu-item--danger:hover { background: var(--st-rejected-bg); }
.top-bar__menu-sep { height: 1px; background: var(--border-soft); margin: 4px 0; }

/* ------------------------------------------------------------
   Notifications — top-bar bell + dropdown feed.
   Hydrated by js/core/notifications.js from GET /api/notifications/feed
   and kept live over the SignalR hub (/hubs/notifications): the badge
   pops + pings and the bell rings on arrival (animations.css), and
   unread rows decay their tint as they're read. The dropdown rides the
   shared .top-bar__menu open/close transition, keyed on the wrap's
   --open modifier exactly like the user menu.
   ------------------------------------------------------------ */
.top-bar__notif-wrap { position: relative; }
.top-bar__notif-wrap--open .top-bar__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.top-bar__bell { display: block; }
.top-bar__dot--notif { pointer-events: none; }

.notif-menu { width: 372px; padding: 0; overflow: hidden; }
.notif-menu__head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.notif-menu__title {
  font-family: var(--f-head); font-weight: 700; font-size: 14px;
  letter-spacing: 0.02em;
}
.notif-menu__unread {
  font-family: var(--f-mono); font-size: 10px; font-weight: 700;
  color: white; background: var(--brand-red);
  border-radius: 9px; padding: 2px 7px;
}
.notif-menu__mark-all {
  margin-left: auto;
  border: 0; background: transparent;
  font-family: var(--f-body); font-size: 12px; font-weight: 600;
  color: var(--st-printed);
  padding: 4px 8px; border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.notif-menu__mark-all:hover { background: var(--st-printed-bg); }
.notif-menu__list {
  max-height: 388px; overflow-y: auto;
  padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.notif-menu__all {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 12px;
  border-top: 1px solid var(--border-soft);
  font-family: var(--f-body); font-size: 13px; font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.notif-menu__all:hover { background: var(--surface-2); color: var(--text); }
.notif-menu__all svg { width: 13px; height: 13px; transition: transform var(--dur-fast) var(--ease-out); }
.notif-menu__all:hover svg { transform: translateX(3px); }
.notif-menu__empty { padding: 28px 16px 30px; text-align: center; }
.notif-menu__empty svg { width: 28px; height: 28px; color: var(--st-approved); }
.notif-menu__empty svg.is-error { color: var(--st-rejected); }
.notif-menu__empty-title { margin-top: 8px; font-family: var(--f-head); font-weight: 700; font-size: 13px; }
.notif-menu__empty-sub { margin-top: 2px; font-size: 12px; color: var(--text-2); }

/* One notification row — shared by the dropdown and the /notifications
   page (the page widens it via .notifs__list overrides). The unread
   state is a left accent rail + a soft brand tint; both transition out
   smoothly when the row is marked read. */
.notif-item {
  position: relative;
  display: flex; gap: 10px; align-items: flex-start;
  width: 100%; text-align: left;
  padding: 10px 12px 10px 16px;
  border: 0; background: transparent;
  border-radius: var(--r-sm);
  font-family: var(--f-body);
  cursor: pointer;
  transition: background var(--dur-med) var(--ease-out);
}
.notif-item:hover, .notif-item:focus-visible { background: var(--surface-2); outline: none; }
.notif-item:focus-visible { box-shadow: inset 0 0 0 2px var(--brand-red-line); }
.notif-item::before {
  content: "";
  position: absolute; left: 5px; top: 12px; bottom: 12px; width: 3px;
  border-radius: 2px;
  background: var(--brand-red);
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease-out);
}
.notif-item--unread { background: rgba(225, 6, 0, 0.045); }
.notif-item--unread::before { opacity: 1; }
.notif-item--unread:hover, .notif-item--unread:focus-visible { background: rgba(225, 6, 0, 0.08); }
.notif-item--unread .notif-item__title { font-weight: 700; }

.notif-stamp {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2);
}
.notif-stamp svg { width: 15px; height: 15px; }
.notif-stamp--requested { background: var(--st-printed-bg);  color: var(--st-printed); }
.notif-stamp--approved  { background: var(--st-approved-bg); color: var(--st-approved); }
.notif-stamp--rejected  { background: var(--st-rejected-bg); color: var(--st-rejected); }

.notif-item__body { flex: 1; min-width: 0; }
.notif-item__top { display: flex; align-items: baseline; gap: 8px; }
.notif-item__title {
  font-size: 13px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notif-item__time {
  margin-left: auto; flex-shrink: 0;
  font-family: var(--f-mono); font-size: 10px; color: var(--text-3);
}
.notif-item__text {
  margin-top: 2px;
  font-size: 12px; line-height: 1.5; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Loading shimmer rows (uses the shared .skeleton block) */
.notif-skel { display: flex; gap: 10px; padding: 10px 12px 10px 16px; }
.notif-skel__stamp { width: 32px; height: 32px; border-radius: var(--r-md); flex-shrink: 0; }
.notif-skel__body { flex: 1; display: flex; flex-direction: column; gap: 7px; padding-top: 3px; }

/* ------------------------------------------------------------
   Context menu — body-portaled row/overflow menu.
   Opened by BT.openMenu(anchor, items) (js/core/site.js): the element is
   appended to <body> and positioned `fixed` from the anchor's rect, so it can
   never be clipped by an overflow container or painted under a table row's
   stacking context (the entrance animation in animations.css makes every
   tbody row a transient stacking context — an absolutely-positioned menu
   inside the row loses to the rows after it).
   ------------------------------------------------------------ */
.ctx-menu {
  position: fixed;
  min-width: 184px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: var(--z-menu);
  margin: 0;
}
.ctx-menu[hidden] { display: none; }
.ctx-menu__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 9px 10px;
  border: 0; background: transparent;
  border-radius: var(--r-sm);
  font-family: var(--f-body); font-size: 13px; color: var(--text);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.ctx-menu__item svg { width: 14px; height: 14px; color: var(--text-3); }
.ctx-menu__item:hover,
.ctx-menu__item:focus-visible { background: var(--surface-2); outline: none; }
.ctx-menu__item:focus-visible { box-shadow: inset 0 0 0 2px var(--brand-red-line); }
.ctx-menu__item--danger { color: var(--st-rejected); }
.ctx-menu__item--danger svg { color: var(--st-rejected); }
.ctx-menu__item--danger:hover,
.ctx-menu__item--danger:focus-visible { background: var(--st-rejected-bg); }
.ctx-menu__sep { height: 1px; background: var(--border-soft); margin: 4px 0; }

/* ------------------------------------------------------------
   Toast — transient feedback after async actions.
   Created by BT.toast(message, kind) (js/core/site.js) inside a fixed
   aria-live region; auto-dismisses, click to dismiss early.
   ------------------------------------------------------------ */
.toast-region {
  position: fixed; top: 72px; right: 24px;
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: 8px;
  max-width: 360px;
  pointer-events: none;        /* the region never blocks the page… */
}
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  cursor: pointer;             /* click to dismiss */
  pointer-events: auto;        /* …but each toast is interactive */
  transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
}
.toast svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.toast--success { border-color: rgba(19,122,63,0.30); color: var(--st-approved); }
.toast--error   { border-color: rgba(194,22,26,0.30); color: var(--st-rejected); }
.toast__text { color: var(--text); }
.toast.is-leaving { opacity: 0; transform: translateX(12px); }

@media (max-width: 767px) {
  .toast-region { left: 16px; right: 16px; max-width: none; }
}

/* ------------------------------------------------------------
   Signature panel — drop zone + immediate upload. Shared by the
   Users edit modal and the Signatories signature modal; commits
   through PUT /api/users/{id}/signature independently of any
   surrounding form.
   Every .sig-stage rule is scoped under .sig-panel: the profile
   screen has its own, unrelated .sig-stage (a plain signature-pad
   container in pages/profile/site.css) that must not inherit the
   drop-zone treatment now that this block is global.
   ------------------------------------------------------------ */
.sig-panel { margin-bottom: 14px; }
.sig-panel [hidden] { display: none !important; }   /* buttons/img set explicit display */

/* The stage doubles as drop target and preview frame. A signing baseline with
   the paper-form "×" marker gives it context; an uploaded image rests on the
   line, multiply-blended so white JPG backgrounds soak into the surface. */
.sig-panel .sig-stage {
  position: relative;
  display: grid; place-items: center;
  min-height: 132px;
  padding: 18px 16px 30px;
  background: var(--surface-2);
  border: 1.5px dashed var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
}
.sig-panel .sig-stage::before {                /* signing baseline */
  content: "";
  position: absolute;
  left: 14%; right: 14%; bottom: 26px;
  border-bottom: 1px solid var(--border);
}
.sig-panel .sig-stage::after {                 /* the "×" beside the line, like a paper form */
  content: "\00d7";
  position: absolute;
  left: calc(14% - 16px); bottom: 27px;
  font-family: var(--f-head);
  font-size: 12px; line-height: 1;
  color: var(--text-3);
}
.sig-panel .sig-stage:hover,
.sig-panel .sig-stage:focus-visible,
.sig-panel .sig-stage.is-dragover {
  border-color: var(--brand-red);
  background: var(--surface);
  box-shadow: var(--shadow-ring);
  outline: none;
}
.sig-panel .sig-stage.is-dragover { border-style: solid; }
.sig-panel .sig-stage.is-loading { opacity: 0.55; pointer-events: none; }

.sig-panel .sig-stage__img {
  max-height: 96px; max-width: 78%;
  object-fit: contain;
  mix-blend-mode: multiply;         /* ink on paper, even for white-background JPGs */
  transform: translateY(8px);       /* rest the strokes on the baseline */
}

.sig-panel .sig-stage__empty { display: grid; justify-items: center; gap: 6px; text-align: center; }
.sig-panel .sig-stage__badge {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.sig-panel .sig-stage__badge svg { width: 16px; height: 16px; }
.sig-panel .sig-stage:hover .sig-stage__badge,
.sig-panel .sig-stage.is-dragover .sig-stage__badge {
  color: var(--brand-red);
  border-color: var(--brand-red);
  transform: translateY(-2px);
}
.sig-panel .sig-stage__title { font-family: var(--f-head); font-size: 13px; font-weight: 600; }
.sig-panel .sig-stage__hint { font-size: 11.5px; color: var(--text-3); }
.sig-panel .sig-stage__browse { color: var(--brand-red); font-weight: 600; }

.sig-panel__error { margin: 8px 0 0; font-size: 12.5px; color: var(--st-rejected); }

.sig-panel__meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-top: 10px;
}
.sig-panel__status { font-size: 12.5px; color: var(--text-2); min-width: 0; }
.sig-panel__status strong { font-family: var(--f-mono); font-weight: 600; color: var(--text); }
.sig-panel__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.sig-panel__remove { color: var(--st-rejected); }
.sig-panel__remove:hover { background: var(--st-rejected-bg); }

.sig-panel > .field__help { display: block; margin-top: 8px; }

/* ------------------------------------------------------------
   Shared Leaflet harness (js/core/map.js) — every map in the app
   mounts through BT.map.create(), so the controls, pin labels,
   wheel-zoom hint, and the full-screen stage are identical on the
   ticket detail, approval inbox, wizard, and the config pickers.
   ------------------------------------------------------------ */

/* Labelled pins: colored letter dot + permanent role chip
   (Starting Site / Destination Site / Supplier). */
.mappin-wrap { background: none; border: 0; }
.mappin {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  color: white; font-family: var(--f-mono); font-size: 12px; font-weight: 700;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(14, 17, 22, 0.45);
}
.mappin--origin   { background: var(--st-approved); }
.mappin--dest     { background: var(--brand-red); }
.mappin--supplier { background: var(--st-printed); }
.mappin--pick     { background: var(--ink); }
.mappin--pick::after {           /* draggable picker pin reads as a target dot */
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: white;
}
.mappin__tag {
  position: absolute;
  left: 31px; top: 50%;
  transform: translateY(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(14, 17, 22, 0.18);
  font-family: var(--f-head); font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
  border-left: 3px solid var(--border);
}
.mappin__tag--origin   { border-left-color: var(--st-approved); }
.mappin__tag--dest     { border-left-color: var(--brand-red); }
.mappin__tag--supplier { border-left-color: var(--st-printed); }
.mappin__tag--pick     { border-left-color: var(--ink); }

/* Recenter + full-screen cluster (top-right, under the zoom control). */
.bt-mapctl { box-shadow: 0 1px 4px rgba(14, 17, 22, 0.18); }
.bt-mapctl__btn {
  display: flex !important;       /* leaflet-bar anchors default to block centering */
  align-items: center; justify-content: center;
  width: 30px; height: 30px;
  color: var(--text) !important;
  cursor: pointer;
}
.bt-mapctl__btn svg { width: 15px; height: 15px; }
.bt-mapctl__btn:hover { background: var(--surface-alt); color: var(--brand-red) !important; }

/* Wheel-zoom teaching pill — fades once the user engages the map. */
.bt-map-hint {
  position: absolute;
  left: 50%; bottom: 10px;
  transform: translateX(-50%);
  z-index: 500;                    /* above tiles, below Leaflet controls (800+) */
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(14, 17, 22, 0.78);
  color: white;
  font-size: 11px; font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease-out);
  white-space: nowrap;
}
@media (hover: hover) {
  .map-stage__map:hover:not(.is-zoom-engaged) .bt-map-hint { opacity: 1; }
}

/* Full-screen stage: the wrapper carries the map AND its linked details
   (address search, lat/lng inputs, legends), so expanding loses nothing.
   .map-stage--on styles both the native :fullscreen element and the
   CSS-fixed fallback (.map-stage--fs supplies the positioning). */
.map-stage--on {
  background: var(--surface);
  padding: 16px;
  overflow: auto;
}
.map-stage--on .map-stage__map {
  /* The map may sit anywhere inside the stage (card bodies, field stacks), so
     it grows by viewport math rather than flex: full height minus the linked
     details riding along (header, search, legend). */
  height: calc(100vh - 280px) !important;
  min-height: 320px;
}
.map-stage--fs {                  /* fallback when the Fullscreen API is unavailable */
  position: fixed; inset: 0;
  z-index: var(--z-mapfs);
}
.bt-fs-lock { overflow: hidden; }

/* Inside Leaflet panes, keep the app font for tooltips/labels. */
.leaflet-container { font-family: var(--f-body, inherit); }
.leaflet-tooltip { font-size: 12px; font-weight: 600; }

/* ------------------------------------------------------------
   Pipeline-step signatures — approved steps render the ACTUAL
   uploaded signature image; the cursive .sig-thumb initials only
   remain as the fallback (no signature on file / image 404 →
   onerror flips .pipe__sig--fallback).
   ------------------------------------------------------------ */
.pipe__sig-img {
  max-height: 36px; max-width: 140px;
  object-fit: contain;
  mix-blend-mode: multiply;          /* ink-on-paper, even for white-background JPGs */
}
.pipe__sig:not(.pipe__sig--fallback) .sig-thumb { display: none; }
.pipe__sig--fallback .pipe__sig-img { display: none; }
