/* =====================================================================
   Nexen dealer portal – theme (Nexen Orange #D93C1A)
   Orange / black / white / grey, industrial type (Barlow)
   ===================================================================== */
:root {
  --nx-orange: #D93C1A;
  --nx-orange-600: #B83217;
  --nx-orange-050: #fcebe7;
  --nx-orange-a20: rgba(217, 60, 26, .20);
  --nx-black: #141414;
  --nx-ink: #1f2124;
  --nx-grey-700: #4a4f55;
  --nx-grey-500: #7b8189;
  --nx-grey-300: #c9cdd2;
  --nx-grey-200: #e3e6e9;
  --nx-grey-100: #f1f3f5;
  --nx-grey-050: #f7f8f9;
  --nx-white: #fff;
  --nx-radius: 12px;
  --nx-radius-sm: 8px;
  --nx-shadow: 0 1px 2px rgba(20, 20, 20, .06), 0 6px 24px -12px rgba(20, 20, 20, .18);
  --nx-header-h: 64px;

  --bs-body-font-family: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-color: var(--nx-ink);
  --bs-body-bg: var(--nx-grey-050);
  --bs-link-color: var(--nx-orange-600);
  --bs-link-color-rgb: 184, 50, 23;
  --bs-link-hover-color: var(--nx-black);
  --bs-border-color: var(--nx-grey-200);
  --bs-focus-ring-color: var(--nx-orange-a20);
}

body { font-size: 15.5px; -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100vh; }
.nx-main { flex: 1 0 auto; }
.nx-container { max-width: 1680px; padding-inline: clamp(12px, 2.4vw, 32px); }
.nx-mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; letter-spacing: -.01em; }
.min-w-0 { min-width: 0; }
.nx-noscroll { overflow: hidden; }

/* ---------- Type ---------- */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--nx-black); }
.nx-hero .nx-hero-title { color: #fff; }
.nx-eyebrow { font-weight: 600; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--nx-orange-600); }
.nx-eyebrow-light { color: var(--nx-orange); }
.nx-h1 { font-family: 'Barlow Condensed', var(--bs-body-font-family); font-weight: 700; font-size: clamp(1.55rem, 1.1rem + 1.4vw, 2.2rem); letter-spacing: -.005em; line-height: 1.1; }
.nx-h2 { font-family: 'Barlow Condensed', var(--bs-body-font-family); font-weight: 700; font-size: 1.45rem; }

/* ---------- Buttons ---------- */
.nx-btn-primary { --bs-btn-bg: var(--nx-orange); --bs-btn-border-color: var(--nx-orange); --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--nx-black); --bs-btn-hover-border-color: var(--nx-black); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--nx-black); --bs-btn-active-border-color: var(--nx-black); --bs-btn-active-color: #fff;
  --bs-btn-focus-shadow-rgb: 217, 60, 26; font-weight: 600; border-radius: var(--nx-radius-sm); }
.nx-btn-ghost { --bs-btn-color: var(--nx-ink); --bs-btn-border-color: var(--nx-grey-300); --bs-btn-bg: #fff;
  --bs-btn-hover-bg: var(--nx-grey-100); --bs-btn-hover-border-color: var(--nx-grey-500); --bs-btn-hover-color: var(--nx-black);
  font-weight: 500; border-radius: var(--nx-radius-sm); }
.nx-icon-btn { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border-radius: 8px;
  color: var(--nx-grey-700); border: 1px solid transparent; background: transparent; font-size: 1.05rem; transition: background .15s, color .15s, transform .1s; }
.nx-icon-btn:hover { background: var(--nx-grey-100); color: var(--nx-black); }
.nx-icon-btn:active { transform: scale(.94); }
.nx-icon-btn-add { color: var(--nx-orange-600); }
.nx-icon-btn-add:hover { background: var(--nx-orange); color: #fff; }
.nx-icon-btn.is-busy { opacity: .5; pointer-events: none; }
.nx-icon-btn.is-done, .nx-icon-btn.is-done:hover { background: #198754; color: #fff; }
.nx-icon-btn.is-done i::before { content: "\F26E"; } /* bi-check-lg */
.btn.nx-btn-primary.is-done { background: #198754; border-color: #198754; }

/* ---------- Header ---------- */
.nx-header { background: var(--nx-white); border-bottom: 1px solid var(--nx-grey-200); box-shadow: 0 1px 0 rgba(0,0,0,.02); z-index: 1030; }
.nx-header::before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--nx-orange) 0 70%, var(--nx-black) 70%); }
.nx-header .navbar { min-height: calc(var(--nx-header-h) - 4px); padding-block: .4rem; }
.nx-logo { height: 34px; width: auto; }
.nx-wordmark { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 1.6rem; letter-spacing: .06em; color: var(--nx-black); line-height: 1; }
.nx-brand-sub { font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: .95rem; text-transform: uppercase; letter-spacing: .14em;
  color: #fff; background: var(--nx-black); padding: 3px 8px 2px; border-radius: 4px; }
.navbar-toggler { border: 1px solid var(--nx-grey-300); font-size: 1.4rem; padding: 4px 10px; }
.navbar-toggler:focus { box-shadow: 0 0 0 .2rem var(--nx-orange-a20); }
.nx-search { position: relative; max-width: 560px; }
.nx-search > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--nx-grey-500); pointer-events: none; }
.nx-search .form-control { padding-left: 36px; border-radius: 999px; background: var(--nx-grey-100); border-color: transparent; height: 40px; }
.nx-search .form-control:focus { background: #fff; border-color: var(--nx-orange); box-shadow: 0 0 0 .2rem var(--nx-orange-a20); }
.nx-pricelist .form-select { min-width: 190px; font-weight: 500; }
.nx-pricelist .input-group-text { background: var(--nx-grey-100); color: var(--nx-grey-700); }
.nx-btn-basket { background: var(--nx-black); color: #fff; font-weight: 600; border-radius: 999px; padding: .45rem 1rem; }
.nx-btn-basket:hover, .nx-btn-basket:focus-visible { background: var(--nx-orange); color: #fff; }
.nx-badge { position: absolute; top: -6px; right: -6px; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
  background: var(--nx-orange); color: #fff; font-size: .72rem; font-weight: 700; border: 2px solid #fff; }
.nx-btn-basket:hover .nx-badge { background: var(--nx-black); }
.nx-bump { animation: nxBump .35s ease; }
@keyframes nxBump { 40% { transform: scale(1.35); } }

.nx-crumbs { background: #fff; border-bottom: 1px solid var(--nx-grey-200); font-size: .88rem; padding: .5rem 0; }
.nx-crumbs a { color: var(--nx-grey-700); text-decoration: none; }
.nx-crumbs a:hover { color: var(--nx-orange-600); }

/* ---------- Hero / catalogue ---------- */
.nx-hero { background: var(--nx-black); color: #fff; padding: clamp(32px, 6vw, 72px) 0; position: relative; overflow: hidden; }
.nx-hero::after { content: ""; position: absolute; right: -8%; top: -40%; width: 46%; height: 180%; background: repeating-linear-gradient(-45deg, var(--nx-orange) 0 26px, transparent 26px 52px); opacity: .9; transform: skewX(-12deg); }
.nx-hero .nx-container { position: relative; z-index: 1; }
.nx-hero-title { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: clamp(2rem, 1.2rem + 3.6vw, 3.6rem); line-height: 1.02; margin: .4rem 0 .8rem; max-width: 16ch; }
.nx-hero-lead { color: #c8ccd1; max-width: 52ch; font-size: 1.05rem; }
.nx-hero-search { position: relative; display: flex; gap: 8px; max-width: 620px; margin-top: 1.5rem; }
.nx-hero-search > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--nx-grey-500); z-index: 2; }
.nx-hero-search .form-control { padding-left: 44px; border: 0; border-radius: var(--nx-radius-sm); }
@media (max-width: 575.98px) { .nx-hero::after { width: 30%; opacity: .5; } .nx-hero-search .btn { padding-inline: 1rem; } }

.nx-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.nx-chip { white-space: nowrap; padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--nx-grey-300); color: var(--nx-ink); text-decoration: none; background: #fff; font-weight: 500; }
.nx-chip.active, .nx-chip:hover { background: var(--nx-black); color: #fff; border-color: var(--nx-black); }

.nx-asm-card { display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--nx-grey-200); border-radius: var(--nx-radius); overflow: hidden;
  text-decoration: none; color: inherit; transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.nx-asm-card:hover { transform: translateY(-3px); box-shadow: var(--nx-shadow); border-color: var(--nx-orange); color: inherit; }
.nx-asm-thumb { aspect-ratio: 16/10; background: #fff; border-bottom: 1px solid var(--nx-grey-200); padding: 10px; }
.nx-asm-thumb img { width: 100%; height: 100%; object-fit: contain; }
.nx-asm-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nx-asm-title { font-weight: 600; font-size: 1.05rem; line-height: 1.25; }
.nx-asm-meta { margin-top: auto; padding-top: 10px; display: flex; align-items: center; gap: 6px; color: var(--nx-grey-500); font-size: .88rem; }
.nx-asm-card:hover .bi-arrow-right { color: var(--nx-orange); }

/* ---------- Cards, tables, misc ---------- */
.nx-card { background: #fff; border: 1px solid var(--nx-grey-200); border-radius: var(--nx-radius); padding: clamp(16px, 2vw, 24px); box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.nx-table { --bs-table-bg: transparent; font-size: .93rem; }
.nx-table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--nx-grey-500); font-weight: 600; background: var(--nx-grey-050); border-bottom: 1px solid var(--nx-grey-200); white-space: nowrap; }
.nx-table td, .nx-table th { padding: .62rem .7rem; }
.nx-table tfoot td { border: 0; }
.nx-table tfoot .nx-grand td, tr.nx-grand td { font-weight: 700; font-size: 1.05rem; border-top: 2px solid var(--nx-black); }
.nx-usedin { display: inline-block; font-size: .82rem; padding: 2px 8px; margin: 2px 4px 2px 0; border-radius: 999px; background: var(--nx-grey-100); color: var(--nx-ink); text-decoration: none; white-space: nowrap; }
.nx-usedin:hover { background: var(--nx-orange); color: #fff; }
.nx-pill { font-size: .78rem; font-weight: 600; color: var(--nx-grey-700); background: var(--nx-grey-100); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.nx-stock { display: inline-block; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 4px; vertical-align: 1px; margin-left: 4px; white-space: nowrap; }
.nx-stock-success { background: #e7f6ec; color: #146c43; }
.nx-stock-warning { background: #fff4d6; color: #8a5a00; }
.nx-stock-secondary { background: var(--nx-grey-100); color: var(--nx-grey-700); }
.nx-stock-danger { background: #fde8e8; color: #b02a37; }
.nx-empty { text-align: center; padding: 48px 20px; background: #fff; border: 1px dashed var(--nx-grey-300); border-radius: var(--nx-radius); color: var(--nx-ink); }
.nx-empty > i { font-size: 2.2rem; color: var(--nx-grey-300); display: block; margin-bottom: 8px; }
.nx-empty-sm { padding: 28px 16px; border: 0; }

/* =====================================================================
   Assembly page – viewer + parts list
   ===================================================================== */
.nx-asm-page { padding-top: 16px; padding-bottom: 28px; }
.nx-asm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.nx-asm-head .nx-h1 { white-space: nowrap; }

.nx-viewer { position: relative; background: #fff; border: 1px solid var(--nx-grey-200); border-radius: var(--nx-radius); overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.nx-stage { position: relative; height: clamp(420px, calc(100vh - 210px), 900px); overflow: hidden; cursor: grab; touch-action: pan-y;
  background: radial-gradient(circle at 1px 1px, var(--nx-grey-200) 1px, transparent 1.2px) 0 0 / 22px 22px, #fff; outline: none; user-select: none; -webkit-user-select: none; }
.nx-stage.is-zoomed { touch-action: none; }
.nx-stage.is-dragging { cursor: grabbing; }
.nx-stage:focus-visible { box-shadow: inset 0 0 0 3px var(--nx-orange-a20); }
.nx-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.nx-canvas.is-animating { transition: transform .25s cubic-bezier(.2,.7,.2,1); }
.nx-canvas img { width: 100%; height: 100%; display: block; pointer-events: none; -webkit-user-drag: none; }

/* Hotspots sit over the printed callout numbers */
.nx-hs { position: absolute; width: 3.5%; height: 4.6%; transform: translate(-50%, -50%); padding: 0; border: 1.5px solid var(--nx-orange-a20);
  border-radius: 6px; background: rgba(217, 60, 26, .07); cursor: pointer; display: grid; place-items: center; transition: background .12s, border-color .12s, box-shadow .12s; }
.nx-hs::after { content: ""; position: absolute; inset: -5px; } /* larger hit area */
.nx-hs span { font: 700 var(--hs-fs, 14px)/1 'Barlow', sans-serif; color: #fff; opacity: 0; transition: opacity .12s; pointer-events: none; }
.nx-hs:hover, .nx-hs.is-hover, .nx-hs:focus-visible { background: var(--nx-orange); border-color: var(--nx-orange); box-shadow: 0 0 0 calc(3px * var(--inv, 1)) var(--nx-orange-a20); z-index: 3; outline: none; }
.nx-hs:hover span, .nx-hs.is-hover span, .nx-hs:focus-visible span, .nx-hs.is-active span { opacity: 1; }
.nx-hs.is-active { background: var(--nx-black); border-color: var(--nx-black); box-shadow: 0 0 0 calc(3px * var(--inv, 1)) var(--nx-orange); z-index: 4; }
.nx-hs.is-dim { opacity: .15; pointer-events: none; }
.nx-hs.is-pulse { animation: nxPulse 1s ease-out 2; }
@keyframes nxPulse { 0% { box-shadow: 0 0 0 0 rgba(217,60,26,.75); } 100% { box-shadow: 0 0 0 calc(22px * var(--inv, 1)) rgba(217,60,26,0); } }

.nx-tools { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px;
  background: rgba(255,255,255,.94); border: 1px solid var(--nx-grey-200); border-radius: 10px; box-shadow: var(--nx-shadow); backdrop-filter: blur(6px); z-index: 5; }
.nx-tool { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 7px; color: var(--nx-ink); font-size: 1.05rem; display: grid; place-items: center; }
.nx-tool:hover { background: var(--nx-black); color: #fff; }
.nx-tool:focus-visible { outline: 2px solid var(--nx-orange); }
.nx-tool-sep { width: 22px; height: 1px; background: var(--nx-grey-200); margin: 3px 0; }
.nx-zoom-level { font-size: .68rem; font-weight: 700; color: var(--nx-grey-500); padding: 1px 0; font-variant-numeric: tabular-nums; }
.nx-viewer-hint { position: absolute; left: 12px; bottom: 10px; font-size: .78rem; color: var(--nx-grey-700); background: rgba(255,255,255,.9);
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--nx-grey-200); pointer-events: none; z-index: 5; }

.nx-tip { position: absolute; left: 0; top: 0; z-index: 6; max-width: 260px; pointer-events: none; background: var(--nx-black); color: #fff; border-radius: 8px;
  padding: 8px 11px; font-size: .82rem; line-height: 1.3; box-shadow: 0 8px 24px -8px rgba(0,0,0,.5); display: grid; gap: 1px; }
.nx-tip-pn { font-family: 'JetBrains Mono', monospace; font-size: .76rem; color: var(--nx-orange); }
.nx-tip-desc em { color: var(--nx-grey-300); font-style: normal; font-size: .75rem; }
.nx-tip-price { font-weight: 700; }

/* Full-screen */
.nx-viewer:fullscreen, .nx-viewer.is-fs { border-radius: 0; border: 0; }
.nx-viewer:fullscreen .nx-stage { height: 100vh; }
.nx-viewer:-webkit-full-screen .nx-stage { height: 100vh; }
.nx-viewer.is-fs { position: fixed; inset: 0; z-index: 2000; }
.nx-viewer.is-fs .nx-stage { height: 100dvh; }

/* Parts panel */
.nx-parts { background: #fff; border: 1px solid var(--nx-grey-200); border-radius: var(--nx-radius); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.nx-parts-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--nx-grey-200); }
.nx-filter { position: relative; flex: 1; }
.nx-filter > i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--nx-grey-500); font-size: .85rem; }
.nx-filter .form-control { padding-left: 30px; height: 34px; }
.nx-filter .form-control:focus, .form-control:focus, .form-select:focus { border-color: var(--nx-orange); box-shadow: 0 0 0 .2rem var(--nx-orange-a20); }
.nx-parts-scroll { overflow: auto; height: calc(clamp(420px, calc(100vh - 210px), 900px) - 55px - 37px); overscroll-behavior: contain; }
.nx-parts-table thead th { position: sticky; top: 0; z-index: 2; }
.nx-parts-table tbody tr { cursor: pointer; transition: background-color .1s; }
.nx-parts-table tbody tr:focus-visible { outline: 2px solid var(--nx-orange); outline-offset: -2px; }
.nx-parts-table tbody tr > * { transition: background-color .12s, box-shadow .12s; }
.nx-parts-table tbody tr.is-hover > * { background: var(--nx-orange-050); }
.nx-parts-table tbody tr.is-hover > :first-child { box-shadow: inset 4px 0 0 var(--nx-orange); }
.nx-parts-table tbody tr.is-active > * { background: #f9e1db; }
.nx-parts-table tbody tr.is-active > :first-child { box-shadow: inset 4px 0 0 var(--nx-black); }
.nx-col-ref { width: 52px; }
.nx-ref { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 6px; border-radius: 6px; background: var(--nx-grey-100);
  font-weight: 700; font-size: .85rem; color: var(--nx-ink); font-variant-numeric: tabular-nums; transition: background .12s, color .12s; }
.nx-ref-sm { min-width: 24px; height: 22px; font-size: .78rem; }
tr.is-hover .nx-ref { background: var(--nx-orange); color: #fff; }
tr.is-active .nx-ref { background: var(--nx-black); color: #fff; }
.nx-actions { width: 1%; }
.nx-parts-foot { padding: 8px 12px; font-size: .78rem; color: var(--nx-grey-500); border-top: 1px solid var(--nx-grey-200); background: var(--nx-grey-050); }

/* ---- Tablet & phone: diagram sticks to the top, list scrolls with the page ---- */
@media (max-width: 991.98px) {
  :root { --nx-header-h: 60px; }
  .nx-asm-page { padding-top: 10px; }
  .nx-asm-head { margin-bottom: 10px; }
  .nx-asm-head .nx-h1 { font-size: 1.35rem; white-space: normal; }
  .nx-viewer-col { position: sticky; top: var(--nx-header-h); z-index: 20; background: var(--nx-grey-050); padding-bottom: 6px; }
  .nx-stage { height: min(44vh, 62vw); min-height: 220px; }
  .nx-viewer-hint { font-size: .72rem; }
  .nx-parts-scroll { height: auto; overflow: visible; }
  .nx-parts-table thead th { top: 0; }
  .nx-tools { flex-direction: row; top: auto; bottom: 8px; right: 8px; }
  .nx-tool-sep { width: 1px; height: 20px; margin: 0 3px; }
  .nx-zoom-level { padding: 0 3px; }
}
@media (max-width: 575.98px) {
  .nx-table td, .nx-table th { padding: .55rem .45rem; }
  .nx-col-ref { width: 40px; }
  .nx-parts-table { font-size: .9rem; }
  .nx-desc-sm { line-height: 1.25; }
  .nx-icon-btn { width: 36px; height: 36px; }
  .nx-viewer-hint { display: none; }
}

/* ---------- Basket (offcanvas + page) ---------- */
.nx-basket { --bs-offcanvas-width: 420px; }
.nx-basket .offcanvas-header { border-bottom: 1px solid var(--nx-grey-200); }
.nx-oc-line { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--nx-grey-200); align-items: flex-start; }
.nx-oc-img, .nx-bline-img { width: 56px; height: 56px; flex: none; border-radius: 8px; background: var(--nx-grey-100); display: grid; place-items: center; color: var(--nx-grey-500); font-size: 1.4rem; overflow: hidden; border: 0; }
.nx-oc-img img, .nx-bline-img img { width: 100%; height: 100%; object-fit: cover; }
.nx-basket-totals { padding: 16px; border-top: 1px solid var(--nx-grey-200); background: var(--nx-grey-050); }
.nx-basket-totals:empty { display: none; }
.nx-stepper { display: inline-flex; align-items: center; border: 1px solid var(--nx-grey-300); border-radius: 8px; overflow: hidden; background: #fff; }
.nx-stepper button { border: 0; background: transparent; width: 30px; height: 30px; display: grid; place-items: center; color: var(--nx-ink); }
.nx-stepper button:hover { background: var(--nx-grey-100); }
.nx-stepper input { width: 42px; border: 0; text-align: center; font-weight: 600; -moz-appearance: textfield; padding: 0; height: 30px; }
.nx-stepper input::-webkit-outer-spin-button, .nx-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.nx-stepper input:focus { outline: none; background: var(--nx-orange-050); }
.nx-stepper-lg button { width: 40px; height: 42px; }
.nx-stepper-lg input { height: 42px; width: 52px; font-size: 1.05rem; }
.nx-totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin-bottom: 1rem; }
.nx-totals dt { font-weight: 500; color: var(--nx-grey-700); }
.nx-totals dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.nx-totals .nx-grand { font-size: 1.15rem; font-weight: 700; color: var(--nx-black); border-top: 1px solid var(--nx-grey-300); padding-top: 8px; margin-top: 2px; }

.nx-bline { display: grid; grid-template-columns: 56px 1fr 84px 96px 36px; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--nx-grey-200); }
.nx-bline:last-child { border-bottom: 0; }
.nx-bline-total { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) {
  .nx-bline { grid-template-columns: 48px 1fr 36px; grid-template-areas: "img main rm" "img qty total"; row-gap: 8px; }
  .nx-bline-img { grid-area: img; width: 48px; height: 48px; }
  .nx-bline-main { grid-area: main; } .nx-bline-qty { grid-area: qty; max-width: 90px; }
  .nx-bline-total { grid-area: total; grid-column: 3 / 4; white-space: nowrap; }
  .nx-bline > form:last-child { grid-area: rm; }
  .nx-bline { grid-template-areas: "img main rm" "img qty total"; grid-template-columns: 48px 1fr auto; }
}
.nx-summary { position: sticky; top: calc(var(--nx-header-h) + 16px); }
.nx-mini-lines li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--nx-grey-200); }
.nx-mini-qty { font-weight: 700; color: var(--nx-orange-600); min-width: 32px; }

/* ---------- Part modal ---------- */
.modal-content { border: 0; border-radius: var(--nx-radius); }
.modal-header { border-bottom: 1px solid var(--nx-grey-200); align-items: flex-start; }
.modal-header::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--nx-orange); border-radius: var(--nx-radius) var(--nx-radius) 0 0; }
.nx-part-photo { aspect-ratio: 1; border-radius: 10px; background: var(--nx-grey-100); overflow: hidden; display: grid; place-items: center; }
.nx-part-photo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.nx-photo-ph { display: grid; place-items: center; gap: 6px; color: var(--nx-grey-500); font-size: .85rem; text-align: center; }
.nx-photo-ph i { font-size: 2.6rem; color: var(--nx-grey-300); }
.nx-modal-price { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 2rem; line-height: 1; }
.nx-specs { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 0 0 1rem; border: 1px solid var(--nx-grey-200); border-radius: 8px; overflow: hidden; font-size: .9rem; }
.nx-specs dt, .nx-specs dd { padding: 7px 12px; margin: 0; border-bottom: 1px solid var(--nx-grey-200); }
.nx-specs dt { background: var(--nx-grey-050); font-weight: 500; color: var(--nx-grey-700); }
.nx-specs dt:nth-last-child(2), .nx-specs dd:last-child { border-bottom: 0; }
.nx-modal-buy { display: flex; gap: 10px; align-items: stretch; }
.nx-usedin-list { display: grid; gap: 6px; }
.nx-usedin-list a { display: block; padding: 8px 12px; border-radius: 8px; background: var(--nx-grey-050); border: 1px solid var(--nx-grey-200); color: var(--nx-ink); text-decoration: none; }
.nx-usedin-list a:hover { border-color: var(--nx-orange); }
.nx-usedin-list a.is-current { border-color: var(--nx-black); }

/* ---------- Toast, footer, confirmation ---------- */
.nx-toast { background: var(--nx-black); color: #fff; border: 0; border-left: 4px solid var(--nx-orange); }
.nx-toast-error { border-left-color: #dc3545; }
.nx-footer { background: var(--nx-black); color: #a9aeb4; font-size: .86rem; padding: 18px 0; margin-top: auto; }
.nx-footer a { color: #fff; text-decoration: none; }
.nx-footer a:hover { color: var(--nx-orange); }
.nx-success { width: 64px; height: 64px; border-radius: 50%; background: var(--nx-orange); color: #fff; display: inline-grid; place-items: center; font-size: 2rem; }

/* ---------- Print: diagram + list only ---------- */
@media print {
  .nx-header, .nx-crumbs, .nx-footer, .nx-tools, .nx-viewer-hint, .nx-parts-head, .nx-actions, .nx-asm-head .btn, .nx-parts-table th:last-child { display: none !important; }
  .nx-viewer-col { position: static !important; }
  .nx-stage { height: auto !important; background: none; }
  .nx-canvas { position: static; transform: none !important; width: 100% !important; height: auto !important; }
  .nx-hs { display: none; }
  .nx-parts-scroll { height: auto; overflow: visible; }
  .col-lg-7, .col-lg-5 { width: 100% !important; }
}

/* =====================================================================
   Catalogue tree, models, build tailoring
   ===================================================================== */
.nx-tree { background: #fff; border: 1px solid var(--nx-grey-200); border-radius: var(--nx-radius); position: sticky; top: calc(var(--nx-header-h) + 16px); overflow: hidden; }
.nx-tree-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--nx-grey-200); }
.nx-tree-body { padding: 8px 6px 12px; max-height: calc(100vh - var(--nx-header-h) - 140px); overflow: auto; overscroll-behavior: contain; }
.nx-tree-list { list-style: none; margin: 0; padding: 0; }
.nx-tree-kids { display: none; padding-left: 14px; margin-left: 13px; border-left: 1px solid var(--nx-grey-200); }
.nx-tree-node.is-open > .nx-tree-kids { display: block; }
.nx-tree-row { display: flex; align-items: center; gap: 2px; border-radius: 7px; padding: 1px 4px 1px 0; }
.nx-tree-row:hover { background: var(--nx-grey-100); }
.nx-tree-row > a { flex: 1; min-width: 0; padding: 6px 4px; color: var(--nx-ink); text-decoration: none; font-weight: 600; }
.nx-tree-row.is-current > a { color: var(--nx-orange-600); }
.nx-tree-toggle, .nx-tree-toggle-sp { width: 26px; height: 26px; flex: none; }
.nx-tree-toggle { border: 0; background: transparent; border-radius: 6px; color: var(--nx-grey-500); display: grid; place-items: center; font-size: .8rem; }
.nx-tree-toggle:hover { color: var(--nx-black); }
.nx-tree-toggle i { transition: transform .15s; }
.nx-tree-node.is-open > .nx-tree-row .nx-tree-toggle i { transform: rotate(90deg); }
.nx-tree-count { font-size: .72rem; font-weight: 600; color: var(--nx-grey-500); background: var(--nx-grey-100); border-radius: 999px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.nx-tree-model { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; border-radius: 7px; color: var(--nx-ink); text-decoration: none; font-size: .92rem; }
.nx-tree-model i { color: var(--nx-grey-500); font-size: .9rem; align-self: center; }
.nx-tree-model:hover { background: var(--nx-orange-050); color: var(--nx-black); }
.nx-tree-model:hover i { color: var(--nx-orange); }
.nx-tree-model.is-current { background: var(--nx-black); color: #fff; }
.nx-tree-model.is-current i, .nx-tree-model.is-current .nx-tree-mname { color: #c9cdd2; }
.nx-tree-code { font-weight: 700; font-variant-numeric: tabular-nums; }
.nx-tree-mname { color: var(--nx-grey-500); font-size: .82rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-tree-mobile-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; border: 0; background: #fff; padding: 12px 14px; font-weight: 600; }
@media (max-width: 991.98px) { .nx-tree { position: static; } .nx-tree-body { max-height: 60vh; } }

.nx-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.nx-cat-tile { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: var(--nx-radius); background: var(--nx-black); color: #fff; text-decoration: none; position: relative; overflow: hidden; min-height: 96px; }
.nx-cat-tile::after { content: ""; position: absolute; right: -24px; top: -24px; width: 72px; height: 72px; background: repeating-linear-gradient(-45deg, var(--nx-orange) 0 7px, transparent 7px 14px); opacity: .55; transform: rotate(8deg); }
.nx-cat-tile:hover { background: var(--nx-orange); color: #fff; }
.nx-cat-name { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 1.3rem; line-height: 1.1; }
.nx-cat-meta { margin-top: auto; font-size: .84rem; color: #c9cdd2; display: flex; gap: 6px; align-items: center; }
.nx-cat-tile:hover .nx-cat-meta { color: #fff; }

.nx-model-card { display: flex; gap: 14px; align-items: stretch; height: 100%; background: #fff; border: 1px solid var(--nx-grey-200); border-radius: var(--nx-radius); padding: 12px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.nx-model-card:hover { border-color: var(--nx-orange); box-shadow: var(--nx-shadow); transform: translateY(-2px); color: inherit; }
.nx-model-img { width: 84px; flex: none; border-radius: 9px; background: var(--nx-grey-100); display: grid; place-items: center; color: var(--nx-grey-500); font-size: 2rem; overflow: hidden; }
.nx-model-img img { width: 100%; height: 100%; object-fit: cover; }
.nx-model-card:hover .nx-model-img { color: var(--nx-orange); }
.nx-model-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nx-model-code { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 1.55rem; line-height: 1; color: var(--nx-black); }
.nx-model-name { color: var(--nx-grey-700); font-size: .92rem; margin-top: 2px; }
.nx-model-meta { margin-top: auto; padding-top: 8px; display: flex; gap: 8px; font-size: .78rem; color: var(--nx-grey-500); }
.nx-model-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--nx-grey-300); color: var(--nx-ink); text-decoration: none; }
.nx-model-pill span { color: var(--nx-grey-500); font-size: .88rem; }
.nx-model-pill:hover { border-color: var(--nx-orange); }

.nx-model-head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.nx-model-head-img { width: 76px; height: 76px; flex: none; border-radius: 12px; background: var(--nx-black); color: var(--nx-orange); display: grid; place-items: center; font-size: 2.2rem; overflow: hidden; }
.nx-model-head-img img { width: 100%; height: 100%; object-fit: cover; }

.nx-hero-error { margin-top: 10px; color: #ffd2b8; font-size: .92rem; max-width: 620px; }

.nx-truck-chip { display: inline-flex; align-items: center; gap: 6px; padding: .4rem .8rem; border-radius: 999px; background: var(--nx-orange-050); border: 1px solid #f4c3b8; color: var(--nx-black); text-decoration: none; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.nx-truck-chip i { color: var(--nx-orange-600); }
.nx-truck-chip:hover { border-color: var(--nx-orange); color: var(--nx-black); }

.nx-build { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--nx-radius); margin-bottom: 20px; border: 1px solid; }
.nx-build-tailored { background: #eef8f1; border-color: #bfe3cb; }
.nx-build-generic { background: #fff; border-color: var(--nx-grey-200); border-left: 4px solid var(--nx-orange); }
.nx-build-icon { font-size: 1.5rem; line-height: 1; color: #198754; }
.nx-build-generic .nx-build-icon { color: var(--nx-orange); }
.nx-build-main { flex: 1 1 260px; min-width: 0; }
.nx-build-title { font-weight: 700; }
.nx-build-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.nx-chip-sm { font-size: .76rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #fff; border: 1px solid #bfe3cb; color: #14532d; }
.nx-build-actions { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nx-build-form { display: flex; gap: 6px; flex-wrap: wrap; flex: 0 1 300px; }
.nx-build-form .form-control { flex: 1; min-width: 140px; }
.nx-build-error { flex-basis: 100%; color: #b02a37; }
.nx-build-compact .nx-build { padding: 10px 14px; margin-bottom: 14px; }

.nx-fit-tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: 1px 7px; border-radius: 4px; background: #eef2ff; color: #3730a3; margin: 2px 4px 0 0; white-space: normal; }
.nx-fit-tag.is-other { background: var(--nx-grey-100); color: var(--nx-grey-500); text-decoration: line-through; }
.nx-asm-card .nx-fit-tag { align-self: flex-start; margin-top: 6px; }

.nx-hero-search .btn { white-space: nowrap; }

/* =====================================================================
   Dealer portal additions (update 024)
   ===================================================================== */
.nx-portal-tag { font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: .95rem; text-transform: uppercase; letter-spacing: .14em; color: #fff; background: var(--nx-orange); padding: 3px 8px 2px; border-radius: 4px; }
.nx-company { font-size: .8rem; color: var(--nx-grey-500); line-height: 1.1; }
.nx-mainnav .nav-link { font-weight: 600; color: var(--nx-ink); padding: .5rem .8rem; border-radius: 8px; display: flex; align-items: center; gap: .45rem; }
.nx-mainnav .nav-link:hover { background: var(--nx-grey-100); color: var(--nx-black); }
.nx-mainnav .nav-link.active { color: var(--nx-orange-600); background: var(--nx-orange-050); }
.nx-user-btn { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--nx-grey-200); background: #fff; border-radius: 999px; padding: .25rem .75rem .25rem .3rem; }
.nx-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--nx-black); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.nx-welcome { background: var(--nx-black); color: #fff; padding: clamp(28px, 5vw, 56px) 0; position: relative; overflow: hidden; }
.nx-welcome::after { content: ""; position: absolute; right: -6%; top: -40%; width: 40%; height: 180%; background: repeating-linear-gradient(-45deg, var(--nx-orange) 0 26px, transparent 26px 52px); opacity: .85; transform: skewX(-12deg); }
.nx-welcome .nx-container { position: relative; z-index: 1; }
.nx-welcome h1 { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem); line-height: 1.05; margin: .3rem 0 .6rem; color: #fff; }
.nx-welcome p { color: #c8ccd1; max-width: 56ch; margin: 0; }
.nx-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.nx-tile { display: flex; gap: 14px; align-items: flex-start; padding: 18px; background: #fff; border: 1px solid var(--nx-grey-200); border-radius: var(--nx-radius); text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; min-height: 108px; }
a.nx-tile:hover { border-color: var(--nx-orange); box-shadow: var(--nx-shadow); transform: translateY(-2px); color: inherit; }
.nx-tile > i { flex: none; width: 46px; height: 46px; border-radius: 10px; background: var(--nx-black); color: #fff; display: grid; place-items: center; font-size: 1.35rem; }
a.nx-tile:hover > i { background: var(--nx-orange); }
.nx-tile strong { display: block; font-size: 1.08rem; }
.nx-tile small { color: var(--nx-grey-500); display: block; margin-top: 2px; }
.nx-tile.is-soon { background: var(--nx-grey-050); border-style: dashed; }
.nx-tile.is-soon > i { background: var(--nx-grey-300); }
.nx-soon { display: inline-block; margin-top: 6px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--nx-grey-700); background: var(--nx-grey-100); border-radius: 4px; padding: 1px 6px; }
.nx-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: #fff; }
.nx-auth-side { background: var(--nx-black); color: #fff; padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.nx-auth-side::after { content: ""; position: absolute; right: -30%; bottom: -30%; width: 80%; height: 80%; background: repeating-linear-gradient(-45deg, var(--nx-orange) 0 22px, transparent 22px 44px); opacity: .9; transform: rotate(8deg); }
.nx-auth-side > * { position: relative; z-index: 1; }
.nx-auth-side h2 { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: clamp(2rem, 1.2rem + 2.5vw, 3.2rem); line-height: 1.02; color: #fff; max-width: 14ch; }
.nx-auth-side ul { color: #c8ccd1; padding-left: 1.1rem; }
.nx-auth-main { display: grid; place-items: center; padding: 32px 16px; }
.nx-auth-card { width: 100%; max-width: 420px; }
.nx-auth-card h1 { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 2rem; }
@media (max-width: 767.98px) { .nx-auth { grid-template-columns: 1fr; } .nx-auth-side { min-height: 0; padding-block: 24px; } .nx-auth-side ul, .nx-auth-side .nx-auth-foot { display: none; } }
.nx-pw-wrap { position: relative; }
.nx-pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--nx-grey-700); font-size: .85rem; font-weight: 600; padding: .25rem .5rem; }
.nx-req-list li { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--nx-grey-200); }
.nx-req-list li:last-child { border-bottom: 0; }
.nx-badge-status { font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--nx-grey-100); color: var(--nx-grey-700); white-space: nowrap; }
.nx-badge-status.new { background: #e6f0fa; color: #174f80; }
.nx-badge-status.in_progress, .nx-badge-status.quoted { background: #fff4d6; color: #7a5200; }
.nx-badge-status.ordered { background: #e7f6ec; color: #146c43; }
.nx-badge-status.cancelled { background: #fde8e8; color: #a3202c; }

/* ---- portal page fixes ---- */
.nx-main .nx-search, form.nx-search[role=search] { display: flex; gap: 8px; max-width: 720px; }
form.nx-search[role=search] .form-control { flex: 1 1 auto; min-width: 0; height: 44px; background: #fff; border-color: var(--nx-grey-200); }
form.nx-search[role=search] .btn { flex: none; border-radius: 999px; padding-inline: 18px; }
.nx-auth-side .nx-wordmark { color: #fff; }
.nx-auth-side::after { right: -22%; bottom: -34%; width: 62%; height: 58%; opacity: .75; }
.nx-auth-side ul, .nx-auth-side h2 { max-width: 30ch; }
.nx-label { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--nx-grey-500); margin-bottom: 12px; }
.nx-avatar-lg { width: 42px; height: 42px; font-size: .95rem; flex: none; }
.nx-soon { margin-top: 0; vertical-align: 2px; margin-left: 4px; }
@media (max-width: 575.98px) {
  .nx-header .navbar > .nx-container { flex-wrap: nowrap; }
  .nx-header .nx-wordmark { font-size: 1.25rem; }
  .nx-header .nx-portal-tag { font-size: .6rem; padding: 2px 6px; letter-spacing: .08em; }
  .nx-header .navbar-collapse { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--nx-grey-200); padding: 0 16px; }
}

/* ---- stage 2: stock, orders, quotes, documents ---- */
.nx-badge-status.reserved, .nx-badge-status.sold, .nx-badge-status.accepted { background: #e7f6ec; color: #146c43; }
.nx-badge-status.declined { background: #fde8e8; color: #a3202c; }
.nx-badge-status.closed { background: var(--nx-grey-100); color: var(--nx-grey-700); }
.nx-tabs { border-bottom: 1px solid var(--nx-grey-200); gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nx-tabs .nav-link { color: var(--nx-grey-700); font-weight: 600; border-bottom: 3px solid transparent; border-radius: 0; padding: 10px 14px; white-space: nowrap; }
.nx-tabs .nav-link:hover { color: var(--nx-black); }
.nx-tabs .nav-link.active { color: var(--nx-black); border-bottom-color: var(--nx-orange); }
.nx-count { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--nx-grey-100); color: var(--nx-grey-700); font-size: .74rem; text-align: center; margin-left: 4px; }
.nx-count.is-hot { background: var(--nx-orange); color: #fff; }
.nx-stock-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nx-stock-filter .form-control { flex: 1 1 240px; min-width: 0; max-width: 460px; }
.nx-stock-filter .form-select { flex: 0 1 220px; }
.nx-stock-list { display: grid; gap: 12px; }
.nx-stock-card { display: grid; grid-template-columns: 148px minmax(0, 1fr) 190px; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--nx-grey-200); border-radius: var(--nx-radius); padding: 12px; transition: border-color .15s, box-shadow .15s; }
.nx-stock-card:hover { border-color: var(--nx-grey-300); box-shadow: var(--nx-shadow); }
.nx-stock-img { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--nx-grey-100); border-radius: var(--nx-radius-sm); overflow: hidden; color: var(--nx-grey-500); font-size: 2rem; }
.nx-stock-img img { width: 100%; height: 100%; object-fit: cover; }
.nx-stock-title { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 1.45rem; margin: 0; line-height: 1.1; }
.nx-stock-title a { color: var(--nx-black); text-decoration: none; }
.nx-stock-title a:hover { color: var(--nx-orange-600); }
.nx-stock-side { text-align: right; border-left: 1px solid var(--nx-grey-200); padding-left: 16px; }
.nx-stock-price { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 1.6rem; line-height: 1; color: var(--nx-black); }
.nx-stock-price-lg { font-size: 2.4rem; margin: 4px 0; }
.nx-line { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .74rem; font-weight: 600; background: var(--nx-black); color: #fff; border-radius: 4px; padding: 1px 7px; }
.nx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nx-chips .nx-chip-sm { border-color: var(--nx-grey-200); color: var(--nx-grey-700); }
.nx-stock-carousel { border-radius: var(--nx-radius); overflow: hidden; background: var(--nx-grey-100); }
.nx-stock-carousel img { aspect-ratio: 4 / 3; object-fit: cover; }
@media (max-width: 767.98px) {
  .nx-stock-card { grid-template-columns: 96px minmax(0, 1fr); }
  .nx-stock-side { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--nx-grey-200); padding: 10px 0 0; display: flex; align-items: center; gap: 12px; text-align: left; }
  .nx-stock-side .small { margin: 0 !important; flex: 1; }
  .nx-stock-side .btn { width: auto !important; }
}
.nx-choice { display: grid; gap: 8px; }
.nx-choice-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--nx-grey-200); border-radius: var(--nx-radius-sm); cursor: pointer; }
.nx-choice-opt:has(input:checked) { border-color: var(--nx-orange); background: var(--nx-orange-050); }
.nx-choice-opt input { margin-top: 4px; accent-color: var(--nx-orange); }
.nx-choice-opt small { display: block; color: var(--nx-grey-500); }
.nx-total { background: var(--nx-black); color: #fff; border-left: 6px solid var(--nx-orange); border-radius: var(--nx-radius-sm); padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.nx-total strong { font-size: 1.6rem; font-family: 'Barlow Condensed', sans-serif; }
.nx-total small { color: #c8ccd1; }
.nx-text-brand { color: var(--nx-orange) !important; }
.nx-doc-row { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--nx-grey-200); padding-right: 8px; }
.nx-doc-row:last-child { border-bottom: 0; }
.nx-doc-main, a.nx-doc-row { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 12px 16px; color: var(--nx-ink); text-decoration: none; }
.nx-doc-main:hover, a.nx-doc-row:hover { background: var(--nx-grey-050); color: var(--nx-black); }
.nx-doc-main > i, a.nx-doc-row > i { font-size: 1.25rem; color: var(--nx-grey-500); flex: none; }
.nx-doc-folder { color: #e0a526 !important; }
.nx-doc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.nx-doc-up { color: var(--nx-grey-700) !important; font-size: .9rem; }

/* ---- stage 3: warranty and customers ---- */
.nx-steps { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; counter-reset: st; }
.nx-steps li { counter-increment: st; font-size: .8rem; font-weight: 600; padding: 6px 12px 6px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--nx-grey-200); color: var(--nx-grey-500); }
.nx-steps li::before { content: counter(st); display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--nx-grey-100); margin-right: 6px; font-size: .72rem; }
.nx-steps li.is-done { color: var(--nx-ink); }
.nx-steps li.is-done::before { content: "✓"; background: #e7f6ec; color: #146c43; }
.nx-steps li.is-now { border-color: var(--nx-orange); color: var(--nx-black); background: var(--nx-orange-050); }
.nx-steps li.is-now::before { background: var(--nx-orange); color: #fff; }
.nx-outcome { border-left: 5px solid var(--nx-orange); }
.nx-thread { display: flex; flex-direction: column; gap: 10px; }
.nx-msg { max-width: 88%; padding: 10px 14px; border-radius: 12px; background: var(--nx-grey-100); }
.nx-msg.is-nexen { align-self: flex-start; border-top-left-radius: 4px; background: #fff; border: 1px solid var(--nx-grey-200); }
.nx-msg.is-dealer { align-self: flex-end; border-top-right-radius: 4px; background: var(--nx-orange-050); }
.nx-msg.is-system { max-width: 100%; align-self: stretch; background: transparent; border: 0; border-left: 3px solid var(--nx-grey-300); border-radius: 0; padding: 4px 12px; font-size: .88rem; color: var(--nx-grey-700); }
.nx-msg-who { font-size: .76rem; font-weight: 700; color: var(--nx-grey-700); margin-bottom: 2px; }
.nx-msg-who time { font-weight: 400; color: var(--nx-grey-500); margin-left: 6px; }
.nx-msg-text { white-space: normal; overflow-wrap: anywhere; }
.nx-files li { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--nx-grey-200); }
.nx-files li:last-child { border-bottom: 0; }
.nx-files a { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; text-decoration: none; color: var(--nx-ink); }
.nx-files a:hover { color: var(--nx-orange-600); }
.nx-files a i { color: var(--nx-grey-500); font-size: 1.1rem; }
.nx-mainnav .nav-link { white-space: nowrap; }
.nx-user-btn .nx-company { display: block; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1199.98px) {
  .nx-header .navbar-collapse { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--nx-grey-200); padding: 0 16px; box-shadow: var(--nx-shadow); }
}

/* ---- stage 4: dealer quotes ---- */
.nx-machine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.nx-machine { display: flex; flex-direction: column; padding: 12px 14px; background: #fff; border: 1px solid var(--nx-grey-200); border-radius: var(--nx-radius-sm); text-decoration: none; color: var(--nx-ink); }
.nx-machine:hover { border-color: var(--nx-orange); box-shadow: var(--nx-shadow); color: var(--nx-black); }
.nx-machine strong { font-family: 'Barlow Condensed', sans-serif; font-size: 1.3rem; }
.nx-machine small { color: var(--nx-grey-500); }
.nx-dq-table td { vertical-align: top; }
.nx-dq-totals { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; margin: 0; }
.nx-dq-totals dt { font-weight: 400; color: var(--nx-grey-700); }
.nx-dq-totals dd { margin: 0; text-align: right; white-space: nowrap; }
.nx-dq-grand { font-weight: 700 !important; color: var(--nx-black) !important; font-size: 1.15rem; border-top: 2px solid var(--nx-black); padding-top: 8px; }
.nx-dq-margin { background: var(--nx-grey-050); border: 1px dashed var(--nx-grey-300); border-radius: var(--nx-radius-sm); padding: 8px 10px; }
.nx-stock-pick { max-height: 320px; overflow: auto; border: 1px solid var(--nx-grey-200); border-radius: var(--nx-radius-sm); padding: 8px 12px; }
.nx-logo-preview { border: 1px solid var(--nx-grey-200); border-radius: var(--nx-radius-sm); padding: 10px; background: #fff; display: inline-block; }
.nx-logo-preview img { max-width: 220px; max-height: 90px; display: block; }
