:root {
  --c-text: #1a1a1a;
  --c-muted: #666;
  --c-soft: #999;
  --c-bg: #f0f0ed;
  --c-card: #fff;
  --c-border: rgba(0,0,0,.10);
  --c-border-strong: rgba(0,0,0,.20);
  --c-primary: #185FA5;
  --c-primary-dk: #0C447C;
  --c-info: #185FA5;
  --c-info-bg: #E6F1FB;
  --c-success: #0F6E56;
  --c-success-bg: #E1F5EE;
  --c-warning: #854F0B;
  --c-warning-bg: #FAEEDA;
  --c-danger: #A32D2D;
  --c-danger-bg: #FBE9E9;
  --c-brand-navy: #0A1F3A;
  --c-brand-plus: #FF5733;
  --r-md: 8px;
  --r-lg: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--c-text);
  background: var(--c-bg);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--c-info); }
a:hover { text-decoration: underline; }

code { font-family: var(--font-mono); font-size: 13px; background: rgba(0,0,0,.05); padding: 1px 4px; border-radius: 3px; }
pre { font-family: var(--font-mono); background: rgba(0,0,0,.04); padding: 1rem; border-radius: var(--r-md); overflow-x: auto; }

h1, h2, h3 { font-weight: 500; margin: 0 0 .75rem; }
h1 { font-size: 22px; }
h2 { font-size: 18px; margin-top: 1.5rem; }
h3 { font-size: 16px; }

.muted { color: var(--c-muted); }
.small { font-size: 12px; }
.mono { font-family: var(--font-mono); }
.err { color: var(--c-danger); }
.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;
}

/* ===== Top bar ===== */
.topbar {
  background: var(--c-card);
  border-bottom: .5px solid var(--c-border);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: .75rem 1.25rem;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  text-decoration: none;
  color: var(--c-text);
}
.brand-wordmark {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.02em;
  color: var(--c-brand-navy);
  line-height: 1;
}
.brand-plus { color: var(--c-brand-plus); }
.brand-sub { font-size: 12px; color: var(--c-muted); text-transform: uppercase; letter-spacing: .5px; }

.nav { display: flex; gap: 1rem; flex: 1; }
.nav a { color: var(--c-muted); text-decoration: none; font-weight: 500; padding: .25rem 0; }
.nav a:hover { color: var(--c-text); }

.user-menu { display: flex; align-items: center; gap: .75rem; font-size: 12px; }
.user-name { color: var(--c-text); font-weight: 500; }
.user-role { color: var(--c-muted); text-transform: uppercase; letter-spacing: .5px; }

/* ===== Main / footer ===== */
.main {
  max-width: 1080px;
  margin: 1.5rem auto;
  padding: 0 1.25rem 4rem;
}
.footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
  color: var(--c-soft);
  text-align: center;
}

/* ===== Flash ===== */
.flash-wrap { margin-bottom: 1rem; }
.flash {
  padding: .6rem 1rem;
  border-radius: var(--r-md);
  margin-bottom: .5rem;
  font-size: 13px;
}
.flash-success { background: var(--c-success-bg); color: var(--c-success); }
.flash-error   { background: var(--c-danger-bg);  color: var(--c-danger); }
.flash-info    { background: var(--c-info-bg);    color: var(--c-info); }
.flash-warning { background: var(--c-warning-bg); color: var(--c-warning); }

/* ===== Cards / containers ===== */
.card {
  background: var(--c-card);
  border: .5px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.card-narrow {
  max-width: 420px;
  margin: 3rem auto;
  background: var(--c-card);
  border: .5px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 2rem;
}

/* ===== Buttons ===== */
.btn-primary {
  background: var(--c-primary);
  color: #fff;
  border: 0;
  padding: .55rem 1.1rem;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
}
.btn-primary:hover { background: var(--c-primary-dk); text-decoration: none; }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--c-muted);
  border: .5px solid var(--c-border-strong);
  padding: .5rem 1rem;
  border-radius: var(--r-md);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
}
.btn-ghost:hover { color: var(--c-text); text-decoration: none; }
.btn-ghost.btn-danger { color: var(--c-danger); border-color: var(--c-danger); }
.btn-ghost.btn-danger:hover { background: var(--c-danger-bg); }

/* ===== Forms ===== */
.form { display: flex; flex-direction: column; gap: 1rem; max-width: 480px; }
.form label { display: flex; flex-direction: column; gap: .25rem; font-size: 13px; }
.form label > span { color: var(--c-muted); text-transform: uppercase; letter-spacing: .5px; font-size: 11px; font-weight: 500; }
.form input,
.form select,
.form textarea {
  padding: .5rem .75rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-card);
  color: var(--c-text);
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}
.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px rgba(24,95,165,.2);
}
.form input:disabled {
  background: var(--c-bg);
  color: var(--c-muted);
}
.form textarea.mono { font-family: var(--font-mono); font-size: 13px; }
.form .err { color: var(--c-danger); }
.form-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-top: .5rem;
}

/* ===== Tables ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-card);
  border-radius: var(--r-md);
  overflow: hidden;
  margin: 1rem 0;
  font-size: 13px;
}
.data-table th, .data-table td {
  padding: .6rem .75rem;
  text-align: left;
  border-bottom: .5px solid var(--c-border);
}
.data-table th {
  background: var(--c-bg);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--c-muted);
  font-weight: 500;
}
.data-table tr.is-inactive td { color: var(--c-soft); }
.data-table .actions { white-space: nowrap; text-align: right; }
.data-table .actions form { display: inline; }
.data-table .actions .btn-ghost { margin-left: .25rem; padding: .3rem .65rem; font-size: 12px; }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.pill-ok  { background: var(--c-success-bg); color: var(--c-success); }
.pill-dim { background: var(--c-bg); color: var(--c-muted); }

/* ===== Page heads ===== */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===== Dashboard stats ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}
.stat {
  background: var(--c-card);
  border: .5px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: var(--c-text);
}
.stat:hover { text-decoration: none; background: var(--c-info-bg); }
.stat-num { font-size: 28px; font-weight: 500; line-height: 1.1; }
.stat-label { font-size: 11px; color: var(--c-muted); text-transform: uppercase; letter-spacing: .5px; margin-top: .25rem; }

/* ===== Prose (markdown rendered) ===== */
.prose { max-width: 720px; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.5rem; }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose li { margin: .25rem 0; }
.prose p { margin: .75rem 0; }
.prose pre { font-size: 13px; }

/* ===== Catalog admin ===== */
.catalog-split {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .catalog-split { grid-template-columns: 1fr; }
}

.catalog-list {
  background: var(--c-card);
  border: .5px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 1rem;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.mat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mat-list li {
  border-bottom: 1px solid var(--c-border);
}
.mat-list li:last-child { border-bottom: 0; }
.mat-list a {
  display: block;
  padding: .5rem .25rem;
  text-decoration: none;
  color: var(--c-text);
}
.mat-list a:hover { background: var(--c-info-bg); }
.mat-list li.is-selected a { background: var(--c-info-bg); border-left: 3px solid var(--c-primary); padding-left: calc(.25rem - 3px + 3px); }
.mat-list li.is-inactive a { opacity: .5; }
.mat-code {
  display: inline-block;
  font-size: 11px;
  color: var(--c-muted);
  margin-right: .5rem;
  font-family: var(--font-mono);
}
.mat-name { font-weight: 500; }
.mat-meta {
  display: block;
  font-size: 11px;
  color: var(--c-muted);
  margin-top: 2px;
}

.sku-block {
  background: var(--c-bg);
  border-radius: var(--r-md);
  padding: 1rem;
  margin: 1rem 0;
}
.sku-block details summary { padding: .25rem 0; }
.sku-block input, .sku-block select { font-size: 13px; }

.tier-table {
  width: 100%;
  margin: .5rem 0;
  border-collapse: collapse;
}
.tier-table th {
  text-align: left;
  font-size: 11px;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 500;
  padding: .25rem .5rem;
}
.tier-table td { padding: 2px .5rem 2px 0; }
.tier-table input { width: 100%; font-size: 13px; padding: .25rem .5rem; }

.addon-row {
  background: var(--c-bg);
  padding: .75rem;
  border-radius: var(--r-md);
  margin-bottom: .5rem;
  max-width: none;
}
.addon-row input, .addon-row select { font-size: 13px; }

.inline-check {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: .35rem;
  font-size: 13px;
  font-weight: normal !important;
  color: var(--c-text) !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}
.inline-check input[type="checkbox"] {
  width: auto !important;
  margin: 0;
}

/* ===== Calculator (prototype-styled) ===== */

.calc-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 1fr);
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .calc-grid { grid-template-columns: 1fr; }
  .calc-result { position: static !important; }
}

.calc-form .card { padding: 1rem 1.25rem; }

/* Generic form-row label */
.flabel {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--c-muted);
  font-weight: 500;
  margin-bottom: 6px;
}
.field { margin-bottom: 1rem; }
.field:last-child { margin-bottom: 0; }

/* Mode pill (Simple / Advanced) */
.modepill {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--c-bg);
  border-radius: var(--r-md);
}
.modepill button {
  padding: 6px 12px;
  border: 0;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-family: inherit;
  font-weight: 500;
}
.modepill button.active {
  background: var(--c-card);
  color: var(--c-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}

/* Units pill (Imperial / Metric) — same pattern as mode pill */
.upill {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--c-bg);
  border-radius: var(--r-md);
}
.upill button {
  padding: 4px 10px;
  border: 0;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-family: inherit;
  font-weight: 500;
}
.upill button.active {
  background: var(--c-card);
  color: var(--c-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}

/* Dimensions row: width × height × qty */
.row3 {
  display: grid;
  grid-template-columns: 1fr 1fr 90px;
  gap: 8px;
  align-items: stretch;
}
.iwrap {
  position: relative;
  display: flex;
  align-items: stretch;
}
.iwrap input {
  width: 100%;
  padding-right: 32px;
}
.iwrap .unit {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  pointer-events: none;
}

/* Collapsible card */
.card.collapsible > .chead {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: -1rem -1.25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--r-lg);
  user-select: none;
}
.card.collapsible > .chead:hover { background: var(--c-bg); }
.card.collapsible > .chead .ctitle {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 500;
}
.card.collapsible > .chead .csub { margin: 0; font-size: 11px; color: var(--c-muted); }
.card.collapsible > .chead .chev {
  font-size: 11px;
  color: var(--c-soft);
  transition: transform .15s;
  display: inline-block;
  margin-left: auto;
  flex-shrink: 0;
}
.card.collapsible.open > .chead .chev { transform: rotate(90deg); }
.card.collapsible > .cbody { margin-top: 1rem; display: none; }
.card.collapsible.open > .cbody { display: block; }

.ctitle { font-size: 14px; font-weight: 500; margin: 0; }
.csub { font-size: 12px; color: var(--c-muted); margin: 0 0 12px; }

/* SKU pill (e.g. "CPC-7") */
.skupill {
  display: inline-block;
  background: var(--c-info-bg);
  color: var(--c-info);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: .5px;
}

/* Apptag — small "PER UNIT" / "ON TOTAL" badge */
.apptag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
  margin-left: 6px;
  vertical-align: 1px;
}
.apptag.pu { background: var(--c-info-bg); color: var(--c-info); }
.apptag.ot { background: #f0e5d8; color: #8a5a1a; }

/* Option group inside Options card */
.optgroup { margin: 12px 0; }
.optgroup:first-child { margin-top: 0; }
.optgroup .flabel { margin-bottom: 8px; }
.optrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 0;
}

/* ----- Complexity / Client button group with colored dots ----- */
.cplx {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--c-bg);
  padding: 3px;
  border-radius: var(--r-md);
}
.cplx-btn {
  background: transparent;
  border: 0;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: var(--c-muted);
  font-family: inherit;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.cplx-btn .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  opacity: .6;
  vertical-align: 1px;
}
.cplx-btn .mult { font-size: 10px; opacity: .7; margin-left: 2px; }
.cplx-btn:hover { color: var(--c-text); }
.cplx-btn.active {
  background: var(--c-card);
  color: var(--c-text);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.cplx-btn.active .dot { opacity: 1; }
.cplx-btn[data-tone="green"]  .dot { background: #10b981; }
.cplx-btn[data-tone="yellow"] .dot { background: #eab308; }
.cplx-btn[data-tone="orange"] .dot { background: #f97316; }
.cplx-btn[data-tone="red"]    .dot { background: #ef4444; }
.cplx-btn[data-tone="blue"]   .dot { background: #3b82f6; }
.cplx-btn.active[data-tone="green"]  { color: #0F6E56; }
.cplx-btn.active[data-tone="yellow"] { color: #854F0B; }
.cplx-btn.active[data-tone="orange"] { color: #9A3412; }
.cplx-btn.active[data-tone="red"]    { color: #A32D2D; }
.cplx-btn.active[data-tone="blue"]   { color: #185FA5; }

/* ----- iOS-style toggle switch ----- */
.tog {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: #cbd5e1;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  border: 0;
  padding: 0;
  transition: background .15s;
}
.tog.on { background: #10b981; }
.tog::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s;
}
.tog.on::after { transform: translateX(16px); }
.tog:disabled { opacity: .5; cursor: not-allowed; }

/* Value-add row (add-on toggle row) */
.va {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--c-border);
  gap: 12px;
}
.va:first-of-type { border-top: 0; padding-top: 0; }
.va:last-of-type { padding-bottom: 0; }
.va.off { opacity: .5; }
.vatxt { font-size: 13px; flex: 1; }
.vatxt em {
  font-style: normal;
  color: var(--c-muted);
  font-size: 11px;
  margin-left: 4px;
}

/* ----- Right column: price summary ----- */
.calc-result { position: sticky; top: 1rem; }

.sum { padding: 1.25rem 1.5rem; }
.slabel {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--c-muted);
  font-weight: 500;
}
.sprice {
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  color: var(--c-brand-navy);
  margin: 4px 0 12px;
  letter-spacing: -.02em;
}
.sgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 1rem;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--c-border);
}

/* Big "Generate quote" button */
.btn-big {
  background: var(--c-primary);
  color: #fff;
  border: 0;
  padding: 11px 24px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.btn-big:hover { background: var(--c-primary-dk); }
.btn-big:disabled {
  background: var(--c-bg);
  color: var(--c-soft);
  cursor: not-allowed;
}

/* Pin + button */
.btn-pin {
  background: transparent;
  color: var(--c-info);
  border: .5px solid var(--c-info);
  padding: 6px 14px;
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.btn-pin:hover { background: var(--c-info-bg); }
.btn-pin:disabled { opacity: .4; cursor: not-allowed; }

/* Math trace */
.math-trace summary { padding: .25rem 0; }
.math-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: .5rem;
}
.math-table td {
  padding: 3px 8px 3px 0;
  border-bottom: 1px solid var(--c-border);
}
.math-table td:last-child { text-align: right; font-family: var(--font-mono); }
.math-table tr.row-emph td { font-weight: 600; background: var(--c-bg); }

/* ===== Pin board ===== */
.pin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.pin-card { padding: 1rem 1.25rem; margin: 0; }
.price-mini { padding-top: .5rem; border-top: 1px solid var(--c-border); }
.price-mini-num {
  font-size: 22px;
  font-weight: 600;
  color: var(--c-brand-navy);
  line-height: 1.1;
}

/* ===== Quote views ===== */
.kv { width: 100%; }
.kv th {
  text-align: left;
  font-weight: 500;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: 11px;
  padding: 4px 12px 4px 0;
  width: 130px;
}
.kv td { padding: 4px 0; }

.quote-line {
  padding: 1rem 0;
  border-bottom: 1px solid var(--c-border);
}
.quote-line:last-child { border-bottom: 0; }
.quote-line h4 { margin: 0; font-size: 14px; }

.totals-table { width: 100%; max-width: 320px; margin-left: auto; }
.totals-table th { text-align: left; font-weight: 400; padding: 4px 0; }
.totals-table td { text-align: right; font-family: var(--font-mono); padding: 4px 0; }
.totals-table tr.row-emph th, .totals-table tr.row-emph td {
  font-weight: 600;
  font-size: 16px;
  border-top: 2px solid var(--c-text);
  padding-top: 6px;
}

/* ===== Calculator: strike-through, savings, tiers table, breakdown ===== */

/* Strike-through "original" price (red, line-through) — used inline before
   the current price to show "you save $X vs entry-level qty pricing" */
.strike-orig {
  text-decoration: line-through;
  color: var(--c-danger);
  font-weight: 400;
  opacity: .85;
  margin-right: 8px;
}
.sprice .strike-orig { font-size: 22px; margin-right: 10px; vertical-align: middle; }

/* Min-qty warning banner */
.banner {
  padding: 8px 12px;
  border-radius: var(--r-md);
  font-size: 12px;
  margin: 8px 0 12px;
}
.banner.err {
  background: var(--c-danger-bg);
  color: var(--c-danger);
}

/* Override the savings pill colors: ok (green) when there's a discount,
   dim (grey) when there isn't */
#price-sav-pill { font-family: var(--font-mono); }

/* Volume savings tiers table */
.tt {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.tt th, .tt td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
}
.tt th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--c-muted);
  font-weight: 500;
  background: var(--c-bg);
}
.tt td:not(:first-child),
.tt th:not(:first-child) { text-align: right; }
.tt td:nth-child(2),
.tt td:nth-child(3) { font-family: var(--font-mono); }
.tt tr.act { background: var(--c-info-bg); font-weight: 500; }
.tt tr.act td { color: var(--c-info); }
.tt .sav    { color: var(--c-success); font-weight: 500; }
.tt .markup { color: var(--c-warning); font-weight: 500; }
.tt .empty  { text-align: center; padding: 12px; color: var(--c-muted); }

/* Detailed breakdown rows */
.br {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--c-border);
}
.br:last-child { border-bottom: 0; }
.br .brsub {
  font-size: 11px;
  color: var(--c-muted);
  margin-top: 2px;
}
.br > div:last-child { font-family: var(--font-mono); white-space: nowrap; }
.br.sec {
  background: var(--c-bg);
  margin: 6px -.5rem 0;
  padding: 6px .5rem;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 500;
  color: var(--c-muted);
  border-bottom: 0;
}
.br.tot {
  font-weight: 600;
  background: var(--c-card);
  padding-top: 8px;
  padding-bottom: 8px;
  border-top: 2px solid var(--c-text);
  border-bottom: 0;
  margin-top: 4px;
}
.br.tot .strike-orig { font-weight: 400; }

/* ===== Pin board (new list layout) ===== */
.pinboard-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 1.25rem;
  position: sticky;
  top: 0;
  z-index: 5;
}
.pinboard-bucket {
  margin: 1.75rem 0 .5rem;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--c-muted);
  font-weight: 500;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--c-border);
}
.pinboard-list { display: flex; flex-direction: column; gap: 6px; }

.pin-row {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 0;
  transition: border-color .15s;
}
.pin-row:hover { border-color: var(--c-soft); }
.pin-row-main {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
}
.pin-check {
  display: flex;
  align-items: center;
  justify-content: center;
}
.pin-check input { width: 18px; height: 18px; cursor: pointer; }

.pin-row-body { min-width: 0; }
.pin-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.pin-title {
  color: var(--c-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
}
.pin-title:hover { color: var(--c-primary); text-decoration: underline; }
.pin-sku {
  background: var(--c-info-bg);
  color: var(--c-info);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
  font-weight: 500;
}
.pin-time { white-space: nowrap; flex-shrink: 0; }
.pin-row-meta { margin-top: 2px; }

.pin-row-price {
  text-align: right;
  white-space: nowrap;
  font-family: var(--font-mono);
  padding-left: 12px;
  border-left: 1px solid var(--c-border);
}
.pin-row-unit  { font-size: 16px; font-weight: 600; color: var(--c-brand-navy); line-height: 1.1; }
.pin-row-total { font-size: 13px; font-weight: 500; margin-top: 4px; }

.pin-row-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}
.pin-row-actions .icon-form { display: inline; margin: 0; }

.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--c-muted);
  font-family: inherit;
  padding: 0;
}
.icon-btn:hover {
  background: var(--c-bg);
  color: var(--c-text);
  border-color: var(--c-border);
}
.icon-btn.icon-danger:hover { color: var(--c-danger); border-color: var(--c-danger); }

.pin-row-detail {
  padding: 12px 16px 16px 60px;
  border-top: 1px solid var(--c-border);
  background: var(--c-bg);
  border-radius: 0 0 var(--r-md) var(--r-md);
}
.pin-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 24px;
  font-size: 13px;
}
.pin-detail-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--c-muted);
  margin-bottom: 2px;
  font-weight: 500;
}

.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Toast for clipboard feedback */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--c-text);
  color: var(--c-card);
  padding: 8px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 1000;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .pin-row-main {
    grid-template-columns: 28px 1fr;
    grid-template-areas:
      "check body"
      "actions price";
    gap: 8px;
  }
  .pin-check       { grid-area: check; }
  .pin-row-body    { grid-area: body; }
  .pin-row-price   {
    grid-area: price; padding-left: 0; border-left: 0; text-align: right;
    display: flex; gap: 12px; align-items: baseline; justify-content: flex-end;
  }
  .pin-row-actions { grid-area: actions; justify-content: flex-start; }
  .pin-row-detail  { padding-left: 16px; }
}

/* ===== Build-quote form ===== */
.qb-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.qb-form-grid .full-width { grid-column: 1 / -1; }

.qb-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  font-size: 13px;
}
.qb-form label > span {
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: 11px;
  font-weight: 500;
}
.qb-form input,
.qb-form textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-card);
  color: var(--c-text);
  width: 100%;
  box-sizing: border-box;
}
.qb-form input:focus,
.qb-form textarea:focus {
  outline: none;
  border-color: var(--c-primary, #0044a3);
  box-shadow: 0 0 0 3px rgba(0, 68, 163, .12);
}
.qb-form textarea { resize: vertical; min-height: 70px; }

@media (max-width: 640px) {
  .qb-form-grid { grid-template-columns: 1fr; }
}

/* ===== Prominent calculator alerts ===== */

/* Bigger, more visible banner — used for min-qty and over-max */
.banner.prominent {
  font-size: 14px;
  line-height: 1.45;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--c-danger);
  background: var(--c-danger-bg);
  color: var(--c-danger);
  margin: 4px 0 16px;
  box-shadow: 0 0 0 3px rgba(204, 0, 0, .08);
  animation: alertPulse 0.3s ease-out;
}
.banner.prominent strong { display: inline-block; font-size: 15px; }

@keyframes alertPulse {
  0%   { transform: scale(0.98); opacity: .6; }
  100% { transform: scale(1);    opacity: 1;  }
}

/* Mark form inputs that triggered the alert */
.input-err,
input.input-err {
  border-color: var(--c-danger) !important;
  background: var(--c-danger-bg) !important;
  box-shadow: 0 0 0 2px rgba(204, 0, 0, .12);
}
