/* ---------------------------------------------------------------------------
   workshop-tools.css
   Shared styles for the three workshop tools that use the workshop profile:
     3d-print-quote-calculator · cut-list-optimizer · insert-hole-size-calculator
   Loaded after calculator.css, so it may extend (never fight) its classes.
   Everything here is mobile-first: one column by default, two from 640px up.
   Colours come from the design tokens of base.css so the tools follow the
   theme without hardcoded hex values.
--------------------------------------------------------------------------- */

/* ---------- profile panel (shared/workshop-profile-ui.js) ---------- */

.ws-profile{display:block;}
.ws-profile-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:14px;
}
.ws-profile-actions .btn-primary,
.ws-profile-actions .btn-secondary{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:14px;
  padding:10px 16px;
}
.ws-file-btn{
  cursor:pointer;
  position:relative;
}
.ws-visually-hidden{
  position:absolute !important;
  left:0;
  top:0;
  width:1px !important;
  max-width:1px;
  height:1px !important;
  padding:0 !important;
  margin:0 !important;
  overflow:hidden;
  clip:rect(0 0 0 0);
  clip-path:inset(50%);
  white-space:nowrap;
  border:0;
}
.ws-save-message{
  font-family:'IBM Plex Mono', monospace;
  font-size:12.5px;
  color:var(--teal-dark);
  background:var(--line-soft);
  border-radius:8px;
  padding:9px 12px;
  margin:0 0 14px;
}
.ws-panel{
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--canvas);
  margin-bottom:12px;
  overflow:hidden;
}
.ws-panel > summary{
  cursor:pointer;
  padding:13px 16px;
  font-family:'Barlow Condensed', sans-serif;
  font-weight:700;
  font-size:17px;
  text-transform:uppercase;
  letter-spacing:.01em;
  color:var(--ink);
  background:var(--card);
  border-bottom:1px solid transparent;
}
.ws-panel[open] > summary{border-bottom-color:var(--line);}
.ws-panel-body{padding:18px 16px;}
.ws-details{
  border:1px dashed var(--line);
  border-radius:var(--radius);
  padding:12px 14px;
  margin:16px 0 0;
}
.ws-details > summary{
  cursor:pointer;
  font-family:'IBM Plex Mono', monospace;
  font-size:12px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:var(--ink-soft);
}
.ws-details > summary:hover{color:var(--ink);}
.ws-details[open] > summary{margin-bottom:0;}
/* "How it's calculated" body — previously unstyled (browser-default h3/ul),
   so the formulas looked broken vs. the article below. Match the .cp-content
   rhythm: Barlow h3, soft-ink list, clear separation when open. */
.ws-howto-body{
  margin-top:12px;
  padding-top:14px;
  border-top:1px solid var(--line);
}
.ws-howto-body h3{
  font-family:'Barlow Condensed', sans-serif;
  font-weight:700;
  font-size:18px;
  text-transform:uppercase;
  letter-spacing:.01em;
  color:var(--ink);
  margin:18px 0 8px;
}
.ws-howto-body h3:first-child{margin-top:0;}
.ws-howto-body ul{
  margin:0 0 16px;
  padding-left:22px;
  color:var(--ink-soft);
  font-size:14.5px;
  line-height:1.65;
}
.ws-howto-body ul:last-child{margin-bottom:2px;}
.ws-howto-body li{margin-bottom:6px;}
.ws-howto-body li::marker{color:var(--ink-soft);}

.ws-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
  margin-bottom:14px;
}
.ws-grid-1{grid-template-columns:1fr;}
.ws-grid-2{grid-template-columns:1fr;}
@media (min-width:560px){
  .ws-grid{grid-template-columns:1fr 1fr;}
  .ws-grid-3{grid-template-columns:repeat(3, minmax(0, 1fr));}
}
@media (min-width:900px){
  .ws-grid-2{grid-template-columns:1fr 1fr;}
}
/* span 2 (not 1/-1): in 3-col grids the lone last field pairs up with the
   slider group instead of leaving an orphan row; identical result in 2-col
   grids, and it clamps to one column on mobile. */
.ws-span-2{grid-column:span 2 / span 2;}
.ws-hint{
  font-size:13px;
  line-height:1.55;
  color:var(--ink-soft);
  margin:0 0 12px;
  max-width:76ch;
}
.ws-profile .input-group textarea,
.ws-profile .ws-import-box{
  width:100%;
  font-family:'Work Sans', sans-serif;
  font-size:14px;
  color:var(--ink);
  background:var(--canvas);
  border:1.5px solid var(--line);
  border-radius:8px;
  padding:10px 12px;
  outline:none;
  resize:vertical;
}
.ws-profile .input-group textarea:focus{border-color:var(--teal); background:#fff;}
/* Quote settings polish (option: UI textarea + gap). Template textareas carry
   multi-line defaults, so give them a readable height and a stable rhythm:
   single-column grids collapse the trailing gap, and the inner details keeps
   its own breathing room. Scoped to .ws-profile/.ws-grid-1 so the quote tool
   form and other grids are untouched. */
.ws-profile .ws-grid-1{margin-bottom:0;}
.ws-profile .ws-grid-1 > .input-group{margin-bottom:14px;}
.ws-profile .ws-grid-1 > .input-group:last-child{margin-bottom:0;}
.ws-profile .input-group textarea[rows="2"]{min-height:88px; line-height:1.55;}
.ws-profile .ws-details{margin-top:14px;}

.ws-logo{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:12px;
  margin-bottom:6px;
}
.ws-logo-preview{
  max-height:52px;
  max-width:180px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
  padding:4px;
}
.ws-logo-empty{
  font-family:'IBM Plex Mono', monospace;
  font-size:12px;
  color:var(--ink-soft);
  border:1px dashed var(--line);
  border-radius:6px;
  padding:14px 18px;
}
.ws-logo .ws-hint{flex:1 1 100%; margin:0;}

.ws-table-wrap{overflow-x:auto; margin:0 0 16px;}
.ws-table{
  border-collapse:collapse;
  width:100%;
  min-width:520px;
  font-size:14px;
}
.ws-table th,
.ws-table td{
  border:1px solid var(--line);
  padding:7px 8px;
  text-align:left;
  vertical-align:middle;
  color:var(--ink-soft);
}
.ws-table thead th{
  background:var(--line-soft);
  color:var(--ink);
  font-family:'IBM Plex Mono', monospace;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.05em;
}
.ws-table input,
.ws-table select{
  width:100%;
  font-family:'Work Sans', sans-serif;
  font-size:14px;
  color:var(--ink);
  background:var(--card);
  border:1.5px solid var(--line);
  border-radius:6px;
  padding:7px 8px;
}
.ws-table input:focus,.ws-table select:focus{border-color:var(--teal); background:#fff;}
.ws-table tbody tr:hover{background:var(--line-soft);}
/* Add-on / labor tables start empty (JS fills them on "Add ..."). Hide the
   empty shell with CSS too so there is no one-frame flash of bare <thead> on
   first paint before app.js sets wrap.hidden. When a row is added the tbody
   is no longer :empty and the table shows automatically — complements the JS
   (which keeps setting .hidden) instead of fighting it. Scoped to :has() so
   tables that always have rows (material library, batch, slicer compare) are
   untouched. */
.ws-table-wrap:has(> .ws-table > tbody:empty){display:none;}
/* Empty-state rhythm for section 3: hint above each Add button breathes, and
   each Add button keeps its distance from the next block. IDs are unique to
   the quote tool, so nothing else on the site is affected. */
#addons-empty,
#labor-empty{margin:10px 0 10px;}
#addon-add,
#labor-add{margin-bottom:20px;}
#labor-add:last-child{margin-bottom:0;}
.ws-icon-btn{
  font-family:'Work Sans', sans-serif;
  font-size:13px;
  line-height:1;
  cursor:pointer;
  border:1px solid var(--line);
  background:var(--card);
  color:var(--ink-soft);
  border-radius:6px;
  padding:6px 9px;
}
.ws-icon-btn:hover{border-color:var(--ochre); color:var(--ochre-dark);}

.ws-jobs{list-style:none; margin:14px 0 0; padding:0;}
.ws-job{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  padding:9px 0;
  border-top:1px solid var(--line-soft);
  font-size:14px;
}
.ws-job-name{font-weight:600; color:var(--ink); flex:1 1 140px;}
.ws-job-meta{
  font-family:'IBM Plex Mono', monospace;
  font-size:11.5px;
  color:var(--ink-soft);
}
.ws-job-actions{display:flex; gap:6px; flex-wrap:wrap;}
.ws-job-actions .btn-secondary{font-size:12px; padding:6px 10px;}
/* Slicer-override actions: two secondary buttons must share one row with a
   gap (they were bare siblings, so the second wrapped with no spacing).
   Scoped to #slicer-details — nothing else gains this row. */
#slicer-details .ws-actions-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:4px 0 8px;
}
#slicer-details .ws-actions-row .btn-secondary{
  font-size:14px;
  padding:10px 16px;
}
#slicer-status,
#slicer-compare{margin:8px 0 0;}
/* Calibration + Saved jobs rhythm (scoped, CSS-only — no JS/logic touched).
   1. Reset-factors button sits directly above the calibration table with no gap
      (both come from adjacent section builders); give the table a top margin
      only in that exact sibling position.
   2. The calibration "No measurements yet" row is a single colspan <tr>, not
      data — render it as a muted empty-state instead of a fake data row. The
      :only-child + [colspan] combo only matches placeholder rows, so real
      tables (material library, batch) are untouched.
   3. A lone job row (or the "Nothing saved yet" placeholder) should not carry
      a leading divider border with nothing above it.
   4. The "Saved jobs live in this browser only" hint sticks to the list
      (ws-hint has no top margin); breathe after .ws-jobs only. */
.ws-panel-body > .btn-secondary + .ws-table-wrap{margin-top:14px;}
.ws-table tbody tr:only-child td[colspan]{
  color:var(--ink-soft);
  font-style:italic;
  font-size:13.5px;
  line-height:1.55;
}
.ws-jobs > .ws-job:only-child{border-top:0;}
.ws-jobs + .ws-hint{margin-top:10px;}

/* ---------- shared tool building blocks ---------- */

/* Drop zone for STL / CSV files. The real <input type="file"> sits inside the
   label so the zone is clickable AND keyboard reachable. */
.ws-dropzone{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  border:2px dashed var(--line);
  border-radius:var(--radius);
  background:var(--canvas);
  padding:26px 18px;
  text-align:center;
  cursor:pointer;
  transition:border-color .15s ease, background .15s ease;
}
.ws-dropzone:focus-within,
.ws-dropzone.is-over{
  border-color:var(--teal);
  background:#fff;
}
.ws-dropzone-title{
  font-family:'Barlow Condensed', sans-serif;
  font-weight:700;
  font-size:19px;
  text-transform:uppercase;
  color:var(--ink);
  margin:0;
}
.ws-dropzone .ws-hint{text-align:center; margin:0;}

/* Progress + status line, used while a Worker parses a large mesh. */
.ws-progress{
  height:6px;
  border-radius:4px;
  background:var(--line-soft);
  overflow:hidden;
  margin:12px 0 6px;
}
.ws-progress span{
  display:block;
  height:100%;
  width:0;
  background:var(--teal);
  transition:width .15s linear;
}
.ws-status{
  font-family:'IBM Plex Mono', monospace;
  font-size:12.5px;
  color:var(--ink-soft);
  margin:0 0 10px;
  min-height:18px;
}

/* Warnings (non-watertight mesh, part bigger than the sheet, …). Plain border
   and text colours, no colour-only meaning: the text says it too. */
.ws-warning,
.ws-error{
  border-left:4px solid var(--ochre);
  background:var(--line-soft);
  border-radius:6px;
  padding:11px 14px;
  font-size:14px;
  color:var(--ink);
  margin:0 0 14px;
}
.ws-error{border-left-color:#B3261E;}
.ws-ok{
  border-left:4px solid var(--teal);
  background:var(--line-soft);
  border-radius:6px;
  padding:11px 14px;
  font-size:14px;
  color:var(--ink);
  margin:0 0 14px;
}

/* Canvas viewport for the 3D previews (STL quote + hole test plate). */
.ws-viewer{
  position:relative;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--canvas);
  overflow:hidden;
}
.ws-viewer canvas{
  display:block;
  width:100%;
  height:auto;
  touch-action:none;
  cursor:grab;
}
.ws-viewer canvas:active{cursor:grabbing;}
.ws-viewer-hint{
  position:absolute;
  left:10px;
  bottom:8px;
  font-family:'IBM Plex Mono', monospace;
  font-size:11px;
  color:var(--ink-soft);
  background:var(--card);
  border:1px solid var(--line-soft);
  border-radius:5px;
  padding:3px 7px;
  pointer-events:none;
}

/* Spec strip: the mesh facts that decide the quote. */
.ws-specs{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  margin:0 0 18px;
}
@media (min-width:640px){
  .ws-specs{grid-template-columns:repeat(3, 1fr);}
}
.ws-spec{
  border:1px solid var(--line);
  border-radius:8px;
  padding:10px 12px;
  background:var(--canvas);
}
.ws-spec-label{
  display:block;
  font-family:'IBM Plex Mono', monospace;
  font-size:10.5px;
  font-weight:600;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--ink-soft);
  margin-bottom:4px;
}
.ws-spec-value{
  display:block;
  font-family:'IBM Plex Mono', monospace;
  font-size:15px;
  font-weight:600;
  color:var(--ink);
}


/* Donut chart + legend table (cost breakdown). */
.ws-breakdown{
  display:grid;
  grid-template-columns:1fr;
  gap:18px;
  align-items:start;
}
@media (min-width:720px){
  .ws-breakdown{grid-template-columns:200px minmax(0, 1fr);}
}
.ws-donut svg{display:block; width:100%; max-width:200px; height:auto;}
.ws-donut-total{
  font-family:'IBM Plex Mono', monospace;
  font-size:13px;
  font-weight:600;
  color:var(--ink);
  margin:6px 0 0;
}
.ws-swatch{
  display:inline-block;
  width:10px;
  height:10px;
  border-radius:2px;
  margin-right:7px;
  vertical-align:middle;
}

/* Tier cards: standard / rush / bulk. */
.ws-tiers{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  margin:16px 0;
}
@media (min-width:720px){
  .ws-tiers{grid-template-columns:repeat(3, 1fr);}
}
.ws-tier{
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:14px 16px;
  background:var(--card);
}
.ws-tier.is-recommended{border-color:var(--teal);}
.ws-tier-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  margin:12px 0 4px;
}
@media (min-width:720px){
  .ws-tier-grid{grid-template-columns:repeat(3, 1fr);}
}
.ws-tier-name{
  font-family:'Barlow Condensed', sans-serif;
  font-weight:700;
  font-size:17px;
  text-transform:uppercase;
  color:var(--ink);
  margin:0 0 6px;
}
.ws-tier-price{
  font-family:'IBM Plex Mono', monospace;
  font-size:21px;
  font-weight:600;
  color:var(--ink);
  margin:0 0 6px;
}
.ws-tier-detail{font-size:13px; color:var(--ink-soft); margin:0;}

/* Range sliders with an always-visible value (no colour-only meaning). */
.ws-range-row{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
}
.ws-range-row input[type="range"]{
  flex:1 1 auto;
  min-width:0;
  accent-color:var(--teal);
  /* Undo the generic .input-group input box (padding-right 40px is reserved
     for inline units like %, mm, s) and redraw the slider as a box with the
     same height as a number input (checkbox-label uses 46px as the reference
     input height) so e.g. "Overhead per layer" and "Expected failure rate"
     sit on one even row. appearance:auto restores the native thumb that the
     generic rule's appearance:none would otherwise strip. */
  appearance:auto;
  -webkit-appearance:auto;
  box-sizing:border-box;
  height:46px;
  margin:0;
  padding:0 12px;
  background:var(--canvas);
  border:1.5px solid var(--line);
  border-radius:8px;
}
/* Inside grids the row gap already separates rows — the trailing 14px would
   make slider cells taller than neighbouring number-input cells. */
.ws-grid .ws-range-row{margin-bottom:0;}
.ws-range-row .input-hint{margin-top:0; white-space:nowrap;}
.ws-range-value{
  font-family:'IBM Plex Mono', monospace;
  font-size:13.5px;
  font-weight:600;
  color:var(--ink);
  min-width:64px;
  text-align:right;
}

/* Sheet diagrams (cut list) and their legend. */
.ws-sheets{
  display:grid;
  grid-template-columns:1fr;
  gap:18px;
}
@media (min-width:860px){
  .ws-sheets{grid-template-columns:1fr 1fr;}
}
.ws-sheet-card{
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:14px;
  background:var(--card);
}
.ws-sheet-card h3{margin-top:0;}
.ws-sheet-svg svg{display:block; width:100%; height:auto; background:var(--canvas); border-radius:6px;}
.ws-sheet-meta{
  font-family:'IBM Plex Mono', monospace;
  font-size:12px;
  color:var(--ink-soft);
  margin:8px 0 0;
}

/* Monospace preview boxes (quote text, DXF/CSV previews). */
.ws-code{
  font-family:'IBM Plex Mono', monospace;
  font-size:12.5px;
  line-height:1.5;
  color:var(--ink);
  background:var(--canvas);
  border:1px solid var(--line);
  border-radius:8px;
  padding:12px;
  white-space:pre-wrap;
  word-break:break-word;
  max-height:340px;
  overflow:auto;
  margin:0 0 12px;
}

/* Small pill used for hardware names and sheet labels. */
.ws-chip{
  display:inline-block;
  font-family:'IBM Plex Mono', monospace;
  font-size:11.5px;
  font-weight:600;
  color:var(--ink);
  background:var(--line-soft);
  border:1px solid var(--line);
  border-radius:999px;
  padding:3px 9px;
  margin:0 6px 6px 0;
}

/* Action rows (copy quote, download SVG/DXF, print). */
.ws-actions-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:12px 0 4px;
}
.ws-actions-row .btn-primary,
.ws-actions-row .btn-secondary{font-size:14px; padding:10px 16px;}

/* Two-column form + results split used by all three tools. */
.ws-columns{
  display:grid;
  grid-template-columns:1fr;
  gap:20px;
}
@media (min-width:1000px){
  .ws-columns-wide{grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);}
}
.ws-subhead{
  font-family:'IBM Plex Mono', monospace;
  font-size:12px;
  font-weight:600;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--ink-soft);
  margin:0 0 10px;
}
.ws-inline-fields{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
  margin-bottom:12px;
}
@media (min-width:640px){
  .ws-inline-fields-3{grid-template-columns:repeat(3, minmax(0, 1fr));}
}
.ws-checklist{list-style:none; margin:0 0 14px; padding:0;}
.ws-checklist li{
  font-size:14px;
  color:var(--ink-soft);
  padding:5px 0 5px 22px;
  position:relative;
}
.ws-checklist li::before{
  content:"✓";
  position:absolute;
  left:0;
  color:var(--teal-dark);
  font-weight:600;
}
.ws-checklist li.is-bad::before{content:"×"; color:#B3261E;}


/* ---------------------------------------------------------------------------
   Print stylesheet (the "PDF export" of the three tools)
   No PDF library is used: each tool renders its printable sheet into
   .print-area, adds `is-printing` to <body> and calls window.print(). The user
   picks "Save as PDF" in the browser dialog, so the file never leaves the
   device and there is no dependency to keep updated.
--------------------------------------------------------------------------- */

.print-area{display:none;}
.print-only{display:none;}
.print-sheet{
  color:#000;
  background:#fff;
  font-family:'Work Sans', sans-serif;
  font-size:12px;
}
.print-sheet h1{
  font-family:'Barlow Condensed', sans-serif;
  font-size:24px;
  text-transform:uppercase;
  margin:0 0 4px;
}
.print-sheet h2{
  font-family:'Barlow Condensed', sans-serif;
  font-size:16px;
  text-transform:uppercase;
  margin:18px 0 6px;
}
.print-sheet .print-head{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  border-bottom:2px solid #000;
  padding-bottom:10px;
  margin-bottom:14px;
}
.print-sheet .print-logo{max-height:56px; max-width:200px;}
.print-sheet .print-meta{
  font-family:'IBM Plex Mono', monospace;
  font-size:11px;
  text-align:right;
  line-height:1.6;
}
.print-sheet table{
  border-collapse:collapse;
  width:100%;
  font-size:11.5px;
  margin:0 0 12px;
}
.print-sheet th,
.print-sheet td{
  border:1px solid #444;
  padding:5px 7px;
  text-align:left;
}
.print-sheet th{background:#eee;}
.print-sheet .print-total{
  font-family:'IBM Plex Mono', monospace;
  font-size:15px;
  font-weight:700;
}
.print-sheet .print-note{
  font-size:11px;
  color:#222;
  white-space:pre-wrap;
  margin:0 0 8px;
}
.print-sheet .print-terms{font-size:10.5px; color:#222; white-space:pre-wrap;}

@media print{
  @page{margin:14mm;}
  html,body{background:#fff !important;}
  body.is-printing{
    color:#000;
  }
  /* Hide the site chrome and every tool control; print only .print-area. */
  body.is-printing .site-header,
  body.is-printing footer,
  body.is-printing .crumbs,
  body.is-printing .cp-hero,
  body.is-printing .cp-content,
  body.is-printing .related-tools,
  body.is-printing .faq-section,
  body.is-printing .trust-badge,
  body.is-printing .ws-profile,
  body.is-printing .no-print,
  body.is-printing [data-print-hide]{display:none !important;}
  body.is-printing .cp-calculator-wrapper > *:not(.print-area){display:none !important;}
  body.is-printing .print-area{display:block !important;}
  body.is-printing .print-only{display:block !important;}
  body.is-printing .ws-sheet-card,
  body.is-printing .ws-tier,
  body.is-printing .ws-spec{break-inside:avoid;}
  body.is-printing .ws-sheet-card{border-color:#444;}
  body.is-printing .ws-sheet-svg svg{background:#fff;}
  body.is-printing a[href]::after{content:"";}
}

.ws-job-empty{color:var(--ink-soft); font-style:italic;}

/* ---------- 3D print quote calculator ---------- */

.quote-grid{display:grid; grid-template-columns:1fr; gap:14px; margin-bottom:14px;}
@media (min-width:760px){
  .quote-grid{grid-template-columns:repeat(2, minmax(0, 1fr));}
  .quote-grid-3{grid-template-columns:repeat(3, minmax(0, 1fr));}
}
.input-hint{
  font-family:'IBM Plex Mono', monospace;
  font-size:12px;
  color:var(--teal-dark);
  margin-top:4px;
}
.quote-columns{display:grid; grid-template-columns:1fr; gap:18px; margin-top:6px;}
/* Mobile safety: both columns carry long unbreakable content (file names,
   "20.0 × 20.0 × 20.0 mm", "yes — 6 orientation(s)...", the 180px donut SVG,
   tier prices). minmax(0,1fr) + min-width:0 lets grid children shrink instead
   of forcing the whole card past 393px; without it every column overflows. */
.quote-columns > div{min-width:0;}
@media (min-width:900px){
  .quote-columns{grid-template-columns:minmax(0, 1.05fr) minmax(0, 1fr);}
}
.ws-canvas-frame{
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--canvas);
  padding:10px;
}
.quote-canvas{
  display:block;
  width:100%;
  height:auto;
  min-height:220px;
  border-radius:8px;
  background:#fff;
  cursor:grab;
}
.quote-canvas:active{cursor:grabbing;}
.quote-canvas:focus-visible{outline:2px solid var(--teal); outline-offset:2px;}
.ws-facts{margin:12px 0 0; display:grid; gap:8px; min-width:0;}
.ws-facts > div{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px dashed var(--line);
  padding-bottom:7px;
  min-width:0;
}
.ws-facts dt{
  font-family:'IBM Plex Mono', monospace;
  font-size:11.5px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:var(--ink-soft);
  margin:0;
}
.ws-facts dd{
  margin:0;
  font-size:14px;
  font-weight:600;
  color:var(--ink);
  text-align:right;
  overflow-wrap:anywhere;
  min-width:0;
}
/* Long fact values (file names, "20.0 × 20.0 × 20.0 mm",
   "yes — 6 orientation(s)...") must wrap inside 393px instead of pushing the
   facts grid wider than the card. */
.ws-facts dd,
#fit-box p,
#fit-box .ws-fit-ok,
#fit-box .ws-fit-bad{overflow-wrap:anywhere; min-width:0;}
.quote-empty{
  border:1px dashed var(--line);
  border-radius:var(--radius);
  background:var(--card);
  color:var(--ink-soft);
  font-size:14px;
  padding:16px;
  margin:0 0 14px;
}
.quote-breakdown{
  display:grid;
  grid-template-columns:minmax(0, 1fr);
  gap:14px;
  margin:14px 0 6px;
}
.quote-breakdown > *{min-width:0;}
@media (min-width:760px){
  .quote-breakdown{grid-template-columns:minmax(0, 220px) minmax(0, 1fr); align-items:start;}
}
.ws-donut-wrap{
  border:1px solid var(--line-soft);
  border-radius:var(--radius);
  background:var(--card);
  padding:12px;
  text-align:center;
}
.ws-donut-wrap .ws-hint{margin:8px 0 0;}
.ws-donut-wrap .quote-donut{max-width:100%; height:auto;}
/* Donut + tables inside the breakdown must shrink on mobile: the SVG is a
   fixed 180px box and money/percent cells don't wrap — without min-width:0
   + table-layout:fixed they force horizontal overflow at 393px. */
.ws-donut-wrap{min-width:0; overflow:hidden;}
.ws-donut{max-width:100%; overflow:hidden;}
.quote-breakdown .ws-table-wrap{min-width:0;}
.quote-breakdown .ws-table{table-layout:fixed; width:100%;}
.quote-breakdown .ws-table th,
.quote-breakdown .ws-table td{overflow-wrap:anywhere;}
.ws-tier-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  margin:12px 0 4px;
}
@media (min-width:720px){
  .ws-tier-grid{grid-template-columns:repeat(3, minmax(0, 1fr));}
}
.ws-tier-card{
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--card);
  padding:14px 16px;
}
.ws-tier-card.is-featured{border-color:var(--teal); box-shadow:0 0 0 1px var(--teal);}
.ws-tier-card.is-muted{opacity:.72;}
.ws-tier-card h3{
  font-family:'Barlow Condensed', sans-serif;
  font-size:16px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.03em;
  color:var(--teal-dark);
  margin:0 0 6px;
}
.ws-tier-profit{font-size:13px; color:var(--ink-soft); margin:6px 0 0; line-height:1.5;}
.quote-message{
  width:100%;
  min-height:170px;
  font-family:'IBM Plex Mono', monospace;
  font-size:12.5px;
  line-height:1.55;
  color:var(--ink);
  background:var(--card);
  border:1.5px solid var(--line);
  border-radius:8px;
  padding:12px;
  resize:vertical;
}
#fit-box{margin-top:12px;}
#fit-box .ws-fit-ok,
#fit-box .ws-fit-bad{margin:0 0 8px; font-size:13.5px; line-height:1.55;}
#fit-box .ws-fit-ok{color:var(--teal-dark);}
#fit-box .ws-fit-bad{color:var(--error);}
#batch-wrap{margin-top:14px;}
.slicer-grid{display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:10px 0 12px;}
@media (max-width:560px){.slicer-grid{grid-template-columns:1fr;}}
#slicer-status, #template-hint, #calculate-hint{min-height:1em; margin:6px 0 0;}

/* Inline link-style button (demo cube) — lives inside the clickable drop zone. */
.ws-link-btn{
  border:none;
  background:none;
  padding:0;
  margin:0;
  font:inherit;
  font-size:inherit;
  color:var(--brand, #2563eb);
  text-decoration:underline;
  cursor:pointer;
}
.ws-link-btn:hover{color:var(--teal-dark, #1d4ed8);}
.ws-link-btn:focus-visible{outline:2px solid var(--teal, #2563eb); outline-offset:2px; border-radius:2px;}

/* Fit-check bed drawing: grey plate, teal part (or red at the suggested scale). */
.fit-visual{margin-top:10px;}
.fit-visual svg{width:100%; max-width:240px; height:auto; display:block;}
.fit-bed{fill:var(--canvas, #f4f6fa); stroke:var(--line, #c9d1de); stroke-width:2;}
.fit-part-ok{fill:var(--teal, #2563eb); opacity:.85;}
.fit-part-bad{fill:var(--error, #d64545); opacity:.85;}

.quote-drop{
  border:2px dashed var(--line, #c9d1de);
  border-radius:12px;
  padding:28px 16px;
  text-align:center;
  cursor:pointer;
  background:var(--panel-soft, #f7f9fc);
  transition:border-color .15s ease, background .15s ease;
}
.quote-drop:hover,
.quote-drop:focus-visible,
.quote-drop.is-dragover{
  border-color:var(--brand, #2563eb);
  background:var(--panel-soft-hover, #eef4ff);
  outline:none;
}
.quote-drop-title{margin:0 0 4px; font-weight:600;}
.quote-drop-sub{margin:0; color:var(--ink-soft, #5b6572); font-size:.9rem;}
.quote-progress{margin-top:10px;}
.quote-progress-track{
  height:10px; border-radius:6px; overflow:hidden;
  background:var(--panel-soft, #e6ebf3);
}
.quote-progress-fill{
  height:100%; width:0%;
  background:var(--brand, #2563eb);
  transition:width .2s ease;
}
.ws-file-list{display:flex; flex-wrap:wrap; gap:8px; margin-top:12px;}
.ws-file-chip{
  border:1px solid var(--line, #c9d1de);
  border-radius:999px;
  padding:6px 14px;
  background:var(--panel, #fff);
  font:inherit; font-size:.9rem;
  cursor:pointer;
}
.ws-file-chip.is-active{
  border-color:var(--brand, #2563eb);
  background:var(--panel-soft-hover, #eef4ff);
  font-weight:600;
}
.ws-step-title{
  margin:22px 0 10px;
  font-size:1rem;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--ink-soft, #5b6572);
}
.ws-donut{display:flex; justify-content:center; padding:8px 0;}
.quote-grid-2{display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:12px;}
@media print{
  .quote-drop, .quote-progress, .ws-file-list{display:none !important;}
}

/* ---------------------------------------------------------------------------
   Insert hole calculator: calibration card (test plate / Calculator tabs).
   Two tabs in one role=tablist; the Calculator tab prints through .print-area
   with the shared print sheet above. Colours come from base.css tokens.
--------------------------------------------------------------------------- */

.ws-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  border-bottom:1px solid var(--line);
  padding-bottom:12px;
  margin:0 0 18px;
}
.ws-tab{
  font-family:'Barlow Condensed', sans-serif;
  font-weight:700;
  font-size:16px;
  text-transform:uppercase;
  letter-spacing:.01em;
  cursor:pointer;
  color:var(--ink-soft);
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:9px 16px;
}
.ws-tab:hover{color:var(--ink);}
.ws-tab[aria-selected="true"]{
  color:#fff;
  background:var(--teal);
  border-color:var(--teal);
}
.ws-tab-panel[hidden]{display:none;}
.ws-subhead{
  font-family:'Barlow Condensed', sans-serif;
  font-size:18px;
  text-transform:uppercase;
  letter-spacing:.01em;
  color:var(--ink);
  margin:22px 0 8px;
}
/* "no compensation saved yet" — the one warning the page owns. */
.ws-note-warn{
  font-size:13px;
  line-height:1.55;
  color:var(--ink);
  background:rgba(201, 138, 44, .14);
  border-left:3px solid var(--ochre);
  border-radius:6px;
  padding:10px 12px;
  margin:0 0 14px;
  max-width:76ch;
}
