/* partSmart supplier portal.
   Tokens match assets/styles.css in partsmart-website so the two read as one
   brand: the same navy, the same partSmart blue, Inter with Lora for display,
   white cards on a cream ground. Only what this page needs is carried over.

   No inline styles anywhere, and none may be added: the Content Security
   Policy in customHttp.yml has no 'unsafe-inline' for style-src. Everything
   is a class, including state (.is-on, .is-done, .is-current). */

:root {
  --navy-900: #061837;
  --navy-800: #0a2455;
  --navy-700: #082c7f;

  --accent: #0180df;
  --accent-600: #0169b8;
  --accent-soft: #e8f4fd;

  --green-600: #157a3f;
  --green-soft: #e4f6ea;
  --amber-700: #a15c00;
  --amber-soft: #fff3dc;
  --red-600: #b3261e;
  --red-soft: #fdecec;

  --cream: #faf7f2;
  --cream-2: #f2ecdf;
  --white: #ffffff;
  --ink: #1c2434;
  --muted: #5b6474;
  --muted-2: #8b93a1;
  --line: #e6e0d4;
  --line-2: #d6dae0;

  --font-display: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "Segoe UI", -apple-system, Helvetica, Arial, sans-serif;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --shadow-card: 0 10px 30px rgba(6, 24, 55, 0.06);
  --shadow-hover: 0 14px 36px rgba(6, 24, 55, 0.1);
  --ring: 0 0 0 3px var(--accent-soft);
  --max: 980px;
}

* { box-sizing: border-box; }

/* The hidden attribute is how this page switches views, and an author rule as
   ordinary as .field { display: block } beats the user-agent [hidden] rule and
   puts the element back on screen. Said once here so every hidden element
   stays hidden. */
[hidden] { display: none !important; }

html { color-scheme: light; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }

/* ---------- a11y helpers ---------- */

.skip {
  position: absolute;
  left: -999px;
  top: 10px;
  z-index: 100;
  background: var(--white);
  color: var(--navy-800);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
}
.skip:focus { left: 10px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

button:focus-visible,
a:focus-visible,
.order:focus-visible {
  outline: 3px solid rgba(1, 128, 223, 0.5);
  outline-offset: 2px;
}

/* ---------- chrome ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(8, 44, 127, 0.05);
}

/* A slim brand stripe: navy into partSmart blue, the two colours the app,
   the poster and the emails all lead with. */
.topbar::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--navy-900), var(--accent));
}

.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

/* The original square mark, trimmed to the artwork with its white ground made
   transparent; the wordmark under the P needs this height to stay legible. */
.logo { height: 52px; width: auto; display: block; }

.brand-tag {
  padding-left: 14px;
  border-left: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--navy-800);
  white-space: nowrap;
}

.topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-right .btn { white-space: nowrap; }

.whoami {
  color: var(--muted);
  font-size: 13px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.foot {
  max-width: var(--max);
  margin: 28px auto 32px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  color: var(--muted-2);
  font-size: 13px;
}

.foot-links { display: flex; flex-wrap: wrap; gap: 18px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--accent-600); text-decoration: underline; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 8px 22px rgba(1, 128, 223, 0.28);
}
.btn-primary:hover { background: var(--accent-600); transform: translateY(-1px); }

.btn-secondary { background: var(--navy-800); color: var(--white); }
.btn-secondary:hover { background: var(--navy-700); }

.btn-ghost { background: transparent; color: var(--navy-700); border-color: var(--navy-700); }
.btn-ghost:hover { background: var(--navy-700); color: var(--white); }

.btn-small { padding: 8px 14px; font-size: 14px; }
.btn-block { width: 100%; }

.btn[disabled] { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }

.link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-600);
  cursor: pointer;
}
.link-button:hover { text-decoration: underline; }

/* ---------- type ---------- */

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-600);
}

.display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--navy-700);
  margin: 0 0 10px;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 54ch;
}

/* ---------- layout ---------- */

main { max-width: var(--max); margin: 0 auto; padding: 36px 20px 20px; width: 100%; }

.page { max-width: 820px; margin: 0 auto; }

.card {
  background: var(--white);
  border: 1px solid rgba(6, 24, 55, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* ---------- auth ---------- */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "intro" "card" "how";
  gap: 28px;
  align-items: start;
}

.auth-intro { grid-area: intro; }
.auth-card { grid-area: card; width: 100%; max-width: 480px; justify-self: center; padding: 26px 24px 24px; }
.how { grid-area: how; }

.auth-card .segmented { display: flex; width: 100%; margin-bottom: 22px; }

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  color: var(--navy-900);
  margin: 0 0 4px;
}

.card-sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.55; }

.how {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.how li { display: flex; gap: 14px; align-items: flex-start; }

.how-n {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy-900);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.how-text strong { display: block; color: var(--navy-800); font-size: 15px; margin-bottom: 2px; }
.how-text span { color: var(--muted); font-size: 14px; line-height: 1.55; }

.auth-foot { text-align: center; margin: 16px 0 0; font-size: 14px; }

/* ---------- segmented control ---------- */

.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--cream-2);
  border-radius: var(--radius-pill);
}

.seg {
  flex: 1 1 auto;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.seg:hover { color: var(--navy-800); }
.seg.is-on { background: var(--white); color: var(--navy-900); box-shadow: 0 1px 3px rgba(6, 24, 55, 0.14); }

.segmented-small .seg { padding: 7px 12px; font-size: 13px; }

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

.field { display: block; margin-bottom: 16px; }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 6px;
}

.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

.input {
  width: 100%;
  font: inherit;
  /* 16px or iOS zooms the page when the field takes focus. */
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder { color: var(--muted-2); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

.password-wrap { position: relative; }
.password-wrap .input { padding-right: 64px; }

.peek {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-600);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
}
.peek:hover { background: var(--accent-soft); }

.hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

.hint-info {
  background: var(--accent-soft);
  color: var(--accent-600);
  border-radius: 10px;
  padding: 10px 12px;
  margin: -6px 0 16px;
}

/* ---------- callouts ---------- */

.callout {
  margin: 14px 0 0;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  line-height: 1.5;
  background: var(--cream-2);
  color: var(--ink);
}
.callout.is-error { background: var(--red-soft); color: var(--red-600); }
.callout.is-good { background: var(--green-soft); color: var(--green-600); }
.callout.is-info { background: var(--accent-soft); color: var(--accent-600); }
.callout.is-warn { background: var(--amber-soft); color: var(--amber-700); }
.callout.notice { margin: 0 0 16px; }

/* ---------- orders ---------- */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.page-head .lede { font-size: 15px; }

.orders { display: grid; gap: 12px; }

.order {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: var(--white);
  border: 1px solid rgba(6, 24, 55, 0.08);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.order:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); border-color: rgba(1, 128, 223, 0.35); }
.order:hover .chev { color: var(--accent); }

/* A new order carries a blue edge until the supplier acknowledges it. */
.order.is-new { box-shadow: inset 4px 0 0 var(--accent), var(--shadow-card); }
.order.is-new:hover { box-shadow: inset 4px 0 0 var(--accent), var(--shadow-hover); }

.order-main { flex: 1 1 auto; min-width: 0; }
.order-title { font-weight: 700; font-size: 16px; color: var(--navy-900); }

.order-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
}
.order-sub span + span::before { content: "\00B7"; margin-right: 8px; color: var(--muted-2); }

.order-right { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }

.chev { width: 18px; height: 18px; color: var(--muted-2); flex: 0 0 auto; transition: color 0.15s ease; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.8; }

.pill-sent { background: var(--accent-soft); color: var(--accent-600); }
.pill-acknowledged,
.pill-picking,
.pill-partial { background: var(--amber-soft); color: var(--amber-700); }
.pill-ready,
.pill-dispatched { background: var(--green-soft); color: var(--green-600); }
.pill-closed { background: #e9edf5; color: var(--navy-800); }
.pill-cancelled { background: #eeeeee; color: #5f6672; }

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 14px;
  background: var(--white);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-md);
}
.empty-icon { width: 40px; height: 40px; color: var(--accent); display: block; margin: 0 auto 10px; }
.empty strong { display: block; color: var(--navy-800); font-size: 16px; margin-bottom: 4px; }

.skeleton {
  height: 76px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #f1ede5 25%, #f8f5ef 50%, #f1ede5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- one order ---------- */

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-600);
  cursor: pointer;
}
.back:hover { text-decoration: underline; }

.detail-head { margin-bottom: 20px; }
.detail-title { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.detail-title .display { margin: 0; }

.meta {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.meta li {
  font-size: 13px;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 5px 11px;
}
.meta li strong { color: var(--ink); font-weight: 600; }

.block { padding: 22px 22px 20px; margin-bottom: 16px; }
.block-head { margin-bottom: 16px; }

.block-title {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  color: var(--navy-900);
  margin: 0 0 4px;
}
.block-note { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.count { color: var(--muted-2); font-weight: 500; font-size: 14px; margin-left: 6px; }

/* progress */

.steps { list-style: none; margin: 0; padding: 0; display: flex; }
.steps li { position: relative; flex: 1 1 0; min-width: 0; }

.steps li::before,
.steps li::after {
  content: "";
  position: absolute;
  top: 19px;
  width: 50%;
  height: 2px;
  background: var(--line-2);
}
.steps li::before { left: 0; }
.steps li::after { right: 0; }
.steps li:first-child::before,
.steps li:last-child::after { display: none; }
.steps li.is-done::before,
.steps li.is-done::after,
.steps li.is-current::before { background: var(--navy-800); }

.step {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 4px 2px 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  background: var(--white);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.step-dot svg { width: 15px; height: 15px; }

.step:hover { color: var(--accent-600); }
.step:hover .step-dot { border-color: var(--accent); color: var(--accent); }

.steps li.is-done .step { color: var(--navy-800); }
.steps li.is-done .step-dot { background: var(--navy-800); border-color: var(--navy-800); color: var(--white); }

.steps li.is-current .step { color: var(--accent-600); }
.steps li.is-current .step-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.steps.is-cancelled { opacity: 0.5; }

.partial-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.chip {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent-600); }
.chip.is-on { border-color: transparent; color: var(--white); }
.chip.is-on:hover { color: var(--white); }
.chip-warn.is-on,
.chip.s-short.is-on { background: var(--amber-700); }
.chip.s-in_stock.is-on { background: var(--green-600); }
.chip.s-substitute.is-on { background: var(--accent-600); }
.chip.s-discontinued.is-on { background: var(--red-600); }

.etaRow {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-top: 18px;
}
.inline { display: block; }
.inline > span { display: block; font-size: 13px; font-weight: 600; color: var(--navy-800); margin-bottom: 6px; }
.inline .input { padding: 10px 12px; }

/* lines */

.lines { display: grid; gap: 12px; }
/* A heading each time the part group changes: like with like, as a counter picks. */
.line-group {
  margin: 10px 0 -4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.line-group:first-child { margin-top: 0; }
.line-group-count {
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--line);
  color: var(--navy-800);
  font-size: 11px;
  letter-spacing: 0;
}

.line {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--white);
}

.line-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.line-name { flex: 1 1 auto; min-width: 0; }
/* The merchant's own code for the part, between the photo and our name. */
.line-code {
  flex: 0 0 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-800);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 7px;
  white-space: nowrap;
}
/* The product photo, or an outlined tile where the company has none. */
.line-img {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
}
.line-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.line-img svg { width: 22px; height: 22px; }
a.line-img:hover { border-color: var(--accent); }
a.line-img:focus-visible { outline: none; box-shadow: var(--ring); }
/* The details row with the PO's PDF at its right-hand end. */
.meta-row { display: flex; align-items: flex-start; gap: 12px; }
.meta-row .meta { flex: 1 1 auto; }
.pdf-link {
  flex: 0 0 auto;
  margin: 8px 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  border-radius: 8px;
}
.pdf-link:hover { color: var(--accent-600); }
.pdf-link:focus-visible { outline: none; box-shadow: var(--ring); }
.pdf-logo { width: 34px; height: 42px; display: block; filter: drop-shadow(0 1px 1px rgba(6, 24, 55, 0.14)); }
.order-sub .is-you { color: var(--accent-600); font-weight: 600; }
.line-name { font-weight: 700; font-size: 15px; color: var(--navy-900); }
.line-qty {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-800);
  background: var(--cream-2);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  white-space: nowrap;
}

.line-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.line-note { margin-top: 10px; font-size: 14px; padding: 10px 12px; }
.line .callout { margin-top: 10px; padding: 8px 12px; font-size: 13px; }

/* thread */

.thread { display: grid; gap: 10px; margin-bottom: 14px; }

.msg {
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 78%;
  color: var(--ink);
}
.msg-supplier { background: var(--accent-soft); justify-self: end; border-bottom-right-radius: 4px; }
.msg-customer { background: var(--cream-2); justify-self: start; border-bottom-left-radius: 4px; }
.msg-who { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }

.thread .empty { padding: 22px; }

.messageForm { display: flex; gap: 10px; align-items: flex-end; }
.messageForm .input { flex: 1 1 auto; resize: vertical; min-height: 48px; font-size: 15px; }

/* ---------- loading ---------- */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 0;
  color: var(--muted);
  font-size: 14px;
}
.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid var(--cream-2);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- help dialog ---------- */

.foot-button { font-size: 13px; font-weight: 400; color: var(--muted); }
.foot-button:hover { color: var(--accent-600); }

dialog.help {
  border: 0;
  padding: 0;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--white);
  color: var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(6, 24, 55, 0.28);
}
dialog.help::backdrop { background: rgba(6, 24, 55, 0.45); }

.help-form { padding: 26px 24px 22px; }
.help-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* The honeypot: present for scripts, absent for people and screen readers. */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- legal pages ---------- */

.legal { max-width: 760px; margin: 0 auto; }
.legal-card { padding: 32px 36px 28px; }
.legal .back { padding-bottom: 18px; text-decoration: none; }
.legal .back:hover { text-decoration: underline; }
.legal .meta { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.legal h2 {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-900);
  margin: 30px 0 8px;
}
.legal h3 { font-size: 15px; font-weight: 700; color: var(--navy-800); margin: 18px 0 6px; }
.legal p, .legal li { font-size: 15px; line-height: 1.65; margin: 0 0 12px; }
.legal li { margin-bottom: 6px; }
.legal em { color: var(--muted); }
.legal a { color: var(--accent-600); }
.legal address { font-style: normal; line-height: 1.65; margin: 0 0 12px; font-size: 15px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0 14px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); line-height: 1.5; }
.legal th { color: var(--navy-800); font-weight: 600; }

@media (max-width: 560px) {
  .legal-card { padding: 22px 18px 20px; }
  .help-form { padding: 22px 18px 18px; }
}

/* ---------- list tools, short lines, team ---------- */

.page-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.search { width: 240px; padding: 9px 12px; font-size: 14px; border-radius: var(--radius-pill); }
.order-sub .is-complete { color: var(--green-600); font-weight: 600; }
/* The branch a line is in stock at, beside the answer chips. */
.line-location { flex: 0 1 220px; min-width: 150px; padding: 7px 10px; font-size: 13px; }
.location-name { padding: 8px 10px; font-size: 14px; }
.part-more { display: block; margin: 14px auto 0; }
.waiting { max-width: 560px; margin: 24px auto; }
.waiting .display { font-size: 28px; }
.waiting .btn { margin-top: 10px; }

.line-extra {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.line-extra .input { padding: 9px 11px; font-size: 14px; }

.team { margin-top: 28px; }
.members { display: grid; gap: 8px; }
.member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.member.is-invite { border-style: dashed; }
.member-main { flex: 1 1 auto; min-width: 0; }
.member-email { font-size: 14px; font-weight: 600; color: var(--navy-900); overflow-wrap: anywhere; }
.member-sub { font-size: 13px; color: var(--muted); }
.btn-tiny { padding: 6px 12px; font-size: 13px; }
.inviteForm { display: flex; gap: 10px; margin-top: 14px; }
.inviteForm .input { flex: 1 1 auto; }

@media (max-width: 560px) {
  /* The top bar did not fit a phone: "Supplier portal" cannot wrap, so it
     ran under the search button and Sign out hung off the right edge. The
     logo already says partSmart; the tag goes, and the gaps tighten. */
  .brand-tag { display: none; }
  .topbar-inner { padding: 10px 14px; gap: 10px; }
  .topbar-right { gap: 8px; }
  .page-tools { width: 100%; }
  .search { width: 100%; }
  .inviteForm { flex-direction: column; }
  .inviteForm .btn { width: 100%; }
}

/* ---------- wide screens ---------- */

@media (min-width: 900px) {
  .auth {
    grid-template-columns: minmax(0, 1fr) 440px;
    grid-template-areas: "intro card" "how card";
    column-gap: 56px;
    row-gap: 32px;
    padding-top: 20px;
  }
  .auth-card { justify-self: end; }
  .auth .display { font-size: 40px; }
}

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

@media (max-width: 640px) {
  .whoami { display: none; }
  /* The privacy page's header button; the back link under the header stays. */
  .narrow-hide { display: none; }
}

@media (max-width: 560px) {
  main { padding: 22px 16px 16px; }
  .display { font-size: 28px; }
  .auth { gap: 22px; }
  .auth-card { padding: 22px 18px 20px; border-radius: var(--radius-md); }
  .card-title { font-size: 22px; }
  .block { padding: 18px 16px; border-radius: var(--radius-md); }
  .page-head { align-items: stretch; }
  .page-head .segmented { display: flex; }
  .order { padding: 14px 14px 14px 16px; gap: 12px; }
  /* Stacked, not wrapped: a wrapped row left the separator dot stranded at
     the start of the second line. */
  .order-sub { flex-direction: column; gap: 1px; }
  .order-sub span + span::before { display: none; }
  .brand-tag { font-size: 13px; padding-left: 12px; }
  .logo { height: 44px; }

  /* The track turns vertical: five labelled steps across 340px is a squeeze. */
  .steps { flex-direction: column; }
  .steps li { flex: none; }
  .steps li::before,
  .steps li::after { left: 15px; right: auto; width: 2px; height: 50%; }
  .steps li::before { top: 0; bottom: auto; }
  .steps li::after { top: auto; bottom: 0; }
  .step { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 7px 0; text-align: left; }

  .etaRow { grid-template-columns: 1fr; }
  .etaRow .btn { width: 100%; }
  .msg { max-width: 92%; }
  .messageForm { flex-direction: column; align-items: stretch; }
}

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

/* ---------- settings ---------- */

/* The gear in the top bar. A circle like the sign-out pill, so the two sit as a pair. */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--navy-700);
  background: transparent;
  color: var(--navy-700);
  cursor: pointer;
  flex: none;
}
.icon-btn:hover { background: var(--navy-700); color: var(--white); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.icon-btn svg { width: 19px; height: 19px; }

/* Password rules, ticking off as the person types. */
.reqs {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
  color: var(--muted);
}
.reqs li { display: inline-flex; align-items: center; gap: 7px; }
.reqs li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-2);
  flex: none;
}
.reqs li.is-ok { color: var(--green-600); }
.reqs li.is-ok::before { background: var(--green-600); }

.form-actions { display: flex; justify-content: flex-end; margin-top: 4px; }

/* A member row's role and remove controls, for admins. */
.member-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.role-select {
  width: auto;
  padding: 6px 30px 6px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

/* Automatic sign-out: a label, a select and a button on one line, wrapping on a phone. */
.inline-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.inline-form .inline { flex: 1 1 260px; }
.inline-form .inline .input { width: 100%; }

/* ---------- parts lookup ---------- */
.parts { display: grid; gap: 8px; margin-top: 12px; }
.parts-count { font-size: 13px; color: var(--muted); margin: 14px 0 0; min-height: 18px; }
.part {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}
.part-main { flex: 1 1 auto; min-width: 0; }
.part-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.part-name { font-weight: 700; font-size: 15px; color: var(--navy-900); }
.part-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.parts-link { gap: 8px; }
.parts-link svg { width: 16px; height: 16px; }
