/* ==========================================================================
   components.css, reusable UI pieces
   Naming: block__element--modifier
   ========================================================================== */

/* ==========================================================================
   Icon
   Lucide symbols from /assets/icons/sprite.svg. Stroke follows currentColor.
   ========================================================================== */

.icon {
  display: block;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }
.icon--xl { width: 28px; height: 28px; }

/* Slightly lighter strokes read better at large sizes. */
.icon--xl,
.icon--lg { stroke-width: 1.8; }

/* ==========================================================================
   Button
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  height: var(--control-h);
  padding: 0 var(--sp-15);
  border: 0;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--text);
  font-size: var(--fs-btn);
  font-weight: var(--fw-bold);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              opacity var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}

.btn:active:not(:disabled) { transform: scale(0.98); }

.btn:disabled,
.btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Dark primary, the main commit action on every screen. */
.btn--primary {
  background: var(--ink);
  color: var(--on-dark);
}
.btn--primary:hover:not(:disabled) { background: #1D2040; }

/* Violet accent, brand action (request via shopper, accept quote). */
.btn--accent {
  background: var(--violet);
  color: var(--on-dark);
}
.btn--accent:hover:not(:disabled) { background: #7C43D0; }

/* Outlined, the paired, lower-weight choice. */
.btn--secondary {
  background: var(--panel);
  border: 1px solid var(--line-input);
  color: var(--text);
}
.btn--secondary:hover:not(:disabled) { background: var(--surface-sub); }

/* "Continue with Google", following Google's own button rule: white, a
   hairline border and the full-colour G, which is what .btn--secondary
   already is. */
.btn--social { gap: var(--sp-7); font-weight: var(--fw-semi); }
.btn--social .icon { width: 20px; height: 20px; }

/* The block that holds them, above the email form on sign up and log in. */
.social { display: flex; flex-direction: column; gap: var(--sp-6); }
.social__fine { margin: 0; color: var(--text-soft); font-size: var(--fs-meta); line-height: 1.5; text-align: center; }
.social__fine a { color: var(--text-body); text-decoration: underline; }
.social__or {
  display: flex;
  align-items: center;
  gap: var(--sp-7);
  margin-top: var(--sp-2);
  color: var(--text-soft);
  font-size: var(--fs-meta);
}
.social__or::before,
.social__or::after { content: ''; flex: 1; height: 1px; background: var(--line-input); }

/* Text-only. */
.btn--ghost {
  height: auto;
  padding: var(--sp-3) var(--sp-4);
  color: var(--violet);
  font-size: var(--fs-chip);
}
.btn--ghost:hover:not(:disabled) { background: var(--violet-soft); }

.btn--danger {
  background: var(--red);
  color: var(--on-dark);
}
.btn--danger:hover:not(:disabled) { background: #B02A33; }

.btn--danger-soft {
  background: var(--red-soft);
  color: var(--red);
}

.btn--success {
  background: var(--green);
  color: var(--on-dark);
}

/* Sizes */
.btn--sm { height: var(--control-h-sm); font-size: var(--fs-body); padding: 0 var(--sp-13); }
.btn--xs { height: var(--control-h-xs); font-size: var(--fs-chip); padding: 0 var(--sp-10); }
.btn--block { width: 100%; }

/* Circular icon button */
.btn--icon {
  width: var(--icon-btn);
  height: var(--icon-btn);
  padding: 0;
  border-radius: var(--r-full);
  background: var(--surface-chip);
  color: var(--text-body);
}
.btn--icon-sm { width: var(--icon-btn-sm); height: var(--icon-btn-sm); }

/* Icon button sitting on the dark hero */
.btn--on-dark {
  background: var(--on-dark-fill);
  color: var(--on-dark);
}
.btn--on-dark:hover:not(:disabled) { background: var(--on-dark-fill-2); }

/* Two buttons side by side, equal width */
.btn-pair {
  display: flex;
  gap: var(--sp-6);
}
.btn-pair > .btn { flex: 1; }

/* ==========================================================================
   Form field
   ========================================================================== */

.field { display: flex; flex-direction: column; gap: var(--sp-5); }

.field__label {
  color: var(--text);
  font-size: var(--fs-label);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-label);
}

.field__hint {
  color: var(--text-soft);
  font-size: var(--fs-meta);
  line-height: var(--lh-normal);
}

.field__error {
  display: none;
  color: var(--red);
  font-size: var(--fs-meta);
  font-weight: var(--fw-semi);
}

.field.is-invalid .field__error { display: block; }

/* Standalone errors, ones not wrapped in a .field, such as the country list
   or the ID capture tiles, show as soon as they carry a message. */
.field__error:not(:empty) { display: block; margin-top: var(--sp-4); }
.field.is-invalid .input,
.field.is-invalid .textarea,
.field.is-invalid .select__control,
.field.is-invalid .upload { border-color: var(--red); }

.input,
.textarea,
.select__control {
  width: 100%;
  padding: var(--sp-8);
  border: 1px solid var(--line-input);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}

.input:focus,
.textarea:focus,
.select__control:focus-within {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-tint);
  outline: none;
}

.input:disabled,
.textarea:disabled,
.input[readonly] {
  background: var(--surface-sub);
  color: var(--text-soft);
  cursor: not-allowed;
}

.textarea { min-height: 62px; }
.textarea--tall { min-height: 104px; }

/* Select: native element with our own chevron. */
.select { position: relative; display: block; }

.select select {
  width: 100%;
  padding: var(--sp-8) var(--sp-17) var(--sp-8) var(--sp-8);
  border: 1px solid var(--line-input);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--text);
  font-size: var(--fs-sm);
  appearance: none;
  -webkit-appearance: none;
}

.select select:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-tint);
}

.select select:invalid,
.select select .is-placeholder { color: var(--text-soft); }

.select::after {
  content: '';
  position: absolute;
  top: 50%;
  right: var(--sp-8);
  width: 9px;
  height: 9px;
  margin-top: -6px;
  border-right: 1.7px solid var(--text-soft);
  border-bottom: 1.7px solid var(--text-soft);
  transform: rotate(45deg);
  pointer-events: none;
}

/* Prefixed input, the +254 phone pattern from the registration frame. */
.field__row { display: flex; gap: var(--sp-5); }
.field__prefix {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 88px;
  padding: var(--sp-8);
  border: 1px solid var(--line-input);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--text);
  font-size: var(--fs-sm);
}
.field__row .input { flex: 1; }

/* Country-code picker, the .select component sized to sit beside a phone
   input the same way .field__prefix used to when the code was fixed at
   +254. A country name can run much longer than "+254" ever did, so the
   closed control truncates rather than pushing the phone input off-screen,
   the full name is still there to read once the dropdown opens. */
.field__code { flex-shrink: 0; width: 132px; }
.field__code select {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Checkbox / radio row */
.check {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  cursor: pointer;
}

.check__box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.8px solid var(--text-disabled);
  border-radius: var(--r-sm);
  background: var(--panel);
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}
.check__box--round { border-radius: var(--r-full); }

.check input { position: absolute; opacity: 0; pointer-events: none; }

.check input:checked + .check__box {
  border-color: var(--violet);
  background: var(--violet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 8'%3E%3Cpath d='M1 4 L3.8 6.6 L9 1.2' stroke='%23fff' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px 8px no-repeat;
}

.check input:focus-visible + .check__box { box-shadow: 0 0 0 3px var(--violet-tint); }

.check__label { color: var(--text-body); font-size: var(--fs-chip); }

/* Quantity stepper */
.stepper { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-6); }

.stepper__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  background: var(--surface-chip);
  color: var(--text-body);
  font-size: 15px;
  line-height: 1;
}
.stepper__btn:disabled { opacity: 0.4; }

.stepper__value {
  min-width: 20px;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  text-align: center;
}

/* ==========================================================================
   Option set, pill selectors (source country, payout method, urgency)
   ========================================================================== */

.optionset { display: flex; flex-wrap: wrap; gap: var(--sp-5); }
.optionset--grid { display: grid; grid-template-columns: repeat(2, 1fr); }

.option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-7) var(--sp-8);
  border: 1px solid var(--line-input);
  border-radius: var(--r-thumb);
  background: var(--panel);
  color: var(--text-body);
  font-size: var(--fs-chip);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}

.option:hover { border-color: var(--violet-line); }

.option.is-selected,
.option[aria-pressed='true'] {
  border: 1.5px solid var(--violet);
  background: var(--violet-tint);
  color: var(--text);
  font-weight: var(--fw-bold);
}

.option:disabled,
.option.is-locked {
  background: var(--surface-sub);
  color: var(--text-soft);
  cursor: not-allowed;
}

/* Two-line variant, a title with an explanation under it, used where the
   choice needs a sentence rather than a word (admin pricing mode, request
   type). Left aligned, because the copy is a paragraph, not a label. */
.option--stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-9) var(--sp-10);
  text-align: left;
}
.option__title { color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.option__desc {
  color: var(--text-soft);
  font-size: var(--fs-meta);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
}
.option--stacked.is-selected .option__desc { color: var(--text-body); }

/* Multi-select tag (shopper specialisation) */
.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-4) var(--sp-9);
  border: 1px solid var(--line-input);
  border-radius: var(--r-card);
  background: var(--panel);
  color: var(--text-body);
  font-size: var(--fs-chip);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.tag.is-selected,
.tag[aria-pressed='true'] {
  border-color: var(--violet);
  background: var(--violet);
  color: var(--on-dark);
  font-weight: var(--fw-bold);
}

.tag--static { cursor: default; }

/* The "+" trigger that opens the custom-category input, styled like a tag
   so it sits in the same row, but never gets an is-selected/pressed state
   of its own, it is an action, not one of the options. */
.tag--add {
  padding: var(--sp-4) var(--sp-7);
  color: var(--text-soft);
  border-style: dashed;
}
.tag--add:hover { border-color: var(--violet-line); color: var(--violet); }

/* ==========================================================================
   Upload zone
   ========================================================================== */

.upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-14);
  border: 1.5px dashed var(--violet);
  border-radius: 13px;
  background: var(--violet-tint);
  text-align: center;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}

.upload:hover,
.upload.is-dragover { background: var(--violet-soft); }

.upload input[type='file'] { display: none; }

.upload__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 38px;
  border-radius: 7px;
  background: var(--hatch-violet);
  color: #8A6BC0;
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.upload__title { color: var(--violet); font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.upload__hint  { color: var(--text-soft); font-size: var(--fs-meta); }

/* Optional / secondary variant, dashed grey, laid out as a row. */
.upload--muted {
  flex-direction: row;
  align-items: center;
  gap: var(--sp-6);
  padding: var(--sp-8);
  border-color: var(--text-disabled);
  border-radius: var(--r-thumb);
  background: transparent;
  text-align: left;
}
.upload--muted .upload__icon {
  width: 36px; height: 30px;
  border-radius: var(--sp-3);
  background: var(--hatch-sm);
}
.upload--muted .upload__title { color: var(--text); font-size: var(--fs-chip); }
.upload--muted .upload__hint  { font-size: var(--fs-micro); }

/* Required-and-missing state, used by the scout report price-tag photo. */
.upload.is-required-missing { border-color: var(--red); background: var(--red-soft); }
.upload.is-required-missing .upload__title { color: var(--red); }

.upload__preview {
  position: relative;
  width: 100%;
  border-radius: var(--r-md);
  overflow: hidden;
}
.upload__preview img { width: 100%; height: auto; display: block; }
.upload__remove {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--r-full);
  background: var(--scrim);
  color: var(--on-dark);
  font-size: var(--fs-micro);
}

/* ==========================================================================
   Card
   ========================================================================== */

.card {
  padding: var(--sp-10) var(--sp-11);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--panel);
}

.card--lg     { border-radius: var(--r-lg); }
.card--xl     { border-radius: var(--r-xl); padding: var(--sp-11); }
.card--flush  { padding: 0; overflow: hidden; }
.card--raised { box-shadow: var(--shadow-raise); border-color: transparent; }
.card--tight  { padding: var(--sp-8) var(--sp-11); }

.card__label {
  color: var(--text);
  font-size: var(--fs-label);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-label);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
}

.card__title { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--text-strong); }
.card__meta  { font-size: var(--fs-meta); color: var(--text-soft); }

.card__divider { height: 1px; background: var(--line-divider); border: 0; margin: 0; }

/* A tappable card */
.card--link { display: block; color: inherit; font-weight: inherit; }
.card--link:hover { opacity: 1; border-color: var(--violet-line); }

/* Rows inside a flush card */
.card__row {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  padding: var(--sp-8) var(--sp-11);
  border-bottom: 1px solid var(--line-rule);
}
.card__row:last-child { border-bottom: 0; }

/* Label / value line */
.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-6);
}
.kv__k { color: var(--text-body); font-size: var(--fs-sm); }
.kv__v { color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-semi); }
.kv--total .kv__k { font-weight: var(--fw-bold); color: var(--text); }
.kv--total .kv__v { font-size: var(--fs-h3); font-weight: var(--fw-black); }

/* Pickup card (js/pickup.js): short facts as kv rows above, the address
   and the rest as label-over-text blocks, since they run long. */
.pickup-card__block {
  display: block;
  margin-top: var(--sp-9);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--line);
}
.pickup-card__label {
  display: block;
  color: var(--text-soft);
  font-size: var(--fs-meta);
}
.pickup-card__text {
  display: block;
  margin-top: var(--sp-2);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.pickup-card__pin {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  margin-top: var(--sp-9);
  color: var(--violet);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
}
.pickup-card__locked {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-5);
  margin: var(--sp-9) 0 0;
  color: var(--text-soft);
  font-size: var(--fs-meta);
}
.pickup-card__locked .icon { flex-shrink: 0; margin-top: 1px; }

/* ==========================================================================
   Note panel, the tinted explainer blocks
   ========================================================================== */

.note {
  display: flex;
  gap: var(--sp-7);
  padding: var(--sp-10) var(--sp-11);
  border-radius: var(--r-card);
  font-size: var(--fs-meta);
  line-height: var(--lh-normal);
}

.note__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: var(--r-full);
  font-size: var(--fs-label);
  font-weight: var(--fw-black);
}

.note--violet { background: var(--violet-soft); color: var(--violet); }
.note--violet .note__icon { background: var(--violet-line); color: var(--violet-deep); }

.note--green { background: var(--green-panel); color: var(--green-mid); }
.note--green .note__icon { background: #CDE9E1; color: var(--green-deep); }

.note--amber { background: var(--amber-soft); color: #8A6A1C; }
.note--amber .note__icon { background: #F2E4C2; color: var(--amber); }

.note--grey { background: var(--surface-sub); color: var(--text-body); }
.note--grey .note__icon { background: var(--surface-shade); color: var(--text-body); }

.note--red { background: var(--red-soft); color: var(--red); }
.note--red .note__icon { background: #F8D7D9; color: var(--red); }

/* Dismissible variant, used for the off-platform payment warning in chat. */
.note__dismiss {
  align-self: flex-start;
  margin-left: auto;
  padding: 0 var(--sp-2);
  color: inherit;
  font-size: var(--fs-label);
  opacity: 0.6;
}
.note__dismiss:hover { opacity: 1; }

/* ==========================================================================
   Legal document prose, terms.html + privacy.html
   ========================================================================== */

.legal__meta {
  color: var(--text-soft);
  font-size: var(--fs-meta);
  margin: 0 0 var(--sp-14);
}

.legal h2 {
  margin: var(--sp-17) 0 var(--sp-8);
  color: var(--text);
  font-size: var(--fs-lg);
  font-weight: var(--fw-black);
}
.legal h2:first-child { margin-top: 0; }

.legal h3 {
  margin: var(--sp-13) 0 var(--sp-4);
  color: var(--text-strong);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
}

.legal p {
  margin: 0 0 var(--sp-10);
  color: var(--text-body);
  font-size: var(--fs-body);
  line-height: var(--lh-loose);
}

.legal ul, .legal ol {
  margin: 0 0 var(--sp-10);
  padding-left: var(--sp-14);
  color: var(--text-body);
  font-size: var(--fs-body);
  line-height: var(--lh-loose);
}
.legal li + li { margin-top: var(--sp-4); }

.legal strong { color: var(--text-strong); font-weight: var(--fw-bold); }

.legal a { color: var(--violet); font-weight: var(--fw-semi); }

/* Inline clause number prefix, e.g. "4.1", on a numbered-clause paragraph. */
.legal__clause {
  margin-right: var(--sp-4);
  color: var(--text);
  font-weight: var(--fw-bold);
}

/* ==========================================================================
   Status pill  (statusColour() maps to these modifiers)
   ========================================================================== */

.pill {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  font-size: var(--fs-badge);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-badge);
  text-transform: uppercase;
  white-space: nowrap;
}

.pill--violet { background: var(--violet-soft); color: var(--violet); }
.pill--green  { background: var(--green-soft);  color: var(--green); }
.pill--amber  { background: var(--amber-soft);  color: var(--amber); }
.pill--grey   { background: var(--surface-sub); color: var(--text-body); }
.pill--red    { background: var(--red-soft);    color: var(--red); }
.pill--ink    { background: var(--ink);         color: var(--on-dark); }

.pill--lg { padding: var(--sp-2) var(--sp-5); font-size: 9px; letter-spacing: 0.4px; }

/* Solid label pill overlaid on a photo (request type on the shopper feed). */
.pill--overlay {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  color: var(--on-dark);
  font-size: 9.5px;
  text-transform: none;
  letter-spacing: 0;
}
.pill--overlay.pill--violet { background: var(--violet); color: var(--on-dark); }
.pill--overlay.pill--green  { background: var(--green);  color: var(--on-dark); }

/* ==========================================================================
   Filter chip
   ========================================================================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
  height: var(--control-h-xs);
  padding: 0 var(--sp-12);
  border: 1px solid var(--line-chip);
  border-radius: var(--r-pill);
  background: var(--panel);
  color: var(--text-body);
  font-size: var(--fs-chip);
  font-weight: var(--fw-semi);
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.chip:hover { border-color: var(--violet-line); }

.chip.is-active,
.chip[aria-pressed='true'] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-dark);
  font-weight: var(--fw-bold);
}

/* Outlined active state, used where a solid chip already means something
   else in the same row, as on the shopper feed (filter vs sort). */
.chip--outline.is-active,
.chip--outline[aria-pressed='true'] {
  border: 1.5px solid var(--text);
  background: var(--panel);
  color: var(--text);
}

.chip--violet.is-active {
  border-color: var(--violet);
  background: var(--violet-soft);
  color: var(--violet);
}

.chip__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 var(--sp-2);
  border-radius: var(--r-full);
  background: var(--violet);
  color: var(--on-dark);
  font-size: 10px;
}

/* Chips laid over the dark hero */
.chip--on-dark {
  border-color: var(--on-dark-line);
  background: transparent;
  color: var(--on-dark-mid);
}
.chip--on-dark.is-active {
  border-color: transparent;
  background: var(--panel);
  color: var(--text);
}

/* ==========================================================================
   Avatar
   ========================================================================== */

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: var(--r-full);
  background: var(--hatch-sm);
  overflow: hidden;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Someone's own photo on the icon button that opens their profile
   (wearOwnPhoto in js/upload.js). */
.own-photo { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

.avatar--xs { width: 24px; height: 24px; }
.avatar--sm { width: 32px; height: 32px; }
.avatar--md { width: 38px; height: 38px; }
.avatar--lg { width: 51px; height: 51px; }
.avatar--xl { width: 74px; height: 74px; border: 3px solid var(--panel); }

.avatar--initials {
  background: var(--ink);
  color: var(--on-dark);
  font-family: var(--font);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
}

/* Country flag. SVG artwork from flagcdn.com (public domain), self-hosted in
   /assets/img/flags. The hairline ring keeps white-heavy flags from
   dissolving into a white card. */
.flag {
  flex-shrink: 0;
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(18, 20, 43, 0.08);
}

.flag--sm { width: 17px; height: 12px; }
.flag--lg { width: 28px; height: 20px; border-radius: 3px; }

/* No artwork for this country yet. */
.flag--empty { display: inline-block; background: var(--surface-flag); }

/* ==========================================================================
   Badge (numeric)
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 var(--sp-2);
  border-radius: var(--r-full);
  background: var(--violet);
  color: var(--on-dark);
  font-size: 9.5px;
  font-weight: var(--fw-bold);
}

.badge--ink   { background: var(--ink); }
.badge--green { background: var(--green); }
.badge--amber { background: var(--amber); }
.badge--red   { background: var(--red); }

/* ==========================================================================
   Progress bar
   ========================================================================== */

.progress {
  height: 5px;
  border-radius: 3px;
  background: var(--line-divider);
  overflow: hidden;
}
.progress--thick { height: 7px; border-radius: 4px; background: var(--surface-chip); }

.progress__fill {
  height: 100%;
  border-radius: inherit;
  background: var(--violet);
  transition: width var(--dur-slow) var(--ease);
}
.progress__fill--green { background: var(--green); }
.progress__fill--amber { background: var(--amber); }

/* ==========================================================================
   Stats row
   ========================================================================== */

.stats { display: flex; align-items: center; }

.stat {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
}
.stat__value { color: var(--text); font-size: var(--fs-h3); font-weight: var(--fw-black); }
.stat__label { color: var(--text-soft); font-size: var(--fs-micro); white-space: nowrap; }

.stats__rule { width: 1px; height: 30px; background: var(--line-rule); }

/* ==========================================================================
   Timeline / status stepper
   ========================================================================== */

.timeline { display: flex; flex-direction: column; }

.timeline__item { display: flex; gap: var(--sp-9); }

.timeline__gutter {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 20px;
}

.timeline__marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1.8px solid var(--text-disabled);
  border-radius: var(--r-full);
  background: var(--panel);
  box-sizing: border-box;
}

.timeline__rail {
  width: 2px;
  flex: 1;
  margin: var(--sp-2) 0;
  background: var(--line-input);
}

.timeline__body { flex: 1; padding-bottom: var(--sp-13); min-width: 0; }
.timeline__item:last-child .timeline__body { padding-bottom: 0; }

.timeline__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
}
.timeline__title { color: var(--text); font-size: var(--fs-body); font-weight: var(--fw-bold); }
.timeline__time  { color: var(--text-soft); font-size: var(--fs-meta); white-space: nowrap; }
.timeline__note  { margin-top: var(--sp-1); color: var(--text-soft); font-size: var(--fs-meta); }

/* Shown only on the current stage, added 16 Sep 2026, names who's
   actually being waited on right now (StubHub's shape from the dossier). */
.timeline__waiting {
  margin-top: var(--sp-3);
  color: var(--violet);
  font-size: var(--fs-meta);
  font-weight: var(--fw-bold);
}

/* Done */
.timeline__item--done .timeline__marker {
  border-color: var(--green);
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 8'%3E%3Cpath d='M1 4 L3.8 6.6 L9 1.2' stroke='%23fff' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 9px 7px no-repeat;
}
.timeline__item--done .timeline__rail { background: var(--green); }

/* Current */
.timeline__item--current .timeline__marker {
  border: 5px solid var(--violet);
  background: var(--panel);
}
.timeline__item--current .timeline__title { color: var(--violet); }
.timeline__item--current .timeline__time  { color: var(--violet); }

/* The line from the current stage to the next one: a violet pulse that
   keeps flowing down, pointing at what happens next. */
.timeline__item--current .timeline__rail {
  background: linear-gradient(to bottom, var(--violet) 0%, var(--violet) 40%, var(--line-input) 40%, var(--line-input) 100%);
  background-size: 100% 200%;
  animation: timeline-flow 1.6s linear infinite;
}
@keyframes timeline-flow {
  from { background-position: 0 100%; }
  to   { background-position: 0 -100%; }
}
@media (prefers-reduced-motion: reduce) {
  .timeline__item--current .timeline__rail {
    animation: none;
    background: linear-gradient(to bottom, var(--violet), var(--line-input));
  }
}

/* Future */
.timeline__item--future .timeline__title { color: var(--text-soft); }

/* Cancelled */
.timeline__item--cancelled .timeline__marker { border-color: var(--red); background: var(--red-soft); }
.timeline__item--cancelled .timeline__title  { color: var(--red); }

/* ==========================================================================
   Chat
   ========================================================================== */

.chat { display: flex; flex-direction: column; gap: var(--sp-7); }

.chat__day {
  align-self: center;
  padding: var(--sp-2) var(--sp-8);
  border-radius: var(--r-thumb);
  background: var(--surface-shade);
  color: var(--text-soft);
  font-size: var(--fs-micro);
}

.bubble {
  max-width: 266px;
  padding: var(--sp-7) var(--sp-9);
  border-radius: var(--r-card);
  font-size: var(--fs-body);
  line-height: var(--lh-snug);
}

.bubble--in {
  align-self: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--r-card) var(--r-card) var(--r-card) var(--sp-2);
  background: var(--panel);
  color: var(--text);
}

.bubble--out {
  align-self: flex-end;
  border-radius: var(--r-card) var(--r-card) var(--sp-2) var(--r-card);
  background: var(--ink);
  color: var(--on-dark);
}

.bubble--photo { padding: var(--sp-4) var(--sp-4) var(--sp-6); }
.bubble--photo img,
.bubble--photo .u-hatch {
  width: 236px;
  height: 158px;
  border-radius: var(--r-md);
  object-fit: cover;
}

.bubble__time {
  margin-top: var(--sp-2);
  color: var(--text-soft);
  font-size: var(--fs-tiny);
}
.bubble--out .bubble__time { color: rgba(255, 255, 255, 0.45); text-align: right; }
.bubble--photo .bubble__time { padding-left: var(--sp-2); }

/* System event line inside the thread */
.chat__event {
  align-self: center;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-9);
  border-radius: 14px;
  background: var(--green-soft);
  color: var(--green);
  font-size: var(--fs-meta);
  font-weight: var(--fw-semi);
}
.chat__event-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: var(--r-full);
  background: var(--green);
}

/* Composer sits in the floating action bar, see layout.css .actionbar */
.composer { display: flex; align-items: center; gap: var(--sp-7); width: 100%; }
.composer__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: var(--fs-body);
}
.composer__input::placeholder { color: var(--text-soft); }
.composer__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--r-full);
  background: var(--surface-chip);
}
.composer__btn--send { background: var(--ink); }

/* ==========================================================================
   Modal & bottom sheet
   ========================================================================== */

.scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-scrim);
  background: var(--scrim);
  opacity: 0;
  animation: scrim-in var(--dur) var(--ease) forwards;
}

@keyframes scrim-in { to { opacity: 1; } }

.modal {
  position: fixed;
  z-index: var(--z-sheet);
  background: var(--panel);
}

/* Bottom sheet (mobile default) */
.modal--sheet {
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88dvh;
  overflow-y: auto;
  padding: var(--sp-10) var(--page-x-wide) var(--sp-17);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  animation: sheet-up var(--dur-slow) var(--ease-out);
}

@keyframes sheet-up { from { transform: translateY(100%); } }

.modal__grab {
  width: 44px;
  height: 5px;
  margin: 0 auto;
  border-radius: 3px;
  background: var(--line-input);
}

.modal__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: var(--sp-15);
  text-align: center;
}

.modal__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: var(--r-full);
  font-size: 30px;
  font-weight: var(--fw-black);
}
.modal__icon--amber  { background: var(--amber-soft);  color: var(--amber); }
.modal__icon--violet { background: var(--violet-soft); color: var(--violet); }
.modal__icon--green  { background: var(--green-soft);  color: var(--green); }
.modal__icon--red    { background: var(--red-soft);    color: var(--red); }

.modal__title {
  margin-top: var(--sp-12);
  font-size: var(--fs-h1);
  font-weight: var(--fw-black);
  letter-spacing: var(--ls-h1);
}

.modal__text {
  max-width: 290px;
  margin-top: var(--sp-5);
  color: var(--text-muted);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
}

.modal__body    { margin-top: var(--sp-14); }
.modal__actions { margin-top: var(--sp-13); display: flex; flex-direction: column; gap: var(--sp-6); }

/* Centred dialog (used by admin on desktop) */
.modal--dialog {
  top: 50%;
  left: 50%;
  width: min(520px, calc(100vw - 48px));
  max-height: 86dvh;
  overflow-y: auto;
  padding: var(--sp-15);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-modal);
  transform: translate(-50%, -50%);
  animation: dialog-in var(--dur) var(--ease-out);
}

@keyframes dialog-in {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.98); }
}

/* Full-size photo viewer (admin scout report photos and similar), a dark
   near-fullscreen overlay rather than the light --panel background every
   other modal uses, since the point here is the photo, not a panel. */
.modal--lightbox {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 18, 0.94);
  animation: dialog-in var(--dur) var(--ease-out);
}

.lightbox__img {
  max-width: min(94vw, 640px);
  max-height: 80dvh;
  object-fit: contain;
  border-radius: var(--r-md);
}

.lightbox__close {
  position: absolute;
  top: var(--sp-11);
  right: var(--sp-11);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: translateY(-50%);
}
.lightbox__nav--prev { left: var(--sp-11); }
.lightbox__nav--next { right: var(--sp-11); }

.lightbox__save {
  position: absolute;
  top: var(--sp-11);
  left: var(--sp-11);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  height: 40px;
  padding: 0 var(--sp-8);
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: var(--fs-meta);
  font-weight: var(--fw-bold);
}

.lightbox__count {
  position: absolute;
  bottom: var(--sp-12);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--sp-3) var(--sp-8);
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: var(--fs-meta);
  font-weight: var(--fw-bold);
}

body.is-modal-open { overflow: hidden; }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--sp-18));
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  width: max-content;
  max-width: min(360px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-8) var(--sp-12);
  border-radius: var(--r-full);
  background: var(--ink);
  color: var(--on-dark);
  font-size: var(--fs-chip);
  font-weight: var(--fw-semi);
  box-shadow: var(--shadow-float);
  animation: toast-in var(--dur) var(--ease-out);
}

.toast.is-leaving { animation: toast-out var(--dur) var(--ease) forwards; }

.toast--success { background: var(--green); }
.toast--error   { background: var(--red); }
.toast--warn    { background: var(--amber); }

@keyframes toast-in  { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(8px); } }

/* ==========================================================================
   Empty state
   ========================================================================== */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-6);
  padding: var(--sp-18) var(--sp-14);
  text-align: center;
}

.empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border: 1.5px dashed var(--violet);
  border-radius: var(--r-full);
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 26px;
  line-height: 1;
}

.empty__title { font-size: var(--fs-lg); font-weight: var(--fw-black); color: var(--text); }
.empty__text  { max-width: 280px; color: var(--text-soft); font-size: var(--fs-chip); line-height: var(--lh-normal); }

/* ==========================================================================
   Skeleton loader
   ========================================================================== */

.skeleton {
  position: relative;
  border-radius: var(--r-md);
  background: var(--surface-shade);
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
              transparent, rgba(255, 255, 255, 0.65), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer { to { transform: translateX(100%); } }

.skeleton--line   { height: 12px; }
.skeleton--line-sm{ height: 9px; }
.skeleton--title  { height: 16px; width: 60%; }
.skeleton--thumb  { width: 56px; height: 56px; border-radius: var(--r-thumb); }
.skeleton--avatar { width: 42px; height: 42px; border-radius: var(--r-full); }
.skeleton--photo  { width: 100%; aspect-ratio: 1 / 1; border-radius: var(--r-thumb); }
.skeleton--chip   { width: 84px; height: var(--control-h-xs); border-radius: var(--r-pill); }

/* Prebuilt skeleton card, matches the list-row card shape. */
.skeleton-card {
  display: flex;
  gap: var(--sp-8);
  padding: var(--sp-10) var(--sp-11);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--panel);
}
.skeleton-card__body { flex: 1; display: flex; flex-direction: column; gap: var(--sp-4); padding-top: var(--sp-2); }

/* ==========================================================================
   Inline loader
   ========================================================================== */

.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--violet-line);
  border-top-color: var(--violet);
  border-radius: var(--r-full);
  animation: spin 0.7s linear infinite;
}
.spinner--sm { width: 16px; height: 16px; border-width: 2px; }
.spinner--on-dark { border-color: var(--on-dark-fill); border-top-color: var(--on-dark); }

@keyframes spin { to { transform: rotate(360deg); } }

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  padding: var(--sp-18) var(--sp-14);
  color: var(--text-soft);
  font-size: var(--fs-chip);
}

.loader--overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  background: rgba(250, 249, 247, 0.85);
  backdrop-filter: blur(2px);
}

/* ==========================================================================
   Table (admin)
   ========================================================================== */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r-thumb);
  background: var(--panel);
  overflow: hidden;
}

.table { width: 100%; font-size: var(--fs-sm); }

.table thead th {
  padding: var(--sp-8) var(--sp-12);
  border-bottom: 1px solid var(--line);
  background: var(--surface-sub);
  color: var(--text-soft);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  white-space: nowrap;
}

.table tbody td {
  padding: var(--sp-8) var(--sp-12);
  border-bottom: 1px solid var(--line-divider);
  color: var(--text-body);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-sub); }

.table__strong { color: var(--text); font-weight: var(--fw-bold); }
.table__num { text-align: right; font-variant-numeric: tabular-nums; }

.table__sort {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.table__sort[aria-sort='ascending'],
.table__sort[aria-sort='descending'] { color: var(--violet); }

/* ==========================================================================
   Metric tile (admin dashboard)
   ========================================================================== */

.metric {
  padding: var(--sp-12);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--panel);
}
.metric__label { color: var(--text-soft); font-size: var(--fs-meta); font-weight: var(--fw-semi); }
.metric__value { margin-top: var(--sp-3); font-size: 28px; font-weight: var(--fw-black); letter-spacing: var(--ls-h1); }
.metric__foot  { margin-top: var(--sp-3); font-size: var(--fs-meta); color: var(--text-soft); }
.metric--alert { border-color: var(--amber); background: var(--amber-soft); }
.metric--alert .metric__value { color: var(--amber); }

/* ==========================================================================
   Photo strip: extra reference photos admin attached to a request, shown
   read-only to the shopper working it (job-detail.html, scout-report.html).
   Tap to view full size, same sizing as admin's own editable gallery on
   request-review.html, just without the checkbox/remove controls.
   ========================================================================== */

.photo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-6);
  margin-top: var(--sp-8);
}
.photo-strip__tile {
  flex: 1 1 100px;
  max-width: 130px;
  aspect-ratio: 1;
}
.photo-strip__img {
  width: 100%;
  height: 100%;
  border-radius: var(--r-md);
  object-fit: cover;
  cursor: zoom-in;
}

/* Small photos under a timeline entry (admin order history, the scout's
   report). One row that scrolls sideways rather than wrapping. */
.tl-thumbs {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  overflow-x: auto;
  scrollbar-width: none;
}
.tl-thumbs::-webkit-scrollbar { display: none; }
.tl-thumbs__btn {
  flex: 0 0 auto;
  width: 64px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--line-input);
  cursor: zoom-in;
}
.tl-thumbs__img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ==========================================================================
   Support numbers sheet (js/support.js)
   ========================================================================== */

.sup__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  padding: var(--sp-6) 0;
  border-bottom: 1px solid var(--line);
}
.sup__row:last-child { border-bottom: 0; }
.sup__where { display: flex; align-items: center; gap: var(--sp-5); min-width: 0; }
.sup__country { display: block; color: var(--text); font-size: var(--fs-body); font-weight: var(--fw-bold); }
.sup__phone { display: block; color: var(--text-soft); font-size: var(--fs-label); font-variant-numeric: tabular-nums; }
.sup__actions { display: flex; gap: var(--sp-3); flex-shrink: 0; }

/* ==========================================================================
   Photo gallery: swipe one at a time, dots below (js/gallery.js)
   ========================================================================== */

.gallery { display: flex; flex-direction: column; gap: var(--sp-4); }
.gallery__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--r-md);
  /* Store photos are shot on white, so they sit on white. */
  background: #fff;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__slide {
  flex: 0 0 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  background: none;
  scroll-snap-align: center;
  cursor: zoom-in;
}
.gallery__img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery__dots { display: flex; justify-content: center; gap: var(--sp-3); }
.gallery__dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--line-input);
  transition: background 0.2s;
}
.gallery__dot.is-on { background: var(--violet); }
