/* Bigblue Dealer Portal — standalone styles (no dashboard CSS loads here). */
:root {
  --navy: #0d2a4d;
  --blue: #1d4f8a;
  --blue-hover: #163f6f;
  --blue-tint: #e8eff8;
  --ink: #14202e;
  --muted: #5b6878;
  --line: #d6dee8;
  --bg: #f3f6fa;
  --card: #ffffff;
  --red: #b42318;
  --red-tint: #fdecea;
  --focus: #3b82f6;
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 8px; top: -48px; z-index: 10;
  background: var(--card); color: var(--blue); padding: 8px 12px; border-radius: 6px;
}
.skip:focus { top: 8px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ── top bar (signed in) ─────────────────────────────────────────────── */
.topbar { background: var(--navy); color: #fff; }
.topbar-inner {
  max-width: 960px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand img { display: block; height: 33px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; letter-spacing: .14em; font-size: 15px; }
.brand-sub { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.who-name {
  font-size: 14px; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 40vw;
}
.topbar .link-btn { color: #fff; }
.topbar .link-btn:focus-visible { outline-color: #9cc3ff; }

/* ── layout ──────────────────────────────────────────────────────────── */
.main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 24px 16px 40px; }
.view-loading { display: flex; justify-content: center; padding: 80px 0; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--blue);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ── sign-in card ────────────────────────────────────────────────────── */
.view-signin { display: flex; justify-content: center; padding-top: 4vh; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(13, 42, 77, .05), 0 8px 24px rgba(13, 42, 77, .06);
}
.signin-card { width: 100%; max-width: 400px; padding: 28px 24px; border-top: 4px solid var(--blue); }
.signin-brand {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line);
}
.signin-brand img { display: block; height: 52px; width: auto; }
.wordmark { color: var(--blue); font-weight: 800; letter-spacing: .16em; font-size: 22px; line-height: 1.1; }
.wordmark-sub { color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }

.card-title { font-size: 20px; margin: 0 0 6px; font-weight: 650; }
.card-lead { margin: 0 0 18px; color: var(--muted); font-size: 14px; }

.field-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.input {
  display: block; width: 100%; padding: 11px 12px; font: inherit; font-size: 16px;
  color: var(--ink); background: #fff; border: 1px solid #b9c5d3; border-radius: 8px;
}
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59, 130, 246, .35); }
.input-code { font-size: 22px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.turnstile { margin-top: 14px; max-width: 100%; overflow: hidden; }

.btn {
  display: block; width: 100%; margin-top: 16px; padding: 12px 16px;
  font: inherit; font-size: 16px; font-weight: 600; border-radius: 8px; cursor: pointer; border: 0;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn[disabled] { opacity: .6; cursor: progress; }

.link-btn {
  background: none; border: 0; padding: 4px 2px; font: inherit; font-size: 14px;
  color: var(--blue); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.link-center { display: block; margin: 12px auto 0; }

.msg { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.msg-error { background: var(--red-tint); color: var(--red); }
.msg-info { margin: 0 0 16px; background: var(--blue-tint); color: var(--navy); }

/* ── home ────────────────────────────────────────────────────────────── */
.page-title { font-size: 24px; margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.page-lead { margin: 4px 0 20px; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; border-left: 4px solid var(--blue);
}
.tile-label { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tile-value {
  font-size: 30px; font-weight: 700; margin-top: 4px; line-height: 1.2;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.tile-note { font-size: 12px; color: var(--muted); }
.tile.is-past-due { border-left-color: var(--red); }
.tile.is-past-due .tile-value { color: var(--red); }

/* ── footer ──────────────────────────────────────────────────────────── */
.footer { text-align: center; color: var(--muted); font-size: 14px; padding: 20px 16px 28px; }
.footer a { color: var(--blue); overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .tiles { grid-template-columns: 1fr; gap: 12px; }
  .main { padding-top: 16px; }
  .signin-card { padding: 22px 18px; }
  .brand-sub { display: none; }
  .who { gap: 10px; }
}

/* ── Project B: tabs, Orders, order detail, Invoices ─────────────────── */
.main:focus { outline: none; }
.tabs { background: var(--navy); border-top: 1px solid rgba(255, 255, 255, .12); }
.tabs-inner {
  max-width: 960px; margin: 0 auto; padding: 0 8px;
  display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tabs-inner::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; color: rgba(255, 255, 255, .78); text-decoration: none; font-size: 15px; font-weight: 600;
  padding: 10px 12px 8px; border-bottom: 3px solid transparent; white-space: nowrap;
}
.tab:hover { color: #fff; }
.tab[aria-current="page"] { color: #fff; border-bottom-color: #7fb2ee; }
.tab:focus-visible { outline-color: #9cc3ff; outline-offset: -3px; }

a.tile-link { display: block; color: inherit; text-decoration: none; transition: box-shadow .15s, border-color .15s; }
a.tile-link:hover { box-shadow: 0 4px 14px rgba(13, 42, 77, .1); border-color: #b9c5d3; }
a.tile-link .tile-note { color: var(--blue); }
a.tile-link.is-past-due .tile-note { color: var(--red); }

.view-orders .page-title, .view-invoices .page-title { margin-bottom: 14px; }
.search { margin: 0 0 12px; }
.search .input { -webkit-appearance: none; appearance: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  font: inherit; font-size: 14px; font-weight: 600; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  background: var(--card); color: var(--blue); border: 1px solid #b9c5d3;
}
.chip[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }

.loading-line { display: flex; justify-content: center; padding: 24px 0; }
.spinner-sm { width: 22px; height: 22px; border-width: 3px; }

.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; color: inherit; text-decoration: none;
}
a.row:hover { border-color: #9fb3ca; box-shadow: 0 2px 10px rgba(13, 42, 77, .07); }
.row-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.row-title { font-weight: 700; color: var(--blue); overflow-wrap: anywhere; }
.row-mid { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--muted); }
.row-mid > * { overflow-wrap: anywhere; min-width: 0; }
.row-po { color: var(--ink); font-weight: 600; }
.row-amt { margin-left: auto; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.row-counts { font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; margin: 0; }
.btn-secondary { background: var(--card); color: var(--blue); border: 1px solid #b9c5d3; max-width: 240px; margin: 16px auto 0; }
.btn-secondary:hover { background: var(--blue-tint); }

.badge {
  display: inline-block; font-size: 12px; font-weight: 700; line-height: 1.4; padding: 1px 8px;
  border-radius: 999px; background: var(--blue-tint); color: var(--navy); white-space: nowrap;
}
.badge-shipped, .badge-paid { background: #e3f4ea; color: #1d6b3d; }
.badge-cancelled { background: #eceff3; color: var(--muted); }
.badge-pastdue { background: var(--red); color: #fff; }
.red { color: var(--red) !important; }
.muted { color: var(--muted); }
.strong { font-weight: 700; }
.mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 14px; overflow-wrap: anywhere; }

.back-link { display: inline-block; margin-bottom: 12px; color: var(--blue); font-weight: 600; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.missing-text { margin: 0 0 8px; font-weight: 600; }
.panel { padding: 16px 18px; margin-bottom: 14px; min-width: 0; }
.panel-title { font-size: 15px; font-weight: 700; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.panel a { color: var(--blue); }
.order-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0 0 10px; }
.kv { display: flex; gap: 8px; min-width: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.shipto { font-size: 15px; overflow-wrap: anywhere; }
.shipto-label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }

.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.lines th { text-align: left; color: var(--muted); font-weight: 600; font-size: 13px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.lines th.num { text-align: right; }
.lines td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.lines tbody tr:last-child td { border-bottom: 0; }
.lines .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lines .sku { font-weight: 600; white-space: nowrap; }
.lines td.is-bo { color: var(--red); font-weight: 700; background: var(--red-tint); }

.sublist { list-style: none; margin: 0; padding: 0; }
.subrow { padding: 10px 0; border-top: 1px solid var(--line); }
.subrow:first-child { border-top: 0; padding-top: 0; }
.subrow-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.subrow-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 14px; color: var(--muted); margin-top: 2px; }
.subrow-meta .strong { color: var(--ink); }
.subrow-track { font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.pdf-link {
  margin-left: auto; font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 6px;
  border: 1px solid var(--blue); text-decoration: none;
}
.pdf-link:hover { background: var(--blue-tint); }
.totals { margin: 0 0 0 auto; max-width: 320px; }
.totals .kv { justify-content: space-between; padding: 3px 0; }
.totals .kv dd { font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; font-size: 17px; }
.totals .grand dt { color: var(--ink); font-weight: 700; }

.inv-summary { margin: 0 0 14px; font-size: 16px; }

@media (max-width: 640px) {
  .panel { padding: 14px; }
  /* line table → stacked cards */
  .lines thead { display: none; }
  .lines, .lines tbody, .lines tr, .lines td { display: block; width: 100%; }
  .lines tr { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; }
  .lines td, .lines tbody tr:last-child td { border-bottom: 0; }
  .lines td {
    display: flex; justify-content: space-between; gap: 12px; padding: 3px 0;
    text-align: right; white-space: normal;
  }
  .lines td::before { content: attr(data-label); color: var(--muted); font-weight: 600; text-align: left; flex: 0 0 auto; }
  .lines td.is-bo { background: none; }
  .totals { max-width: none; }
}

/* ── Project C: Shop (price list | tiles), product popup, Quick order, Cart ──
   Price-list rows, the qty stepper and the popup are ported from the Rep App
   (static/css/rep_app.css table.rp-pl, .rp-q, #rp-pv) into the portal's own
   tokens; nothing here loads dashboard CSS. */
:root { --ok: #0a7a2f; --lo: #b36b00; --sec: #dfe8f3; --zebra: #f6f8fb; --hi: #fff4d6; }

.tab-cart { display: inline-flex; align-items: center; gap: 6px; }
.tab-count {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; text-align: center;
  background: #ffc233; color: var(--navy); font-size: 12px; font-weight: 800; line-height: 20px;
}
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 20px; }
.btn-inline { display: inline-block; width: auto; margin: 0; text-decoration: none; text-align: center; }
.home-actions .btn-secondary { max-width: none; }

.shop-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.seg { display: inline-flex; border: 1px solid #b9c5d3; border-radius: 8px; overflow: hidden; background: var(--card); }
.seg-btn { font: inherit; font-size: 14px; font-weight: 600; padding: 7px 14px; border: 0; background: none; color: var(--blue); cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid #b9c5d3; }
.seg-btn[aria-pressed="true"] { background: var(--blue); color: #fff; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chips-scroll .chip { flex: none; }

.stock { font-size: 13px; font-weight: 600; white-space: nowrap; }
.stock-in { color: var(--ok); }
.stock-low { color: var(--lo); }
.stock-out { color: var(--red); }
.tag-new { margin-left: 6px; color: var(--ok); font-size: 10px; font-weight: 800; letter-spacing: .04em; }

/* qty stepper (Rep App .rp-q) + Add */
.buy { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.qstep { display: inline-flex; align-items: stretch; border: 1px solid #9fb0c3; border-radius: 6px; overflow: hidden; background: #fff; }
.qstep button { background: none; border: 0; font: inherit; font-size: 18px; width: 34px; min-height: 34px; cursor: pointer; color: var(--navy); }
.qstep button:hover { background: var(--blue-tint); }
.qstep input {
  width: 48px; border: 0; border-left: 1px solid #9fb0c3; border-right: 1px solid #9fb0c3; text-align: center;
  font: inherit; font-size: 15px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield;
}
.qstep input::-webkit-outer-spin-button, .qstep input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.add-btn {
  font: inherit; font-size: 14px; font-weight: 700; padding: 7px 14px; min-height: 36px; border: 0; border-radius: 6px;
  background: var(--blue); color: #fff; cursor: pointer;
}
.add-btn:hover { background: var(--blue-hover); }
.add-btn[disabled] { opacity: .6; cursor: progress; }
.add-btn.is-done { background: var(--ok); }
.incart { flex-basis: 100%; text-align: right; font-size: 12px; font-weight: 700; color: var(--navy); }
.call { font-size: 14px; }

/* price list (Rep App table.rp-pl as a responsive grid) */
.pl-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.pl-wrap:empty { display: none; }
.pl-row {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) 110px 90px 90px 210px;
  align-items: center; gap: 4px 10px; padding: 7px 12px; border-top: 1px solid var(--line); font-size: 14px; cursor: pointer;
}
.pl-row:nth-of-type(even) { background: var(--zebra); }
.pl-row:hover { background: var(--blue-tint); }
.pl-head {
  background: var(--blue) !important; color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; border-top: 0; cursor: default; border-radius: var(--radius) var(--radius) 0 0;
}
.pl-head .pl-price, .pl-head .pl-map { text-align: right; }
.pl-head .buy { justify-content: flex-end; }
.pl-sku { overflow-wrap: anywhere; min-width: 0; }
.pl-name { all: unset; cursor: pointer; color: var(--blue); min-width: 0; overflow-wrap: anywhere; }
.pl-head .pl-name { color: #fff; cursor: default; }
.pl-name:hover { text-decoration: underline; }
.pl-name:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.pl-price { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-map { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.pl-map-l { display: none; }
.pl-kid .pl-sku { padding-left: 18px; }
.pl-sec {
  margin: 0; padding: 7px 12px; background: var(--sec); color: var(--blue); font-size: 13px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; border-top: 1px solid var(--line);
}
.pl-fam {
  display: flex; width: 100%; align-items: center; gap: 10px; flex-wrap: wrap; text-align: left;
  font: inherit; font-size: 14px; padding: 8px 12px; border: 0; border-top: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer;
}
.pl-fam:hover { background: var(--blue-tint); }
.pl-fam::before { content: "\25B8"; color: var(--blue); }
.pl-fam.open::before { content: "\25BE"; }
.pl-fam-sku { font-weight: 800; }
.pl-fam-label { color: var(--muted); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pl-fam-from { font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .pl-head { display: none; }
  .pl-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "sku price" "name name" "stock map" "buy buy";
    padding: 10px 12px;
  }
  .pl-sku { grid-area: sku; }
  .pl-name { grid-area: name; }
  .pl-stock { grid-area: stock; }
  .pl-price { grid-area: price; }
  .pl-map { grid-area: map; font-size: 13px; }
  .pl-map-l { display: inline; }
  .pl-row > .buy { grid-area: buy; justify-content: flex-start; }
  .pl-row > .buy .incart { flex-basis: auto; text-align: left; }
}

/* tiles */
.tiles-grid .pl-sec { border: 0; border-radius: 8px; margin: 18px 0 10px; }
.tiles-grid .pl-sec:first-child { margin-top: 0; }
.ptiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.ptile {
  display: flex; flex-direction: column; min-width: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.ptile:hover { box-shadow: 0 4px 14px rgba(13, 42, 77, .1); }
.ptile-media { all: unset; display: block; cursor: pointer; aspect-ratio: 1 / 1; background: #fff; }
.ptile-media:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.ptile-media .photo, .ptile-media .nophoto { width: 100%; height: 100%; min-height: 0; }
.photo { display: flex; align-items: center; justify-content: center; background: #fff; }
.photo img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.ptile-media .photo img { width: 100%; height: 100%; padding: 10px; }
/* no-photo tile (Rulings): flat navy, SKU in large type + the BIGBLUE wordmark */
.nophoto {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: var(--navy); color: #fff; padding: 16px; text-align: center; min-height: 160px;
}
.nophoto-sku { font-size: 22px; font-weight: 800; letter-spacing: .03em; overflow-wrap: anywhere; line-height: 1.15; }
.nophoto-mark { font-size: 12px; font-weight: 800; letter-spacing: .3em; opacity: .7; }
.ptile-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; flex: 1; }
.ptile-name { all: unset; cursor: pointer; font-weight: 700; color: var(--blue); overflow-wrap: anywhere; line-height: 1.3; }
.ptile-name:hover { text-decoration: underline; }
.ptile-name:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ptile-sku { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.ptile-price { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-variant-numeric: tabular-nums; }
.ptile-price .muted { font-size: 13px; }
.ptile .buy { margin-top: auto; padding-top: 6px; justify-content: flex-start; }
.ptile .incart { text-align: left; }

/* product popup (Rep App #rp-pv): bottom sheet on phones, centred card wider */
body.pv-open { overflow: hidden; }
.pv-bg { position: fixed; inset: 0; z-index: 49; background: rgba(7, 19, 31, .5); }
.pv {
  position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow-y: auto;
  background: var(--card); border-radius: 14px 14px 0 0; padding: 14px 16px 18px;
  box-shadow: 0 -8px 30px rgba(7, 19, 31, .25);
}
.pv-x {
  position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border: 0; border-radius: 20px; z-index: 1;
  background: rgba(255, 255, 255, .9); font-size: 18px; cursor: pointer; color: var(--ink);
}
.pv-x:hover { background: var(--blue-tint); }
.pv-img { margin: -14px -16px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.pv-img .photo img { max-height: 42vh; }
.pv-img .nophoto { min-height: 200px; }
.pv-title { font-size: 20px; margin: 0; padding-right: 44px; overflow-wrap: anywhere; }
.pv-sku { margin: 2px 0 8px; font-size: 14px; }
.pv-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin: 0 0 12px; }
.pv-specs { width: 100%; border-collapse: collapse; margin: 4px 0 14px; font-size: 14px; line-height: 1.35; }
.pv-specs th, .pv-specs td { text-align: left; vertical-align: top; padding: 5px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.pv-specs th { width: 38%; padding-right: 10px; font-weight: 600; color: var(--muted); }
.pv-desc { margin: 0 0 14px; line-height: 1.5; }
.pv-link { display: inline-block; margin: 0 0 6px; color: var(--blue); font-weight: 700; }
.pv-buy { border-top: 1px solid var(--line); padding-top: 12px; }
.pv-buy .buy { justify-content: flex-start; }
.pv-buy .incart { text-align: left; }
@media (min-width: 700px) {
  .pv {
    left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%);
    width: 600px; max-width: calc(100vw - 32px); max-height: 88vh; border-radius: 12px;
  }
  .pv-img { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
}

/* quick order */
.quick-card { padding: 18px; }
.quick-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; gap: 12px; align-items: end; }
.quick-find { position: relative; min-width: 0; }
.quick-add { min-height: 46px; }
.quick-pick { margin: 10px 0 0; min-height: 1.5em; font-size: 14px; }
.suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin: 4px 0 0; padding: 4px 0; list-style: none;
  background: var(--card); border: 1px solid #b9c5d3; border-radius: 8px; box-shadow: 0 8px 24px rgba(13, 42, 77, .15);
  max-height: 320px; overflow-y: auto;
}
.suggest-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding: 8px 12px; cursor: pointer; font-size: 14px; }
.suggest-item:hover, .suggest-item.is-active { background: var(--blue-tint); }
.suggest-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-price { font-weight: 700; font-variant-numeric: tabular-nums; }
#quick-added-wrap .btn-inline { margin-top: 12px; }
#quick-added .subrow-top .strong { margin-right: 4px; }

/* cart */
.cart-lines { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cart-line { padding: 12px 14px; }
.cart-line.is-gone { border-color: #f1b8b2; background: #fffafa; }
.cl-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.cl-sku { font-weight: 800; }
.cl-name { color: var(--muted); overflow-wrap: anywhere; min-width: 0; }
.cl-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; }
.cl-price { font-size: 14px; font-variant-numeric: tabular-nums; }
.cl-total { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.cl-gone { font-size: 14px; font-weight: 600; }
.cl-foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.cl-bo { font-size: 13px; font-weight: 700; color: var(--lo); }
.cl-rm { margin-left: auto; color: var(--red); }
.cart-sum .totals { max-width: 380px; }
.cart-sum .totals .disc dd { color: var(--ok); }
.cart-hint {
  margin: 10px 0 0 auto; max-width: 380px; padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 700;
  background: var(--hi); color: #7a4a00; text-align: right;
}
.cart-note { margin: 8px 0 0 auto; max-width: 380px; font-size: 13px; text-align: right; }
.cart-sum .btn-primary { max-width: 380px; margin-left: auto; }
.cart-sum .link-center { margin-right: 0; margin-left: auto; display: block; }
.cart-empty a { color: var(--blue); }

@media (max-width: 640px) {
  .quick-row { grid-template-columns: minmax(0, 1fr) 90px; }
  .quick-add { grid-column: 1 / -1; width: 100%; }
  .ptiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .nophoto-sku { font-size: 17px; }
  .ptile .qstep button { width: 30px; }
  .ptile .qstep input { width: 38px; }
  .cart-hint, .cart-note, .cart-sum .btn-primary, .cart-sum .totals { max-width: none; text-align: left; }
}

/* ── checkout ─────────────────────────────────────────────────────────── */
.co-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; margin-top: 16px; }
.co-main { display: grid; gap: 16px; min-width: 0; }
.co-sec { margin: 0; }
.co-sum { position: sticky; top: 12px; margin: 0; }
.co-sum .totals, .co-sum .cart-hint, .co-sum .cart-note, .co-sum .btn-primary { max-width: none; }
.co-count { margin: -4px 0 8px; font-size: 14px; }
.co-radios { display: grid; gap: 8px; }
.co-radio {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.co-radio:has(input:checked) { border-color: var(--blue); background: var(--blue-tint); }
.co-radio input { margin-top: 4px; flex: none; }
.co-radio-text { display: flex; flex-direction: column; min-width: 0; }
.co-radio-title { font-weight: 600; }
.co-radio-sub { font-size: 13px; overflow-wrap: anywhere; }
.co-drop { border: 0; padding: 0; margin: 12px 0 0; min-width: 0; }
.co-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; }
.co-f { grid-column: span 1; min-width: 0; }
.co-f-wide { grid-column: span 2; }
.co-f:not(.co-f-wide):not(.co-f-sm) { grid-column: span 2; }
.co-gap { margin-top: 12px; }
.co-notes { resize: vertical; min-height: 72px; }
.co-paynote { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: var(--blue-tint); color: var(--navy); font-size: 14px; font-weight: 600; }
#co-addcard { margin-top: 10px; }
.co-card { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.co-card-el { padding: 12px; border: 1px solid #b9c5d3; border-radius: 8px; background: #fff; min-height: 44px; }
.co-card-err { margin: 8px 0 0; font-size: 14px; min-height: 1em; }
.co-card-actions { display: flex; align-items: center; gap: 14px; }
.co-card-actions .btn { width: auto; margin-top: 8px; }
.co-nocard { margin: 0; font-size: 14px; }
.co-review { margin: 12px 0 0; font-size: 14px; }
.co-why { margin: 8px 0 0; font-size: 14px; font-weight: 600; }
.co-banner { margin: 12px 0 0; font-weight: 700; }
.placed-card { max-width: 560px; }
.placed-card .btn-primary { color: #fff; }
.placed-so { font-size: 18px; margin: 12px 0 4px; }
.placed-total { margin: 0 0 12px; }

@media (max-width: 860px) {
  .co-grid { grid-template-columns: minmax(0, 1fr); }
  .co-sum { position: static; }
}
@media (max-width: 640px) {
  .co-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .co-f, .co-f-wide, .co-f:not(.co-f-wide):not(.co-f-sm) { grid-column: 1 / -1; }
  .co-f-sm { grid-column: span 1; }
}

/* ── Project E: Account ──────────────────────────────────────────────── */
.msg-ok { background: #e3f4ea; color: #1d6b3d; }
.acct-body { display: grid; gap: 16px; margin-top: 4px; }
.acct-sec { margin: 0; }
.acct-note { margin: 8px 0 0; font-size: 14px; }
.acct-callout { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: var(--blue-tint); color: var(--navy); font-size: 14px; font-weight: 600; }
.acct-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.acct-facts dt { color: var(--muted); font-size: 14px; font-weight: 600; }
.acct-facts dd { margin: 0; overflow-wrap: anywhere; }
.acct-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 12px; }
.acct-actions .btn { margin-top: 0; }
.acct-rcpts { display: grid; gap: 8px; }
.acct-rcpt {
  display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(0, 2fr) auto; gap: 8px 14px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.acct-rcpt.is-locked { background: var(--zebra, #f6f8fb); }
.acct-rcpt-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.acct-rcpt-email { font-weight: 600; overflow-wrap: anywhere; }
.acct-rcpt-input { padding: 8px 10px; }
.acct-lock { flex-basis: 100%; font-size: 12.5px; color: var(--muted); }
.acct-lock::before { content: "\1F512\FE0E  "; }
.acct-rcpt-kinds { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.acct-kind { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.acct-rcpt.is-locked .acct-kind { cursor: default; color: var(--muted); }
.acct-rcpt-end { display: flex; align-items: center; gap: 10px; }
.acct-role { width: auto; padding: 6px 8px; }
.acct-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.acct-item {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.acct-item.is-default { border-color: var(--blue); }
.acct-item-main { min-width: 0; }
.acct-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.acct-item-sub { font-size: 14px; overflow-wrap: anywhere; }
.acct-acts { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.acct-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex-basis: 100%; }
.acct-confirm-q { font-weight: 600; }
.acct-danger { background: var(--red); color: #fff; padding: 8px 14px; font-size: 14px; margin: 0; }
.acct-empty { padding: 6px 0; border: 0; }
.acct-form { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.acct-form-title { font-size: 15px; margin: 0 0 10px; }
#acct-addcard { margin-top: 10px; }

@media (max-width: 600px) {
  .acct-rcpt { grid-template-columns: minmax(0, 1fr); }
  .acct-facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .acct-facts dd { margin-bottom: 8px; }
  .acct-body .co-fields { grid-template-columns: minmax(0, 1fr); }
  .acct-body .co-f, .acct-body .co-f-wide, .acct-body .co-f-sm { grid-column: 1 / -1; }
}

/* ── Heated package (Part 3): shop card, configurator #pkg, cart group ───── */
.pkg-card-wrap { margin: 0 0 14px; }
.pkg-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 16px;
  border-left: 4px solid var(--blue); background: var(--blue-tint);
}
.pkg-card-text { flex: 1 1 260px; min-width: 0; }
.pkg-card-title { font-weight: 800; color: var(--navy); overflow-wrap: anywhere; }
.pkg-card-note { font-size: 14px; margin-top: 2px; }
.pkg-card-btn { flex: none; }
.pkg-note { margin: 6px 0 10px; font-size: 14px; }
.pkg-slot { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 10px 0 6px; min-width: 0; }
.pkg-slot-head { display: flex; align-items: center; gap: 8px; padding: 0; font-weight: 700; margin-bottom: 6px; }
.badge-req { background: var(--navy); color: #fff; }
.badge-bo { background: var(--red-tint); color: var(--red); }
.pkg-group { font-size: 13px; font-weight: 600; margin: 8px 0 2px; text-transform: uppercase; letter-spacing: .04em; }
.pkg-opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; margin: 4px 0;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.pkg-opt:hover { background: var(--blue-tint); }
.pkg-opt:has(input:checked) { border-color: var(--blue); background: var(--blue-tint); }
.pkg-opt input { margin-top: 3px; flex: none; width: 18px; height: 18px; }
.pkg-opt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.pkg-opt-top { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.pkg-opt-name { font-weight: 600; overflow-wrap: anywhere; }
.pkg-opt-sku { font-size: 13px; overflow-wrap: anywhere; }
.pkg-opt-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 14px; font-variant-numeric: tabular-nums; }
.pkg-foot { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 6px; }
.pkg-count { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.pkg-count .field-label { margin: 0; }
.pkg-totals { margin: 0 0 10px; }
.pkg-toast {
  position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(7, 19, 31, .3); max-width: calc(100vw - 32px);
}
.cart-pkg .pkg-title { color: var(--navy); }
.pkg-parts { list-style: none; margin: 10px 0 0; padding: 0 0 0 16px; border-left: 3px solid var(--blue-tint); }
.pkg-part-line { padding: 6px 0; border-top: 1px solid var(--line); }
.pkg-part-line:first-child { border-top: 0; }
.pkg-part-line .cl-row { margin-top: 4px; }
.pkg-part-line .cl-bo { display: block; margin-top: 2px; }
.pkg-qty { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lines td.pkg-head { font-weight: 800; }
.lines tr.pkg-part td.name { padding-left: 24px; }
