/* Cutitonce: shop-drawing look. Boards drawn to scale in wood tones on the cutting-mat grid, parts in pale ply colours
   with dark kerf-thin outlines, numbers in tabular figures. Everything else stays Prism. */
:root { --wood: color-mix(in srgb, oklch(.82 .07 75) 75%, var(--surface)); --wood-line: color-mix(in srgb, oklch(.6 .08 70) 80%, var(--surface)); --warn-bg: color-mix(in srgb, var(--bad) 14%, var(--surface)); --warn-ink: var(--ink); }

.cut { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .cut { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; } .cut-in { position: sticky; top: 84px; } }
.cut-in h2, .cut-out h2 { margin: 16px 0 8px; }
.cut-set { display: flex; flex-wrap: wrap; gap: 12px; }
.cut-set .field { flex: 1 1 110px; }
.edit { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.edit th { text-align: left; font-weight: 600; font-size: .8rem; color: var(--dim); padding: 0 4px 4px; }
.edit td { padding: 2px 3px; }
.edit td.c { text-align: center; }
.edit .in.sm { width: 100%; min-width: 0; padding-inline: 8px; }
.edit .in.num { text-align: right; }
.edit col.n { width: 18%; } .edit col.q { width: 14%; } .edit col.x { width: 40px; }
.cut-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.cut-warn { background: var(--warn-bg); color: var(--warn-ink); padding: 10px 12px; border-radius: 4px; }

.boards { display: grid; gap: 20px; margin-top: 12px; }
.board { margin: 0; }
.board figcaption { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.board figcaption .muted { margin-left: auto; }
.board svg { width: 100%; height: auto; display: block; overflow: visible; }
.board .stock { fill: var(--wood); stroke: var(--wood-line); stroke-width: .25%; vector-effect: non-scaling-stroke; }
.board .pt rect { stroke: var(--ink); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.board text { fill: var(--ink); text-anchor: middle; dominant-baseline: middle; font-weight: 600; font-variant-numeric: tabular-nums; }
.board text.d { font-weight: 400; }
.pt.c0 rect { fill: color-mix(in srgb, oklch(.88 .07 155) 70%, var(--surface)); }
.pt.c1 rect { fill: color-mix(in srgb, oklch(.88 .07 185) 70%, var(--surface)); }
.pt.c2 rect { fill: color-mix(in srgb, oklch(.88 .07 295) 70%, var(--surface)); }
.pt.c3 rect { fill: color-mix(in srgb, oklch(.88 .07 30) 70%, var(--surface)); }
.pt.c4 rect { fill: color-mix(in srgb, oklch(.88 .07 240) 70%, var(--surface)); }
.pt.c5 rect { fill: color-mix(in srgb, oklch(.88 .07 115) 70%, var(--surface)); }
.pt.c6 rect { fill: color-mix(in srgb, oklch(.88 .07 340) 70%, var(--surface)); }
.cut-stats small, .stats small { display: block; color: var(--dim); font-size: .78rem; }

.sag { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .sag { grid-template-columns: minmax(340px, 4fr) minmax(0, 6fr); align-items: start; } }
.sag-verdict { display: grid; gap: 4px; padding: 14px 16px; border-left: 6px solid; border-radius: 4px; margin-bottom: 12px; }
.sag-verdict b { font-size: 1.35rem; }
.sag-verdict.good { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.sag-verdict.bad { border-color: var(--bad); background: var(--warn-bg); color: var(--warn-ink); }
.radios { display: flex; flex-wrap: wrap; gap: 6px 16px; border: 0; padding: 0; margin: 0; }
.radios legend { margin-bottom: 4px; } .radios label { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; }

@media print {
  header, footer, nav, .cut-in, .cut-tools, .pw-method, .pw-section:not(.cut-print) { display: none !important; }
  .cut { display: block; } .board { break-inside: avoid; }
}

/* phones: each row becomes a small card, name on top, numbers below with their own labels */
@media (max-width: 640px) {
  .edit thead, .edit colgroup { display: none; }
  .edit, .edit tbody { display: block; width: 100%; }
  .edit tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 36px; gap: 4px 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .edit td { padding: 0; }
  .edit td::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--dim); margin-bottom: 2px; }
  .edit td:first-child { grid-column: 1 / 5; }
  .edit td:last-child { grid-column: 5; grid-row: 1; align-self: end; }
  .edit.parts td[data-label="Cut from"] { grid-column: 1 / 5; }
  .edit td.c { text-align: left; }
/* inputs never push their cell wider than its column (the Length/Width/How many/Price row was clipped on phones) */
.tblwrap .edit td:not(.num, :first-child), .edit td { min-width: 0; } /* beats Prism's .tblwrap td { min-width: 9em }, which pushed each number cell past its grid column */ .edit td > .in, .edit td > select, .edit td > input { min-width: 0; width: 100%; box-sizing: border-box; }
}

/* "On the bench": the layout as 3D slabs */
.co-bench-b{margin-bottom:10px}
.boards.turntable,.boards.turntable:active{place-items:stretch;width:auto;max-width:none;margin-inline:0;padding:0;perspective:none;cursor:auto;touch-action:auto;border-radius:0} /* flat: the turntable's own look stays off */
.boards.turntable:focus-visible{outline-offset:2px;border-radius:8px} /* as before: Prism's plain focus ring */
.co-bench .boards.turntable{perspective:1400px;padding:40px 0 60px;cursor:grab;touch-action:none}
.co-bench .boards.turntable:active{cursor:grabbing}
.co-bench .board svg{margin-block:44px;transform:perspective(1400px) rotateX(var(--rx,58deg)) rotateZ(var(--rz,-32deg)) scale(.78);transition:transform var(--dur-3,.35s) cubic-bezier(.2,.8,.2,1);filter:drop-shadow(0 2px 0 oklch(.55 .07 60)) drop-shadow(0 4px 0 oklch(.5 .07 60)) drop-shadow(0 6px 0 oklch(.45 .07 60)) drop-shadow(0 22px 18px oklch(0 0 0 / .3))}
/* only the drawing tilts, scaled to stay inside a phone-width column; the board's name and cut order stay flat and readable */
@media (prefers-reduced-motion:reduce){.co-bench .board svg{transition:none}}
@media print{.co-bench-b{display:none}.co-bench .board svg{transform:none;filter:none}}
.cut-out.co-bench{overflow:clip}
.seq { margin-top: 8px; } .seq summary { cursor: pointer; font-weight: 600; min-height: 32px; } .seq-p { white-space: nowrap; color: var(--accent); }


/* parts: two lines per row at every width, sizes on the first, how it's cut on the second */
.edit.parts thead { display: none; }
.edit.parts, .edit.parts tbody { display: block; width: 100%; }
.edit.parts tr { display: grid; grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(0, 1fr)) minmax(0, .7fr) 36px; gap: 4px 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.edit.parts td { padding: 0; }
.edit.parts td::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--dim); margin-bottom: 2px; }
.edit.parts td:first-child { grid-column: 1; }
.edit.parts td:last-child { grid-column: 5; grid-row: 1; align-self: end; }
.edit.parts td[data-label="Cut from"] { grid-column: 1; grid-row: 2; }
.edit.parts td[data-label="Thick"] { grid-column: 2; grid-row: 2; }
.edit.parts td[data-label="Band"] { grid-column: 3 / 5; grid-row: 2; }
.edit.parts td[data-label="Grain"] { grid-column: 5; grid-row: 2; text-align: center; }
@media (min-width: 1100px) { .cut-in { max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain; } }
.co-no { flex: 0 0 100%; width: 100%; margin: 0 0 6px; font: 600 .78rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.co-chips { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 12px 0 0; font-size: .92rem; }
.co-chips a { font-weight: 600; }
/* the sheet index: the drawing set's contents page */
.co-index { margin-top: 48px; border: 2px solid var(--ink); background: var(--surface); }
.co-index h2 { margin: 0; padding: 8px 16px; background: var(--ink); color: var(--void); font-size: 18px; }
.co-index ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); margin: 0; padding: 0; list-style: none; }
.co-index a { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 8px; min-height: 64px; padding: 12px 16px; align-content: center; border: solid var(--line3); border-width: 0 1px 1px 0; color: var(--ink); text-decoration: none; }
.co-index a:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.co-index a[aria-current] { box-shadow: inset 4px 0 0 var(--accent); }
.co-index .num { grid-row: 1 / 3; font-size: .85rem; color: var(--dim); align-self: center; }
.co-index .muted { font-size: .85rem; }
/* plans */
.pw-tool:has(.co-cards) { padding: 0; background: none; border: 0; box-shadow: none; } .pw-tool:has(.co-cards)::before, .pw-tool:has(.co-cards)::after { display: none; } .pw-tool:has(.co-cards) > .pb { padding: 0; }
.co-cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin: 0; padding: 0; list-style: none; }
.co-cards a { text-align: left; display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px; border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink); text-decoration: none; transition: box-shadow var(--dur-2, .2s), transform var(--dur-2, .2s); }
.co-cards a:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 color-mix(in srgb, var(--accent) 30%, transparent); }
.co-cards b { font-size: 1.1rem; margin-top: 8px; } .co-meta { font-size: .85rem; color: var(--dim); margin-top: auto; padding-top: 6px; }
.co-thumb { display: flex; align-items: center; height: 150px; overflow: hidden; } .co-thumb svg { max-height: 150px; } .co-thumb text { display: none; }
.co-block { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 0; margin: 0 0 16px; border: 1.5px solid var(--ink); }
.co-block div { padding: 10px 14px; border: solid var(--line3); border-width: 0 1px 1px 0; } .co-block dt { font: 600 .72rem var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--dim); } .co-block dd { margin: 2px 0 0; font-weight: 600; }
.co-list { margin: 0; padding-left: 20px; } .co-list li { margin: 4px 0; }
.co-steps { max-width: 72ch; margin: 0; padding: 0; list-style: none; counter-reset: s; } .co-steps li { counter-increment: s; position: relative; padding: 0 0 16px 44px; } .co-steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; display: grid; place-items: center; border: 1.5px solid var(--ink); font: 600 .9rem var(--mono); }
.co-tip { max-width: 72ch; margin: 24px 0; padding: 12px 16px; border-left: 6px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); } .co-tip p { margin: 4px 0 0; }
.co-vs { margin-bottom: 12px; } .co-vs .field { flex: 1 1 200px; } [data-vs-out] { margin-bottom: 24px; } .co-win { font-weight: 700; color: var(--accent-ink, var(--accent)); }
@media print { .co-index, .co-tip, .pw-shelf, .cut-tools { display: none !important; } .pw-section { display: block !important; } }
/* below desktop the inputs come first: at the bench you type, then read */
@media (max-width: 1099px) { html[data-look=blueprint] .cut-out { order: 0; } }
.radios input, .check input { width: 20px; height: 20px; } .pw-shelf-h a { display: inline-block; padding: 12px 0; } .radios label, label.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; }
