
:root {
  --site-header-h: 56px;
  --radius: 14px; --pad: 20px;
  --bg: #fbfbfd; --card: #ffffff; --text:#0a0a0a; --muted:#666;
  --border:#e8e8ed; --accent:#5b7c99; --accent-ink:#ffffff;
}
* { box-sizing: border-box; }
body { margin:0; font-family: Inter, -apple-system, system-ui, Segoe UI, Roboto, Arial; background: var(--bg); color: var(--text); }
.header {
  min-height: var(--site-header-h); position: sticky; top:0; z-index:10; backdrop-filter: blur(10px); background: rgba(255,255,255,0.75); border-bottom: 1px solid var(--border); padding: 12px 18px; display:flex; align-items:center; gap:18px; }
.brand { font-weight:700; letter-spacing:.2px; color: var(--accent); }
.container { max-width: 1280px; padding: 20px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: calc(var(--pad) + 4px); box-shadow: 0 5px 15px rgba(0,0,0,0.04); margin-bottom: 16px; }
.card h3, .card h4 { margin: 0 0 12px 0; }
.section { border:1px solid var(--border); border-radius: 12px; padding: 12px; margin: 8px 0 0 0; }
.section > .title { font-weight:600; margin: -4px 0 8px 0; padding-left: 10px; border-left: 4px solid var(--accent); }
.grid { display:grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.col-span-2 { grid-column: span 2; } .col-span-3 { grid-column: span 3; }
label { display:block; font-weight:600; margin-bottom: 6px; }
input, select { width:100%; padding: 10px 12px; border-radius: 12px; border:1px solid #ddd; background:#fff; }
input[type="checkbox"], input[type="radio"] { width:auto; }
input:focus, select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.actions { position: static; z-index: auto; display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-end; margin-top: 10px; padding: 8px 0 0; background: transparent; border-top: 0; }
button { padding:10px 16px; border-radius: 999px; border:1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor:pointer; font-weight:600; }
button.secondary { background:#fff; color: #0a0a0a; border-color:#ddd; }
.nav a { color:#111; text-decoration:none; padding:6px 10px; border-radius:10px; }
.nav a:hover { background:#f2f2f7; }
.table-scroller { overflow-x:auto; border:1px solid var(--border); border-radius:12px; }
table { width: max(100%, 900px); border-collapse: collapse; }
th, td { text-align:left; padding:10px; border-bottom:1px solid var(--border); font-size:14px; white-space:nowrap; }

.kicker { font-size:12px; color: var(--muted); margin-top: 6px; }
.toggle-row { display:flex; gap:8px; align-items:center; }
.badge { display:inline-block; padding: 2px 8px; border-radius: 999px; background: #e5f1ff; color: #0a5bd7; font-size: 12px; border: 1px solid #cfe4ff; }

/* --- Added in v8_22: wide container + compact table + editable style --- */
.container { max-width: 1500px; padding: 20px; margin: 0 auto; }
.table-wrap { overflow-x: auto; border:1px solid var(--border,#e6e9ef); border-radius: 12px; background:#fff; }
.compact th, .compact td { padding: 6px 8px; font-size: 13px; }
.editable { background: #fffdf6; }



/* === Steele branding overrides (v8_23) === */
:root{
  --pad: 22px;                 /* slightly roomier */
  --accent: #5b7c99;
  --accent-ink: #ffffff;
}

.header{
  background: rgba(255,255,255,.85);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand{display:flex; align-items:center; gap:12px;}
.brand img{height:28px; width:auto; display:block}
.brand-text{font-weight:700; letter-spacing:.2px; color: var(--accent);}

.container{ max-width: none !important; width: 100% !important; padding: 24px !important; }

/* Ensure forms/tables stretch */
.card form, .table-wrap, table{ width: 100%; }
.section{ padding: 16px; } /* a bit more breathing room */

/* Table compact/comfort balance */
.table-wrap.compact th, .table-wrap.compact td { padding: 6px 8px; font-size: 13px; }
th, td { white-space: nowrap; }

/* Focus ring */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,124,153,.16);
}
.button, button, .secondary {
  --_c: var(--accent);
}


/* unified sticky table header offset under site header */




/* === UI Polish (v8_28) === */
:root{
  --radius: 16px;
  --pad: 22px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.06), 0 10px 30px rgba(0,0,0,.06);
  --shadow-2: 0 1px 3px rgba(0,0,0,.08), 0 12px 40px rgba(0,0,0,.08);
  --accent: #5b7c99;
  --accent-ink:#fff;
  --site-header-h: 56px;
}

.header{ 
  min-height: var(--site-header-h); 
  padding: 12px 20px; 
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.85);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
}
.brand{ display:flex; align-items:center; gap:12px; }
.brand img{ height:28px; width:auto; display:block; }
.brand-text{ font-weight:700; color: var(--accent); letter-spacing:.2px }

.container{ max-width: none; width: 100%; padding: 24px; }
.card{ padding: var(--pad); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card:hover{ box-shadow: var(--shadow-2); transition: box-shadow .2s ease; }

/* Buttons */
button, .button, .secondary{
  height: 40px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font-weight: 700; cursor: pointer;
  transition: transform .02s ease, box-shadow .2s ease, background .2s ease;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 6px 18px rgba(91,124,153,.20);
}
button:hover{ background: #4f6f8a }
.secondary{ background:#fff; color: var(--accent); }

/* Inputs */
input, select, textarea{
  border-radius: 12px; padding: 10px 12px; border:1px solid var(--border); outline:none;
}
input:focus, select:focus, textarea:focus{ border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,124,153,.16); }
.grid{ gap: 16px }
.section{ padding: 16px }
.section > .title{ border-left: 4px solid var(--accent); padding-left: 10px }

/* Tables */
.table-wrap{ border:1px solid var(--border); border-radius: 14px; overflow:auto; background:#fff }
table{ width: max(100%, 1100px); border-collapse: collapse; }
thead th{ font-weight:700; background:#fff; }
tbody tr:hover{ background: #fafafa }
th, td{ padding: 12px 14px; border-bottom:1px solid var(--border); font-size:14px; }
.table-wrap.compact th, .table-wrap.compact td{ padding: 6px 8px; font-size: 13px; }

/* Sticky header unified */


/* Inline edit states */
td[contenteditable="true"]{ outline: none; }
td.editable{ background: #fffdf6; box-shadow: inset 0 0 0 2px #ffe7a3; }
td.saved{ animation: savedFlash 1.2s ease-out; }
td.error{ background:#fff5f5; box-shadow: inset 0 0 0 2px #ffb0b0; }
@keyframes savedFlash{
  0%{ background:#eaffea }
  100%{ background:transparent }
}

/* Subtle link styling in nav */
.nav a{ border-radius: 10px; padding: 8px 10px; }
.nav a:hover{ background:#f2f3f5 }



/* === v8_28 UI polish === */
:root{
  --site-header-h: 64px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06), 0 6px 18px rgba(0,0,0,.06);
  --shadow-input: 0 1px 1.5px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.08);
  --accent-100: #eaf1f7;
}

/* Header baseline size so sticky math is stable */
.header{ min-height: var(--site-header-h); }

/* Inputs: higher contrast + soft shadows */
input, select, textarea{
  background:#fff;
  border:1px solid var(--border, #e8e8ed);
  border-radius: 12px;
  box-shadow: var(--shadow-input);
}
input::placeholder, textarea::placeholder{ color:#9aa0a6; }
input:focus, select:focus, textarea:focus{
  outline:none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,124,153,.16), 0 2px 8px rgba(0,0,0,.10);
}

/* Buttons: clearer affordance */
button, .button, .secondary{
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 6px 18px rgba(91,124,153,.18);
}

/* Cards + sections: more breathing room */
.card{ padding: 22px; box-shadow: var(--shadow-sm); }
.section{ padding: 16px; background:#fff; border:1px solid var(--border); border-radius: 12px; }
.section > .title{ font-weight:700; margin-bottom:10px; border-left:4px solid var(--accent); padding-left:10px; }
.grid{ gap: 14px; }

/* Sticky table header with dynamic offset (never hide first rows) */


/* Section navigation (auto-built) */
.section-nav{
  position: sticky;
  top: var(--site-header-h);
  z-index: 5;
  display:flex; gap:8px; flex-wrap:wrap;
  padding:8px; margin: 8px 0 14px;
  background:#fff;
  border:1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.section-pill:hover{ background:#fafafa; }
.section-pill.active{ border-color: var(--accent); background: var(--accent-100); color: var(--accent); }

/* Anchor offset so anchors don't hide under sticky headers */
.section{ scroll-margin-top: calc(var(--site-header-h) + 12px); }


/* v8_29: unified sticky table header just below site header */
.table-wrap thead th {
  position: sticky;
  top: var(--site-header-h) !important;
  background: #fff;
  z-index: 5;
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
}


/* v8_29: clearer field visuals */
input, select, textarea {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 1px rgba(0,0,0,.02);
  transition: box-shadow .2s ease, border-color .2s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,124,153,.16), 0 2px 8px rgba(0,0,0,.08);
  outline: none;
}

/* Table tools row */
.table-tools {
  display:flex; gap:14px; align-items:center; justify-content:flex-end;
  padding: 8px 10px; border-bottom:1px solid var(--border);
  background:#fafafb; position:static; top:auto; z-index:auto;
}
.table-tools .tt-left,
.table-tools .tt-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.table-tools .tt-left{margin-right:auto; min-width:min(100%, 380px);}
.table-tools .tt-filter{min-width:min(100%, 260px);}
.table-tools label { font-size: 12px; color: #4b5563; display:inline-flex; gap:6px; align-items:center }
.table-scroller .table-tools{ border-radius:12px 12px 0 0; margin:0; }
.tt-filter-state{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  margin:8px 0 0;
  border:1px solid #dbeafe;
  border-radius:10px;
  background:#eff6ff;
  color:#1d4ed8;
  font-size:.82rem;
  font-weight:600;
}
.tt-filter-state .secondary{
  min-height:34px;
  height:auto;
  padding:6px 12px;
}

/* 8_29 — force shadows on data-entry forms (minimal, safe) */
.card .section form.grid input:not([type="checkbox"]):not([type="radio"]),
.card .section form.grid select,
.card .section form.grid textarea,
.card form input:not([type="checkbox"]):not([type="radio"]),
.card form select,
.card form textarea {
  background: #fff !important;
  border: 1px solid var(--border, #e6e8ee) !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 0 rgba(0,0,0,.03), 0 1px 8px rgba(0,0,0,.06) !important;
  transition: box-shadow .15s ease, border-color .15s ease !important;
}
.card .section form.grid input:focus,
.card .section form.grid select:focus,
.card .section form.grid textarea:focus,
.card form input:focus,
.card form select:focus,
.card form textarea:focus {
  outline: none !important;
  border-color: var(--accent, #5b7c99) !important;
  box-shadow: 0 0 0 3px rgba(91,124,153,.18), 0 4px 16px rgba(0,0,0,.08) !important;
  background: #fff !important;
}

/* v8_29 final: enforce form shadows */
.card .section form input:not([type="checkbox"]):not([type="radio"]),
.card .section form select,
.card .section form textarea,
form.grid input:not([type="checkbox"]):not([type="radio"]),
form.grid select,
form.grid textarea {
  background: #fff !important;
  border: 1px solid var(--border, #e6e8ee) !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 0 rgba(0,0,0,.03), 0 1px 8px rgba(0,0,0,.06) !important;
}
.card .section form input:focus,
.card .section form select:focus,
.card .section form textarea:focus,
form.grid input:focus,
form.grid select:focus,
form.grid textarea:focus {
  outline: none !important;
  border-color: var(--accent, #5b7c99) !important;
  box-shadow: 0 0 0 3px rgba(91,124,153,.18), 0 4px 16px rgba(0,0,0,.08) !important;
  background: #fff !important;
}

/* explicit: Raw Materials + Mixes */
#rmForm input:not([type="checkbox"]):not([type="radio"]), #rmForm select, #rmForm textarea,
#mixForm input:not([type="checkbox"]):not([type="radio"]), #mixForm select, #mixForm textarea {
  background: #fff !important;
  border: 1px solid var(--border, #e6e8ee) !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 0 rgba(0,0,0,.03), 0 1px 8px rgba(0,0,0,.06) !important;
}
#rmForm input:focus, #rmForm select:focus, #rmForm textarea:focus,
#mixForm input:focus, #mixForm select:focus, #mixForm textarea:focus {
  outline: none !important;
  border-color: var(--accent, #5b7c99) !important;
  box-shadow: 0 0 0 3px rgba(91,124,153,.18), 0 4px 16px rgba(0,0,0,.08) !important;
}



/* Stronger hover focus */
.form-shadow:hover, .card-shadow:hover, .form-shadow:focus-within {
  box-shadow: 0 6px 18px rgba(0,0,0,0.10), 0 18px 32px rgba(0,0,0,0.06);
  transition: box-shadow 160ms ease;
}



/* --- Updated by assistant: Shadows for entire grid --- */
.grid {
  box-shadow: 0 2px 4px rgba(0,0,0,0.05), 0 8px 16px rgba(0,0,0,0.04);
  border-radius: 6px;
  background: #fff;
}
.grid:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.08), 0 12px 20px rgba(0,0,0,0.06);
  transition: box-shadow 150ms ease;
}



/* Utility class if you want to opt-in somewhere else */
.input-shadow {
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 4px 8px rgba(0,0,0,0.04);
  border: 1px solid var(--border, #e6e9ef);
  border-radius: 8px;
  background: #fff;
  transition: box-shadow 140ms ease, border-color 140ms ease;
}

/* Apply to all inputs/selects/textareas that live inside grids/tables */
.table-wrap input,
.table-wrap select,
.table-wrap textarea,
.table-wrap .grid input,
.table-wrap .grid select,
.table-wrap .grid textarea {
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 4px 8px rgba(0,0,0,0.04);
  border: 1px solid var(--border, #e6e9ef);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}

/* Focus/hover elevation */
.table-wrap input:hover,
.table-wrap select:hover,
.table-wrap textarea:hover,
.table-wrap [contenteditable="true"]:hover,
.input-shadow:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 10px 18px rgba(0,0,0,0.06);
}

.table-wrap input:focus,
.table-wrap select:focus,
.table-wrap textarea:focus,
.table-wrap [contenteditable="true"]:focus,
.input-shadow:focus {
  outline: none;
  border-color: var(--accent, #2454FF);
  box-shadow: 0 3px 10px rgba(0,0,0,0.10), 0 16px 28px rgba(0,0,0,0.06);
}

/* Support for editable cell patterns that use contenteditable */
.table-wrap [contenteditable="true"] {
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
  border: 1px dashed var(--border, #e6e9ef);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}



/* --- Updated by assistant: differentiated shadows for grids vs other UI --- */

/* Lighter base shadow for general form-shadow usage */
.form-shadow {
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 6px 12px rgba(0,0,0,0.03);
}

/* Stronger hover/focus for all form-shadow */
.form-shadow:hover, .form-shadow:focus-within {
  box-shadow: 0 4px 10px rgba(0,0,0,0.08), 0 14px 28px rgba(0,0,0,0.05);
  transition: box-shadow 160ms ease;
}

/* Stronger default shadow for grids */
.grid, .table-wrap .grid {
  box-shadow: 0 2px 6px rgba(0,0,0,0.06), 0 12px 24px rgba(0,0,0,0.04);
}

/* Strong hover/focus shadow for grids */
.grid:hover, .grid:focus-within,
.table-wrap .grid:hover, .table-wrap .grid:focus-within {
  box-shadow: 0 6px 18px rgba(0,0,0,0.10), 0 18px 32px rgba(0,0,0,0.06);
  transition: box-shadow 160ms ease;
}

/* Reports page */
.report-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.report-tab-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.report-tab-link.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}
.report-checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  font-weight: 500;
}
.report-checkbox-line input[type="checkbox"] {
  width: auto;
  margin-top: 2px;
  flex: 0 0 auto;
}
.report-checkbox-line span {
  line-height: 1.3;
}

.photo-gallery{
  display:grid;
  gap:10px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 180px));
  justify-content:flex-start;
  margin:.35rem 0 .6rem;
}
.photo-item{
  margin:0;
  border:1px solid var(--border);
  border-radius:10px;
  padding:8px;
  background:#fff;
}
.photo-item img{
  width:100%;
  height:120px;
  object-fit:cover;
  border-radius:8px;
}
.photo-item figcaption{
  margin-top:6px;
  font-size:12px;
  color:#4b5563;
  line-height:1.3;
}
.photo-remove-label{
  display:flex;
  align-items:center;
  gap:5px;
  margin-top:6px;
  font-size:.78rem;
  color:#ef4444;
  cursor:pointer;
  font-weight:500;
}

.binder-tag-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap:8px;
  margin-top:6px;
}
@media (max-width:640px){
  .binder-tag-grid{ grid-template-columns: 1fr; }
}
.binder-tag-btn{
  border-color:#cbd5e1 !important;
  background:#f8fafc !important;
  color:#334155 !important;
  box-shadow:none !important;
}
.binder-tag-btn:hover{ filter:none !important; }
.binder-tag-btn:nth-child(1){ background:#eff6ff !important; border-color:#bfdbfe !important; color:#1e3a8a !important; }
.binder-tag-btn:nth-child(2){ background:#f0fdf4 !important; border-color:#bbf7d0 !important; color:#14532d !important; }
.binder-tag-btn:nth-child(3){ background:#fff7ed !important; border-color:#fed7aa !important; color:#9a3412 !important; }
.binder-tag-btn:nth-child(4){ background:#f5f3ff !important; border-color:#ddd6fe !important; color:#4c1d95 !important; }
.binder-tag-btn:nth-child(5){ background:#fef2f2 !important; border-color:#fecaca !important; color:#991b1b !important; }
.binder-tag-btn:nth-child(6){ background:#fffbeb !important; border-color:#fde68a !important; color:#92400e !important; }
.binder-tag-btn:nth-child(7){ background:#f0fdfa !important; border-color:#99f6e4 !important; color:#115e59 !important; }
.binder-tag-btn:nth-child(8){ background:#faf5ff !important; border-color:#e9d5ff !important; color:#6b21a8 !important; }
.binder-tag-btn:nth-child(9){ background:#fff1f2 !important; border-color:#fecdd3 !important; color:#9f1239 !important; }
.binder-tag-btn.is-active{
  border-color:#334155 !important;
  box-shadow: inset 0 0 0 1px #334155 !important;
}
.binder-tag-btn.is-active::before{
  content:"✓ ";
  font-weight:700;
}
.binder-tags-cell{
  white-space: normal;
  max-width: 200px;
  vertical-align: top;
}

.binder-tag-pill{
  display:inline-block;
  font-size:11px;
  line-height:1.1;
  padding:2px 6px;
  margin:0 4px 4px 0;
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#f8fafc;
  color:#334155;
  white-space:normal;
  word-break:break-word;
}
.binder-tag-pill.tag-1{ background:#eff6ff; border-color:#bfdbfe; color:#1e3a8a; }
.binder-tag-pill.tag-2{ background:#f0fdf4; border-color:#bbf7d0; color:#14532d; }
.binder-tag-pill.tag-3{ background:#fff7ed; border-color:#fed7aa; color:#9a3412; }
.binder-tag-pill.tag-4{ background:#f5f3ff; border-color:#ddd6fe; color:#4c1d95; }
.binder-tag-pill.tag-5{ background:#fef2f2; border-color:#fecaca; color:#991b1b; }
.binder-tag-pill.tag-6{ background:#fffbeb; border-color:#fde68a; color:#92400e; }
.binder-tag-pill.tag-7{ background:#f0fdfa; border-color:#99f6e4; color:#115e59; }
.binder-tag-pill.tag-8{ background:#faf5ff; border-color:#e9d5ff; color:#6b21a8; }
.binder-tag-pill.tag-9{ background:#fff1f2; border-color:#fecdd3; color:#9f1239; }



/* === Assistant override: emphasize grid shadows, lighten others, keep strong hover === */

/* 1) Remove/neutralize wrapper shadow so inner grid stands out */
.table-wrap { box-shadow: none !important; background: #fff; }

/* 2) Lighter default for general form/card shadows */
.form-shadow, .card-shadow {
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 6px 12px rgba(0,0,0,0.035) !important;
}
/* Stronger hover/focus for general UI */
.form-shadow:hover, .card-shadow:hover, .form-shadow:focus-within, .card-shadow:focus-within {
  box-shadow: 0 6px 18px rgba(0,0,0,0.12), 0 18px 32px rgba(0,0,0,0.08) !important;
  transition: box-shadow 160ms ease;
}

/* 3) Strong default for grids (form grids and data grids) */
.grid, .table-wrap .grid, .data-grid {
  box-shadow: 0 2px 6px rgba(0,0,0,0.10), 0 14px 28px rgba(0,0,0,0.08) !important;
  border-radius: 12px;
  background: #fff;
}
/* Stronger hover/focus for grids */
.grid:hover, .table-wrap .grid:hover, .data-grid:hover,
.grid:focus-within, .table-wrap .grid:focus-within, .data-grid:focus-within {
  box-shadow: 0 8px 22px rgba(0,0,0,0.16), 0 24px 44px rgba(0,0,0,0.10) !important;
  transition: box-shadow 160ms ease;
}


#raw-materials,
#wbm-environment,
#cpft-wet,
#cpft-dry {
  box-shadow: 0 2px 6px rgba(0,0,0,0.06), 0 12px 24px rgba(0,0,0,0.04);
  border-radius: 12px;
  background: #fff;
}
#raw-materials:hover,
#wbm-environment:hover,
#cpft-wet:hover,
#cpft-dry:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.10), 0 18px 32px rgba(0,0,0,0.06);
  transition: box-shadow 160ms ease;
}

/* Toggle row shadow for cpft-mode */
#cpft-mode {
  box-shadow: 0 2px 4px rgba(0,0,0,0.05), 0 8px 16px rgba(0,0,0,0.04);
  border-radius: 6px;
  background: #fff;
}
#cpft-mode:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.08), 0 12px 20px rgba(0,0,0,0.06);
  transition: box-shadow 150ms ease;
}



/* --- Added by assistant: Targeted input shadows for specific sections --- */
#raw-materials input,
#raw-materials select,
#raw-materials textarea,
#wbm-environment input,
#wbm-environment select,
#wbm-environment textarea,
#cpft-wet input,
#cpft-wet select,
#cpft-wet textarea,
#cpft-dry input,
#cpft-dry select,
#cpft-dry textarea {
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 4px 8px rgba(0,0,0,0.04);
  border: 1px solid var(--border, #e6e9ef);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  transition: box-shadow 140ms ease, border-color 140ms ease;
}

#raw-materials input:hover,
#raw-materials select:hover,
#raw-materials textarea:hover,
#wbm-environment input:hover,
#wbm-environment select:hover,
#wbm-environment textarea:hover,
#cpft-wet input:hover,
#cpft-wet select:hover,
#cpft-wet textarea:hover,
#cpft-dry input:hover,
#cpft-dry select:hover,
#cpft-dry textarea:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 10px 18px rgba(0,0,0,0.06);
}

#raw-materials input:focus,
#raw-materials select:focus,
#raw-materials textarea:focus,
#wbm-environment input:focus,
#wbm-environment select:focus,
#wbm-environment textarea:focus,
#cpft-wet input:focus,
#cpft-wet select:focus,
#cpft-wet textarea:focus,
#cpft-dry input:focus,
#cpft-dry select:focus,
#cpft-dry textarea:focus {
  outline: none;
  border-color: var(--accent, #2454FF);
  box-shadow: 0 3px 10px rgba(0,0,0,0.10), 0 16px 28px rgba(0,0,0,0.06);
}

/* Toggle row shadow for cpft-mode inputs */
#cpft-mode input,
#cpft-mode select,
#cpft-mode textarea {
  box-shadow: 0 2px 4px rgba(0,0,0,0.05), 0 8px 16px rgba(0,0,0,0.04);
  border-radius: 6px;
  border: 1px solid var(--border, #e6e9ef);
  background: #fff;
  padding: 8px 10px;
  transition: box-shadow 140ms ease, border-color 140ms ease;
}
#cpft-mode input:hover,
#cpft-mode select:hover,
#cpft-mode textarea:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.08), 0 12px 20px rgba(0,0,0,0.06);
}
#cpft-mode input:focus,
#cpft-mode select:focus,
#cpft-mode textarea:focus {
  outline: none;
  border-color: var(--accent, #2454FF);
  box-shadow: 0 6px 14px rgba(0,0,0,0.12), 0 18px 32px rgba(0,0,0,0.08);
}



/* --- Added by assistant: Per-input shadows for specific sections (all input types) --- */
#raw-materials input,
#raw-materials select,
#raw-materials textarea,
#raw-materials [contenteditable="true"],
#wbm-environment input,
#wbm-environment select,
#wbm-environment textarea,
#wbm-environment [contenteditable="true"],
#cpft-wet input,
#cpft-wet select,
#cpft-wet textarea,
#cpft-wet [contenteditable="true"],
#cpft-dry input,
#cpft-dry select,
#cpft-dry textarea,
#cpft-dry [contenteditable="true"],
#cpft-mode input,
#cpft-mode select,
#cpft-mode textarea,
#cpft-mode [contenteditable="true"] {
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 4px 8px rgba(0,0,0,0.04);
  border: 1px solid var(--border, #e6e9ef);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  transition: box-shadow 140ms ease, border-color 140ms ease;
}

#raw-materials input:hover,
#raw-materials select:hover,
#raw-materials textarea:hover,
#raw-materials [contenteditable="true"]:hover,
#wbm-environment input:hover,
#wbm-environment select:hover,
#wbm-environment textarea:hover,
#wbm-environment [contenteditable="true"]:hover,
#cpft-wet input:hover,
#cpft-wet select:hover,
#cpft-wet textarea:hover,
#cpft-wet [contenteditable="true"]:hover,
#cpft-dry input:hover,
#cpft-dry select:hover,
#cpft-dry textarea:hover,
#cpft-dry [contenteditable="true"]:hover,
#cpft-mode input:hover,
#cpft-mode select:hover,
#cpft-mode textarea:hover,
#cpft-mode [contenteditable="true"]:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 10px 18px rgba(0,0,0,0.06);
}

#raw-materials input:focus,
#raw-materials select:focus,
#raw-materials textarea:focus,
#raw-materials [contenteditable="true"]:focus,
#wbm-environment input:focus,
#wbm-environment select:focus,
#wbm-environment textarea:focus,
#wbm-environment [contenteditable="true"]:focus,
#cpft-wet input:focus,
#cpft-wet select:focus,
#cpft-wet textarea:focus,
#cpft-wet [contenteditable="true"]:focus,
#cpft-dry input:focus,
#cpft-dry select:focus,
#cpft-dry textarea:focus,
#cpft-dry [contenteditable="true"]:focus,
#cpft-mode input:focus,
#cpft-mode select:focus,
#cpft-mode textarea:focus,
#cpft-mode [contenteditable="true"]:focus {
  outline: none;
  border-color: var(--accent, #2454FF);
  box-shadow: 0 3px 10px rgba(0,0,0,0.10), 0 16px 28px rgba(0,0,0,0.06);
}



/* --- Assistant: neutralize section-wide shadows for specified IDs --- */
#raw-materials,
#wbm-environment,
#cpft-wet,
#cpft-dry,
#cpft-mode {
  box-shadow: none !important;
}
/* ===== Global spacing tokens (tweak as you like) ===== */
:root{
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
}

/* ===== Cards & Sections ===== */
.card{
  padding: var(--space-5);
  margin-bottom: var(--space-6); /* more space between cards/sections */
}

.card .section{
  padding: var(--space-4) var(--space-5);
}

.card .section + .section{
  margin-top: var(--space-5); /* space between stacked sections */
}

.card .title,
.card h3,
.card h4{
  margin-bottom: var(--space-3);
}

/* ===== Grids ===== */
.grid{
  /* more room between inputs in all grids */
  gap: var(--space-5) var(--space-5); /* row-gap col-gap */
}

/* keep form fields off the grid edges and separated within each cell */
form.grid{
  box-sizing: border-box;
  padding: var(--space-3);
}
form.grid > div{
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* actions row often feels cramped; give it breathing room */
.grid > .actions{
  margin-top: var(--space-3);
  grid-column: 1 / -1;
}

/* tables under a section/card */
.table-scroller{
  margin-top: var(--space-4);
}

/* ===== Compact mode (your toggle) =====
   If bindCompactToggle adds .compact to the card/container,
   these rules shrink spacing appropriately. */
.card.compact{ margin-bottom: var(--space-4); padding: var(--space-4); }
.card.compact .section{ padding: var(--space-3) var(--space-4); }
.card.compact .section + .section{ margin-top: var(--space-3); }
.card.compact .grid{ gap: var(--space-2) var(--space-3); }
.card.compact .table-scroller{ margin-top: var(--space-3); }

/* ===== Small screens: dial spacing back slightly ===== */
@media (max-width: 640px){
  .card{ margin-bottom: var(--space-5); padding: var(--space-4); }
  .grid{ gap: var(--space-4) var(--space-4); }
  .table-scroller{ margin-top: var(--space-3); }
}

.alert.error{
  background: #eef4f9;
  color: #334155;
  border: 1px solid #f5c2c0;
  padding: 10px 12px;
  border-radius: 8px;
  margin: 10px 0 16px;
}

.ac-panel{
  position:absolute; z-index:50; top:calc(100% + 4px); left:0; right:0;
  background:#fff; border:1px solid #e5e7eb; border-radius:8px;
  box-shadow:0 6px 20px rgba(0,0,0,.08); max-height:260px; overflow:auto; padding:6px 0;
}
.ac-item{ padding:8px 12px; cursor:pointer; line-height:1.2; }
.ac-item:hover{ background:#f3f4f6; }
.ac-muted{ font-size:12px; color:#6b7280; }

/* CPFT cards */
#wet_group, #dry_group {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  padding: 12px 14px;
  margin-top: 8px;
}
#wet_group .title, #dry_group .title { margin-top: 4px; }

/* === Global UX refresh: softer palette + consistent buttons === */
:root{
  --accent: #5b7c99;
  --accent-ink: #ffffff;
  --accent-100: #eaf1f7;
  --accent-border: #c9d8e6;
}

button,
a.button,
.button,
a.secondary,
.secondary,
input[type="submit"]{
  min-height: 40px !important;
  height: 40px !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  border: 1px solid var(--accent) !important;
  background: var(--accent) !important;
  color: var(--accent-ink) !important;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 4px 12px rgba(91,124,153,.20) !important;
  font-weight: 600 !important;
  line-height: 38px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

a.secondary,
.secondary{
  background: #fff !important;
  color: #334155 !important;
  border-color: var(--accent-border) !important;
}

button:hover,
a.button:hover,
.button:hover,
a.secondary:hover,
.secondary:hover,
input[type="submit"]:hover{
  filter: brightness(0.98);
}

input:focus,
select:focus,
textarea:focus{
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(91,124,153,.18), 0 2px 8px rgba(0,0,0,.08) !important;
}

/* Final UI language alignment (centered button labels) */
:root{
  --accent: #5b7c99;
  --accent-ink: #ffffff;
  --accent-100: #eaf1f7;
}

button,
a.button,
.button,
a.secondary,
.secondary,
input[type="submit"]{
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1.2 !important;
}

button:hover,
a.button:hover,
.button:hover,
a.secondary:hover,
.secondary:hover,
input[type="submit"]:hover{
  background: #4f6f8a !important;
  border-color: #4f6f8a !important;
  color: #ffffff !important;
}

a.secondary:hover,
.secondary:hover{
  background: #f2f6fa !important;
  border-color: #9fb3c7 !important;
  color: #334155 !important;
}

.table-wrap .table-tools{
  position: static;
  top: auto;
  z-index: auto;
}

.mix-row-wbm{
  min-width: 96px;
  width: 100%;
  max-width: none;
  text-align: center;
  font-weight: 700;
  border: 1px solid #f59e0b;
  background: #fff;
}
.mix-row-wbm:focus{
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .18);
}
.mix-calc-summary-grid{
  display: grid;
  gap: 14px 16px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: end;
}
.mix-operator-panel{
  margin-top: 16px;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #dbe4ee;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
  box-shadow: 0 14px 28px rgba(15,23,42,.06);
}
.mix-operator-head{
  display: grid;
  gap: 4px;
}
.mix-operator-title{
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
}
.mix-operator-copy{
  font-size: .88rem;
  color: #475569;
  line-height: 1.55;
}
.mix-operator-top{
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.05fr) minmax(220px, .95fr);
  align-items: stretch;
}
.mix-operator-water-card{
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 18px;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
}
.mix-operator-panel[data-water-tone="warn"] .mix-operator-water-card{
  border-color: #fdba74;
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
}
.mix-operator-kicker{
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #1d4ed8;
}
.mix-operator-panel[data-water-tone="warn"] .mix-operator-kicker{
  color: #c2410c;
}
.mix-operator-water-card strong{
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  line-height: 1;
  letter-spacing: -.03em;
  color: #0f172a;
}
.mix-operator-water-card > span:last-child{
  font-size: .84rem;
  color: #334155;
  line-height: 1.45;
}
.mix-operator-stat-grid{
  display: grid;
  gap: 10px;
}
.mix-operator-stat{
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #dbe4ee;
  border-radius: 14px;
  background: #fff;
}
.mix-operator-stat span{
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
}
.mix-operator-stat strong{
  font-size: .95rem;
  color: #0f172a;
  font-weight: 700;
}
.mix-operator-materials{
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.mix-operator-material{
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}
.mix-operator-material.is-missing{
  border-color: #fdba74;
  background: #fffaf5;
}
.mix-operator-material-main{
  min-width: 0;
  display: grid;
  gap: 4px;
}
.mix-operator-material-name{
  font-size: .92rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}
.mix-operator-material-meta{
  font-size: .8rem;
  color: #64748b;
  line-height: 1.4;
}
.mix-operator-material-amount{
  text-align: right;
  white-space: nowrap;
  font-size: 1.02rem;
  font-weight: 800;
  color: #0f172a;
}
.mix-operator-material-amount.is-missing{
  color: #c2410c;
}
.mix-operator-empty{
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  color: #64748b;
  background: #fff;
  font-size: .88rem;
}
.mix-calc-table-row{
  margin-top: 14px;
}
.mix-calc-scroller{
  overflow-x: auto;
  width: 100%;
}
.mix-calc-table{
  width: max(100%, 900px);
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.mix-form .mix-calc-table{
  width: max(100%, 940px);
  min-width: 940px;
}
.mix-calc-table th,
.mix-calc-table td{
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}
.mix-calc-table thead th{
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #475569;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: normal;
  line-height: 1.25;
}
.mix-calc-table tbody td{
  white-space: nowrap;
}
.mix-calc-table tbody .mix-calc-col-material{
  white-space: normal;
  line-height: 1.3;
}
.mix-calc-table tbody tr:last-child td{
  border-bottom: none;
}
.mix-calc-col-material{
  width: 220px;
  min-width: 220px;
  text-align: left;
  font-weight: 600;
}
.mix-calc-col-pct{
  width: 88px;
  min-width: 88px;
}
.mix-calc-col-received{
  width: 170px;
  min-width: 170px;
}
.mix-calc-col-dry{
  width: 150px;
  min-width: 150px;
}
.mix-calc-table tbody .mix-calc-col-pct,
.mix-calc-table tbody .mix-calc-col-received,
.mix-calc-table tbody .mix-calc-col-dry{
  text-align: right;
}
.mix-calc-col-wbm{
  width: 160px;
  min-width: 160px;
  text-align: center;
  background: #fff7ed;
}
.mix-calc-table thead .mix-calc-col-pct,
.mix-calc-table thead .mix-calc-col-received,
.mix-calc-table thead .mix-calc-col-wbm,
.mix-calc-table thead .mix-calc-col-dry{
  text-align: center;
}
.mix-calc-table thead .mix-calc-col-wbm{
  background: #fed7aa;
  color: #9a3412;
}
.mix-calc-edit-cell{
  display: flex;
  justify-content: center;
}
.mix-calc-readonly-value{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #fdba74;
  font-weight: 700;
}
.calculated-field{
  min-width: 0;
}
.calculated-field > label{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}
.calculated-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid #bfdbfe;
  background:#eff6ff;
  color:#1d4ed8;
  font-size:.68rem;
  font-weight:700;
  letter-spacing:.03em;
  text-transform:uppercase;
  line-height:1.2;
  white-space:nowrap;
}
.calculated-helper{
  margin-top:4px;
  font-size:.75rem;
  line-height:1.35;
  color:#64748b;
}
.calculated-field input[readonly],
.calculated-field textarea[readonly],
.calculated-field select[disabled],
.calculated-field .mix-calc-readonly-value{
  background:#f8fbff !important;
  border:1px dashed #93c5fd !important;
  color:#0f172a !important;
  font-weight:700;
  box-shadow:none !important;
}
.calculated-field input[readonly]{
  cursor:not-allowed;
}
.input-unit{
  display:flex;
  align-items:center;
  gap:8px;
}
.input-unit .unit-cue{
  font-size:12px;
  color:#64748b;
  white-space:nowrap;
}
.rm-inventory-section{
  margin-top: 6px;
}
.rm-inventory-flash{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #166534;
}
.rm-inventory-flash.is-error{
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.rm-inventory-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:12px;
  margin-top: 12px;
}
.rm-inventory-card{
  padding:14px 16px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#f8fafc;
}
.rm-inventory-card label{
  display:block;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:#64748b;
}
.rm-inventory-value{
  margin-top:6px;
  font-size:1.2rem;
  font-weight:700;
  color:#0f172a;
}
.rm-inventory-value.is-on-hand{
  color:#0f766e;
}
.rm-inventory-form{
  margin-top:16px;
  gap:12px 16px;
  align-items:end;
}
.rm-inventory-form .actions{
  justify-content:flex-start;
  position:static;
  margin-top:0;
}
.rm-inventory-history{
  margin-top:18px;
}
.rm-inventory-history-title{
  font-weight:700;
  margin-bottom:8px;
}
.mix-form > .section{
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.mix-form > .section > .grid{
  padding: 6px;
  gap: 16px 18px;
}
.extrusion-form > .section{
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.extrusion-form > .section > .grid{
  padding: 4px;
  gap: 14px 16px;
}
.extrusion-outcome-section{
  border: 1px solid #d8e2ea;
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfd;
}
.outcome-button-row{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.outcome-button{
  position: relative;
  min-height: 52px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}
.outcome-button input{
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.outcome-button:has(input:checked),
.outcome-button.is-selected{
  border-color: #496b86;
  box-shadow: 0 0 0 2px rgba(73, 107, 134, 0.14);
}
.outcome-button.is-yes:has(input:checked),
.outcome-button.is-yes.is-selected{
  color: #166534;
  border-color: #86b99a;
  background: #f0f8f2;
}
.outcome-button.is-no:has(input:checked),
.outcome-button.is-no.is-selected{
  color: #991b1b;
  border-color: #ef9a9a;
  background: #fff5f5;
}
.retry-change-grid{
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  margin: 4px 4px 14px;
}
.retry-change-grid label{
  min-height: 46px;
  border: 1px solid #d6e0e8;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-weight: 600;
}
.retry-change-fields{
  padding: 4px;
}

@media (max-width: 1024px){
  .mix-form > .section > .grid,
  .extrusion-form > .section > .grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
  }

  #rmForm,
  #specimenForm{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 14px;
  }

  .mix-copy-actions{
    flex-wrap: wrap;
    gap: 8px;
  }

  .mix-copy-actions > *{
    flex: 1 1 180px;
  }

  .mix-operator-top{
    grid-template-columns: 1fr;
  }

  .retry-change-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px){
  .mix-form > .section > .grid,
  .extrusion-form > .section > .grid,
  #rmForm,
  #specimenForm{
    grid-template-columns: 1fr !important;
  }

  .mix-copy-actions{
    flex-direction: column;
    align-items: stretch !important;
  }

  .mix-copy-actions > *{
    width: 100%;
  }

  .retry-change-grid{
    grid-template-columns: 1fr;
  }

  .mix-operator-panel{
    padding: 14px;
  }

  .mix-operator-materials,
  .mix-operator-material{
    grid-template-columns: 1fr;
  }

  .mix-operator-material-amount{
    text-align: left;
  }
}

.table-wrap thead th{
  z-index: 6;
}

/* Table readability: grid lines + zebra rows */
.table-scroller table th,
.table-scroller table td,
.table-wrap table th,
.table-wrap table td{
  border-right: 1px solid var(--border);
}
.table-scroller table th:last-child,
.table-scroller table td:last-child,
.table-wrap table th:last-child,
.table-wrap table td:last-child{
  border-right: none;
}
.table-scroller table tbody tr:not(.table-related-row):nth-child(even of :not(.table-related-row)),
.table-wrap table tbody tr:not(.table-related-row):nth-child(even of :not(.table-related-row)){
  background: #f8fafc;
}

.table-scroller table th.cell-wide,
.table-scroller table td.cell-wide,
.table-wrap table th.cell-wide,
.table-wrap table td.cell-wide{
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-scroller table th.cell-truncate,
.table-scroller table td.cell-truncate,
.table-wrap table th.cell-truncate,
.table-wrap table td.cell-truncate{
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-scroller table td.cell-wide > a:not([class]),
.table-scroller table td.cell-truncate > a:not([class]),
.table-wrap table td.cell-wide > a:not([class]),
.table-wrap table td.cell-truncate > a:not([class]){
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Keep sticky headers below sticky table tools/filter row */
.table-tools + .table-scroller table thead th,
.table-tools + .table-wrap table thead th,
.table-tools + table thead th{
  top: calc(var(--site-header-h) + 52px) !important;
}

.alert.error{
  background: #eef4f9;
  color: #334155;
  border-color: #c9d8e6;
}

td.error{
  background: #eef4f9;
  box-shadow: inset 0 0 0 2px #c9d8e6;
}

input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button{
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  cursor: pointer;
}

/* Mobile table responsiveness */
@media (max-width: 900px){
  .table-tools{
    justify-content:stretch;
  }
  .table-tools .tt-left,
  .table-tools .tt-right{
    width:100%;
  }
  .table-tools .tt-filter,
  .table-tools .tt-scope,
  .table-tools .tt-right button{
    width:100%;
  }
  .tt-filter-state{
    flex-direction:column;
    align-items:flex-start;
  }
  .table-scroller{
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
  }
  .table-scroller table{
    min-width: 900px;
  }
  .table-scroller th,
  .table-scroller td{
    padding: 8px 10px !important;
    font-size: 12px !important;
  }
  .table-scroller td form{
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .toolbar{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .card form.grid,
  .card form .grid{
    grid-template-columns: 1fr !important;
  }
  .card form .col-span-2,
  .card form .col-span-3{
    grid-column: span 1 !important;
  }
  .card form .section{
    padding: 12px !important;
  }
  .card form input,
  .card form select,
  .card form textarea{
    max-width: 100%;
    min-width: 0;
  }
  .card form.grid > *{
    min-width: 0;
    max-width: 100%;
  }
  .card form .actions{
    flex-wrap: wrap;
  }
  .mix-copy-actions{
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px;
  }
  .mix-copy-actions select,
  .mix-copy-actions button{
    width: 100%;
  }
  .mix-calc-scroller table.mix-calc-table{
    min-width: 900px !important;
    width: max(100%, 900px) !important;
  }
  .mix-form .mix-calc-scroller table.mix-calc-table{
    min-width: 940px !important;
    width: max(100%, 940px) !important;
  }
  .mix-calc-table th{
    white-space: normal !important;
    word-break: normal;
  }
  .mix-calc-table td{
    white-space: nowrap !important;
    word-break: normal;
  }
  .input-unit{
    gap:6px;
  }
  .rm-inventory-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mix-form > .section{
    padding: 16px;
  }
  .extrusion-form > .section{
    padding: 12px;
  }
}
@media (max-width: 680px){
  .rm-inventory-grid{
    grid-template-columns: 1fr;
  }
}

/* ── Hard-stop header layout ────────────────────────────────────────────────
   The page is a flex column. The header occupies its natural height and is
   never overlaid. main.container owns the scroll viewport, so all sticky
   children (workspace bar, table headers, toolbar) reference top: 0.
   ────────────────────────────────────────────────────────────────────────── */
html, body { height: 100%; }
body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.header {
  position: relative !important;        /* override position:sticky from earlier rules */
  flex-shrink: 0;
  background: #fff !important;          /* solid — no longer overlays content */
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
main.container {
  flex: 1 1 0;
  min-height: 0;                        /* allow flex child to shrink */
  overflow-y: auto;
}
/* All sticky offsets now relative to main.container, not the viewport */
.section-nav         { top: 0 !important; }
.table-wrap thead th { top: 0 !important; }
.section             { scroll-margin-top: 12px; }

/* ── Universal 3-D press effect on interactive form elements ────────────────
   Buttons get a raised "ledge" shadow that collapses on click.
   Inputs / selects / textareas get a subtle floor shadow that lifts on focus.
   Disabled elements are flat — no 3-D cue.
   ────────────────────────────────────────────────────────────────────────── */

/* Base raised state — primary buttons */
button,
a.button,
.button,
input[type="submit"],
input[type="button"] {
  box-shadow:
    0 4px 0 0 #3a5e78,
    0 6px 16px rgba(91,124,153,.22) !important;
  transform: translateY(0);
  transition:
    transform .08s ease,
    box-shadow .08s ease,
    background .15s ease,
    border-color .15s ease,
    filter .15s ease !important;
  position: relative;
}

/* Slight lift on hover */
button:hover:not(:disabled),
a.button:hover,
.button:hover,
input[type="submit"]:hover:not(:disabled),
input[type="button"]:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 5px 0 0 #3a5e78,
    0 8px 20px rgba(91,124,153,.30) !important;
}

/* Press down on active */
button:active:not(:disabled),
a.button:active,
.button:active,
input[type="submit"]:active:not(:disabled),
input[type="button"]:active:not(:disabled) {
  transform: translateY(3px) !important;
  box-shadow:
    0 1px 0 0 color-mix(in srgb, var(--accent) 60%, #000),
    0 2px 6px rgba(91,124,153,.12) !important;
}

/* Secondary / ghost buttons — lighter ledge */
a.secondary,
.secondary,
button.secondary {
  box-shadow:
    0 4px 0 0 #b8c5d0,
    0 6px 14px rgba(0,0,0,.08) !important;
}
a.secondary:hover,
.secondary:hover,
button.secondary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 5px 0 0 #b8c5d0,
    0 8px 18px rgba(0,0,0,.10) !important;
}
a.secondary:active,
.secondary:active,
button.secondary:active {
  transform: translateY(3px) !important;
  box-shadow:
    0 1px 0 0 #b8c5d0,
    0 2px 6px rgba(0,0,0,.06) !important;
}

/* Flat when disabled — no depth cue */
button:disabled,
button[disabled],
input[type="submit"]:disabled,
input[type="button"]:disabled {
  transform: none !important;
  box-shadow: none !important;
  opacity: .55;
}

/* Inputs, selects, textareas — floor shadow gives a "resting in tray" look */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
select,
textarea {
  box-shadow:
    0 2px 0 rgba(0,0,0,.07),
    0 1px 5px rgba(0,0,0,.05) !important;
  transition:
    box-shadow .15s ease,
    border-color .15s ease,
    transform .1s ease !important;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):hover,
select:hover,
textarea:hover {
  box-shadow:
    0 3px 0 rgba(0,0,0,.09),
    0 2px 8px rgba(0,0,0,.07) !important;
  border-color: var(--accent-border) !important;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):focus,
select:focus,
textarea:focus {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 3px rgba(91,124,153,.18),
    0 3px 0 rgba(58,94,120,.35),
    0 5px 14px rgba(0,0,0,.09) !important;
  border-color: var(--accent) !important;
}

/* ── Drag-and-drop file upload zones ─────────────────────────────────── */
.file-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 18px 14px 14px;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  text-align: center;
  min-height: 76px;
  position: relative;
  user-select: none;
}
.file-drop-zone:hover,
.file-drop-zone:focus-within {
  border-color: var(--accent, #5b7c99);
  background: #eef4f9;
  outline: none;
  box-shadow: 0 0 0 3px rgba(91,124,153,.12);
}
.file-drop-zone.file-drop-over {
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.file-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  margin: 0;
}
.file-drop-icon { font-size: 1.5rem; pointer-events: none; line-height: 1; }
.file-drop-label { font-size: .875rem; color: #475569; pointer-events: none; }
.file-drop-hint  { font-size: .72rem;  color: #94a3b8;  pointer-events: none; letter-spacing: .03em; }
.file-drop-list  { margin-top: 8px; width: 100%; }
.file-drop-item  {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: #334155;
  padding: 5px 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-top: 4px;
  text-align: left;
  word-break: break-all;
  pointer-events: none;
}
.file-drop-item small { color: #94a3b8; white-space: nowrap; margin-left: auto; }
@media (max-width: 640px) {
  .file-drop-zone { padding: 14px 10px 10px; min-height: 64px; }
  .file-drop-icon { font-size: 1.2rem; }
  .file-drop-label { font-size: .82rem; }
}

@media (min-width: 1100px) {
  .mix-form,
  .extrusion-form {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .mix-form > .section,
  .mix-form > .actions,
  .extrusion-form > .section,
  .extrusion-form > .actions {
    grid-column: 1 / -1 !important;
  }

  #rmForm,
  #specimenForm {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    align-items: start;
  }

  #rmForm > .section,
  #rmForm > fieldset.section,
  #rmForm > .col-span-2,
  #rmForm > .col-span-3,
  #rmForm > .actions,
  #specimenForm > .section,
  #specimenForm > fieldset.section,
  #specimenForm > .col-span-2,
  #specimenForm > .col-span-3,
  #specimenForm > .actions {
    grid-column: 1 / -1 !important;
  }

  .mix-form .table-scroller,
  .mix-form .mix-calc-scroller,
  .extrusion-form .table-scroller,
  #rmForm .table-scroller,
  #specimenForm .table-scroller {
    width: 100%;
  }
}


/* ── Column & panel resize handles ─────────────────────────────── */
.col-resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  cursor: col-resize;
  z-index: 2;
  background: transparent;
  transition: background .1s;
}
.col-resize-handle:hover,
.col-resizing .col-resize-handle {
  background: color-mix(in srgb, var(--accent, #5b7c99) 35%, transparent);
}
/* Suppress text selection while dragging */
.col-resizing, .col-resizing * { user-select: none !important; cursor: col-resize !important; }

.panel-resize-handle {
  position: absolute;
  right: -5px;
  top: 0;
  bottom: 0;
  width: 10px;
  cursor: ew-resize;
  z-index: 20;
  background: transparent;
  transition: background .1s;
}
.panel-resize-handle:hover {
  background: color-mix(in srgb, var(--accent, #5b7c99) 25%, transparent);
}

/* ══════════════════════════════════════════════════════════════════
   Visual Polish Pass — status badges, tables, forms, nav, empty states
   ══════════════════════════════════════════════════════════════════ */

/* 1 ── Semantic status badges ───────────────────────────────────── */
.badge-active  { background:#f0fdf4; border-color:#86efac; color:#15803d !important; font-weight:600; }
.badge-deleted { background:#fef2f2; border-color:#fca5a5; color:#b91c1c !important; font-weight:600; }
.badge-archived{ background:#f8fafc; border-color:#cbd5e1; color:#64748b !important; font-weight:600; }
.badge-pending { background:#fffbeb; border-color:#fde68a; color:#92400e !important; font-weight:600; }
.badge-failed { background:#fff1f2; border-color:#fda4af; color:#be123c !important; font-weight:600; }

/* 2 ── Table zebra striping + stronger hover ─────────────────────── */
tbody tr:nth-child(even):not(.table-related-row)  { background: #f9fafb; }
tbody tr:nth-child(odd):not(.table-related-row)   { background: #ffffff; }
tbody tr:hover:not(.table-related-row)            { background: #eef4f9 !important; transition: background .1s; }
/* Keep related rows distinct */
.table-related-row td { background: #f8fafc !important; }

/* 3 ── Danger / destructive button ──────────────────────────────── */
.btn-danger,
button.btn-danger {
  background: #fff !important;
  color: #dc2626 !important;
  border-color: #fca5a5 !important;
  box-shadow: 0 1px 0 rgba(0,0,0,.03), 0 2px 8px rgba(220,38,38,.08) !important;
}
.btn-danger:hover,
button.btn-danger:hover {
  background: #fef2f2 !important;
  border-color: #f87171 !important;
  color: #b91c1c !important;
  filter: none !important;
}

/* Rich empty states */
.table-loading-state {
  font-size: .85rem;
  color: #64748b;
  margin: 0 0 .5rem 0;
}
.table-empty-state {
  padding: 48px 24px !important;
  text-align: center !important;
  color: #94a3b8 !important;
  font-size: .9rem;
}
.table-empty-state-icon  { font-size: 2.2rem; display:block; margin-bottom: 10px; opacity:.45; }
.table-empty-state-title { display:block; font-size:1rem; font-weight:700; color:#475569; margin-bottom:6px; }
.table-empty-state-sub   { display:block; font-size:.83rem; color:#94a3b8; margin-bottom:14px; line-height:1.5; }

/* Stronger focus ring */
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px rgba(91,124,153,.22), 0 2px 8px rgba(0,0,0,.08) !important;
  outline: none !important;
}

/* Consistent form label sizing */
label {
  font-size: .79rem !important;
  font-weight: 600 !important;
  color: #475569 !important;
  margin-bottom: 4px !important;
}
/* Don't shrink labels inside table cells, nav, or non-form contexts */
.table-tools label,
.nav label,
.help-nav-btn,
th label { font-size: inherit !important; color: inherit !important; font-weight: inherit !important; }

/* 8 ── Active nav state ──────────────────────────────────────────── */
.nav > a.nav-active {
  background: var(--accent-100, #eaf1f7) !important;
  color: var(--accent, #5b7c99) !important;
  border-color: var(--accent-border, #c9d8e6) !important;
  box-shadow: inset 0 -2px 0 var(--accent, #5b7c99), 0 1px 2px rgba(0,0,0,.04) !important;
}

/* 9 ── Autocomplete dropdown radius ─────────────────────────────── */
.ac-panel { border-radius: 12px !important; }
/* customers.html inline .ac-panel override */
.table-wrap .ac-panel,
.card .ac-panel { border-radius: 12px !important; }

/* 10 ── Lighter placeholder contrast ────────────────────────────── */
input::placeholder,
textarea::placeholder { color: #b8c5d0 !important; }

/* 11 ── Deleted row tint instead of opacity ──────────────────────── */
tr.muted,
tr.muted td {
  opacity: 1 !important;
  color: #9ca3af !important;
}
tr.muted { background: #fdf4f4 !important; }
tr.muted:hover { background: #fdecea !important; }
tr.muted:nth-child(even) { background: #fdf4f4 !important; }

/* 12 ── Alternating section backgrounds ──────────────────────────── */
.card > .section:nth-child(even),
form.grid ~ .section:nth-child(even) { background: #f8fafc; }

/* 13 ── Workspace bar bottom shadow (visually separates sticky bar from content) */
.workspace-bar.active {
  box-shadow: 0 3px 10px rgba(91,124,153,.14), 0 1px 2px rgba(0,0,0,.06) !important;
}

/* Sticky table header shadow when scrolled under */
.table-wrap thead th {
  box-shadow: 0 1px 0 var(--border, #e8e8ed), 0 2px 6px rgba(0,0,0,.06) !important;
}

/* Shared speed + beauty pass */
:root{
  --shell-bg-top: #f5f8fc;
  --shell-bg-bottom: #f7f5ef;
  --shell-accent-strong: #365f7c;
  --shell-ink-soft: #64748b;
}

body{
  background:
    radial-gradient(circle at top left, rgba(91,124,153,.12), transparent 34%),
    radial-gradient(circle at top right, rgba(196,167,122,.12), transparent 28%),
    linear-gradient(180deg, var(--shell-bg-top) 0%, var(--shell-bg-bottom) 100%) !important;
}

.header{
  background: rgba(255,255,255,.88) !important;
  box-shadow: 0 10px 30px rgba(15,23,42,.08);
}

main.container{
  padding-top: 18px !important;
}

.card,
.section,
.table-wrap,
.table-scroller{
  border-color: rgba(148,163,184,.22) !important;
}

.card{
  box-shadow: 0 14px 38px rgba(15,23,42,.06), 0 2px 8px rgba(15,23,42,.03) !important;
}

.card h3,
.card h4{
  letter-spacing: -.01em;
}

.table-tools{
  background: linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(248,250,252,.94) 100%) !important;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(15,23,42,.05);
}

.lims-quickbar{
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  margin: 0 0 14px;
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96) 0%, rgba(245,249,252,.96) 100%);
  box-shadow: 0 14px 34px rgba(15,23,42,.06);
}

.lims-quickbar-main{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lims-quickbar-btn{
  min-height: 36px !important;
  height: 36px !important;
  padding: 0 12px !important;
}

.lims-quickbar-hint{
  font-size: .82rem;
  color: var(--shell-ink-soft);
}

.lims-quickbar-groups{
  display: grid;
  gap: 10px;
}

.lims-quickbar-group{
  display: grid;
  gap: 7px;
}

.lims-quickbar-label{
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.lims-quickbar-links{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lims-quickbar-chip{
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.24);
  background: #fff;
  color: #334155;
  text-decoration: none;
  font-size: .84rem;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(15,23,42,.05);
}

.lims-quickbar-chip:hover{
  border-color: rgba(74,127,165,.45);
  background: #f8fbfe;
  color: var(--shell-accent-strong);
}

.lims-quickbar-chip-pinned{
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.lims-quickbar-chip-customer{
  background: #f8fafc;
}

#command-palette-dialog{
  width: min(92vw, 920px);
  max-width: min(92vw, 920px);
  border: none;
  border-radius: 22px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(15,23,42,.28);
  background: transparent;
}

#command-palette-dialog::backdrop{
  background: rgba(15,23,42,.48);
  backdrop-filter: blur(8px);
}

.command-palette-shell{
  background: #fff;
}

.command-palette-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 26px 16px;
  background:
    linear-gradient(180deg, rgba(245,248,252,.96) 0%, rgba(236,243,248,.96) 100%);
  border-bottom: 1px solid rgba(148,163,184,.18);
}

.command-palette-eyebrow{
  margin: 0 0 8px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--shell-accent-strong);
}

.command-palette-head h2{
  margin: 0;
  font-size: 1.5rem;
  color: #0f172a;
}

.command-palette-lead{
  margin: 10px 0 0;
  color: var(--shell-ink-soft);
  line-height: 1.55;
}

.command-palette-close{
  min-width: 38px !important;
  width: 38px !important;
  min-height: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  border-radius: 999px !important;
}

.command-palette-search-row{
  padding: 16px 26px 18px;
  border-bottom: 1px solid rgba(148,163,184,.14);
}

#command-palette-input{
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  padding: 0 16px;
  font-size: 1rem;
}

.command-palette-body{
  max-height: min(62vh, 620px);
  overflow: auto;
  padding: 10px 14px 14px;
}

.command-palette-group + .command-palette-group{
  margin-top: 12px;
}

.command-palette-group-title{
  padding: 4px 10px 8px;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.command-palette-item{
  width: 100%;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px;
  min-height: 56px !important;
  height: auto !important;
  padding: 12px 14px !important;
  border-radius: 16px !important;
  border: 1px solid transparent !important;
  background: #fff !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

.command-palette-item:hover,
.command-palette-item.is-active{
  border-color: rgba(74,127,165,.28) !important;
  background: #f8fbfe !important;
}

.command-palette-item-copy{
  display: grid;
  gap: 3px;
  text-align: left;
}

.command-palette-item-title{
  display: block;
  font-size: .95rem;
  font-weight: 700;
  color: #0f172a;
}

.command-palette-item-subtitle{
  display: block;
  font-size: .82rem;
  color: var(--shell-ink-soft);
}

.command-palette-item-meta{
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: .74rem;
  font-weight: 800;
}

.command-palette-empty{
  padding: 14px 12px;
  color: var(--shell-ink-soft);
  font-size: .9rem;
}

.command-palette-foot{
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(148,163,184,.16);
  background: #f8fafc;
  color: var(--shell-ink-soft);
  font-size: .8rem;
}

.command-palette-foot kbd{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  padding: 0 6px;
  border: 1px solid #dbe4ec;
  border-bottom-width: 2px;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: .75rem;
  font-weight: 800;
}

.ws-recent-loading,
.ws-pending-loading{
  display: grid;
  gap: 8px;
}

.ws-recent-skeleton-row{
  height: 42px;
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(226,232,240,.7) 25%, rgba(241,245,249,.96) 50%, rgba(226,232,240,.7) 75%);
  background-size: 220% 100%;
  animation: lims-skeleton-wave 1.2s ease-in-out infinite;
}

@keyframes lims-skeleton-wave{
  0%{ background-position: 100% 50%; }
  100%{ background-position: 0 50%; }
}

@media (max-width: 900px){
  .lims-quickbar{
    padding: 12px;
  }

  .lims-quickbar-main{
    align-items: stretch;
  }

  .lims-quickbar-btn{
    width: 100%;
  }

  #command-palette-dialog{
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .command-palette-head,
  .command-palette-search-row{
    padding-left: 16px;
    padding-right: 16px;
  }

  .command-palette-body{
    padding-left: 10px;
    padding-right: 10px;
  }

  .command-palette-foot{
    padding: 12px 14px 16px;
  }
}

/* Shared record detail/edit hero */
.record-shell{
  display: grid;
  gap: 16px;
}

.record-hero{
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, .8fr);
  gap: 16px;
  padding: 22px 24px;
  border: 1px solid rgba(187,205,221,.85);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(138,170,196,.18), transparent 44%),
    linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(247,250,252,.96) 100%);
  box-shadow: 0 18px 44px rgba(15,23,42,.08);
}

.record-kicker{
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7c94aa;
}

.record-title{
  margin: 6px 0 0;
  font-size: clamp(1.4rem, 2vw, 2.05rem);
  line-height: 1.08;
  color: #102133;
}

.record-subtitle{
  margin: 8px 0 0;
  font-size: .96rem;
  line-height: 1.55;
  color: #526579;
  max-width: 70ch;
}

.record-chip-row{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.record-chip{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid #d8e4ef;
  background: rgba(255,255,255,.92);
  color: #304455;
  font-size: .8rem;
  font-weight: 700;
}

.record-chip.is-muted{
  color: #63778a;
  font-weight: 600;
}

.record-chip.is-accent{
  border-color: #b8d2e7;
  background: #ecf6fd;
  color: #215274;
}

.record-chip.is-good{
  border-color: #b8e5c7;
  background: #effbf2;
  color: #166534;
}

.record-chip.is-warn{
  border-color: #f4d08d;
  background: #fff8eb;
  color: #9a5b03;
}

.record-meta-grid{
  display: grid;
  gap: 10px;
  align-content: start;
}

.record-meta-card{
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #dbe7f1;
  background: rgba(255,255,255,.88);
}

.record-meta-label{
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8ba0b3;
}

.record-meta-value{
  font-size: .95rem;
  line-height: 1.45;
  color: #102133;
  font-weight: 700;
  word-break: break-word;
}

.record-card{
  border-radius: 20px;
}

.record-card .section:first-child{
  padding-top: 2px;
}

.record-form-actions{
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid #e6eef5;
}

@media (max-width: 860px){
  .record-hero{
    grid-template-columns: 1fr;
    padding: 18px 18px;
  }

  .record-title{
    font-size: 1.45rem;
  }
}

.pagination-bar{
  position: static;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.pagination-summary{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pagination-size{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: #5f7286;
}

.pagination-size select{
  min-width: 112px;
  padding: 6px 10px;
  border-radius: 10px;
}

.pagination-links{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 900px){
  .header{
    gap: 8px;
  }

  main.container{
    padding: 14px 12px 28px !important;
    scroll-padding-top: 8px;
  }

  .card{
    padding: 16px !important;
    border-radius: 16px !important;
  }

  .section{
    padding: 12px !important;
    border-radius: 14px !important;
  }

  .card h3,
  .card h4{
    margin-bottom: 10px;
  }

  .record-hero{
    padding: 16px !important;
    gap: 12px;
    border-radius: 18px;
  }

  .record-chip-row{
    gap: 6px;
  }

  .record-chip{
    padding: 5px 10px;
    font-size: .76rem;
  }

  .record-meta-grid{
    gap: 8px;
  }

  .table-tools{
    gap: 8px;
    padding: 10px !important;
    border-radius: 14px;
  }

  .table-tools label{
    width: 100%;
  }

  .table-wrap,
  .table-scroller{
    border-radius: 14px !important;
  }

  .table-scroller table,
  .table-wrap table{
    min-width: 720px;
  }

  .table-scroller th,
  .table-scroller td,
  .table-wrap th,
  .table-wrap td{
    font-size: 12px !important;
    line-height: 1.35;
  }

  .card > .actions,
  .card > form > .actions,
  .card form.grid > .actions,
  .record-form-actions{
    align-items: stretch;
    justify-content: stretch;
    gap: 8px;
  }

  .card > .actions > *,
  .card > form > .actions > *,
  .card form.grid > .actions > *,
  .record-form-actions > *{
    width: 100%;
    justify-content: center;
  }

  .pagination-bar{
    align-items: stretch;
  }

  .pagination-summary,
  .pagination-links{
    width: 100%;
  }

  .pagination-size{
    width: 100%;
    justify-content: space-between;
  }

  .pagination-size select{
    flex: 1 1 auto;
    min-width: 0;
  }

  .lims-quickbar{
    gap: 10px;
    padding: 12px 12px 14px;
    border-radius: 16px;
  }

  .lims-quickbar-main{
    gap: 8px;
  }

  .lims-quickbar-btn{
    min-height: 38px !important;
    height: auto !important;
    padding: 0 12px !important;
  }

  .lims-quickbar-links{
    gap: 6px;
  }

  .lims-quickbar-chip{
    min-height: 32px;
    padding: 0 10px;
    font-size: .79rem;
  }
}

@media (max-width: 640px){
  main.container{
    padding: 12px 10px 24px !important;
  }

  .card{
    padding: 14px !important;
    margin-bottom: 14px;
  }

  .section{
    padding: 10px !important;
  }

  .card h3,
  .card h4{
    font-size: 1rem;
  }

  .grid{
    gap: 12px !important;
  }

  .table-tools{
    padding: 8px !important;
  }

  .table-scroller table,
  .table-wrap table{
    min-width: 620px;
  }

  .record-hero{
    padding: 14px !important;
    gap: 10px;
  }

  .record-title{
    font-size: 1.28rem;
  }

  .record-subtitle{
    font-size: .9rem;
  }

  .lims-quickbar{
    padding: 10px 10px 12px;
  }

  .lims-quickbar-chip{
    font-size: .76rem;
  }
}

/* Accessibility typography preferences */
html {
  font-size: 16px;
}

html[data-text-size="large"] {
  font-size: 17px;
}

html[data-text-size="extra-large"] {
  font-size: 18px;
}

body {
  --user-font-weight-body: 400;
  --user-font-weight-emphasis: 600;
  --user-font-weight-strong: 700;
  font-size: 1rem;
  font-weight: var(--user-font-weight-body);
  line-height: 1.5;
}

body[data-text-weight="medium"] {
  --user-font-weight-body: 500;
  --user-font-weight-emphasis: 700;
  --user-font-weight-strong: 800;
}

body[data-text-weight="bold"] {
  --user-font-weight-body: 600;
  --user-font-weight-emphasis: 700;
  --user-font-weight-strong: 800;
}

input,
select,
textarea,
button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

label {
  font-weight: var(--user-font-weight-emphasis) !important;
}

.brand,
.brand-text,
.card h3,
.card h4,
.section > .title,
button,
.button,
.secondary,
.badge,
thead th,
th,
strong,
b {
  font-weight: var(--user-font-weight-strong);
}

th,
td {
  font-size: .875rem;
}

.compact th,
.compact td,
.table-wrap.compact th,
.table-wrap.compact td {
  font-size: .8125rem;
}

.kicker,
.badge,
.table-tools label {
  font-size: .75rem;
}

@media (max-width: 900px) {
  .table-scroller th,
  .table-scroller td,
  .table-wrap th,
  .table-wrap td {
    font-size: .8125rem !important;
  }
}

@media (max-width: 640px) {
  .table-scroller th,
  .table-scroller td,
  .table-wrap th,
  .table-wrap td {
    font-size: .75rem !important;
  }
}

/* Design optimization pass: faster navigation and denser work surfaces */
body{
  background:linear-gradient(180deg,#f6f8fb 0%,#f8f7f3 100%) !important;
}

.lims-quickbar{
  display:grid !important;
  grid-template-columns:auto minmax(0,1fr);
  align-items:start;
  gap:10px 14px !important;
  padding:10px 12px !important;
  border-radius:12px !important;
}

.lims-quickbar-main{
  gap:8px !important;
}

.lims-quickbar-groups{
  display:flex !important;
  flex-wrap:wrap;
  gap:10px 16px !important;
}

.lims-quickbar-group{
  display:grid;
  gap:5px !important;
}

.lims-quickbar-label{
  font-size:.68rem !important;
}

.lims-quickbar-chip{
  min-height:30px !important;
  padding:0 10px !important;
  border-radius:8px !important;
}

.lims-quickbar-chip-start{
  border-color:#d6e2ec !important;
  background:#fff !important;
}

.lims-quickbar-chip-active{
  border-color:#99d2b3 !important;
  background:#ecfdf5 !important;
  color:#166534 !important;
}

.table-tools{
  position:sticky !important;
  top:calc(var(--site-header-h, 64px) + 8px) !important;
  z-index:8 !important;
  margin:0 0 8px !important;
}

.table-tools ~ .table-scroller thead th,
.table-tools ~ .table-wrap thead th,
.table-tools + .table-scroller table thead th,
.table-tools + .table-wrap table thead th,
.table-tools + table thead th{
  top:0 !important;
}

.table-tools .tt-filter{
  min-height:38px;
}

.table-tools .tt-density-toggle[aria-pressed="true"]{
  background:#102133 !important;
  border-color:#102133 !important;
  color:#fff !important;
}

tr[data-row-href]:focus-visible,
tr[data-row-href]:focus-within{
  outline:2px solid rgba(22,163,74,.35);
  outline-offset:-2px;
}

.table-scroller:has(table:not([data-no-enhance]) .table-empty-state) thead,
.table-wrap:has(table:not([data-no-enhance]) .table-empty-state) thead,
table.tt-empty-table thead{
  display:none !important;
}

.table-scroller:has(table:not([data-no-enhance]) .table-empty-state),
.table-wrap:has(table:not([data-no-enhance]) .table-empty-state){
  overflow-x:hidden !important;
}

@media (max-width: 900px){
  .lims-quickbar{
    grid-template-columns:1fr;
  }

  .lims-quickbar-main{
    display:grid !important;
    grid-template-columns:1fr 1fr;
  }

  .lims-quickbar-hint{
    grid-column:1 / -1;
  }

  .table-tools{
    top:calc(var(--site-header-h, 64px) + 6px) !important;
  }

  .table-tools ~ .table-scroller thead th,
  .table-tools ~ .table-wrap thead th,
  .table-tools + .table-scroller table thead th,
  .table-tools + .table-wrap table thead th,
  .table-tools + table thead th{
    top:0 !important;
  }
}

@media (max-width: 560px){
  .lims-quickbar-main{
    grid-template-columns:1fr;
  }
}

.home-workbench{
  display:grid;
  grid-template-columns:minmax(0,1.35fr) minmax(260px,.75fr);
  gap:14px;
}

.home-panel{
  display:grid;
  gap:14px;
  align-content:start;
  padding:18px;
  border:1px solid rgba(148,163,184,.24);
  border-radius:14px;
  background:#fff;
  box-shadow:0 12px 30px rgba(15,23,42,.06);
}

.home-panel-primary{
  grid-row:span 2;
  align-content:space-between;
  min-height:320px;
}

.home-kicker{
  margin:0 0 8px;
  color:#5b7c99;
  font-size:.76rem;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.home-panel h1{
  margin:0;
  color:#102133;
  font-size:clamp(1.6rem,2.5vw,2.4rem);
  line-height:1.05;
}

.home-panel h2{
  margin:0;
  color:#102133;
  font-size:1rem;
}

.home-lead{
  max-width:58ch;
  margin:10px 0 0;
  color:#526579;
  line-height:1.55;
}

.home-primary-actions,
.home-link-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:8px;
}

.home-action,
.home-link-grid a,
.home-link-grid button{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  min-height:42px !important;
  height:auto !important;
  padding:8px 12px !important;
  border:1px solid #d7e2eb !important;
  border-radius:10px !important;
  background:#f8fafc !important;
  color:#24384a !important;
  box-shadow:none !important;
  text-align:center;
  text-decoration:none;
  font-size:.9rem;
  font-weight:700;
}

.home-action:hover,
.home-link-grid a:hover,
.home-link-grid button:hover{
  border-color:#9bbbd4 !important;
  background:#eef6fb !important;
  color:#1f4d72 !important;
}

.home-action-strong{
  border-color:#365f7c !important;
  background:#365f7c !important;
  color:#fff !important;
}

.home-action-strong:hover{
  background:#294c65 !important;
  color:#fff !important;
}

@media (max-width: 840px){
  .home-workbench{
    grid-template-columns:1fr;
  }

  .home-panel-primary{
    min-height:0;
  }
}

/* Simpler daily-use chrome: table tools should feel like inline help, not a second nav bar. */
.lims-quickbar{
  display:none !important;
}

.table-tools{
  position:static !important;
  top:auto !important;
  z-index:auto !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:8px !important;
  margin:0 0 8px !important;
  padding:4px 0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
}

.table-tools .tt-left{
  display:block !important;
  flex:1 1 auto !important;
  min-width:min(100%, 320px) !important;
}

.table-tools .tt-right{
  flex:0 0 auto !important;
}

.table-tools .tt-scope,
.table-tools .tt-view-tools,
.table-tools .tt-reset-view,
.table-tools .tt-density-toggle{
  display:none !important;
}

.table-tools .tt-filter{
  width:100% !important;
  min-width:0 !important;
  min-height:36px !important;
}

.table-tools .tt-customize-btn{
  min-height:36px !important;
  height:36px !important;
  padding:0 12px !important;
  white-space:nowrap !important;
}

@media (max-width: 900px){
  .table-tools{
    align-items:stretch !important;
  }

  .table-tools .tt-left{
    min-width:0 !important;
  }
}

/* ── Row action dropdown menus ─────────────────────────────────── */
.row-actions-menu{
  position:relative;
  display:inline-flex;
  vertical-align:middle;
}
.row-actions-panel{
  position:absolute;
  top:calc(100% + 4px);
  right:0;
  z-index:200;
  background:#fff;
  border:1px solid var(--border,#e6e9ef);
  border-radius:10px;
  box-shadow:0 4px 20px rgba(0,0,0,.13);
  min-width:150px;
  padding:4px 0;
  white-space:nowrap;
}
.row-actions-panel[hidden]{ display:none !important; }
.row-actions-panel form{ display:block; margin:0; padding:0; }
.row-actions-item{
  display:block !important;
  width:100% !important;
  padding:9px 16px !important;
  text-align:left !important;
  background:none !important;
  border:none !important;
  border-radius:0 !important;
  font-size:.875rem !important;
  color:#334155 !important;
  cursor:pointer !important;
  text-decoration:none !important;
  box-shadow:none !important;
  font-weight:500 !important;
  min-height:unset !important;
  height:auto !important;
  line-height:1.4 !important;
  white-space:nowrap;
}
.row-actions-item:hover{
  background:#f1f5f9 !important;
  color:#0f172a !important;
  filter:none !important;
}
.row-actions-item--danger{ color:#dc2626 !important; }
.row-actions-item--danger:hover{ background:#fef2f2 !important; }
