/* Client portal
   ---------------------------------------------------------------------------
   Design contract shared with the marketing site. Same tokens, same curves,
   same display face. Dark UI, because this gets used outdoors and a white
   screen in a yard at 4pm is a mirror.

   House rules learned the hard way on the marketing build and observed here:
     * every clamp() has whitespace around its + and -;
     * grid-template-columns never mixes a flexible track with auto-fit;
     * --molten is capped at a handful of runs per page and is never used to
       mean a lead status -- status colour is functional, not decorative;
     * anything anchored gets scroll-margin-top because the header is fixed.
   Touch targets are 48px, not 44px: this is operated with gloves on.
--------------------------------------------------------------------------- */

@font-face {
  font-family: "Archivo";
  src: url("archivo-var.4efe97f31699.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --ink: #070C18;
  --graphite: #0F1626;
  --slate: #182642;
  --steel: #8695B0;
  --steel-bright: #C4D3ED;
  --paper: #F3F7FD;
  --ink-on-paper: #0C1526;
  --molten: #E9B949;
  --molten-hot: #F7CF66;
  --molten-dim: #8A6410;

  --spring: cubic-bezier(.32, .72, 0, 1);
  --swift: cubic-bezier(.2, .8, .2, 1);

  /* Functional status colours. Each is >= 4.5:1 as text on --graphite and
     --slate, and is used as its own chip border so the boundary clears 3:1.
     None of them is --molten: an accent must not read as a state. */
  --s-new: #7FB3FF;
  --s-contacted: #B79CF0;
  --s-quoted: #E8C25A;
  --s-scheduled: #58C7D8;
  --s-picked_up: #8FD16B;
  --s-paid: #4ADE80;
  --s-closed: #9AA3B0;
  --s-lost: #FF6B7A;

  --line: #243149;
  --line-strong: #36466A;
  --ok: #4ADE80;
  --warn: #E8C25A;
  --bad: #FF6B7A;

  --r-card: 16px;
  --r-panel: 20px;
  --r-control: 12px;
  --tap: 48px;
  --header-h: 68px;
  --gutter: clamp(0.875rem, 0.5rem + 1.4vw, 1.75rem);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* Any author `display` declaration outranks the user-agent sheet's
   `[hidden] { display: none }`, so a `.field` or a `.column` stays on screen
   after JS hides it. Say it once, here, and never chase that bug again. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--steel-bright);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.5;
  font-variation-settings: "wght" 420, "wdth" 100;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: "Archivo", system-ui, sans-serif;
  font-variation-settings: "wght" 780, "wdth" 80;
  color: var(--paper);
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0;
}

h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem); }
h2 { font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.6rem); }
h3 { font-size: clamp(1.02rem, 0.97rem + 0.3vw, 1.2rem); }

p { margin: 0 0 0.75rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--paper); text-decoration-color: var(--steel); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--paper); }

[id] { scroll-margin-top: calc(var(--header-h) + 1.25rem); }

/* Focus is never removed and never subtle. Cold hands miss; the ring is how
   you find your way back. */
:focus-visible {
  outline: 3px solid var(--molten-hot);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -100vh;
  z-index: 100;
  background: var(--paper);
  color: var(--ink-on-paper);
  padding: 0.75rem 1.1rem;
  border-radius: var(--r-control);
  font-variation-settings: "wght" 700, "wdth" 90;
}
.skip-link:focus { top: 0.5rem; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------ shell */

.shell { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--graphite) 94%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 2px 0 0 var(--molten);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--header-h);
  padding: 0.5rem var(--gutter);
  max-width: 1560px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  text-decoration: none;
  font-variation-settings: "wght" 820, "wdth" 78;
  font-size: 1.0625rem;
  color: var(--paper);
  letter-spacing: 0.01em;
  /* It is a link, so it is a target, so it is 48px like every other target. */
  min-height: var(--tap);
  padding: 0.4rem 0;
}
.brand__mark {
  font-variation-settings: "wght" 860, "wdth" 74;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  color: var(--molten-hot);
}

.nav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
  align-items: center;
  flex-wrap: wrap;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 0.9rem;
  border-radius: var(--r-control);
  color: var(--steel-bright);
  text-decoration: none;
  font-variation-settings: "wght" 620, "wdth" 92;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color .22s var(--swift), color .22s var(--swift);
}
.nav__link:hover { background: var(--slate); color: var(--paper); }
.nav__link--button { background: none; font-family: inherit; font-size: inherit; cursor: pointer; }
.nav__link[aria-current="page"] {
  color: var(--paper);
  background: var(--slate);
  border-color: var(--line-strong);
  box-shadow: inset 0 -2px 0 0 var(--molten);
}

.main {
  flex: 1;
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: clamp(1rem, 0.7rem + 1vw, 1.75rem) var(--gutter) 4rem;
}

/* ------------------------------------------------------------ page header */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
}
.page-head__sub {
  color: var(--steel);
  margin: 0.35rem 0 0;
  max-width: 60ch;
}
.page-head__actions { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }

.tally {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-variation-settings: "wght" 760, "wdth" 84;
  color: var(--paper);
}
.tally__n { font-size: 1.6rem; color: var(--molten-hot); }
.tally__label { color: var(--steel); font-variation-settings: "wght" 500, "wdth" 96; }

/* ----------------------------------------------------------------- alerts */

.live-region {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
}

.flash {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  border: 1px solid var(--line-strong);
  border-left-width: 4px;
  background: var(--slate);
  color: var(--paper);
  border-radius: var(--r-control);
  padding: 0.85rem 1rem;
  margin: 0 0 0.75rem;
}
.flash--success { border-left-color: var(--ok); }
.flash--error { border-left-color: var(--bad); }
.flash--info { border-left-color: var(--s-new); }
.flash--warning { border-left-color: var(--warn); }
.flash__list { list-style: none; margin: 0; padding: 0; }

/* --------------------------------------------------------------- controls */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 1.05rem;
  border-radius: var(--r-control);
  border: 1px solid var(--line-strong);
  background: var(--slate);
  color: var(--paper);
  font: inherit;
  font-variation-settings: "wght" 660, "wdth" 92;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s var(--spring), background-color .2s var(--swift),
              border-color .2s var(--swift);
}
.btn:hover { background: #1E2C48; border-color: #3A4A6B; }
.btn:active { transform: translateY(1px) scale(.995); }

.btn--primary {
  background: var(--molten);
  border-color: var(--molten);
  color: #0C1526;
  font-variation-settings: "wght" 720, "wdth" 90;
}
.btn--primary:hover { background: var(--molten-hot); border-color: var(--molten-hot); }

.btn:disabled {
  cursor: wait;
  opacity: 0.82;
  transform: none;
}

.upload-spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  border: 2px solid rgba(12, 21, 38, 0.35);
  border-top-color: #0C1526;
  border-radius: 50%;
}

[aria-busy="true"] .upload-spinner {
  display: inline-block;
  animation: upload-spin 0.75s linear infinite;
}

.upload-status {
  margin: 0.75rem 0 0;
  color: var(--steel-bright);
}

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

.btn--ghost { background: transparent; }
.btn--danger { border-color: color-mix(in srgb, var(--bad) 60%, var(--line-strong)); }
.btn--block { width: 100%; }
.btn--sm { min-height: var(--tap); padding: 0 0.8rem; font-size: 0.94rem; }

.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.stack-top { margin-top: 1rem; }
.split--spaced { margin-top: 1.25rem; }
.contact-row--wide { max-width: 26rem; }

/* Call / text pair on a card: two big slabs, thumb-sized, side by side. */
.contact-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.7rem;
}
.contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--tap);
  border-radius: var(--r-control);
  border: 1px solid var(--line-strong);
  background: #16223C;
  color: var(--paper);
  text-decoration: none;
  font-variation-settings: "wght" 680, "wdth" 90;
  transition: background-color .2s var(--swift), border-color .2s var(--swift);
}
.contact-btn:hover { background: #1E2C48; border-color: #3A4A6B; }
.contact-btn--button {
  width: 100%;
  padding: 0 0.8rem;
  font: inherit;
  cursor: pointer;
}
.contact-btn[aria-disabled="true"] {
  color: var(--steel);
  background: transparent;
  border-style: dashed;
  pointer-events: none;
}

/* ----------------------------------------------------------------- fields */

.field { display: block; margin-bottom: 1rem; }
.form-narrow { max-width: 48rem; }
.record-actions { max-width: 48rem; margin-top: 1.25rem; }
.field__label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--paper);
  font-variation-settings: "wght" 640, "wdth" 94;
}
.field__req { color: var(--s-quoted); font-variation-settings: "wght" 700, "wdth" 94; }
.field__help { color: var(--steel); font-size: 0.9rem; margin-top: 0.3rem; }
.field__error {
  color: var(--bad);
  font-size: 0.94rem;
  margin-top: 0.35rem;
  font-variation-settings: "wght" 620, "wdth" 94;
}

.field__input,
.field__select {
  width: 100%;
  min-height: var(--tap);
  padding: 0.6rem 0.8rem;
  border-radius: var(--r-control);
  border: 1px solid var(--line-strong);
  background: #0B1220;
  color: var(--paper);
  font: inherit;
}
textarea.field__input { min-height: 6rem; line-height: 1.45; resize: vertical; }
.field__input::placeholder { color: #7C8AA6; }
.field__input:focus, .field__select:focus { border-color: var(--steel-bright); }

.field--check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.7rem 0.85rem;
  min-height: var(--tap);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background: #0B1220;
  margin-bottom: 1rem;
}
.field__check { width: 26px; height: 26px; accent-color: var(--molten); flex: none; margin: 0; }

.field-group {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
}
.field-group legend {
  color: var(--paper);
  font-variation-settings: "wght" 640, "wdth" 94;
  margin-bottom: 0.35rem;
}
.weekday-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.weekday-checks label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: var(--tap);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background: #0B1220;
  padding: 0.5rem 0.7rem;
  color: var(--paper);
  cursor: pointer;
}
.weekday-checks input { width: 24px; height: 24px; accent-color: var(--molten); }
.time-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.routing-summary {
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--s-new);
  border-radius: var(--r-control);
  background: var(--slate);
  color: var(--paper);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}
.routing-summary p { color: var(--steel-bright); margin-top: 0.35rem; }

/* ------------------------------------------------------------ status chip */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-variation-settings: "wght" 720, "wdth" 88;
  color: var(--chip, var(--steel-bright));
  border: 1px solid var(--chip, var(--line-strong));
  background: color-mix(in srgb, var(--chip, var(--steel)) 14%, transparent);
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.s-new { --chip: var(--s-new); }
.s-contacted { --chip: var(--s-contacted); }
.s-quoted { --chip: var(--s-quoted); }
.s-scheduled { --chip: var(--s-scheduled); }
.s-picked_up { --chip: var(--s-picked_up); }
.s-paid { --chip: var(--s-paid); }
.s-closed { --chip: var(--s-closed); }
.s-lost { --chip: var(--s-lost); }

/* ------------------------------------------------------------------ board */

.board-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--graphite);
  margin-bottom: 1.25rem;
}
.board-tools .field { margin-bottom: 0; min-width: 15rem; }
.board-tools__note { color: var(--steel); font-size: 0.92rem; margin-left: auto; }

/* Two grids, never one eight-cell grid: in a single grid every row is as tall
   as its tallest column, which leaves a crater under the short ones. */
.board {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
.board[hidden] { display: none; }

.board-divider {
  margin: 2rem 0 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--steel);
  font-size: 0.86rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-variation-settings: "wght" 700, "wdth" 88;
}
.board-divider[hidden] { display: none; }

.column {
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--graphite);
  padding: 0.85rem;
  min-width: 0;
}
.column[hidden] { display: none; }

.column__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.7rem;
  margin-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}
/* The column's heading is a wrapper for the status chip and nothing else, so
   it carries none of an h3's default size or margin. It has to stay an h3:
   aria-labelledby points at it and the board's structure is what a screen
   reader navigates by. */
.column__title { margin: 0; font-size: inherit; font-weight: inherit; }

.column__count {
  margin-left: auto;
  color: var(--steel-bright);
  font-variation-settings: "wght" 740, "wdth" 86;
  background: var(--slate);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  min-width: 2rem;
  text-align: center;
  padding: 0.05rem 0.5rem;
  font-size: 0.9rem;
}

.column__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }

.column__empty {
  color: var(--steel);
  font-size: 0.95rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-card);
  padding: 0.9rem;
  margin: 0;
}

/* ------------------------------------------------------------------- card */

.card {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  background: var(--slate);
  padding: 0.9rem;
  transition: border-color .25s var(--swift), transform .3s var(--spring);
}
.card:hover { border-color: #3A4A6B; }
.card.is-moving { transform: scale(.98); opacity: .55; }
.card.is-landed { animation: land .5s var(--spring); }

@keyframes land {
  from { transform: translateY(-6px) scale(.985); }
  to { transform: none; }
}

.card__top { display: flex; align-items: flex-start; gap: 0.6rem; margin-bottom: 0.5rem; }
.card__vehicle {
  font-variation-settings: "wght" 760, "wdth" 84;
  font-size: 1.06rem;
  color: var(--paper);
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.card__vehicle a { text-decoration: none; color: inherit; }
.card__vehicle a:hover { text-decoration: underline; }

.card__meta {
  list-style: none;
  margin: 0 0 0.35rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.8rem;
  color: var(--steel-bright);
  font-size: 0.95rem;
}
.card__meta b { font-variation-settings: "wght" 640, "wdth" 94; color: var(--paper); }
.card__age { color: var(--steel); }
.card__age--stale { color: var(--s-quoted); }

.card__phone {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--paper);
  font-variation-settings: "wght" 640, "wdth" 94;
}

.card__move {
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
}
.card__move-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem; }
.card__lost { margin-top: 0.55rem; }
.card__lost[hidden] { display: none; }

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

/* One column on a phone, in the order a phone needs: the thing you came to do
   (move the lead) before the paperwork. Two columns on a desktop, where the
   move control belongs beside the record rather than above it. */
.split {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
.split__move { order: -1; }
.split__consent { order: 1; }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--graphite);
  padding: clamp(0.9rem, 0.75rem + 0.6vw, 1.4rem);
}
.panel + .panel { margin-top: 1.25rem; }
.panel__head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.panel__note { color: var(--steel); font-size: 0.94rem; }

.facts { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.1rem 1rem; }
.facts dt {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: var(--steel);
  font-size: 0.86rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-variation-settings: "wght" 640, "wdth" 92;
  padding-top: 0.6rem;
}
.facts dd { margin: 0 0 0.5rem; color: var(--paper); overflow-wrap: anywhere; }
.facts dd.is-blank { color: var(--steel); font-style: italic; }
/* A hint belongs under the value, not welded to the end of it. */
.facts dd .field__help { display: block; margin-top: 0.15rem; font-style: normal; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.tag {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.88rem;
  color: var(--steel-bright);
  background: var(--slate);
}

/* ---------------------------------------------------------- the timeline */

.timeline { list-style: none; margin: 0; padding: 0 0 0 1.25rem; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 4px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--line-strong);
}
.timeline__item { position: relative; padding: 0 0 1.1rem 0.25rem; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -1.25rem; top: 0.45rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--steel);
  box-shadow: 0 0 0 3px var(--graphite);
}
.timeline__item--move::before { background: var(--s-new); }
.timeline__when { color: var(--steel); font-size: 0.88rem; }
.timeline__what { color: var(--paper); font-variation-settings: "wght" 620, "wdth" 94; }
.timeline__note { color: var(--steel-bright); margin-top: 0.2rem; white-space: pre-wrap; }

.consent {
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--s-paid);
  border-radius: var(--r-control);
  padding: 0.85rem 1rem;
  background: var(--slate);
}
.consent--missing { border-left-color: var(--bad); }
.consent__quote {
  color: var(--steel-bright);
  font-style: italic;
  margin: 0.5rem 0 0;
  padding-left: 0.8rem;
  border-left: 2px solid var(--line-strong);
}

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

.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.row-card {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  background: var(--slate);
  padding: 0.85rem 1rem;
}
.row-card__title { font-variation-settings: "wght" 720, "wdth" 88; color: var(--paper); }
.row-card__title a { color: inherit; text-decoration: none; }
.row-card__title a:hover { text-decoration: underline; }
.row-card__meta { color: var(--steel); font-size: 0.94rem; }
.row-card__actions { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }

.photo-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}
.photo-card {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--slate);
}
.photo-card img { display: block; width: 100%; height: 150px; object-fit: cover; background: #0A1120; }
.photo-card__body { padding: 0.7rem 0.8rem; }
.photo-card__alt { color: var(--paper); font-size: 0.94rem; }
.photo-card__flag { font-size: 0.88rem; margin-top: 0.3rem; }
.photo-card__flag--yes { color: var(--ok); }
.photo-card__flag--no { color: var(--bad); }

/* Position 1 is the photo the store grid shows and a shared link previews,
   so the card that holds it says so rather than leaving it to be discovered. */
.photo-card--lead { border-color: var(--accent, var(--ok)); }
.photo-card__lead {
  color: var(--ok);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}
.photo-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

/* One description box per chosen file. The rows are built by portal.js; with
   scripting off this list never exists and the single-photo form shows
   instead. */
.photo-batch { margin-top: 1.1rem; }
.photo-batch__list { list-style: none; margin: 0.8rem 0 0; padding: 0; }
.photo-batch__row { margin-bottom: 0.75rem; }
.photo-batch__label {
  display: block;
  color: var(--steel);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  overflow-wrap: anywhere;
}
.photo-batch__row .field__input { width: 100%; }

.blockers {
  border: 1px solid color-mix(in srgb, var(--bad) 55%, var(--line-strong));
  border-radius: var(--r-control);
  background: color-mix(in srgb, var(--bad) 8%, transparent);
  padding: 0.85rem 1rem 0.85rem 1.9rem;
  margin: 0 0 1rem;
  color: var(--paper);
}
.blockers li { margin-bottom: 0.3rem; }

.ask-jeff {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--steel-bright);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
  background: var(--slate);
  white-space: nowrap;
}
.unverified {
  color: var(--s-quoted);
  font-size: 0.85rem;
  font-variation-settings: "wght" 680, "wdth" 92;
  white-space: nowrap;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-panel);
  padding: clamp(1.25rem, 1rem + 1.4vw, 2.5rem);
  text-align: left;
  color: var(--steel-bright);
  background: var(--graphite);
  max-width: 60ch;
}
.empty-state h2 { margin-bottom: 0.5rem; }

.login-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--gutter);
}
.login-card {
  width: min(26rem, 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--graphite);
  padding: clamp(1.25rem, 1rem + 1vw, 2rem);
}

/* ------------------------------------------------------------ breakpoints */

@media (min-width: 760px) {
  .board--open,
  .board--done { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: 13rem minmax(0, 1fr); }
  .facts dt { padding-top: 0.6rem; }
  .facts dd { padding-top: 0.6rem; }
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .weekday-checks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1000px) {
  .board--open,
  .board--done { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .split__main { grid-column: 1; grid-row: 1 / span 2; }
  .split__move { grid-column: 2; grid-row: 1; order: 0; }
  .split__consent { grid-column: 2; grid-row: 2; order: 0; }
}

/* Five open columns is the whole live pipeline on one screen at 1440. The
   archive stays at three -- it is reference, not work. */
@media (min-width: 1320px) {
  .board--open { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* On a phone the board is one prioritised list, top to bottom. No sideways
   dragging, ever: you cannot scroll two axes holding a phone in one glove.
   The header also stops sticking -- 100px of chrome on an 844px screen is a
   fifth of the yard gone. */
@media (max-width: 759px) {
  :root { --header-h: 0px; }
  .topbar { position: static; }
  .topbar__inner { flex-wrap: wrap; gap: 0.4rem 0.5rem; padding-bottom: 0.4rem; }
  .brand {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.6;
  }
  .brand__mark { margin-right: 0.4rem; }
  /* Five sections now (Intake joined Leads, Listings, Settings and Sign out).
     At 0.6rem of side padding the fifth one wraps to a second row and the
     header grows from 118px to 169px -- a sixth of an 844px screen spent on
     chrome. Trimmed to 0.45rem they all fit on one row again; the targets stay
     48px tall, which is the part that matters with gloves on. */
  /* Seven sections now (Stock and Till joined Leads, Intake, Listings,
     Settings and Sign out). Seven will not fit across 390px at a legible size,
     and shrinking them further would trade the one thing that matters with
     gloves on -- the 48px target -- for a row of chrome. So it is two tidy
     rows of a four-column grid rather than six-and-a-ragged-one: same height
     either way, but the eye finds an item by position instead of scanning. */
  .nav {
    margin-left: 0;
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.2rem;
  }
  .nav > * { min-width: 0; }
  .nav form { display: block; }
  .nav__link {
    justify-content: center;
    padding: 0 0.3rem;
    font-size: 0.92rem;
    width: 100%;
  }
  .live-region { position: static; }
  .board-tools__note { margin-left: 0; width: 100%; }
  .row-card__actions { margin-left: 0; width: 100%; }
  .page-head__actions { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (prefers-contrast: more) {
  :root { --line: #4A5A76; --line-strong: #637390; --steel: #A7B4C9; }
}

/* ---------------------------------------------------------- SMS thread */

/* A conversation reads top-to-bottom like a phone: outbound texts (what the
   yard said) sit on --slate against the right rail, inbound (what the seller
   said) sit on --graphite against the left. No --molten here -- an accent must
   not read as a bubble state, same rule as the status chips. */
.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.thread__msg {
  max-width: 85%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  padding: 0.6rem 0.85rem;
}
.thread__msg--out {
  justify-self: end;
  background: var(--slate);
  border-bottom-right-radius: 4px;
}
.thread__msg--in {
  justify-self: start;
  background: var(--graphite);
  border-bottom-left-radius: 4px;
}
.thread__body { margin: 0; color: var(--paper); overflow-wrap: anywhere; white-space: pre-wrap; }
.thread__meta { margin: 0.3rem 0 0; color: var(--steel); font-size: 0.82rem; }
.thread__empty { color: var(--steel); }

/* Calls: the receptionist's call log. A row-card per call with an expandable
   transcript. The transcript mirrors the SMS .thread bubbles -- the caller on
   one side, the assistant on the other -- so the two comms surfaces read the
   same. It is a <details>, so it is closed by default and costs no height
   until opened. */
.transcript {
  margin: 0.6rem 0 0;
  border-top: 1px solid var(--line);
  padding-top: 0.5rem;
}
.transcript__summary {
  cursor: pointer;
  color: var(--steel-bright);
  font-size: 0.85rem;
  list-style: none;
}
.transcript__summary::-webkit-details-marker { display: none; }
.transcript__summary::before {
  content: "\25B8";              /* right-pointing triangle */
  display: inline-block;
  margin-right: 0.45rem;
  color: var(--steel);
  transition: transform 0.15s var(--swift);
}
.transcript[open] .transcript__summary::before { transform: rotate(90deg); }
.transcript__body {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.6rem;
}
.transcript__turn {
  max-width: 85%;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  padding: 0.45rem 0.7rem;
}
.transcript__turn--assistant {
  justify-self: start;
  background: var(--graphite);
  border-bottom-left-radius: 4px;
}
.transcript__turn--caller {
  justify-self: end;
  background: var(--slate);
  border-bottom-right-radius: 4px;
}
.transcript__role {
  display: block;
  color: var(--steel);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.15rem;
}
.transcript__text { color: var(--paper); overflow-wrap: anywhere; white-space: pre-wrap; }
