[hidden]{display:none !important;}
/* KC Solitaire UI — clean editorial style */

:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --text: #1c1917;
  --text-muted: #78716c;
  --text-faint: #a8a29e;
  /* KC brand colours — sampled from the logo */
  --accent: #451020;
  --accent-soft: #5e1a2c;
  --accent-tint: #f6ebef;
  --gold: #c9b483;
  --gold-soft: #efe9d4;
  --stock: #15803d;
  --stock-soft: #dcfce7;
  --memo: #b45309;
  --memo-soft: #fef3c7;
  --hold: #1d4ed8;
  --hold-soft: #dbeafe;
  --blocked: #b91c1c;
  --blocked-soft: #fee2e2;
  --shadow-sm: 0 1px 2px rgba(28,25,23,0.04);
  --shadow-md: 0 4px 16px rgba(28,25,23,0.08);
  --shadow-lg: 0 20px 50px rgba(28,25,23,0.12);
  --radius: 8px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }
kbd {
  font: 11px ui-monospace, monospace; padding: 1px 6px; border: 1px solid var(--border-strong);
  border-bottom-width: 2px; border-radius: 4px; background: #fff; color: var(--text-muted);
}

/* ---- top bar ---------------------------------------------------------- */

.topbar {
  display: flex; align-items: center; gap: 18px;
  min-height: 60px; padding: 8px 20px;
  background: var(--accent);
  color: #fdf6f0;
  border-bottom: none;
  position: sticky; top: 0; z-index: 50;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 200px; }

/* Narrow-window adjustments — keep Cart + Selected always visible */
@media (max-width: 1200px) {
  .topbar { gap: 10px; padding: 8px 12px; }
  .brand { min-width: 0; gap: 8px; }
  .brand-sub { display: none; }
  .topbar-search { min-width: 0 !important; flex: 1 1 200px; }
  .pills { flex-wrap: wrap; }
  .quick-pill { margin-left: 0; }
}
@media (max-width: 800px) {
  .brand-title { display: none; }
  .pills .pill-label { display: none; }   /* show colored dots + numbers only */
}
.brand-mark {
  width: 34px; height: 34px; object-fit: contain; display: block;
}
.brand-title { font-size: 15px; font-weight: 600; letter-spacing: 0.01em; color: #fdf6f0; }
.brand-sub   { font-size: 11px; color: rgba(253,246,240,0.55); letter-spacing: 0.04em; text-transform: uppercase; }

.pills { display: flex; gap: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; height: 32px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px; color: #ecdfe3; font-size: 12px;
  transition: all 120ms ease;
}
.pill:hover { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.3); }
.pill.active { background: #fdf6f0; border-color: #fdf6f0; color: var(--accent); box-shadow: var(--shadow-sm); }
.quick-pill { font-weight: 700; letter-spacing: 0.3px; margin-left: 6px; padding-left: 10px; padding-right: 10px; }
.pill-dot { width: 7px; height: 7px; border-radius: 999px; }
.dot-stock   { background: var(--stock); }
.dot-memo    { background: var(--memo); }
.dot-hold    { background: var(--hold); }
.dot-blocked { background: var(--blocked); }
.pill-n { font-variant-numeric: tabular-nums; font-weight: 600; opacity: 0.9; padding-left: 2px; }

.topbar-search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px; min-width: 320px;
  color: var(--text-muted);
}
.topbar-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(24,24,27,0.06); }
.topbar-search input { border: 0; outline: 0; background: transparent; flex: 1; color: var(--text); }
.topbar-search input::placeholder { color: var(--text-faint); }

/* ---- layout ---------------------------------------------------------- */

.layout { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 60px); }

.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 16px 16px 60px 16px; overflow-y: auto;
  position: sticky; top: 60px; height: calc(100vh - 60px);
}
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted);
}
.link-btn { background: none; border: 0; color: var(--text-muted); font-size: 11px; text-decoration: underline; padding: 0; }
.link-btn:hover { color: var(--accent); }

.fgroup { border-bottom: 1px solid var(--border); padding: 10px 0; }
.fgroup summary {
  list-style: none; cursor: pointer; padding: 4px 0;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: var(--text);
}
.fgroup summary::-webkit-details-marker { display: none; }
.fgroup summary::after {
  content: "▾"; color: var(--text-faint); font-size: 10px; transition: transform 120ms;
}
.fgroup:not([open]) summary::after { transform: rotate(-90deg); }

.fbody { padding-top: 10px; }
.range-row {
  display: flex; align-items: center; gap: 8px;
}
.range-row .dash { color: var(--text-faint); }
.range-row input, .range-row select {
  flex: 1; min-width: 0; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.range-row select { padding: 6px 28px 6px 10px; appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 16px) center, calc(100% - 11px) center; background-size: 5px 5px; background-repeat: no-repeat; }
.range-row input:focus, .range-row select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(24,24,27,0.06); }

.quick-cts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.qbtn {
  padding: 4px 8px; font-size: 11px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-muted);
}
.qbtn:hover { background: var(--surface); color: var(--text); }
.qbtn.active { background: var(--accent); color: white; border-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; font-size: 11.5px; line-height: 1.2;
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); cursor: pointer; transition: all 100ms;
}
.chip:hover { border-color: var(--border-strong); }
.chip.active { background: var(--accent); border-color: var(--accent); color: white; }
.chip-n { font-size: 10px; opacity: 0.7; font-variant-numeric: tabular-nums; }
.fhint { font-size: 10.5px; color: var(--text-faint); margin-top: 6px; }
.grade-lbl { display: block; font-size: 10.5px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin: 10px 0 5px; }
.grade-lbl:first-child { margin-top: 0; }
#cut-chips, #pol-chips, #sym-chips, #color-chips, #clarity-chips { display: flex; flex-wrap: wrap; gap: 4px; }

.grade-rows {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; align-items: center;
}
.grade-rows label { font-size: 11px; color: var(--text-muted); }
.grade-rows select { padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); width: 100%; }

.other-rows label { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; }
.other-rows label > span { font-size: 12px; color: var(--text-muted); }
.other-rows select { padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); flex: 1; max-width: 160px; }

/* ---- main / results -------------------------------------------------- */

.main { padding: 16px 20px 80px 20px; overflow: hidden; min-width: 0; }
.result-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px;
}
.result-info { font-size: 13px; color: var(--text-muted); }
.result-info #total-label { color: var(--text); font-weight: 600; }
.result-info .sep { margin: 0 6px; color: var(--text-faint); }
.result-actions { display: flex; gap: 6px; }

.ghost-btn {
  padding: 6px 12px; border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-sm); color: var(--text); font-size: 12px;
}
.ghost-btn:hover { border-color: var(--border-strong); background: #fff; }
.ghost-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ghost-btn.active { background: var(--accent); color: #fafaf9; border-color: transparent; }
.ghost-btn.active:hover { background: var(--accent); }

.grid-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: auto; max-height: calc(100vh - 220px); box-shadow: var(--shadow-sm);
  position: relative;
}
.grid { width: 100%; border-collapse: collapse; font-size: 12px; }
.grid thead th {
  position: sticky; top: 0; z-index: 5;
  background: #fafaf9; padding: 8px 10px; text-align: left;
  font-weight: 600; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.grid thead th[data-sort] { cursor: pointer; user-select: none; }
.grid thead th[data-sort]:hover { color: var(--text); }
.grid thead th[data-sort].sorted { color: var(--accent); }
.grid thead th[data-sort].sorted::after { content: " ↑"; font-size: 10px; }
.grid thead th[data-sort].sorted.desc::after { content: " ↓"; }
.grid thead th.num { text-align: right; }
.grid tbody td { padding: 6px 10px; border-bottom: 1px solid #f5f5f4; white-space: nowrap; }
.grid tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid tbody tr:hover { background: var(--gold-soft); cursor: pointer; }
.grid tbody tr.selected { background: var(--gold-soft); }

.cell-lot { font-weight: 600; color: var(--accent); }
.cell-shape { color: var(--text); }
.cell-pair { color: var(--text-muted); font-size: 11px; }
.cell-cert-no { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.cell-grade { font-weight: 500; }
.cell-grade.ex { color: var(--stock); }
.cell-grade.vg { color: var(--memo); }
.cell-grade.gd { color: var(--hold); }
.cell-flag { display: inline-block; padding: 1px 6px; font-size: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.04em; }
.cell-status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; font-size: 11px; border-radius: 999px; font-weight: 500; }
.cell-status .pill-dot { width: 6px; height: 6px; }
.status-Stock   { background: var(--stock-soft); color: var(--stock); }
.status-Memo    { background: var(--memo-soft); color: var(--memo); }
.status-Hold    { background: var(--hold-soft); color: var(--hold); }
.status-Blocked { background: var(--blocked-soft); color: var(--blocked); }

.grid-empty { padding: 60px 20px; text-align: center; color: var(--text-muted); }
.grid-loading {
  position: absolute; inset: 0; background: rgba(255,255,255,0.7); backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center; color: var(--text-muted);
  font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase;
}
.grid-wrap.loading .grid-loading { display: flex; }

.pager {
  display: flex; align-items: center; gap: 8px; padding: 14px 0; font-size: 12px;
}
#page-info { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pager .spacer { flex: 1; }
.pagesize { color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.pagesize select { padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }

/* ---- drawer ---------------------------------------------------------- */

.scrim {
  position: fixed; inset: 0; background: rgba(28,25,23,0.32);
  opacity: 0; transition: opacity 180ms ease; z-index: 90; pointer-events: none;
}
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(620px, 90vw);
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 100; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 200ms cubic-bezier(.2,.7,.2,1);
}
.drawer.show { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.drawer-lot { font-size: 22px; font-weight: 600; letter-spacing: 0.005em; }
.drawer-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.drawer-close {
  width: 32px; height: 32px; border: 0; background: transparent; font-size: 22px;
  color: var(--text-muted); border-radius: 6px;
}
.drawer-close:hover { background: var(--bg); color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.drawer-loading { text-align: center; color: var(--text-muted); padding: 60px 0; }

.d-section { margin-bottom: 28px; }
.d-section h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin: 0 0 10px 0; font-weight: 600;
}
.d-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px;
  font-size: 13px;
}
.d-row { display: contents; }
.d-row .lbl  { color: var(--text-muted); font-size: 11.5px; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.d-row .val  { font-weight: 500; padding: 4px 0; border-bottom: 1px dashed var(--border); text-align: right; }
.d-row .val.mono { font-variant-numeric: tabular-nums; }

.d-stones {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin-bottom: 14px;
}
.d-stone { text-align: center; }
.d-stone .v { font-size: 16px; font-weight: 600; }
.d-stone .l { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }

.d-tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.d-tag {
  padding: 3px 10px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; font-size: 11px; color: var(--text-muted);
}
.d-tag.active { background: var(--accent); color: white; border-color: var(--accent); }

.d-history-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.d-history-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.d-history-table td { padding: 6px 8px; border-bottom: 1px solid #f5f5f4; }
.d-history-table tr:last-child td { border-bottom: 0; }
.d-empty { font-style: italic; color: var(--text-faint); font-size: 12px; padding: 8px 0; }

.d-link {
  display: inline-block; padding: 3px 10px;
  background: var(--gold-soft); color: #6b5b2c;
  border-radius: 999px; font-size: 11.5px; text-decoration: none;
  border: 1px solid #e1d5b9;
}
.d-link:hover { background: #e7d8b6; }

.cell-age { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cell-age:empty::before { content: "—"; color: var(--text-faint); }

/* ---- cart -------------------------------------------------------- */
.cart-btn {
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: 6px; height: 36px; padding: 0 12px;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px; color: #fdf6f0; font-size: 12px;
  transition: all 120ms ease;
}
.cart-btn:hover { border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.2); }
.cart-btn.has-items { background: var(--gold); border-color: var(--gold); color: var(--accent); }
.cart-btn .cart-count { font-weight: 600; font-variant-numeric: tabular-nums; }
.cart-btn .cart-cts { opacity: 0.7; font-size: 11px; font-variant-numeric: tabular-nums; }
.cart-btn.has-items .cart-cts { opacity: 0.85; }

.col-check { width: 28px; text-align: center; padding: 0 !important; }
.cell-check { width: 28px; text-align: center; padding: 4px 0 !important; }
.cell-check input { cursor: pointer; }
#check-all { cursor: pointer; }

.grid tbody tr.in-cart { background: var(--gold-soft); }
.grid tbody tr.in-cart:hover { background: #e7d8b6; }
.grid tbody tr.selected { background: var(--accent-tint); }
.grid tbody tr.selected:hover { background: #efdce1; }
.grid tbody tr.selected.in-cart { background: linear-gradient(90deg, var(--accent-tint) 0%, var(--accent-tint) 60%, var(--gold-soft) 100%); }
#selection-btn.has-items { background: var(--accent); color: #fafaf9; border-color: transparent; }
.primary-action { background: var(--accent) !important; color: #fafaf9 !important; border-color: transparent !important; }
.primary-action:disabled { opacity: 0.4; }
@keyframes cart-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.cart-btn.pulse { animation: cart-pulse 0.5s ease-in-out 2; }
.cart-refresh-note { padding: 10px 14px; font-size: 12px; color: #888; text-align: center; }
.cart-refresh-note.alert { background: #fef3c7; color: #854d0e; border: 1px solid #fcd34d;
  border-radius: 6px; text-align: left; margin: 8px 14px; line-height: 1.55; }
.cart-refresh-note.alert b { color: #92400e; }
.cart-pending { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 6px;
  margin: 10px 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.cart-pending-text { font-size: 13px; color: #1e3a8a; line-height: 1.4; }
.cart-pending-text b { color: #1e40af; }
.cart-pending-actions { display: flex; gap: 8px; }
.cart-pending-actions .ghost-btn { padding: 7px 14px; font-size: 13px; }

/* ---- block modal (staff only) ---- */
.modal { position: fixed; inset: 0; background: rgba(15,15,17,.55); z-index: 1100;
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { background: #fff; border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.3);
  width: 100%; max-width: 480px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display:flex; justify-content:space-between; align-items:center;
  padding: 14px 18px; border-bottom: 1px solid #e5e7eb; font-weight: 600; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-body .field { display:flex; flex-direction:column; gap:6px; margin-top:10px; }
.modal-body .field span { font-size: 12px; color: #6b7280; font-weight: 600; }
.modal-body textarea { width: 100%; border: 1px solid #d1d5db; border-radius: 6px;
  padding: 8px 10px; font-size: 14px; font-family: inherit; resize: vertical; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px; border-top: 1px solid #e5e7eb; background: #fafafa; }
.modal-foot .primary-btn { background: var(--accent, #dc2626); color: #fff; border: 0;
  padding: 8px 18px; border-radius: 6px; font-weight: 600; cursor: pointer; }
.modal-foot .primary-btn[disabled] { opacity: .6; cursor: not-allowed; }
.block-summary { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px;
  padding: 12px 14px; font-size: 13px; color: #7f1d1d; }
.block-summary .block-lots { font-family: ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size: 12px; margin-top: 6px; color: #991b1b; word-break: break-word; line-height: 1.5; }
.block-summary .block-skipped { margin-top: 8px; font-size: 12px; color: #92400e;
  background: #fef3c7; border: 1px solid #fde68a; padding: 6px 8px; border-radius: 6px; }
.unblock-summary { background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px;
  padding: 12px 14px; font-size: 13px; color: #065f46; }
.unblock-summary .block-lots { font-family: ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size: 12px; margin-top: 6px; color: #047857; word-break: break-word; line-height: 1.5; }
.unblock-summary .block-skipped { margin-top: 8px; font-size: 12px; color: #92400e;
  background: #fef3c7; border: 1px solid #fde68a; padding: 6px 8px; border-radius: 6px; }
.unblock-note { font-size: 12px; color: #6b7280; padding: 8px 2px 0; line-height: 1.5; }

/* ---- 360 / video media viewer ---- */
.d-media-frame { width: 100%; aspect-ratio: 1/1; max-height: 420px;
  border: 1px solid #e5e7eb; border-radius: 8px; background: #000; display: block; }
.d-media-link { display: inline-block; margin-top: 6px; font-size: 12px;
  color: var(--accent, #2563eb); text-decoration: none; }
.email-status { font-size: 13px; min-height: 18px; margin-top: 8px; }
.email-status.ok  { color: #065f46; }
.email-status.err { color: #b91c1c; }
.dis-chip { display: inline-block; background: #fce7f3; color: #9d174d; font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px; letter-spacing: 0.3px; margin-left: 2px; }
.cl-lot-row, .lot-no-row { display:inline-flex; align-items:center; gap:8px; flex-wrap:wrap; }
.cl-status {
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
  padding: 2px 8px; border-radius: 999px;
}
.cl-status.st-Stock   { background: #dcfce7; color: #15803d; }
.cl-status.st-Memo    { background: #fef3c7; color: #b45309; }
.cl-status.st-Hold    { background: #ffe4cf; color: #c2410c; }
.cl-status.st-Blocked { background: #fee2e2; color: #b91c1c; }

.multiselect { margin-top: 10px; }
.multi-search {
  width: 100%; padding: 6px 10px; font-size: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); box-sizing: border-box; margin-bottom: 6px;
}
.multi-list {
  max-height: 200px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); padding: 4px;
}
.multi-list label {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px; font-size: 12px; cursor: pointer;
  border-radius: 4px;
}
.multi-list label:hover { background: rgba(0,0,0,0.04); }
.multi-list label.checked { background: rgba(59,130,246,0.08); font-weight: 600; }
.multi-list label .ms-n { margin-left: auto; opacity: 0.55; font-variant-numeric: tabular-nums; }
.multi-tally { font-size: 11px; color: var(--muted); margin-top: 4px; }
.multi-tally .clear { color: var(--accent); cursor: pointer; margin-left: 8px; text-decoration: underline; }
.cert-link { color: inherit; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; cursor: pointer; }
.cert-link:hover { color: var(--accent); text-decoration-style: solid; }
.cert-link .cert-tag { cursor: pointer; }

.cart-drawer { display: flex; flex-direction: column; }
.cart-drawer .drawer-body { padding: 12px 22px; }
.cart-line {
  display: grid; grid-template-columns: 24px 1fr auto 24px; align-items: center;
  gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border);
}
.cart-line .lot-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; background: var(--bg); border-radius: 6px;
  font-size: 10px; color: var(--text-muted); font-weight: 600;
}
.cart-line .lot-info {
  display: flex; flex-direction: column; min-width: 0;
}
.cart-line .lot-no { font-weight: 600; font-size: 13px; }
.cart-line .lot-desc { font-size: 11.5px; color: var(--text-muted); }
.cart-line .lot-price {
  font-variant-numeric: tabular-nums; text-align: right;
}
.cart-line .lot-price .pct {
  display: block; font-size: 13.5px; font-weight: 500;
}
.cart-line .lot-price .tot {
  display: block; font-size: 11px; color: var(--text-muted);
}
.cart-line .lot-remove {
  width: 24px; height: 24px; border: 0; background: transparent;
  color: var(--text-muted); font-size: 18px; border-radius: 4px;
}
.cart-line .lot-remove:hover { background: var(--blocked-soft); color: var(--blocked); }
.cart-empty {
  padding: 60px 20px; text-align: center; color: var(--text-muted);
}

.cart-foot {
  border-top: 1px solid var(--border); padding: 14px 22px;
  background: var(--surface);
}
.cart-totals {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px;
  margin-bottom: 10px;
}
.cart-totals > div { display: flex; flex-direction: column; }
.cart-totals .lbl { font-size: 10.5px; text-transform: uppercase;
   letter-spacing: 0.06em; color: var(--text-muted); }
.cart-totals .val { font-size: 17px; font-weight: 600;
   font-variant-numeric: tabular-nums; margin-top: 2px; }
.cart-actions { display: flex; gap: 6px; }
.cart-actions .ghost-btn { flex: 1; }


/* ---- group/status rows (match production sheet) ---------- */
.grid tbody tr.group-row {
  background: #d6eece;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  cursor: default;
}
.grid tbody tr.group-row:hover { background: #d6eece; }
.grid tbody tr.group-row td {
  font-size: 11.5px; font-weight: 600; color: #1a3d1a;
  padding: 6px 10px; letter-spacing: 0.02em;
}

.grid tbody tr.status-row-Stock { background: #ffffff; }
.grid tbody tr.status-row-Memo   { background: #fff4dc; }   /* beige */
.grid tbody tr.status-row-Hold   { background: #fde2c4; }   /* peach/orange */
.grid tbody tr.status-row-Blocked{ background: #f9d8d8; }

.grid tbody tr.status-row-Stock:hover   { background: #fafaf9; }
.grid tbody tr.status-row-Memo:hover    { background: #ffe9be; }
.grid tbody tr.status-row-Hold:hover    { background: #fbcfa3; }
.grid tbody tr.status-row-Blocked:hover { background: #f3bdbd; }

.grid tbody tr.in-cart   { box-shadow: inset 3px 0 0 var(--gold); }
.grid tbody tr.in-cart td:first-child + td { font-weight: 700; }

.cell-cert .cert-tag {
  display: inline-block; padding: 1px 7px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; font-weight: 600; font-size: 11px;
}
.cell-meas { font-variant-numeric: tabular-nums; }
.cell-dis  { color: var(--blocked); font-weight: 500; }
.cell-remarks { color: var(--text-muted); font-size: 11.5px; }

/* engine-calculated prices (no manual price set) */
.grid tbody td.engine-priced { font-style: italic; }
.grid tbody td.engine-priced::after { content: "·"; margin-left: 3px; color: var(--gold); font-style: normal; font-weight: 700; }


/* ---- Ask (natural-language search) ---- */
.ask-btn{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 13px;
  margin-left:6px;border-radius:8px;font-size:12px;font-weight:600;
  background:var(--gold);color:var(--accent);border:1px solid var(--gold);}
.ask-btn:hover{background:#d8c79a;}
.ask-btn:active{transform:scale(.97);}
.ask-btn.busy{opacity:.6;pointer-events:none;}
.ask-banner{display:flex;align-items:center;gap:8px;margin-bottom:10px;
  padding:9px 13px;border-radius:8px;background:var(--gold-soft);
  border:1px solid #e1d5b9;color:#6b5b2c;font-size:12.5px;}
.ask-banner svg{flex-shrink:0;}
#ask-banner-text{flex:1;}
#ask-banner-text b{font-weight:700;}
.ask-clear{background:none;border:0;color:#6b5b2c;font-size:11.5px;
  text-decoration:underline;padding:2px 4px;white-space:nowrap;}
.ask-clear:hover{color:var(--accent);}
