/* SUP Dieline Studio — UI styles */

:root {
  --bg: #11151c;
  --panel: #1a212c;
  --panel-2: #202938;
  --line: #2c3648;
  --text: #dde4ee;
  --muted: #8b97a8;
  --label: #aab4c4;
  --accent: #4dabf7;
  --accent-2: #9775fa;
  --good: #51cf66;
  --warn: #fcc419;
  --err: #ff6b6b;
  --canvas-bg: #f4f6f9;
  font-size: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- header ---------- */
header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
header h1 { font-size: 15px; font-weight: 700; letter-spacing: 0.3px; }
header h1 span { color: var(--accent); }
header .sub { color: var(--muted); font-size: 12px; }
header .spacer { flex: 1; }

/* ---------- workflow spine (job-progress stepper under the header) ---------- */
#workflowSpine { display: flex; align-items: flex-start; padding: 9px 18px 7px; background: var(--panel); border-bottom: 1px solid var(--line); flex: 0 0 auto; }
#workflowSpine[hidden] { display: none; }
.wf-step { flex: 1 1 0; position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; cursor: pointer; background: none; border: 0; font: inherit; padding: 0; }
.wf-step::after { content: ""; position: absolute; top: 13px; left: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.wf-step:last-child::after { display: none; }
.wf-step.s-done::after { background: var(--good); }
.wf-node { position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--panel-2); border: 1.5px solid var(--line); color: var(--muted); }
.s-done .wf-node { background: #16321f; border-color: var(--good); color: var(--good); }
.s-attention .wf-node { background: #3a3413; border-color: var(--warn); color: var(--warn); }
.s-locked .wf-node { border-style: dashed; }
.wf-step.s-current .wf-node { box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.20); }
.wf-name { margin-top: 6px; font-size: 11px; font-weight: 600; color: var(--text); letter-spacing: 0.02em; }
.s-locked .wf-name, .wf-step.s-available .wf-name { color: var(--muted); }
.wf-sub { font-size: 10px; margin-top: 1px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-done .wf-sub { color: var(--good); }
.s-attention .wf-sub { color: var(--warn); }
.wf-step:hover .wf-name { color: var(--accent); }

.btn {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 7px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.btn:hover { background: #283349; border-color: #3a4a66; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0b1320; }
.btn.primary:hover { background: #66b8f8; }
.btn.small { padding: 4px 9px; font-size: 11.5px; }

/* ---------- main layout ---------- */
main { display: flex; flex: 1 1 auto; min-height: 0; }

/* ---------- sidebar ---------- */
#sidebar {
  width: 318px;
  flex: 0 0 auto;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  transition: width 0.15s;
}
#sidebar.collapsed { width: 34px; }
#sidebar.collapsed #sidebarBody,
#sidebar.collapsed #sidebarHead > span { display: none; }
#sidebarHead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; font-weight: 700; font-size: 12.5px; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--accent); background: var(--panel-2);
  border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
#sidebarBody { overflow-y: auto; padding: 10px 12px 40px; flex: 1 1 auto; min-height: 0; }
#sidebarBody::-webkit-scrollbar { width: 9px; }
#sidebarBody::-webkit-scrollbar-thumb { background: #303c52; border-radius: 5px; }
/* proof mode swaps the spec form for the file/proofing panel */
#proofFileRail { display: none; }
#sidebarBody.proof-mode > #sbSearch,
#sidebarBody.proof-mode > .section { display: none !important; }
#sidebarBody.proof-mode > #proofFileRail { display: block; }

.section { margin-bottom: 6px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.section > summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 12px;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--panel-2);
  display: flex;
  align-items: center;
  user-select: none;
}
.section > summary::-webkit-details-marker { display: none; }
.section > summary::after { content: "▾"; margin-left: auto; color: var(--muted); font-size: 11px; transition: transform .15s; }
.section:not([open]) > summary::after { transform: rotate(-90deg); }
.section .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 9px; }

.row { display: flex; align-items: center; gap: 8px; }
.row label { flex: 1; color: var(--label); font-size: 12.5px; }
.row .unit { color: var(--muted); font-size: 11px; width: 26px; }
/* field-attached guidance: a quiet ⓘ on a row; the note appears on focus or click,
   instead of a standing 'Why' footnote row */
.row.has-hint { flex-wrap: wrap; }
.fhint { background: none; border: 0; color: var(--muted); cursor: help; font-size: 11px; line-height: 1; padding: 0 2px; margin-left: 2px; flex: 0 0 auto; }
.fhint:hover { color: var(--accent); }
.fhint-pop { display: none; flex-basis: 100%; width: 100%; margin-top: 5px; padding: 6px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.fhint-pop > div + div { margin-top: 5px; }
.row.has-hint:focus-within > .fhint-pop, .row.hint-open > .fhint-pop { display: block; }
/* preflight: advisory (warning/info) notes fold behind a count; blocking errors stay shown */
details.pf-advisory { margin-top: 5px; }
details.pf-advisory > summary { cursor: pointer; color: var(--muted); font-size: 11px; padding: 2px 0; list-style: none; }
details.pf-advisory > summary::-webkit-details-marker { display: none; }
details.pf-advisory > summary::before { content: "▸ "; }
details.pf-advisory[open] > summary::before { content: "▾ "; }

input[type="number"] { font-variant-numeric: tabular-nums; }
input[type="number"], input[type="text"], select {
  background: #131922;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  width: 96px;
  font-variant-numeric: tabular-nums;
}
input[type="text"] { width: 100%; }
select { width: 150px; }
select.wide, .row select.full { width: 100%; flex: 1; }
input:focus, select:focus { outline: none; border-color: var(--accent); }

input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }
.row.check { justify-content: flex-start; }
.row.check label { flex: none; color: var(--text); }

.seg { display: flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button {
  flex: 1; background: transparent; color: var(--muted);
  border: none; padding: 6px 4px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.seg button.active { background: var(--accent); color: #0b1320; }

.hint { color: var(--muted); font-size: 11px; line-height: 1.45; }

/* ---------- canvas area ---------- */
#stage { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }

#tabs {
  display: flex; gap: 4px; padding: 8px 14px 0;
  background: var(--bg);
}
#tabs button {
  background: transparent; border: 1px solid transparent; border-bottom: none;
  color: var(--muted); padding: 7px 16px; font-size: 12.5px; font-weight: 600;
  border-radius: 8px 8px 0 0; cursor: pointer;
}
#tabs button.active { background: var(--canvas-bg); color: #25313f; }
#tabSpacer { flex: 1 1 auto; }
#tabs button.tab-toggle {
  align-self: center; margin-bottom: 4px; padding: 5px 13px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--muted); font-size: 12px;
}
#tabs button.tab-toggle:hover { border-color: var(--accent); color: var(--text); }
#tabs button.tab-toggle.on {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
/* imported artwork sits behind the linework; keep it crisp, not smoothed */
#svgHost .art-layer image { image-rendering: auto; }

#canvasWrap {
  flex: 1 1 auto; position: relative; background: var(--canvas-bg);
  margin: 0 14px 0; border-radius: 0 10px 10px 10px; overflow: hidden;
  cursor: grab;
}
#canvasWrap.panning { cursor: grabbing; }
#svgHost { width: 100%; height: 100%; display: block; }

#zoomCtrls {
  position: absolute; right: 12px; top: 12px; display: flex; gap: 6px;
}
#zoomCtrls .btn { background: #ffffffd9; color: #25313f; border-color: #cdd6e2; }
#zoomCtrls .btn:hover { background: #fff; }

#legend {
  position: absolute; left: 12px; bottom: 12px;
  background: #ffffffe8; border: 1px solid #cdd6e2; border-radius: 9px;
  padding: 9px 12px; font-size: 11.5px; color: #2b3645;
  display: grid; grid-template-columns: auto auto; gap: 3px 18px;
}
#legend .key { display: flex; align-items: center; gap: 7px; }
#legend .swatch { width: 22px; height: 0; border-bottom-width: 2.5px; border-bottom-style: solid; }
#legend .swatch.dashed { border-bottom-style: dashed; }
#legend .swatch.fill { height: 10px; border: 1px solid #9aa7b5; border-radius: 2px; }

#readout {
  position: absolute; right: 12px; bottom: 12px;
  background: #ffffffe8; border: 1px solid #cdd6e2; border-radius: 8px;
  padding: 5px 10px; font-size: 11.5px; color: #2b3645; font-variant-numeric: tabular-nums;
}

/* ---------- proof-view panel review ---------- */
#proofReview {
  position: absolute; left: 12px; top: 12px; right: auto;
  display: flex; flex-direction: column; gap: 3px;
  background: #fffffff2; border: 1px solid #cdd6e2; border-left: 4px solid var(--accent);
  border-radius: 9px; padding: 8px 12px; max-width: 60%;
  box-shadow: 0 4px 14px rgba(20,30,48,.12); color: #25313f;
}
#proofReview.all-done { border-left-color: #16a34a; }
#proofReview b { font-size: 12.5px; }
#proofReview.all-done b { color: #15803d; }
#proofReview .pr-sub { font-size: 11px; color: #5b6677; }
#proofReview .pr-chips { display: flex; gap: 5px; margin-top: 3px; flex-wrap: wrap; }
#proofReview .pr-chip {
  font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: #eef1f6; color: #5b6677; border: 1px solid #d7deea;
}
#proofReview .pr-chip.done { background: #dcfce7; color: #15803d; border-color: #86efac; }
#svgHost .proof-hit { cursor: pointer; transition: fill .12s; }
#svgHost .proof-hit:hover { fill: rgba(58,128,255,0.10); }
#svgHost .proof-hit.done:hover { fill: rgba(34,197,94,0.18); }

/* ---------- warnings ---------- */
#warnings {
  flex: 0 0 auto; margin: 8px 14px 12px; display: flex; flex-direction: column; gap: 5px;
  max-height: 130px; overflow-y: auto;
}
.wmsg {
  border-radius: 7px; padding: 7px 11px; font-size: 12.5px; display: flex; gap: 8px; align-items: baseline;
}
.wmsg.warn { background: #3a3413; color: var(--warn); border: 1px solid #5c521d; }
.wmsg.error { background: #3d1d1f; color: var(--err); border: 1px solid #6b3034; }
.wmsg .tag { font-weight: 800; font-size: 10.5px; letter-spacing: 0.6px; }
.wmsg-ok { color: var(--good); font-size: 12px; padding: 4px 2px; }

/* ---------- spec sheet ---------- */
#specSheet {
  flex: 1 1 auto; overflow-y: auto; background: var(--canvas-bg);
  margin: 0 14px; border-radius: 0 10px 10px 10px; padding: 26px 34px; color: #1f2937;
}
#specSheet h2 { font-size: 17px; margin-bottom: 4px; }
#specSheet h3 { font-size: 13px; margin: 20px 0 8px; text-transform: uppercase; letter-spacing: 0.5px; color: #4b5b70; }
#specSheet table { border-collapse: collapse; width: 100%; max-width: 640px; font-size: 13px; }
#specSheet td { padding: 6px 12px; border-bottom: 1px solid #dbe2ea; }
#specSheet td:first-child { color: #51616f; width: 46%; }
#specSheet td:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- Calyx lock buttons ---------- */
.lockbtn { padding: 4px 7px; font-size: 12px; line-height: 1; flex: 0 0 auto; }
input:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- clickable warnings + field flash ---------- */
.wmsg.clickable { cursor: pointer; }
.wmsg.clickable:hover { filter: brightness(1.25); }
.row.flash { animation: fieldFlash 1.6s ease-out; border-radius: 6px; }
@keyframes fieldFlash {
  0% { background: rgba(77, 171, 247, 0.45); box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.45); }
  100% { background: transparent; box-shadow: none; }
}

/* ---------- legend scales with the viewport ---------- */
#legend { transform-origin: left bottom; max-width: 44vw; }
@media (max-width: 1400px) { #legend { transform: scale(0.88); } }
@media (max-width: 1150px) { #legend { transform: scale(0.76); grid-template-columns: auto; gap: 2px 0; } }
@media (max-width: 900px)  { #legend { transform: scale(0.66); } }
@media (max-height: 700px) { #legend { transform: scale(0.72); grid-template-columns: auto; } }

/* ---------- material intelligence panel (right side) ---------- */
#matpanel {
  width: 304px; flex: 0 0 auto; background: var(--panel);
  border-left: 1px solid var(--line); display: flex; flex-direction: column;
  min-height: 0; transition: width 0.15s;
}
#matpanel.collapsed { width: 34px; }
#matpanel.collapsed #matpanelBody, #matpanel.collapsed #matpanelHead span { display: none; }
#matpanelHead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; font-weight: 700; font-size: 12.5px; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--accent-2); background: var(--panel-2);
  border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
#matpanelBody { overflow-y: auto; padding: 10px 12px 40px; flex: 1 1 auto; }
#matpanelBody::-webkit-scrollbar { width: 9px; }
#matpanelBody::-webkit-scrollbar-thumb { background: #303c52; border-radius: 5px; }

.matcard {
  border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px;
  background: var(--panel-2); overflow: hidden;
}
.matcard > .mhead {
  padding: 8px 11px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
}
.matcard > .mhead::after {
  content: "▾"; color: var(--muted); font-size: 11px; transition: transform .15s;
  margin-left: auto; flex: 0 0 auto;
}
.matcard.collapsed > .mhead::after { transform: rotate(-90deg); }
.matcard.collapsed > .mbody { display: none; }
.matcard > .mbody { padding: 0 11px 10px; font-size: 12px; }
/* attention: a card needing a decision/fix keeps a colored edge even when folded,
   so nothing actionable is buried in 'simple' density */
.matcard.mat-attn { border-left: 3px solid var(--warn); }
.matcard.mat-attn-bad { border-left-color: var(--err); }
.matcard.mat-attn > .mhead { color: var(--warn); }
.matcard.mat-attn-bad > .mhead { color: var(--err); }
/* Simple / Detailed density control in the panel header */
.density-seg { display: inline-flex; margin-left: auto; margin-right: 6px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; flex: 0 0 auto; }
.density-seg button { background: transparent; border: 0; color: var(--muted); font: inherit; font-size: 9px; font-weight: 700; letter-spacing: 0; text-transform: uppercase; padding: 2px 5px; cursor: pointer; white-space: nowrap; }
.density-seg button.on { background: var(--accent); color: #0b1320; }
#matpanel.collapsed #matDensity { display: none; }
.matcard .big { font-size: 17px; font-weight: 700; color: var(--text); }
.matcard .sub { color: var(--muted); font-size: 11px; line-height: 1.45; }
.matrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0; }
.matrow .k { color: var(--muted); }
/* label material that still needs picking: amber-highlighted select + "confirm" chip */
.msub { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 2px 0 3px; }
.matrow.mat-unset select { border-color: var(--warn); box-shadow: 0 0 0 2px rgba(252,196,25,.25); }
.mat-need { display: inline-block; background: #3a3413; color: var(--warn); font-size: 9.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; border-radius: 5px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
@keyframes matFlash { 0%, 100% { box-shadow: 0 0 0 0 rgba(252,196,25,0); } 30% { box-shadow: 0 0 0 3px rgba(252,196,25,.55); } }
.matcard.mat-flash { animation: matFlash 1.6s ease-in-out; border-color: var(--warn); }
.matrow .v { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.badge { display: inline-block; border-radius: 5px; padding: 1.5px 7px; font-size: 10.5px; font-weight: 700; }
.badge.good { background: #16321f; color: var(--good); }
.badge.warn { background: #3a3413; color: var(--warn); }
.badge.bad  { background: #3d1d1f; color: var(--err); }
.badge.info { background: #1d2c44; color: var(--accent); }
.matbar { height: 5px; border-radius: 3px; background: #131922; overflow: hidden; margin: 4px 0 2px; }
.matbar > div { height: 100%; border-radius: 3px; }

/* ---------- 3D view ---------- */
#view3d { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0;
  margin: 0 14px; border-radius: 0 10px 10px 10px; overflow: hidden; background: var(--canvas-bg); }
#threeHost { flex: 1 1 auto; min-height: 0; }
#threeHost canvas { display: block; }
#view3dBar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: #ffffffea; border-top: 1px solid #cdd6e2; }
#view3dBar label { font-size: 12px; color: #2b3645; font-weight: 600; }
#view3dBar input[type=range] { width: 220px; accent-color: var(--accent); }
#view3dBar select { width: 170px; background: #fff; color: #25313f; border-color: #cdd6e2; }
#view3dBar select.v3dsm { width: auto; min-width: 96px; }
#view3dBar .v3dchk { display: flex; align-items: center; gap: 4px; font-size: 12px;
  color: #2b3645; font-weight: 600; cursor: pointer; user-select: none; }
#view3dBar .spacer { flex: 1; }
#view3dNote { flex: 0 0 auto; padding: 5px 14px 8px; font-size: 11.5px; color: #51616f; background: #ffffffea; }

/* production-file import panel */
#artModal { position: fixed; inset: 0; background: rgba(10,14,20,0.55); z-index: 60;
  display: flex; align-items: center; justify-content: center; }
#artModalCard { background: #fff; color: #1d2733; border-radius: 10px; padding: 18px 20px;
  width: min(560px, 92vw); max-height: 84vh; overflow: auto; box-shadow: 0 18px 60px rgba(0,0,0,.45); }
#artModalCard h3 { margin: 0 0 8px; font-size: 15px; }
#artModalInfo { font-size: 12px; color: #445162; margin-bottom: 10px; }
#artModalLayers { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
#artModalLayers .artrow { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
#artModalLayers .artrow .lname { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#artModalLayers select { width: 130px; background: #fff; color: #25313f; border: 1px solid #cdd6e2; border-radius: 6px; padding: 3px 6px; }
/* confirm-gate: detected-finish badges + attention highlight (modal is light) */
#artModalLayers .finbadge { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 10px; white-space: nowrap; letter-spacing: .2px; }
#artModalLayers .finbadge.auto { background: #e3f6ea; color: #176b3a; border: 1px solid #b6e2c4; }
#artModalLayers .finbadge.confirm { background: #fdf2dc; color: #8a5a08; border: 1px solid #f0d399; }
#artModalLayers .finbadge.review { background: #fdeadb; color: #9a4a16; border: 1px solid #f1c39a; }
#artModalLayers .artrow.needs-confirm { background: #fffaf0; border-left: 3px solid #e8a33d; padding: 4px 6px 4px 8px; margin: 0 -6px; }
#artModalLayers .artnote { font-size: 11.5px; font-weight: 700; color: #9a4a16; background: #fdeadb; border: 1px solid #f1c39a; border-radius: 7px; padding: 6px 10px; }
#artModalLayers .seprow { align-items: flex-start; }
#artModalLayers .seprow .lname { flex: 0 0 auto; }
#artModalLayers .sepchips { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; }
#artModalLayers .sepchip { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 9px; background: #eef1f5; color: #445162; border: 1px solid #dde3ec; white-space: nowrap; }
#artModalLayers .sepchip.finish { background: #e7eefb; color: #26477e; border-color: #c6d6f1; }
#artModalLayers .sepchip.collision { background: #fdeadb; color: #9a4a16; border-color: #f1c39a; }
#artModalMeasure { font-size: 12px; color: #445162; min-height: 16px; margin-bottom: 10px; }
#artModalMeasure .dev-bad { color: #b3261e; font-weight: 700; }
#artModalMeasure .dev-ok { color: #156c35; font-weight: 700; }
.art-family { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 9px; padding-bottom: 9px; border-bottom: 1px solid #e3e9f1; }
.art-family > b { font-size: 12.5px; color: #1d2733; }
.art-family select { background: #fff; color: #1d2733; border: 1px solid #cdd6e2; border-radius: 6px; padding: 4px 8px; font-weight: 700; font-size: 12.5px; }
.art-family-conf { font-size: 11px; color: #6b7a8d; }
.art-family-why { flex-basis: 100%; font-size: 11px; color: #6b7a8d; margin-top: 1px; }
#artModalBtns { display: flex; justify-content: flex-end; gap: 8px; }
#artModalBtns .primary { background: var(--accent); color: #fff; border-color: var(--accent); }

/* embellishment zones panel */
#embPanel { position: fixed; right: 14px; bottom: 64px; z-index: 55; width: 354px;
  background: #fff; color: #1d2733; border-radius: 10px; padding: 12px 14px;
  box-shadow: 0 14px 44px rgba(0,0,0,.4); font-size: 12.5px; max-height: 72vh; overflow: auto; }
#embPanel h4 { margin: 0 0 4px; font-size: 13px; }
#embPanel h5 { margin: 10px 0 4px; font-size: 11.5px; color: #4a5a6d;
  text-transform: uppercase; letter-spacing: .4px; }
#embPanel .embsub { color: #5d6d80; font-size: 11.5px; line-height: 1.45; margin-bottom: 6px; }
#embPanel .embimport { display: flex; gap: 7px; align-items: center; padding: 4px 2px; }
#embPanel .embimport.off > span:not(.embnote) { color: #9aa7b5; text-decoration: line-through; }
#embPanel .embnote { color: #8a97a6; font-size: 11px; margin-left: auto; }
#embPanel .embcard { border: 1px solid #dfe6ee; border-radius: 8px; padding: 8px 9px;
  margin-top: 8px; background: #f9fbfd; }
#embPanel .embcard.off { opacity: .55; background: #f2f4f6; }
#embPanel .embhead { display: flex; gap: 6px; align-items: center; }
#embPanel .embhead .grow { flex: 1; min-width: 0; }
#embPanel .embblurb { color: #5d6d80; font-size: 11px; line-height: 1.4; margin: 5px 0 2px; }
#embPanel .embline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
#embPanel .embline .k { color: #4a5a6d; font-size: 11px; font-weight: 600; min-width: 42px; }
#embPanel .embline.params .k { min-width: 0; margin-left: 2px; }
#embPanel select, #embPanel input[type=range] { background: #fff; color: #25313f;
  border: 1px solid #cdd6e2; border-radius: 6px; padding: 2px 4px; font-size: 12px; }
#embPanel input[type=range] { flex: 1; padding: 0; border: none; }
#embPanel .pickbtn { background: var(--accent); color: #fff; border: none; border-radius: 6px;
  padding: 3px 8px; cursor: pointer; font-size: 12px; }
#embPanel .ord { background: none; border: 1px solid #cdd6e2; color: #4a5a6d; border-radius: 6px;
  cursor: pointer; font-size: 11px; padding: 1px 5px; }
#embPanel .rm { background: none; border: none; color: #b3261e; cursor: pointer; font-weight: 700; }
#embPanel .hint { color: #667687; font-size: 11.5px; margin-top: 8px; line-height: 1.45; }
#embPanel .addbtn { margin-top: 10px; }

/* shots menu */
#shotsMenu { position: fixed; right: 14px; bottom: 64px; z-index: 56; width: 250px;
  background: #fff; color: #1d2733; border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 14px 44px rgba(0,0,0,.4); font-size: 12.5px; }
#shotsMenu button { display: block; width: 100%; margin: 4px 0; text-align: left; }
#shotsMenu .busy { color: #667687; font-size: 11.5px; min-height: 14px; }

/* ============================================================
 * Tier-1 UI refresh: button system, export menu, sidebar
 * search, inline-unit groups, on-demand hints
 * ============================================================ */

/* button system: primary (accent) / default / ghost (quiet) */
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #232d3e; color: var(--text); border-color: transparent; }

/* export split-menu */
.menu { position: relative; display: inline-block; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; min-width: 210px; box-shadow: 0 16px 44px rgba(0,0,0,.45);
  display: flex; flex-direction: column; gap: 3px;
}
.menu-pop[hidden] { display: none; }
.btn.menu-item {
  display: block; width: 100%; text-align: left; background: transparent;
  border-color: transparent; color: var(--text); font-size: 12.5px; padding: 8px 10px;
}
.btn.menu-item:hover { background: var(--accent); color: #0b1320; border-color: transparent; }

/* sidebar search header (sticky; survives form rebuilds) */
#sbSearch { position: sticky; top: 0; z-index: 5; background: var(--panel);
  padding: 0 0 8px; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
#fieldSearch {
  flex: 1; width: 100%; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel-2); color: var(--text); font-size: 12.5px;
}
#fieldSearch::placeholder { color: var(--muted); }
#fieldSearch:focus { outline: none; border-color: var(--accent); }
#sbSearchClear {
  border: none; background: var(--panel-2); color: var(--muted); border-radius: 7px;
  width: 28px; height: 30px; cursor: pointer; font-size: 12px; flex: 0 0 auto;
}
#sbSearchClear:hover { color: var(--text); background: #2a3548; }
.section.search-hide, .row.search-hide, details.hint.search-hide { display: none !important; }
mark.sb-hit { background: var(--accent); color: #0b1320; border-radius: 2px; padding: 0 1px; }

/* inline-unit group: input + unit suffix read as one control (no floating column) */
.inputgroup {
  display: flex; align-items: center; width: 150px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2);
  overflow: hidden;
}
.inputgroup:focus-within { border-color: var(--accent); }
.inputgroup input[type="number"] {
  border: none; background: transparent; border-radius: 0; flex: 1; min-width: 0;
  text-align: right; padding-right: 4px;
}
.inputgroup input:focus { outline: none; }
.inputgroup .unit { width: auto; padding: 0 9px 0 4px; color: var(--muted); font-size: 11px; }
.inputgroup input:disabled { opacity: 0.55; }

/* on-demand hints: a quiet ⓘ that expands the guidance inline */
details.hint { border: 0; }
details.hint > summary {
  list-style: none; cursor: pointer; color: var(--muted); font-size: 11px;
  display: inline-flex; align-items: center; gap: 4px; user-select: none; padding: 1px 0;
}
details.hint > summary::-webkit-details-marker { display: none; }
details.hint > summary::before { content: "ⓘ"; font-size: 11px; opacity: .85; }
details.hint > summary:hover { color: var(--accent); }
details.hint[open] > summary { color: var(--text); }
details.hint .hint-body { color: var(--muted); font-size: 11px; line-height: 1.45; margin-top: 5px; }

/* ============================================================
 * Product gallery — sidebar trigger + category/dieline modal
 * ============================================================ */

/* sidebar trigger: shows current product, opens the gallery */
.product-trigger {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; cursor: pointer; color: var(--text);
}
.product-trigger:hover { border-color: var(--accent); background: #243044; }
.product-trigger .pt-ico { width: 34px; height: 30px; color: var(--accent); flex: 0 0 auto; }
.product-trigger .pt-ico svg { width: 100%; height: 100%; }
.product-trigger .pt-txt { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.product-trigger .pt-txt b { font-size: 13px; font-weight: 700; }
.product-trigger .pt-txt i { font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-trigger .pt-chev { font-size: 11px; color: var(--accent); font-weight: 600; flex: 0 0 auto; }

/* modal overlay + card */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(8,11,16,.66);
  display: flex; align-items: center; justify-content: center; padding: 28px;
  backdrop-filter: blur(2px);
}
.modal-overlay[hidden] { display: none; }
.pm-card-wrap {
  width: min(860px, 94vw); max-height: 88vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.5); overflow: hidden;
}
.pm-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px 12px; }
.pm-head h2 { font-size: 18px; font-weight: 700; }
.pm-head p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.pm-head .btn.ghost { font-size: 16px; padding: 4px 10px; margin-left: auto; }

.pm-tabs { display: flex; gap: 6px; padding: 0 22px 14px; border-bottom: 1px solid var(--line); }
.pm-tabs button {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  border-radius: 9px; padding: 7px 15px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.pm-tabs button:hover { color: var(--text); }
.pm-tabs button.active { background: var(--accent); border-color: var(--accent); color: #0b1320; }

.pm-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px; padding: 18px 22px 24px; overflow-y: auto;
}
.pm-card {
  display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 10px 13px; cursor: pointer; color: var(--text); transition: border-color .12s, transform .08s, background .12s;
}
.pm-card:hover { border-color: var(--accent); background: #243044; transform: translateY(-2px); }
.pm-card.current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pm-card.current::after { content: "✓ current"; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .4px; }
.pm-card .pm-ico {
  width: 100%; height: 66px; background: var(--canvas-bg); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 7px; overflow: hidden;
}
.pm-card .pm-ico svg { width: 100%; height: 100%; display: block; }
/* real dieline thumbnails: keep per-layer colours, force a legible px stroke */
.pm-card .pm-ico svg path, .pm-card .pm-ico svg line, .pm-card .pm-ico svg rect,
.pm-card .pm-ico svg circle, .pm-card .pm-ico svg ellipse, .pm-card .pm-ico svg polygon {
  vector-effect: non-scaling-stroke; stroke-width: 1.15px;
}
.pm-card .pm-name { font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.pm-card .pm-blurb { font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.pm-grid::-webkit-scrollbar { width: 9px; }
.pm-grid::-webkit-scrollbar-thumb { background: #303c52; border-radius: 5px; }

/* ============================================================
 * Live coupling, inline validation, number scrub
 * ============================================================ */

/* hover a field -> spotlight the matching dieline layer(s) [fallback, whole layer] */
#svgHost.coupling g[id^="layer-"] { opacity: .15; transition: opacity .1s ease; }
#svgHost.coupling g[id^="layer-"].cpl-hot { opacity: 1; filter: drop-shadow(0 0 2px var(--accent)); }
/* granular spotlight: dim every drawn element, lift only the tagged dim/feature */
#svgHost.coupling-el g[id^="layer-"] > * { opacity: .12; transition: opacity .1s ease; }
#svgHost.coupling-el g[id^="layer-"] > .cpl-hot { opacity: 1; filter: drop-shadow(0 0 1.6px var(--accent)); }

/* scrub: drag the label to change the value */
.row.scrub > label { cursor: ew-resize; }
.row.scrub > label:hover { color: var(--accent); }
.row.scrub > label::after { content: " ⇆"; font-size: 10px; opacity: .45; }
.row.scrub > label:hover::after { opacity: .9; }

/* inline field validation: red/amber border + message under the field */
.row.field-bad, .row.field-warn { flex-wrap: wrap; }
.row.field-bad input, .row.field-bad select, .row.field-bad .inputgroup { border-color: var(--err) !important; }
.row.field-warn input, .row.field-warn select, .row.field-warn .inputgroup { border-color: var(--warn) !important; }
.field-msg { flex-basis: 100%; font-size: 10.5px; line-height: 1.35; margin-top: 3px; }
.row.field-bad .field-msg { color: var(--err); }
.row.field-warn .field-msg { color: var(--warn); }

/* quote option blocks in the Material Intelligence panel */
.qopt { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; margin-top: 7px; }
.qopt.qrec { border-color: var(--accent); background: #1b2436; }
.qopt-h { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; font-size: 12px; }
.qopt .matrow { padding: 2px 0; }
.qspec { background: #161e2c; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; margin-bottom: 8px; }
.qspec + .qspec { margin-top: -2px; }
.qspec-h { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 1px 0 3px; }
.qspec .matrow { padding: 2px 0; }
.qspec select { width: 168px; }

/* ---------- preflight card ---------- */
.pf-card.matcard { border-left: 3px solid var(--accent); }
.pf-headline { font-weight: 700; font-size: 12.5px; margin-top: 2px; }
.pf-headline.ready { color: #22c55e; }
.pf-headline.bad { color: #f87171; }
.pf-headline.warn { color: #fbbf24; }
.pf-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.pf-find { position: relative; padding-left: 15px; font-size: 11.5px; line-height: 1.4; }
.pf-dot { position: absolute; left: 0; top: 4px; width: 7px; height: 7px; border-radius: 50%; }
.pf-msg { color: var(--text); }
.pf-tag { display: inline-block; font-size: 9px; text-transform: uppercase; letter-spacing: .04em;
  font-weight: 700; padding: 1px 6px; border-radius: 999px; margin-left: 6px; vertical-align: 1px;
  border: 1px solid var(--line); color: var(--muted); }
.pf-tag.pf-deterministic { color: #22c55e; border-color: rgba(34,197,94,.45); }
.pf-tag.pf-heuristic { color: #fbbf24; border-color: rgba(251,191,36,.45); }
.pf-tag.pf-ai { color: #a5b4fc; border-color: rgba(165,180,252,.45); }
.pf-tag.pf-human { color: var(--muted); }
.pf-why { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.pf-assume { color: #fbbf24; }
/* press-aware ink/colour count (preflight source line) */
.pf-ink { color: var(--label); font-weight: 700; cursor: help; border-bottom: 1px dotted rgba(148,160,180,.5); }
.pf-inkbadge { font-size: 10px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; white-space: nowrap; }

/* ============ Price & Lead Time tab ============ */
#priceView { flex: 1 1 auto; min-height: 0; overflow-y: auto; background: var(--bg); }
.pv { max-width: 1080px; margin: 0 auto; padding: 22px 26px 44px; display: flex; flex-direction: column; gap: 18px; }
.pv-empty { padding: 64px; text-align: center; color: var(--muted); }
.pv-unsupported { padding: 56px 40px; max-width: 560px; margin: 0 auto; }
.pv-unsup-h { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 10px; }
.pv-unsup-sub { font-size: 13.5px; line-height: 1.65; color: var(--muted); }
.pv-unsup-sub b { color: var(--label); }
/* inline material picker shown in the price box when facestock/laminate are unset */
.pv-matpick { max-width: 380px; margin: 20px auto 0; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.pv-matpick .matrow { padding: 6px 0; }
.pv-matpick .mat-suggest { margin: -2px 0 6px; font-size: 11.5px; line-height: 1.5; }
.pv-matpick-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.pv-matpick-foot a { color: var(--accent); text-decoration: none; }
.pv-matpick-foot a:hover { text-decoration: underline; }
/* live-pricing error card — amber for retryable (transient/rate/network/off),
   red for hard errors that need a change or admin (spec/scope/auth/config) */
.pv-error { border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 12px; background: rgba(252,196,25,.07); padding: 13px 16px; }
.pv-error-h { font-size: 14px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 8px; }
.pv-error-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: none; }
.pv-error-d { font-size: 12.5px; color: var(--label); margin-top: 5px; line-height: 1.55; }
.pv-error-issues { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--label); }
.pv-error-issues li { margin: 2px 0; }
.pv-error-issues b { color: var(--text); font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.pv-error-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.pv-error-hint { font-size: 12px; color: var(--muted); }
.pv-err-spec, .pv-err-scope, .pv-err-auth, .pv-err-config { border-left-color: var(--err); background: rgba(255,107,107,.07); }
.pv-err-spec .pv-error-dot, .pv-err-scope .pv-error-dot, .pv-err-auth .pv-error-dot, .pv-err-config .pv-error-dot { background: var(--err); }

.pv-top { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.pv-title { font-size: 19px; font-weight: 700; }
.pv-sub { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 3px; }
.pv-controls { display: flex; gap: 10px; margin-left: auto; }
.pv-num { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--label); }
.pv-num input { width: 108px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 7px; padding: 7px 9px; font-size: 13px; font-weight: 600; }
.pv-num input:focus { outline: none; border-color: var(--accent); }
.pv-source { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pv-srctag { font-size: 11px; font-weight: 700; letter-spacing: .4px; padding: 3px 9px; border-radius: 20px; text-transform: uppercase; }
.pv-srctag.est { background: #243044; color: var(--muted); }
.pv-srctag.live { background: rgba(81,207,102,.14); color: var(--good); }
.pv-srctag.sm { text-transform: none; letter-spacing: 0; padding: 1px 7px; }
.pv-hint { font-size: 11.5px; color: var(--muted); }
.pv-hint.err { color: var(--err); }

.pv-hero { display: flex; gap: 24px; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #1c2738 0%, #1a2230 62%); border: 1px solid #314058;
  border-left: 4px solid var(--accent); border-radius: 14px; padding: 22px 26px; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.pv-hero-tag { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--accent); text-transform: uppercase; }
.pv-hero-method { font-size: 26px; font-weight: 800; margin-top: 6px; }
.pv-hero-why { font-size: 13px; color: var(--label); margin-top: 8px; max-width: 520px; line-height: 1.5; }
.pv-hero-r { text-align: right; flex: 0 0 auto; }
.pv-hero-price .amt { font-size: 40px; font-weight: 800; color: #fff; letter-spacing: -1px; }
.pv-hero-price .unit { font-size: 14px; color: var(--muted); margin-left: 4px; }
.pv-hero-meta { display: grid; grid-template-columns: repeat(2, auto); gap: 8px 22px; margin-top: 14px; justify-content: end; }
.pv-hero-meta .k { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.pv-hero-meta .v { font-size: 14px; font-weight: 700; }

.pv-sec { font-size: 12.5px; font-weight: 700; color: var(--label); text-transform: uppercase; letter-spacing: .5px; margin: 4px 0 -4px; }
.pv-sec b { color: var(--text); text-transform: none; letter-spacing: 0; }

.pv-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(214px, 1fr)); gap: 12px; }
.pv-opt { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 15px; cursor: pointer; position: relative; transition: border-color .12s, transform .08s, box-shadow .12s; color: var(--text); font: inherit; }
.pv-opt:hover { border-color: #3a4a66; transform: translateY(-1px); }
.pv-opt.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 6px 20px rgba(77,171,247,.12); }
.pv-opt.rec { background: linear-gradient(180deg, #1d2a3a, var(--panel)); }
.pv-opt-rank { position: absolute; top: 12px; right: 13px; font-size: 11px; font-weight: 800; color: var(--muted); }
.pv-opt.rec .pv-opt-rank, .pv-opt.sel .pv-opt-rank { color: var(--accent); }
.pv-opt-method { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding-right: 22px; }
.pv-opt-price { margin: 9px 0 1px; }
.pv-opt-price .amt { font-size: 24px; font-weight: 800; }
.pv-opt-price .unit { font-size: 12px; color: var(--muted); margin-left: 3px; }
.pv-opt-from { font-size: 11px; color: var(--muted); }
.pv-opt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 11px 0; }
.pv-opt-grid .k { display: block; font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.pv-opt-grid .v { font-size: 12.5px; font-weight: 700; }
.pv-opt-lead { font-size: 11px; color: var(--label); }
.pv-opt-lead .fr { color: var(--muted); }

.pv-tag { font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 5px; text-transform: uppercase; letter-spacing: .3px; }
.pv-tag.rec { background: rgba(77,171,247,.16); color: var(--accent); }
.pv-tag.ok { background: rgba(81,207,102,.14); color: var(--good); }
.pv-tag.warn { background: rgba(252,196,25,.16); color: var(--warn); }

.pv-leadbar { display: flex; height: 6px; border-radius: 4px; background: #222d3e; overflow: hidden; margin-top: 6px; }
.pv-leadbar .seg { height: 100%; display: block; }
.pv-leadbar .seg.prod { background: var(--accent); }
.pv-leadbar .seg.fr { background: var(--accent-2); opacity: .6; }

.pv-breaks { display: flex; gap: 10px; flex-wrap: wrap; }
.pv-brk { flex: 1 1 108px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px; text-align: center; }
.pv-brk.cur { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: linear-gradient(180deg, #1d2a3a, var(--panel)); }
.pv-brk-q { font-size: 15px; font-weight: 800; }
.pv-brk-q .u { display: block; font-size: 9.5px; color: var(--muted); font-weight: 500; text-transform: uppercase; }
.pv-brk-pu { font-size: 18px; font-weight: 800; color: var(--accent); margin-top: 7px; }
.pv-brk-pu .u { font-size: 10px; color: var(--muted); font-weight: 500; }
.pv-brk-sav { font-size: 11px; font-weight: 700; color: var(--good); margin-top: 5px; }
.pv-brk-sav.base { color: var(--muted); }
.pv-brk-tot { font-size: 11px; color: var(--label); margin-top: 3px; }

/* live multi-vendor fan-out (cc2 flex pricing) */
.pv-vendors-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.pv-vendors { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.pv-vendors th, .pv-vendors td { padding: 9px 12px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--line); }
.pv-vendors thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; background: #1b2636; position: sticky; top: 0; }
.pv-vendors tbody th { text-align: left; font-weight: 800; }
.pv-vendors tbody th .u { font-size: 9.5px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.pv-vendors td .pu { font-weight: 800; }
.pv-vendors td .tot { display: block; font-size: 10.5px; color: var(--muted); font-weight: 500; }
.pv-vendors td.best { background: rgba(81,207,102,.12); }
.pv-vendors td.best .pu { color: var(--good); }
.pv-vendors td.na { color: var(--muted); }
.pv-vendors td.lead { color: var(--label); font-weight: 600; }
.pv-vendors tbody tr:last-child th, .pv-vendors tbody tr:last-child td { border-bottom: 0; }
.pv-vendor-legend { font-size: 11px; color: var(--muted); margin-top: -2px; }

.pv-leads { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.pv-leadrow { display: grid; grid-template-columns: 132px 1fr 210px; gap: 14px; align-items: center; padding: 6px 0; }
.pv-leadrow.sel .pv-leadrow-m { color: var(--accent); }
.pv-leadrow-m { font-size: 12.5px; font-weight: 600; }
.pv-leadrow-d { font-size: 11.5px; color: var(--label); text-align: right; }
.pv-leadrow-d .fr { color: var(--muted); }
.pv-leadrow .pv-leadbar { margin: 0; height: 9px; }
.pv-lead-legend { font-size: 11px; color: var(--muted); margin-top: 11px; display: flex; align-items: center; gap: 6px; }
.pv-lead-legend .seg { width: 14px; height: 8px; border-radius: 3px; display: inline-block; }
.pv-lead-legend .seg.prod { background: var(--accent); }
.pv-lead-legend .seg.fr { background: var(--accent-2); opacity: .6; }

.pv-foot { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.pv-foot .pv-assume { flex-basis: 100%; line-height: 1.5; }

/* ---- Price tab: clickable breaks + Next steps / order ---- */
.pv-brk { cursor: pointer; font: inherit; color: inherit; }
.pv-brk:hover { border-color: #3a4a66; transform: translateY(-1px); }
.pv-order { display: flex; gap: 18px; flex-wrap: wrap; background: linear-gradient(135deg, #1c2738, #1a2230); border: 1px solid #314058; border-radius: 14px; padding: 20px 24px; }
.pv-order-recap { flex: 1 1 320px; }
.pv-order-h { font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.pv-order-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px 18px; margin-top: 12px; }
.pv-order-grid .k { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.pv-order-grid .v { font-size: 14px; font-weight: 700; }
.pv-order-grid .v.big { font-size: 21px; }
.pv-order-grid .v .fr { font-size: 11px; color: var(--muted); font-weight: 500; }
.pv-order-action { flex: 0 0 290px; display: flex; flex-direction: column; gap: 14px; border-left: 1px solid var(--line); padding-left: 22px; }
.pv-steps { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; flex-wrap: wrap; }
.pv-step { color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.pv-step .dot { width: 8px; height: 8px; border-radius: 50%; background: #33425a; display: inline-block; }
.pv-step.done { color: var(--good); } .pv-step.done .dot { background: var(--good); }
.pv-step.cur { color: var(--accent); } .pv-step.cur .dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(77,171,247,.2); }
.pv-step .arr { color: #3a4a66; }
.pv-order-cta { display: flex; flex-direction: column; gap: 7px; }
.btn.block { width: 100%; text-align: center; padding: 10px; font-size: 13px; }
.pv-cta-sub { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.pv-cta-sub b { color: var(--text); }
.pv-order-ok { font-size: 14px; color: var(--good); font-weight: 800; }
.pv-order-err { font-size: 11.5px; color: var(--err); }

/* Price tab: progressive-disclosure toggle for breaks + lead detail */
.pv-disclose { align-self: flex-start; background: none; border: 1px solid var(--line); color: var(--label); border-radius: 8px; padding: 8px 13px; font-size: 12px; font-weight: 600; cursor: pointer; transition: border-color .12s, color .12s; }
.pv-disclose:hover { border-color: #3a4a66; color: var(--text); }

/* =================================================================== */
/* Proof mode — file & proofing (left rail) + approval (right rail)     */
/* =================================================================== */
.prcard { border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; background: var(--panel-2); overflow: hidden; }
.prcard > .prhead {
  padding: 8px 11px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px;
}
.prcard > .prhead .prh-r { margin-left: auto; font-weight: 600; text-transform: none; letter-spacing: 0; }
.prcard > .prbody { padding: 2px 11px 11px; font-size: 12px; }
.pr-empty { font-size: 12px; color: var(--muted); line-height: 1.5; padding: 4px 0; }

/* key/value file facts */
.pr-kv { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.pr-kv:last-child { border-bottom: 0; }
.pr-kv .k { color: var(--muted); flex: 0 0 auto; }
.pr-kv .v { font-weight: 600; text-align: right; word-break: break-word; }
.pr-chips2 { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.pr-chip2 {
  font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--panel); color: var(--label); border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: 5px;
}
.pr-ink { width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); flex: 0 0 auto; }
.pr-warn { font-size: 11.5px; color: var(--warn); margin-top: 6px; }

/* proofing controls */
.pr-ctl { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12px; }
.pr-ctl input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); }
.pr-ctl label { cursor: pointer; }
.pr-btnrow { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* panel review checklist */
.pr-check {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; margin-top: 6px; cursor: pointer; color: var(--text);
  font-size: 12px; transition: border-color .12s, background .12s;
}
.pr-check:hover { border-color: #3a4a66; background: #283349; }
.pr-check .box {
  width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid #8a98ac;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  font-size: 11px; color: #fff;
}
.pr-check.done { border-color: #2f7d4f; background: rgba(34,197,94,.10); }
.pr-check.done .box { background: #16a34a; border-color: #16a34a; }
.pr-check .lbl { font-weight: 600; }
.pr-check .sub { color: var(--muted); margin-left: auto; font-weight: 600; font-size: 11px; }
.pr-progress { font-size: 11.5px; color: var(--muted); margin-top: 8px; }

/* approval status banner + gates */
.pr-status {
  border-radius: 9px; padding: 11px 12px; margin-bottom: 10px; border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 3px;
}
.pr-status .st-lbl { font-size: 13px; font-weight: 800; letter-spacing: .2px; }
.pr-status .st-sub { font-size: 11px; color: var(--muted); }
.pr-status.pending  { background: rgba(151,117,250,.10); border-color: rgba(151,117,250,.40); }
.pr-status.pending .st-lbl { color: var(--accent-2); }
.pr-status.changes  { background: rgba(217,119,6,.12); border-color: rgba(217,119,6,.45); }
.pr-status.changes .st-lbl { color: #f59e0b; }
.pr-status.approved { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.45); }
.pr-status.approved .st-lbl { color: #4ade80; }

.pr-gate { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 4px 0; }
.pr-gate .g-ico { flex: 0 0 auto; width: 16px; text-align: center; font-weight: 700; }
.pr-gate.ok .g-ico { color: #4ade80; }
.pr-gate.no .g-ico { color: var(--muted); }
.pr-gate.bad .g-ico { color: var(--err); }
.pr-gate .g-txt { color: var(--label); }

.pr-field { margin-top: 9px; }
.pr-field > label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .3px; }
.pr-field input[type="text"], .pr-field textarea {
  width: 100%; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 7px; padding: 7px 9px; font-size: 12px; font-family: inherit; box-sizing: border-box;
}
.pr-field textarea { resize: vertical; min-height: 54px; }
.pr-actions { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.pr-actions .btn { width: 100%; justify-content: center; display: inline-flex; }
.btn.approve { background: #15803d; border-color: #1c9e4e; color: #fff; }
.btn.approve:hover:not(:disabled) { background: #1c9e4e; }
.btn.approve:disabled { opacity: .45; cursor: not-allowed; }
.btn.changes { background: #b45309; border-color: #d97706; color: #fff; }
.btn.changes:hover { background: #d97706; }

.pr-signoff { margin-top: 10px; padding: 10px; border-radius: 8px; background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.35); font-size: 12px; }
.pr-signoff b { color: #4ade80; }
.pr-log { margin-top: 10px; }
.pr-log .lg { display: flex; gap: 8px; font-size: 11px; color: var(--muted); padding: 3px 0; border-top: 1px solid var(--line); }
.pr-log .lg .t { flex: 0 0 auto; color: var(--label); font-variant-numeric: tabular-nums; }

/* =================================================================== */
/* Multi-document Files filmstrip (top of stage)                        */
/* =================================================================== */
#filmstrip { background: var(--panel); border-bottom: 1px solid var(--line); padding: 7px 14px 6px; flex: 0 0 auto; }
#filmstrip .fs-row { display: flex; gap: 8px; align-items: center; overflow-x: auto; }
#filmstrip .fs-row::-webkit-scrollbar { height: 7px; }
#filmstrip .fs-row::-webkit-scrollbar-thumb { background: #303c52; border-radius: 5px; }
.fs-tile { flex: 0 0 auto; width: 58px; background: none; border: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.fs-thumb { position: relative; width: 50px; height: 60px; border-radius: 6px; border: 2px solid var(--line); overflow: hidden; background: var(--panel-2); display: flex; align-items: center; justify-content: center; }
.fs-tile.active .fs-thumb { border-color: var(--accent); }
.fs-tile:hover .fs-thumb { border-color: #3a4a66; }
.fs-tile.active:hover .fs-thumb { border-color: var(--accent); }
.fs-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fs-ph { color: var(--muted); font-size: 18px; }
.fs-badge { position: absolute; top: 2px; right: 2px; min-width: 14px; height: 14px; border-radius: 999px; font-size: 10px; line-height: 14px; text-align: center; color: #fff; padding: 0 2px; }
.fs-badge.ok { background: #16a34a; } .fs-badge.chg { background: #d97706; } .fs-badge.err { background: #dc2626; }
.fs-badge.pend { background: #5b6677; } .fs-badge.proc { background: var(--accent); }
.fs-badge .spin { display: inline-block; animation: fsspin 1s linear infinite; }
@keyframes fsspin { to { transform: rotate(360deg); } }
.fs-name { font-size: 10px; color: var(--label); max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-tile.active .fs-name { color: var(--text); font-weight: 600; }
.fs-add { flex: 0 0 auto; align-self: center; background: var(--panel-2); border: 1px dashed var(--line); color: var(--muted); border-radius: 6px; height: 60px; padding: 0 11px; cursor: pointer; font-size: 12px; white-space: nowrap; }
.fs-add:hover { border-color: var(--accent); color: var(--text); }
.fs-sum { font-size: 11px; color: var(--muted); margin-top: 5px; display: block; }

/* ============================================================ *
 * LEAD LANDING — artwork-upload front door (#landing)          *
 * ============================================================ */
header h1#logoHome { cursor: pointer; user-select: none; transition: opacity .15s; }
header h1#logoHome:hover { opacity: .82; }
header h1#logoHome:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

#landing {
  position: fixed; inset: 0; z-index: 1000; overflow: auto;
  background: radial-gradient(1200px 720px at 50% -12%, #1c2740 0%, var(--bg) 58%);
  display: flex; align-items: center; justify-content: center;
  opacity: 1; transition: opacity .35s ease, visibility .35s;
}
#landing.hide { opacity: 0; visibility: hidden; pointer-events: none; }
/* film grain — kills gradient banding, reads premium (very low opacity) */
#landing::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

.ld-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ld-blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; animation: ldfloat 26s ease-in-out infinite; will-change: transform; }
.ld-blob.b1 { width: 560px; height: 560px; left: -120px; top: -160px; background: radial-gradient(circle, #4dabf7, transparent 70%); }
.ld-blob.b2 { width: 620px; height: 620px; right: -180px; top: -80px; background: radial-gradient(circle, #9775fa, transparent 70%); animation-delay: -9s; }
.ld-blob.b3 { width: 520px; height: 520px; left: 40%; bottom: -240px; background: radial-gradient(circle, #22d3ee, transparent 70%); opacity: .35; animation-delay: -16s; }
@keyframes ldfloat { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,30px) scale(1.08); } }

/* margin:auto (not just the parent's align-items:center) so a too-tall wrap on
 * short/mobile screens stays fully scrollable — flex centering alone clips the top. */
.ld-wrap { position: relative; width: 100%; max-width: 760px; margin: auto; padding: 52px 28px 44px; text-align: center; }
/* entrance: children fade-up, staggered, ending on the dropzone */
.ld-wrap > * { animation: ldrise .5s cubic-bezier(.22,1,.36,1) both; }
.ld-wrap > *:nth-child(1){animation-delay:.04s} .ld-wrap > *:nth-child(2){animation-delay:.10s}
.ld-wrap > *:nth-child(3){animation-delay:.16s} .ld-wrap > *:nth-child(4){animation-delay:.22s}
.ld-wrap > *:nth-child(5){animation-delay:.28s} .ld-wrap > *:nth-child(6){animation-delay:.34s}
.ld-wrap > *:nth-child(7){animation-delay:.40s} .ld-wrap > *:nth-child(8){animation-delay:.46s}
@keyframes ldrise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.ld-brand { font-size: 12px; font-weight: 800; letter-spacing: 3px; color: var(--label); display: inline-flex; align-items: center; gap: 8px; }
.ld-brand span { color: var(--accent); }
.ld-brand em { font-style: normal; font-weight: 600; letter-spacing: .5px; color: var(--muted); border-left: 1px solid var(--line); padding-left: 8px; }

.ld-head { font-size: clamp(30px, 5vw, 50px); line-height: 1.08; font-weight: 800; letter-spacing: -.5px; margin: 20px 0 0; color: var(--text); }
.ld-grad { background: linear-gradient(92deg, var(--accent), var(--accent-2) 50%, #22d3ee, var(--accent)); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: ldsheen 9s linear infinite; }
@keyframes ldsheen { to { background-position: 250% 0; } }
.ld-sub { font-size: clamp(14px, 1.7vw, 16px); line-height: 1.6; color: var(--muted); max-width: 600px; margin: 14px auto 0; }
.ld-sub b { color: var(--label); font-weight: 700; }

/* payoff preview: flat proof → 3D mockup + live quote */
.ld-preview { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 24px auto 0; }
.ld-pv-file { width: 88px; height: 110px; border-radius: 9px; background: rgba(14,20,36,.7); border: 1px solid #25304a; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #6b7c99; }
.ld-pv-file span { font-size: 10px; }
.ld-pv-arrow { position: relative; color: #4a5878; display: inline-flex; align-items: center; }
.ld-pv-arrow i { position: absolute; left: 2px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--accent); animation: ldflow 1.5s ease-in-out infinite; }
@keyframes ldflow { 0% { transform: translateX(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateX(16px); opacity: 0; } }
.ld-pv-3d { position: relative; width: 150px; height: 110px; border-radius: 11px; overflow: hidden; color: #6c8cc4;
  border: 1px solid #2a3550; background: linear-gradient(160deg, #18203a, #0e1426); display: flex; align-items: center; justify-content: center; }
.ld-pv-shine { position: absolute; top: -60%; left: -30%; width: 40%; height: 220%; transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(120,170,255,.16), transparent); animation: ldshine 4.5s ease-in-out infinite; }
@keyframes ldshine { 0%,100% { left: -40%; } 55%,100% { left: 130%; } }
.ld-pv-pill { position: absolute; bottom: -1px; left: 0; right: 0; font-size: 11px; font-weight: 700; color: #08160f; background: linear-gradient(90deg,#2bd4a0,#27c08f);
  padding: 4px 8px; display: flex; align-items: baseline; justify-content: center; gap: 3px; font-variant-numeric: tabular-nums; }
.ld-pv-pill i { font-style: normal; font-weight: 600; opacity: .8; font-size: 10px; }
.ld-pv-cap { font-size: 11.5px; color: var(--muted); margin-top: 12px; }
.ld-pv-cap b { color: var(--label); font-weight: 700; }

.ld-drop { position: relative; margin: 24px auto 0; max-width: 600px; padding: 26px 24px 22px; cursor: pointer;
  border: 2px dashed #3a4761; border-radius: 18px; background: rgba(26,33,44,.55);
  backdrop-filter: blur(6px); transition: border-color .18s, box-shadow .18s, background .18s, transform .14s; }
.ld-drop:hover { border-color: var(--accent); background: rgba(26,33,44,.8); }
.ld-drop:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(77,171,247,.18); }
.ld-drop.drag { border-color: var(--accent); border-style: solid; background: rgba(77,171,247,.12); box-shadow: 0 0 0 6px rgba(77,171,247,.16), 0 18px 60px -20px rgba(77,171,247,.55); transform: scale(1.02); }
.ld-drop-ring { width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 34px -8px rgba(77,171,247,.7); animation: ldbreathe 2.6s ease-in-out infinite; will-change: transform; }
@keyframes ldbreathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.ld-drop-icon { font-size: 28px; font-weight: 800; color: #07101e; line-height: 1; }
.ld-drop.drag .ld-drop-ring { animation: ldpulse 1s ease-in-out infinite; }
@keyframes ldpulse { 0%,100% { transform: translateY(0) scale(1.04); } 50% { transform: translateY(-5px) scale(1.04); } }
.ld-drop-h { font-size: 17px; font-weight: 800; color: var(--text); }
.ld-drop-h b { color: var(--accent); }
.ld-drop-sub { font-size: 13px; color: var(--muted); margin-top: 5px; }
.ld-browse { background: none; border: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; padding: 0; }
.ld-droperr { margin-top: 12px; font-size: 12.5px; font-weight: 700; color: var(--err); }

/* try-a-sample chips */
.ld-try { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.ld-try-k { font-size: 11.5px; color: var(--muted); }
.ld-samp { font-size: 12.5px; font-weight: 700; color: #bcd4f5; background: rgba(19,32,58,.85); border: 1px solid #284268; border-radius: 9px; padding: 6px 13px; cursor: pointer; transition: transform .14s, border-color .14s, background .14s, color .14s; }
.ld-samp:hover { transform: translateY(-2px); border-color: var(--accent); color: #fff; background: rgba(77,171,247,.16); }
.ld-samp:active { transform: translateY(0) scale(.97); }
.ld-samp:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(77,171,247,.3); }

.ld-trust { margin: 26px auto 0; }
.ld-trust-k { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: #56657f; }
.ld-reassure { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 14px auto 0; }
.ld-reassure span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.ld-reassure svg { color: var(--good); }

.ld-skip { display: block; margin: 24px auto 0; background: none; border: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; transition: color .15s; }
.ld-skip:hover { color: var(--accent); }

/* whole-page drag state: dim everything but the dropzone so the target pops */
#landing.dragging .ld-wrap > *:not(.ld-drop) { opacity: .35; filter: blur(1px); transition: opacity .2s, filter .2s; }

/* build-progress overlay (shown while a dropped/sample file is processed) */
.ld-build { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(8,12,22,.72); backdrop-filter: blur(4px); }
.ld-build[hidden] { display: none; }
.ld-build-card { width: 300px; max-width: 84vw; text-align: left; background: rgba(18,24,40,.96); border: 1px solid #283450; border-radius: 16px; padding: 22px 24px; box-shadow: 0 30px 80px -30px #000; }
.ld-build-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(77,171,247,.22); border-top-color: var(--accent); margin: 0 auto 14px; animation: ldspin .8s linear infinite; }
@keyframes ldspin { to { transform: rotate(360deg); } }
.ld-build-name { font-size: 13px; font-weight: 700; color: var(--text); text-align: center; margin-bottom: 14px; word-break: break-word; }
.ld-build-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.ld-build-steps li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); transition: color .2s; }
.ld-build-steps li i { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 1.5px solid #36425e; position: relative; transition: border-color .2s, background .2s; }
.ld-build-steps li.active { color: var(--text); }
.ld-build-steps li.active i { border-color: var(--accent); }
.ld-build-steps li.done { color: var(--text); }
.ld-build-steps li.done i { background: var(--good); border-color: var(--good); }
.ld-build-steps li.done i::after { content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid #08160f; border-width: 0 2px 2px 0; transform: rotate(45deg); }

@media (max-width: 560px) {
  .ld-preview { gap: 10px; }
  .ld-pv-file { width: 70px; height: 88px; } .ld-pv-3d { width: 120px; height: 88px; }
  .ld-reassure { gap: 12px; }
}
/* honour reduced-motion: keep state changes, drop ambient/idle/entrance motion */
@media (prefers-reduced-motion: reduce) {
  .ld-blob, .ld-grad, .ld-pv-shine, .ld-pv-arrow i, .ld-drop-ring, .ld-wrap > *, .ld-build-spin { animation: none !important; }
  .ld-wrap > * { opacity: 1; transform: none; }
}

/* =========================================================================
 * Training cockpit (the #trainView pane) — diagnosis-right / action-left.
 * Semantic working palette: truth=green machine=amber die=magenta dim=cyan.
 * ========================================================================= */
#trainView { flex: 1 1 auto; min-height: 0; overflow: hidden; background: var(--bg); }
/* the cockpit owns the full stage — its own queue (left) + matrix (right) replace the app rails */
body.train-active #sidebar, body.train-active #matpanel { display: none !important; }
#tc { display: flex; flex-direction: column; height: 100%; min-height: 0; --truth:#3ad6a0; --machine:#f3b13f; --die:#e64aa0; --dim:#3fb6f5; --reject:#f15b6c; }
.tc-empty { padding: 28px; color: var(--muted); font-size: 13px; }
/* header */
#tc-head { display: grid; grid-template-columns: 1.3fr 1.7fr 1.2fr .8fr; border-bottom: 1px solid var(--line); background: var(--panel); flex: 0 0 auto; }
.tc-hcell { padding: 9px 15px; border-right: 1px solid var(--line); min-width: 0; }
.tc-hcell:last-child { border-right: 0; }
.tc-hlabel { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.tc-mut { color: var(--muted); font-weight: 400; }
.tc-hrow { display: flex; gap: 14px; }
.tc-stat { display: flex; flex-direction: column; font-size: 10px; color: var(--muted); line-height: 1.1; }
.tc-stat b { font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tc-stat.pos b { color: var(--truth); } .tc-stat.neg b { color: var(--machine); } .tc-stat.rej b { color: var(--reject); }
.tc-sinks { display: flex; gap: 6px; flex-wrap: wrap; }
.tc-sink { font-size: 10.5px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; color: var(--label); }
.tc-sink i { font-style: normal; color: var(--truth); font-variant-numeric: tabular-nums; }
.tc-slow { font-size: 9px; color: var(--muted); margin-top: 5px; }
.tc-spark { display: flex; align-items: flex-end; gap: 2px; height: 28px; }
.tc-spark span { width: 5px; background: linear-gradient(180deg, var(--truth), #1c7a55); border-radius: 1px; }
.tc-spark-empty { font-size: 10px; color: var(--muted); }
.tc-actions { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.tc-btn, .tc-savebtn { background: var(--accent); color: #08121d; border: 0; font-weight: 700; border-radius: 7px; padding: 7px 12px; font-size: 12px; cursor: pointer; }
.tc-savebtn { width: 100%; background: var(--truth); }
.tc-btn:focus-visible, .tc-savebtn:focus-visible, .tc-qrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* body 3-pane */
#tc-body { display: grid; grid-template-columns: 300px 1fr 340px; flex: 1 1 auto; min-height: 0; }
#tc-left { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
#tc-queue { display: flex; flex-direction: column; min-height: 0; flex: 1 1 38%; }
#tc-ledger { border-top: 2px solid var(--line); display: flex; flex-direction: column; min-height: 0; flex: 1 1 62%; background: var(--panel-2); }
#tc-stage { display: flex; flex-direction: column; min-width: 0; background: linear-gradient(#0c1320, #0a111b); }
#tc-matrix { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--panel-2); }
.tc-panehd { padding: 8px 13px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; background: var(--panel); flex: 0 0 auto; }
.tc-ttl { font-size: 10px; letter-spacing: .11em; text-transform: uppercase; color: var(--label); font-weight: 700; }
.tc-meta { margin-left: auto; font-size: 9.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
/* queue */
.tc-formats { padding: 8px 11px; display: flex; flex-wrap: nowrap; gap: 5px; border-bottom: 1px solid var(--line); overflow-x: auto; flex: 0 0 auto; }
.tc-fmt { white-space: nowrap; flex: 0 0 auto; }
.tc-fmt { font-size: 10px; border: 1px solid var(--line); border-radius: 13px; padding: 3px 8px; color: var(--muted); cursor: pointer; }
.tc-fmt:hover { color: var(--text); border-color: var(--accent); }
.tc-fmt.tc-add { border-style: dashed; color: var(--accent); }
.tc-qlist { overflow: auto; flex: 1 1 auto; }
.tc-qrow { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.tc-qrow:hover { background: var(--panel-2); }
.tc-qrow.on { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--truth); }
.tc-pip { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tc-qmeta { flex: 1; min-width: 0; }
.tc-fn { font-size: 11px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-qsub { font-size: 9.5px; color: var(--muted); }
.tc-ubar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 4px; overflow: hidden; }
.tc-ubar i { display: block; height: 100%; background: linear-gradient(90deg, var(--good), var(--machine) 65%, var(--reject)); }
/* ledger */
.tc-famcard { padding: 10px 13px; border-bottom: 1px solid var(--line); }
.tc-famtop { display: flex; align-items: center; gap: 8px; }
.tc-fambadge { font-size: 11px; font-weight: 800; color: #08121d; background: var(--truth); padding: 2px 8px; border-radius: 5px; }
.tc-why { font-size: 10px; color: var(--muted); margin-top: 6px; font-style: italic; }
.tc-reclass { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; }
.tc-rc { font-size: 9.5px; border: 1px solid var(--line); border-radius: 11px; padding: 2px 8px; color: var(--label); cursor: pointer; }
.tc-rc:hover { border-color: var(--accent); color: var(--text); }
.tc-lrows { overflow: auto; flex: 1 1 auto; }
.tc-lrow { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 7px 13px; border-bottom: 1px solid var(--line); align-items: center; }
.tc-lrow.disp { background: rgba(243,177,63,.08); }
.tc-lrow.focus { box-shadow: inset 3px 0 0 var(--accent); }
.tc-lrow.done-ok { opacity: .62; } .tc-lrow.done-rej { box-shadow: inset 3px 0 0 var(--reject); } .tc-lrow.done-fix { box-shadow: inset 3px 0 0 var(--dim); }
.tc-k { font-size: 11px; color: var(--label); }
.tc-vals { font-size: 10px; margin-top: 2px; }
.tc-gv { color: #5eead4; } .tc-vv { color: var(--machine); } .tc-tv { color: var(--truth); font-weight: 600; } .tc-author { color: #a98bff; }
.tc-acts { display: flex; gap: 4px; }
.tc-ab { width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); cursor: pointer; }
.tc-ab.c:hover { color: var(--truth); border-color: var(--truth); } .tc-ab.e:hover { color: var(--dim); border-color: var(--dim); } .tc-ab.r:hover { color: var(--reject); border-color: var(--reject); }
.tc-matgroup { border-top: 1px solid var(--line); } .tc-grouphd { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 7px 13px 3px; }
.tc-savebar { padding: 10px 13px; border-top: 1px solid var(--line); background: var(--panel); flex: 0 0 auto; }
.tc-impact { font-size: 9.5px; color: var(--muted); margin-top: 7px; line-height: 1.5; }
.tc-impact i { font-style: normal; color: var(--truth); }
/* stage */
#tc-stagewrap { flex: 1 1 auto; position: relative; display: flex; align-items: center; justify-content: center; padding: 14px; min-height: 0; }
.tc-svg { max-width: 100%; max-height: 100%; }
.tc-toggle { position: absolute; top: 10px; left: 12px; display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; font-size: 10px; }
.tc-toggle b { padding: 4px 9px; color: var(--muted); } .tc-toggle b.t.on { background: var(--truth); color: #08121d; } .tc-toggle b.mc.on { background: var(--machine); color: #08121d; }
.tc-noart { display: flex; gap: 14px; align-items: center; max-width: 420px; color: var(--text); }
.tc-noart-i { font-size: 40px; color: var(--die); }
#tc-hud { border-top: 1px solid var(--line); background: var(--panel); padding: 7px 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 0 0 auto; }
.tc-key { font-size: 9.5px; color: var(--label); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; } .tc-key b { color: var(--text); }
.tc-prog { margin-left: auto; font-size: 9.5px; color: var(--muted); }
/* matrix */
.tc-matgrid { overflow: auto; flex: 1 1 auto; }
table.tc-mat { width: 100%; border-collapse: collapse; font-size: 10px; }
table.tc-mat th { position: sticky; top: 0; background: var(--panel); color: var(--muted); text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: 9px; letter-spacing: .04em; }
table.tc-mat th .tc-hue { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }
table.tc-mat td { padding: 6px 8px; border-bottom: 1px solid var(--line); color: var(--label); white-space: nowrap; }
table.tc-mat tr.disp td { background: rgba(243,177,63,.08); } table.tc-mat tr.disp .tc-field { color: var(--machine); }
.tc-field { color: var(--text); font-weight: 600; }
.tc-mb { display: inline-block; height: 3px; width: 26px; border-radius: 2px; background: var(--line); overflow: hidden; vertical-align: middle; margin-left: 5px; }
.tc-mb i { display: block; height: 100%; background: #5eead4; }
.tc-stab { font-size: 9px; } .tc-stab.hi { color: var(--truth); } .tc-stab.lo { color: var(--reject); } .tc-stab.sg { color: var(--muted); }
.tc-matnote { padding: 8px 12px; border-top: 1px solid var(--line); font-size: 9px; color: var(--muted); line-height: 1.5; }
@media (max-width: 980px) { #tc-body { grid-template-columns: 1fr; } #tc-head { grid-template-columns: 1fr 1fr; } }
