/* EDGE Wholesale dealer order form */
:root {
  --ink: #231F20;        /* brand charcoal */
  --ink-2: #4A4647;
  --muted: #6E726C;
  --faint: #9A9E98;
  --line: #E7E9E5;
  --line-2: #F0F1EE;
  --bg: #FFFFFF;
  --soft: #F7F8F6;
  --green: #83B34F;      /* brand green */
  --green-hover: #77A646;
  --green-ink: #4A7524;  /* green text on light */
  --green-wash: #F3F8EC;
  --danger: #B3261E;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --shadow: 0 1px 2px rgba(35, 31, 32, .04), 0 8px 24px rgba(35, 31, 32, .06);
  --topbar: 72px;
  --display: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  --body: 'Barlow Semi Condensed', 'Arial Narrow', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 20px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body);
  font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* views */
.view { display: none; }
body[data-view="shop"] .view-shop,
body[data-view="review"] .view-review,
body[data-view="sent"] .view-sent { display: block; }
body:not([data-view="shop"]) .shop-tools { display: none; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { height: var(--topbar); display: flex; align-items: center; gap: 28px; }
.brand { display: block; line-height: 0; flex: none; }
.logo { height: 38px; width: auto; }
.shop-tools { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.search { position: relative; flex: 1; max-width: 520px; display: flex; align-items: center; }
.search svg { position: absolute; left: 14px; color: var(--faint); pointer-events: none; }
.search input {
  width: 100%; height: 42px; padding: 0 16px 0 42px;
  border: 1px solid transparent; border-radius: 999px; background: var(--soft);
  font-size: 15px; transition: background .15s, border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--faint); }
.search input:hover { background: #F1F2EF; }
.search input:focus { outline: none; background: #fff; border-color: var(--line); box-shadow: 0 0 0 4px rgba(131, 179, 79, .18); }
.jump { display: none; }
.jump select { height: 42px; border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 0 14px; max-width: 200px; }
.print-list { margin-left: auto; }

/* ---------- buttons ---------- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border: 0; border-radius: var(--r);
  background: var(--green); color: var(--ink);
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn-primary:hover:not(:disabled) { background: var(--green-hover); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { background: var(--line-2); color: var(--faint); cursor: not-allowed; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; cursor: pointer; font-weight: 500; font-size: 14px; white-space: nowrap; color: var(--ink-2);
}
.btn-ghost:hover { border-color: #CFD2CC; color: var(--ink); }
.btn-text { border: 0; background: none; padding: 2px 0; color: var(--muted); cursor: pointer; font-size: 13px; }
.btn-text:hover { color: var(--ink); text-decoration: underline; }
.btn-back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; margin: 32px 0 20px; font-weight: 500; font-size: 14px; color: var(--muted); cursor: pointer; }
.btn-back:hover { color: var(--ink); }
.btn-back::before { content: "←"; }

/* ---------- shop layout ---------- */
.shop { display: grid; grid-template-columns: 184px minmax(0, 1fr) 320px; gap: 40px; padding-top: 40px; padding-bottom: 96px; align-items: start; }

.intro { margin: 0 0 28px; }
.intro h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.intro p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

.rail { position: sticky; top: calc(var(--topbar) + 32px); max-height: calc(100vh - var(--topbar) - 56px); overflow: auto; margin-top: 4px; }
.rail ol { list-style: none; margin: 0; padding: 0; }
.rail a {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: var(--r-sm); color: var(--muted); text-decoration: none; font-size: 13.5px; line-height: 1.35;
}
.rail a:hover { color: var(--ink); background: var(--soft); }
.rail a.active { color: var(--ink); font-weight: 600; background: var(--soft); }
.rail .count:not(:empty) { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--green); color: var(--ink); font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.rail li.dim { display: none; }

/* ---------- catalog ---------- */
.catalog { min-width: 0; }
.category { margin: 0 0 44px; }
.category[hidden] { display: none; }
.cat-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 0 0 12px; }
.cat-head h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
.cat-note { font-size: 12.5px; font-weight: 500; color: var(--green-ink); background: var(--green-wash); padding: 3px 10px; border-radius: 999px; }

.items { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.item {
  display: grid; grid-template-columns: minmax(0, 1fr) 80px 112px 118px; gap: 12px; align-items: center;
  padding: 12px 16px; border-top: 1px solid var(--line-2); background: #fff; transition: background .15s;
}
.item:first-child { border-top: 0; }
.item[hidden] { display: none; }
.item:hover { background: #FCFCFB; }
.item.on { background: var(--green-wash); }
.item-name { font-weight: 500; font-size: 15px; line-height: 1.35; }
.item-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.item-meta .part { color: var(--ink-2); }
.price { text-align: right; font-size: 15px; color: var(--ink-2); }
.line-total { text-align: right; font-weight: 600; }
.mob-label { display: none; }
.add-skid {
  display: inline-flex; align-items: center; margin-top: 7px; height: 26px; padding: 0 11px;
  border: 1px solid #CFE2B8; border-radius: 999px; background: #fff; color: var(--green-ink);
  font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s;
}
.add-skid:hover { background: var(--green-wash); border-color: var(--green); }
.add-skid:active { transform: translateY(1px); }
.skid-note { font-size: 12px; font-weight: 500; color: var(--green-ink); margin-top: 1px; white-space: nowrap; }
.skid-note.partial { color: #8A6D1E; }
.adj-note { font-size: 12.5px; font-weight: 600; white-space: nowrap; margin-top: 1px; }
.line-total .skid-note, .line-total .adj-note { font-family: var(--body); letter-spacing: 0; }
.fee, .adj-note.fee, .summary-lines .a.fee, .ra.fee { color: #8A5A12; }
.disc, .adj-note.disc, .summary-lines .a.disc, .ra.disc { color: var(--green-ink); }
.summary-lines .x { grid-row: 2; }
.summary-lines .a { grid-column: 1; grid-row: 3; font-size: 12.5px; font-weight: 600; }
.ra { font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.summary-total .row.fee, .summary-total .row.disc { font-weight: 600; }
.order-table tfoot tr.fee td, .order-table tfoot tr.disc td { font-weight: 600; }
.order-table tfoot tr.fee td { color: #8A5A12; }
.order-table tfoot tr.disc td { color: var(--green-ink); }
.price, .line-total, .qty input, .summary-total, .summary-lines .t, .summary-lines .q, .order-table .num, .mobile-total, .rail .count { font-variant-numeric: tabular-nums; }

/* ---------- order summary ---------- */
.summary { position: sticky; top: calc(var(--topbar) + 32px); }
.summary-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 22px; max-height: calc(100vh - var(--topbar) - 56px); display: flex; flex-direction: column; }
.summary-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.summary h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.summary-empty { margin: 4px 0 18px; color: var(--muted); font-size: 14px; }
.summary-lines { list-style: none; margin: 0 -4px; padding: 0 4px; overflow: auto; flex: 1 1 auto; min-height: 0; }
.summary-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 12px; padding: 11px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.summary-lines li:first-child { border-top: 0; }
.summary-lines .n { font-weight: 500; line-height: 1.35; }
.summary-lines .q { color: var(--muted); font-size: 13px; grid-column: 1; }
.summary-lines .t { font-weight: 600; grid-row: 1; grid-column: 2; }
.summary-lines .x { grid-column: 2; justify-self: end; border: 0; background: none; color: var(--faint); font-size: 12.5px; cursor: pointer; padding: 0; }
.summary-lines .x:hover { color: var(--danger); }
.summary-total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 14px; margin-bottom: 18px; }
.summary-total .row { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.summary-total .row.big { color: var(--ink); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.summary .btn-primary { width: 100%; }

.mobile-bar { display: none; }

/* ---------- review ---------- */
.review { padding-bottom: 96px; }
.review-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.section-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 18px; }
.review-order, .dealer-form { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; }
.dealer-form { box-shadow: var(--shadow); }
.order-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.order-table th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 0 8px 10px; border-bottom: 1px solid var(--line); }
.order-table td { padding: 12px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.order-table .rn { font-weight: 500; }
.order-table .rp { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.order-table .num { text-align: right; white-space: nowrap; }
.order-table tbody td:last-child { font-weight: 600; }
.order-table tfoot td { border-bottom: 0; padding-top: 12px; color: var(--muted); }
.order-table tfoot td:first-child { text-align: right; }
.order-table tfoot .grand td { color: var(--ink); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; padding-top: 2px; }
.fine { font-size: 13px; color: var(--muted); margin: 14px 0 0; text-align: center; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 500; min-width: 0; color: var(--ink-2); }
.field[hidden] { display: none; }
.lbl { display: block; }
.span-2 { grid-column: span 2; }
.opt { font-weight: 400; color: var(--faint); margin-left: 4px; }
.field input, .field textarea {
  width: 100%; border: 1px solid #DCDFD9; border-radius: var(--r-sm); background: #fff;
  padding: 10px 12px; font-weight: 400; font-size: 15px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input { height: 44px; }
.field textarea { resize: vertical; }
.field input:hover, .field textarea:hover { border-color: #C9CDC5; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(131, 179, 79, .18); }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
fieldset.ship { border: 0; padding: 0; margin: 0; flex-direction: row; flex-wrap: wrap; gap: 10px; }
fieldset.ship legend { padding: 0; margin-bottom: 6px; float: left; width: 100%; }
.ship .choice { flex: 1; }
.choice {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px;
  border: 1px solid #DCDFD9; border-radius: var(--r-sm); font-weight: 500; cursor: pointer; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.choice:hover { border-color: #C9CDC5; }
.choice:has(input:checked) { border-color: var(--green); background: var(--green-wash); }
.choice input { width: 16px; height: 16px; margin: 0; accent-color: var(--green-ink); }
fieldset.invalid .choice { border-color: var(--danger); }
.hp { position: absolute; left: -9999px; }
.form-error { margin: 18px 0 0; padding: 12px 14px; border-radius: var(--r-sm); background: #FCEEEC; color: var(--danger); font-size: 14px; font-weight: 500; }
.btn-send { width: 100%; margin-top: 22px; height: 52px; font-size: 16px; }
.btn-send[aria-busy="true"] { opacity: .7; cursor: progress; }

/* ---------- sent ---------- */
.sent { padding-top: 48px; padding-bottom: 96px; max-width: 860px; }
.sent-head { display: flex; gap: 18px; align-items: center; margin-bottom: 28px; }
.tick { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--green-wash); color: var(--green-ink); display: grid; place-items: center; }
.sent h2 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.025em; }
.sent-head p { margin: 2px 0 0; color: var(--muted); }
#sent-copy { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; }
.copy-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 24px; margin: 0 0 24px; font-size: 14px; }
.copy-meta dt { color: var(--muted); font-size: 12.5px; }
.copy-meta dd { margin: 2px 0 0; font-weight: 500; white-space: pre-line; }
.sent-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.sent-actions .btn-ghost { height: 48px; border-radius: var(--r); padding: 0 20px; }

.foot { border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; padding: 22px 0 30px; }

/* ---------- type roles, matched to the EDGE shipping app ---------- */
.intro h1, .cat-head h2, .summary h2, .section-title, .sent h2,
.btn-primary, .btn-ghost, .add-skid, .btn-back {
  font-family: var(--display); text-transform: uppercase; letter-spacing: .02em;
}
.intro h1 { font-size: 40px; font-weight: 700; letter-spacing: .01em; line-height: 1; }
.cat-head h2 { font-size: 24px; font-weight: 700; letter-spacing: .015em; }
.summary h2 { font-size: 22px; font-weight: 700; }
.section-title { font-size: 26px; }
.sent h2 { font-size: 34px; letter-spacing: .01em; }
.btn-primary { font-size: 17px; font-weight: 700; letter-spacing: .03em; }
.btn-ghost { font-size: 15px; font-weight: 600; letter-spacing: .03em; }
.add-skid { font-size: 13.5px; font-weight: 600; letter-spacing: .03em; }
.btn-back { font-size: 15px; font-weight: 600; letter-spacing: .03em; }
.field .lbl, fieldset.ship legend, .order-table th, .copy-meta dt, .summary-total .row span:first-child {
  text-transform: uppercase; letter-spacing: .05em; font-weight: 600; font-size: 13px;
}
.opt { text-transform: none; letter-spacing: 0; }
.summary-total .row.big span:first-child { font-family: var(--display); font-size: 24px; letter-spacing: .02em; font-weight: 700; }
.price, .line-total, .qty input, .order-table .num, .summary-lines .t,
.summary-total .row span:last-child, .mobile-total strong, .item-meta .part, .rail .count, #sent-ref {
  font-family: var(--mono); letter-spacing: -0.01em;
}
.price { font-size: 14.5px; }
.line-total { font-size: 14.5px; font-weight: 700; }
.qty input { font-size: 15px; font-weight: 700; }
.item-meta .part { font-size: 12.5px; }
.summary-lines .t { font-size: 13.5px; font-weight: 700; }
.summary-total .row.big span:last-child { font-size: 22px; letter-spacing: -0.02em; }
.order-table tfoot .grand td { font-family: var(--display); text-transform: uppercase; letter-spacing: .02em; }
.order-table tfoot .grand td.num { font-family: var(--mono); letter-spacing: -0.02em; }
.item-name { font-size: 16.5px; font-weight: 500; }
.rail a { font-size: 15px; }
.mobile-total strong { font-size: 18px; }

.qty { display: flex; align-items: center; justify-self: center; height: 36px; border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 0 3px; transition: border-color .15s, box-shadow .15s; }
.qty button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; font-size: 17px; line-height: 1; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.qty button:hover { background: var(--soft); color: var(--ink); }
.qty input { width: 44px; height: 100%; border: 0; text-align: center; font-weight: 600; background: transparent; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input::placeholder { color: #C3C6C0; font-weight: 400; }
.qty input:focus { outline: none; }
.qty:focus-within { border-color: #CFD2CC; box-shadow: 0 0 0 4px rgba(131, 179, 79, .18); }
.item.on .qty { border-color: #CFE2B8; }

.empty { border: 1px dashed var(--line); border-radius: var(--r); padding: 40px; text-align: center; color: var(--muted); }



/* ================= dealer portal additions ================= */
body[data-view="boot"] .view-boot, body[data-view="login"] .view-login, body[data-view="recover"] .view-recover,
body[data-view="blocked"] .view-blocked, body[data-view="orders"] .view-orders, body[data-view="account"] .view-account { display: block; }
body[data-view="boot"] .topbar, body[data-view="login"] .topbar, body[data-view="recover"] .topbar, body[data-view="blocked"] .topbar,
body[data-view="boot"] .foot, body[data-view="login"] .foot, body[data-view="recover"] .foot, body[data-view="blocked"] .foot { display: none; }
.boot-msg { color: var(--muted); padding: 80px 0; text-align: center; }

/* nav */
.mainnav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-link {
  font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; font-size: 15px;
  color: var(--muted); background: none; border: 0; padding: 8px 12px; border-radius: 999px; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.nav-link:hover { color: var(--ink); background: var(--soft); }
.nav-link.current { color: var(--ink); background: var(--soft); }
.shop-tools { flex: 1 1 auto; }

/* sign in */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: var(--soft); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 32px 28px 24px; }
.auth-logo { display: block; height: 52px; width: auto; margin: 0 auto 24px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form[hidden] { display: none; }
.auth-form h1, .auth-title { margin: 0; font-family: var(--display); text-transform: uppercase; letter-spacing: .02em; font-size: 28px; font-weight: 700; text-align: center; }
.auth-help { margin: 0 0 4px; color: var(--muted); text-align: center; }
.view-blocked .auth-help { margin: 10px 0 20px; }
.auth-alt { align-self: center; }
.auth-foot { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; font-size: 14px; color: var(--muted); }
.btn-block { width: 100%; }
.form-ok { margin: 0; padding: 12px 14px; border-radius: var(--r-sm); background: var(--green-wash); color: var(--green-ink); font-size: 14px; font-weight: 500; }
.form-error { margin-top: 0; }
.dealer-form .form-error { margin-top: 18px; }

/* notices + toast */
.notice { margin: 0 0 20px; padding: 12px 16px; border-radius: var(--r); background: #FFF6E5; color: #6B4A0E; font-size: 15px; border: 1px solid #F1DDB3; }
.notice.warn { background: #FCEEEC; color: var(--danger); border-color: #F3C9C4; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 60; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r); font-size: 15px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(35, 31, 32, .25); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* sold out */
.item.sold-out { background: #FAFAF9; }
.item.sold-out .item-name { color: var(--muted); }
.item.sold-out .price { color: var(--faint); text-decoration: line-through; text-decoration-thickness: 1px; }
.item.sold-out .qty { opacity: .45; }
.item.sold-out .qty button, .item.sold-out .qty input { cursor: not-allowed; }
.stock-flag { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 7px; }
.pill {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px;
  font-family: var(--display); text-transform: uppercase; letter-spacing: .05em; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.pill-out { background: #FCEEEC; color: var(--danger); }
.eta { font-size: 13.5px; color: #8A5A12; font-weight: 600; }

/* dealer details card */
.dealer-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 0; padding: 16px; background: var(--soft); border-radius: var(--r); }
.dealer-card dt { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--muted); }
.dealer-card dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.fine-left { font-size: 13.5px; color: var(--muted); margin: 8px 0 22px; }
.field select {
  width: 100%; height: 44px; border: 1px solid #DCDFD9; border-radius: var(--r-sm); background: #fff; padding: 0 12px;
  font-size: 15px; font-weight: 500; color: var(--ink);
}
.field select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(131, 179, 79, .18); }
.field.invalid select { border-color: var(--danger); }
.table-scroll { overflow-x: auto; }

/* my orders */
.orders, .account { padding-top: 40px; padding-bottom: 96px; max-width: 980px; }
.order-group { margin-bottom: 36px; }
.group-title { font-family: var(--display); text-transform: uppercase; letter-spacing: .03em; font-size: 20px; font-weight: 700; color: var(--muted); margin: 0 0 12px; }
.order-card { border: 1px solid var(--line); border-radius: var(--r); background: #fff; margin-bottom: 10px; overflow: hidden; }
.order-card[open] { box-shadow: var(--shadow); }
.order-card > summary { list-style: none; display: flex; align-items: center; gap: 16px; padding: 16px 18px; cursor: pointer; }
.order-card > summary::-webkit-details-marker { display: none; }
.order-card > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg); margin-left: 4px; transition: transform .15s; flex: none; }
.order-card[open] > summary::after { transform: rotate(-135deg); }
.order-card > summary:hover { background: #FCFCFB; }
.oc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.oc-ref { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.oc-meta { color: var(--muted); font-size: 14px; }
.oc-total { font-family: var(--mono); font-weight: 700; min-width: 110px; text-align: right; }
.status-submitted { background: #EEF2F7; color: #2F4A6B; }
.status-confirmed { background: var(--green-wash); color: var(--green-ink); }
.status-shipped { background: #EDEDEB; color: var(--ink-2); }
.status-cancelled { background: #FCEEEC; color: var(--danger); }
.oc-body { padding: 4px 18px 18px; border-top: 1px solid var(--line-2); }
.oc-body .copy-meta { margin: 16px 0; }
.oc-actions { margin-top: 16px; display: flex; gap: 10px; }
.oc-actions .btn-ghost { border-radius: var(--r); height: 44px; }
.empty .btn-primary { margin-top: 12px; }
.empty p { margin: 0; }
.order-table tfoot tr.grand td { color: var(--ink); font-size: 18px; font-weight: 700; }
.order-table tfoot tr.grand td:first-child { font-family: var(--display); text-transform: uppercase; letter-spacing: .02em; }
.order-table tfoot tr.grand td.num { font-family: var(--mono); }

/* account */
.account-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; }
.fields.one { grid-template-columns: minmax(0, 1fr); margin-bottom: 18px; }
.panel .btn-ghost { border-radius: var(--r); height: 46px; }

.setup-needed { max-width: 560px; margin: 80px auto; padding: 0 16px; text-align: center; }
.setup-needed img { height: 48px; width: auto; }
.setup-needed h1 { font-family: var(--display); text-transform: uppercase; font-size: 30px; }
.setup-needed code { background: var(--soft); padding: 1px 6px; border-radius: 4px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .shop { grid-template-columns: minmax(0, 1fr) 310px; gap: 36px; }
  .rail { display: none; }
  .jump { display: block; }
}
@media (max-width: 900px) {
  :root { --topbar: 64px; }
  .wrap { padding: 0 16px; }
  .shop { grid-template-columns: minmax(0, 1fr); padding-top: 28px; padding-bottom: 120px; }
  .summary { display: none; }
  .review-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .print-list { display: none; }
  .mobile-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30;
    padding: 10px 10px 10px 18px; border-radius: var(--r-lg);
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
    border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(35, 31, 32, .14);
  }
  .mobile-total { display: flex; flex-direction: column; line-height: 1.25; }
  .mobile-total span { font-size: 12.5px; color: var(--muted); }
  .mobile-total strong { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
  .mobile-bar .btn-primary { height: 44px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar-inner { height: auto; flex-wrap: wrap; gap: 10px 14px; padding-top: 12px; padding-bottom: 12px; }
  body:not([data-view="shop"]) .topbar-inner { height: var(--topbar); padding-top: 0; padding-bottom: 0; }
  .logo { height: 30px; }
  .shop-tools { flex-basis: 100%; }
  .search { max-width: none; }
  .jump { flex: none; }
  .jump select { width: 118px; padding: 0 10px; }
  .search input { font-size: 16px; }
  .search input::placeholder { font-size: 14.5px; }
  html { scroll-padding-top: 130px; }
  .intro h1 { font-size: 32px; }
  .intro { margin-bottom: 22px; }
  .category { margin-bottom: 32px; }
  .item { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name qty" "price total"; gap: 6px 12px; padding: 14px; }
  .item-info { grid-area: name; }
  .qty { grid-area: qty; align-self: start; }
  .price { grid-area: price; text-align: left; font-size: 14px; }
  .line-total { grid-area: total; }
  .mob-label { display: inline; color: var(--faint); }
  .line-total:empty { display: none; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .review-order, .dealer-form { padding: 20px 16px; }
  .order-table td, .order-table th { padding-left: 4px; padding-right: 4px; }
  .sent h2 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}


/* account details */
.locked-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 0; padding: 14px 16px; background: var(--soft); border-radius: var(--r); }
.locked-details dt { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--muted); }
.locked-details dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
/* account settings layout */
.account { max-width: 1000px; }
.settings { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); margin: 0 0 24px; overflow: hidden; }
.set-section { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px 40px; padding: 30px 32px; border-top: 1px solid var(--line-2); }
.set-section:first-child { border-top: 0; }
.set-head h2 { margin: 0 0 6px; font-family: var(--display); text-transform: uppercase; letter-spacing: .02em; font-size: 22px; font-weight: 700; line-height: 1.1; }
.set-head p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.set-body.fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-content: start; }
.set-body .field input { height: 46px; }
.set-body .locked-details { background: var(--soft); padding: 16px 18px; gap: 14px 24px; }
.set-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px 16px; padding: 18px 32px; background: var(--soft); border-top: 1px solid var(--line); }
.set-actions .form-error { margin: 0 auto 0 0; }
.set-actions .btn-primary { min-width: 180px; }
.addr-row { display: grid; grid-template-columns: 1.5fr 0.8fr 1fr; gap: 20px; }
@media (max-width: 640px) { .addr-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .addr-row .field:first-child { grid-column: 1 / -1; } }
.signout-row { margin: 24px 0 0; }
.signout-row .btn-ghost { border-radius: var(--r); height: 44px; }
.btn-link { border: 0; background: none; padding: 0; color: var(--green-ink); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.addr-hint { display: block; margin: 4px 0 0; font-weight: 400; }
@media (max-width: 860px) {
  .set-section { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 24px 20px; }
  .set-actions { padding: 16px 20px; }
}
@media (max-width: 640px) {
  .locked-details { grid-template-columns: minmax(0, 1fr); }
  .set-body.fields { grid-template-columns: minmax(0, 1fr); }
  .set-body .span-2 { grid-column: auto; }
  .set-actions .btn-primary { flex: 1 1 100%; }
}

/* revisions */
.revise-bar { background: #FFF6E5; border-bottom: 1px solid #F1DDB3; color: #6B4A0E; }
body:not([data-view="shop"]):not([data-view="review"]) .revise-bar { display: none; }
.revise-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.revise-inner p { margin: 0; font-size: 15px; }
.revise-inner .btn-ghost { border-color: #E5C98F; background: #fff; color: #6B4A0E; border-radius: var(--r-sm); height: 36px; font-size: 14px; }
.revise-inner #rev-ref { font-family: var(--mono); }
.changes-box { border: 1px solid #F1DDB3; background: #FFF6E5; border-radius: var(--r); padding: 14px 16px; margin: 0 0 20px; }
.changes-title { font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; font-size: 15px; color: #6B4A0E; margin-bottom: 6px; }
.changes-box ul { margin: 0; padding: 0; list-style: none; }
.changes-box li { font-size: 14.5px; padding: 2px 0; }
.changes-box li.add { color: var(--green-ink); } .changes-box li.rem { color: var(--danger); } .changes-box li.tot { font-weight: 700; }
.changes-none { margin: 0; font-size: 14.5px; color: #6B4A0E; }
.oc-actions { flex-wrap: wrap; align-items: center; }
.oc-actions .btn-primary { height: 44px; }
.oc-actions .a-hint { font-size: 13.5px; color: var(--faint); }
.rev-history { margin-top: 18px; }
.rev-history-title { font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; font-size: 15px; font-weight: 700; color: var(--muted); margin: 0 0 8px; }
.rev-history { padding-top: 18px; border-top: 1px solid var(--line); }
.ver { border: 1px solid var(--line); border-radius: var(--r); background: var(--soft); margin-bottom: 10px; overflow: hidden; }
.ver > summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 12px 16px; cursor: pointer; }
.ver > summary::-webkit-details-marker { display: none; }
.ver > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg); flex: none; transition: transform .15s; }
.ver[open] > summary::after { transform: rotate(-135deg); }
.ver > summary:hover { background: #F1F2EF; }
.ver-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ver-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.ver-ref { font-family: var(--mono); font-weight: 700; font-size: 14.5px; }
.ver-tag { font-family: var(--display); text-transform: uppercase; letter-spacing: .05em; font-size: 12.5px; font-weight: 700; background: #EDEDEB; color: var(--ink-2); border-radius: 999px; padding: 1px 9px; }
.ver-meta { font-size: 14px; color: var(--muted); }
.ver-total { font-family: var(--mono); font-weight: 700; font-size: 15px; white-space: nowrap; }
.ver-body { background: #fff; border-top: 1px solid var(--line); padding: 14px 16px 6px; }
.ver-body .changes-box.compact { margin-bottom: 14px; padding: 10px 14px; }
.ver-body .changes-box.compact .changes-title { font-size: 14px; }
.ver-details { margin: 0 0 12px; }
.ver-table td, .ver-table th { padding-top: 8px; padding-bottom: 8px; }

.oc-cancel { margin-left: auto; font-size: 14px; color: var(--danger); }
.oc-cancel:hover { color: var(--danger); }
.cancel-help { margin-top: 14px; border: 1px solid #F3C9C4; background: #FDF3F2; border-radius: var(--r); padding: 14px 16px; }
.cancel-title { margin: 0 0 4px; font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; font-size: 15px; color: var(--danger); }
.cancel-text { margin: 0 0 12px; font-size: 15px; }
.cancel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.cancel-actions .btn-primary { height: 42px; font-size: 15px; }
.cancel-addr { font-family: var(--mono); font-size: 14px; color: var(--ink-2); user-select: all; }

/* ---------- portal responsive ---------- */
@media (max-width: 900px) {
  .topbar { position: static; }
  .topbar-inner { height: auto; flex-wrap: wrap; gap: 10px 12px; padding-top: 12px; padding-bottom: 10px; }
  .mainnav { order: 3; flex-basis: 100%; margin: 0 -8px; overflow-x: auto; scrollbar-width: none; }
  .mainnav::-webkit-scrollbar { display: none; }
  .shop-tools { order: 2; flex-basis: 100%; }
  html { scroll-padding-top: 16px; }
  .rail { display: none; }
  .account-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body:not([data-view="shop"]) .topbar-inner { height: auto; padding-top: 12px; padding-bottom: 10px; }
  .dealer-card dl { grid-template-columns: minmax(0, 1fr); }
  .mainnav { justify-content: space-between; margin: 0 -6px; }
  .nav-link { font-size: 14px; padding: 7px 8px; letter-spacing: .03em; }
  .order-card > summary { flex-wrap: wrap; gap: 6px 12px; }
  .oc-main { flex-basis: 100%; }
  .oc-total { min-width: 0; margin-left: auto; }
  .orders, .account { padding-top: 28px; }
  .panel { padding: 20px 16px; }
}

/* ---------- print ---------- */
@media print {
  @page { size: letter; margin: 0.45in 0.45in 0.55in; }
  body { font-size: 10pt; }
  .wrap { max-width: none; padding: 0; }
  .topbar { position: static; border-bottom: 0.75pt solid #BBB; background: #fff; backdrop-filter: none; }
  .topbar-inner { height: auto; padding: 0 0 8pt; }
  .logo { height: 40px; }
  .shop-tools, .rail, .summary, .mobile-bar, .btn-back, .sent-actions, .foot, .dealer-form, .tick, .mainnav, .notice, .toast { display: none !important; }
  .shop { display: block; padding: 10pt 0 0; }
  .intro { margin-bottom: 8pt; }
  .intro h1 { font-size: 16pt; }
  .intro p { font-size: 9pt; }
  .category { margin-bottom: 8pt; break-inside: auto; }
  .cat-head { break-after: avoid; padding: 6pt 0 3pt; }
  .cat-head h2 { font-size: 11.5pt; }
  .cat-note { font-size: 8pt; padding: 1pt 6pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .items { border: 0.75pt solid #CCC; border-radius: 4pt; }
  .item { padding: 2.5pt 8pt; break-inside: avoid; grid-template-columns: minmax(0, 1fr) 64pt 58pt 64pt; gap: 8pt; border-top-color: #E3E5E0; }
  .item.on { background: none; }
  .item-info { display: flex; align-items: baseline; gap: 10pt; }
  .item-name { font-size: 9.5pt; }
  .item-meta { font-size: 8pt; margin: 0; white-space: nowrap; }
  .price { font-size: 9.5pt; }
  .qty { height: 14pt; border: 0.75pt solid #999; border-radius: 3pt; padding: 0; }
  .qty button { display: none; }
  .add-skid, .skid-note, .adj-note { display: none; }
  .qty input { width: 54pt; }
  .qty input::placeholder { color: transparent; }
  .review-grid { display: block; }
  .review-order, #sent-copy { border: 0; padding: 0; box-shadow: none; }
  .sent { padding-top: 12pt; }
}

/* revision: the rep can't be changed */
.rep-locked { margin: 8px 0 0; }
select:disabled { background: var(--soft); color: var(--ink); opacity: 1; cursor: not-allowed; }

/* cancellation requested */
.status-pending { background: #FFF4DC; color: #8A5A00; }
.cancel-sent { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #F3C9C4; }
.cancel-sent-text { flex: 1 1 280px; margin: 0; font-size: 14.5px; color: var(--ink-2); }
.cancel-sent .btn-ghost { height: 42px; background: #fff; }
.cancel-sent.nudge .btn-ghost { border-color: var(--ink); }
.pending-note { margin-top: 14px; border: 1px solid #F1DDB0; background: #FFF9EC; border-radius: var(--r); padding: 14px 16px; }
.pending-title { margin: 0 0 4px; font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; font-size: 15px; color: #8A5A00; }
.pending-text { margin: 0; font-size: 15px; }

/* My orders paging */
.orders-more { display: flex; justify-content: center; padding: 8px 0 4px; }
.orders-more .fine-left { margin: 0; }

/* pickup / ship date from the shipping portal */
.oc-sched { align-self: flex-start; margin-top: 6px; font-size: 13.5px; font-weight: 600; color: #2F4A6B; background: #EEF2F7; border-radius: 999px; padding: 2px 10px; }
.oc-sched.done { color: var(--green-ink); background: var(--green-wash); }
