.cut-sheet {
  color: var(--ink);
  max-width: 1080px;
  margin-inline: auto;
  padding-bottom: 65px;
}
.cs-filters {
  display: grid;
  gap: 12px;
  margin: 12px 0 20px;
}
/* The full tray stays open while its cards scroll independently of the tickets. */
.cs-picker {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
}
.cs-picker-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(140px, 16vw, 169px);
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #9da99b transparent;
  overscroll-behavior-x: contain;
  padding: 3px 2px 7px;
}
.cs-picker-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  overflow: hidden;
  border: 1px solid #c7cec1;
  border-radius: 10px;
  padding: 0;
  color: var(--ink);
  font: 600 14px/1.25 var(--body);
  text-align: start;
  white-space: normal;
}
.cs-picker-card img {
  width: 100%;
  height: 66px;
  object-fit: contain;
  background: #f1f2e9;
  border-bottom: 1px solid #dde2d4;
}
.cs-picker-caption {
  display: grid;
  align-content: center;
  flex: 1;
  gap: 3px;
  padding: 7px 9px 8px;
}
.cs-picker-caption small { font: 500 12px/1.1 var(--mono); color: #526754; }
.cs-picker-card[aria-checked=true] { border-color: #345644; box-shadow: inset 0 0 0 1px #345644; }
.cs-picker-card[aria-checked=true] .cs-picker-caption { background: #344f40; color: white; }
.cs-picker-card[aria-checked=true] small { color: #e2eade; }
.cs-picker-card:focus-visible, .cs-picker-browse:focus-visible { outline: 2px solid #325f69; outline-offset: 1px; }
.cs-picker-browse {
  display: grid; place-items: center;
  background: transparent; border: 0; color: #476351;
}
.cs-picker-browse > span {
  width: 11px; height: 11px; border-top: 2px solid; border-right: 2px solid;
}
.cs-picker-browse .cs-back { transform: rotate(-135deg); }
.cs-picker-browse .cs-forward { transform: rotate(45deg); }
.cs-picker-browse:disabled { opacity: .25; }
@media (max-width: 680px) {
  .cs-picker { position: relative; grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cs-picker-rail { grid-auto-columns: clamp(135px, 38vw, 166px); }
  .cs-picker-browse { display: none; }
}
.cut-sheet .cs-group { margin: 0 0 32px; padding: 0; border: 0; }
.cs-group-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 13px; margin-bottom: 12px; }
.cs-group-title:has(.guide-section-toggle) { align-items: center; flex-wrap: nowrap; gap: 12px; margin-bottom: 4px; }
.cs-group-title:has(.guide-section-toggle) h2 { flex: 1; min-width: 0; }
.cs-group-title .guide-section-toggle { width: 100%; }
.cs-group:has(.cs-group-content[hidden]) { margin-bottom: 6px; }
.cs-group-content [data-code] { scroll-margin-top: 72px; }
.cs-step { font: 500 13px/1.4 var(--mono); color: #496150; text-underline-offset: 3px; white-space: nowrap; }
.cs-group-title h2 { font: 500 clamp(20px, 3.2vw, 26px)/1.25 var(--display); letter-spacing: -.025em; margin: 0; }
.cs-group-note, .cs-board-note { color: #596459; }
.cs-group-note { margin: -2px 0 14px; max-width: 74ch; }
.cs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.cs-ticket {
  min-width: 0;
  overflow: hidden;
  background: var(--white);
  border: 1px solid #cfd3c8;
  border-radius: 13px;
  box-shadow: 0 2px 3px #28342607;
}
.cs-ticket-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 13px 16px 0;
}
.cs-ticket-head h3 { margin: 0 auto 0 0; font: 600 18px/1.4 var(--body); letter-spacing: -.015em; }
.cs-quantity, .cs-hold { font: 500 13px/1.4 var(--body); }
.cs-quantity { color: #556456; }
.cs-hold { color: #82522a; }
.cs-stock-info { margin: 2px 16px 0; font-size: 14px; color: #637066; }
.cs-illustration {
  margin: 12px 0 0;
  padding: 13px 15px 12px;
  background-color: #f7f6ef;
  background-image: radial-gradient(#babca97a .72px, transparent .85px);
  background-size: 8px 8px;
  border-block: 1px solid #e5e5d9;
}
.cs-strip {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 48px;
  gap: 1px;
}
.cs-segment, .cs-tail { flex-basis: 0; min-width: 0; position: relative; border-radius: 2px; }
.cs-tail {
  margin-block: 4px;
  border: 1px dashed #b7ae98;
  background: repeating-linear-gradient(130deg, transparent 0 4px, #c8bca875 4px 5px);
}
.cs-segment {
  container-type: inline-size;
  display: block;
  border: 0;
  padding: 0;
  text-align: left;
  background: transparent;
}
.cs-timber {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 3px 0;
  overflow: hidden;
  color: #443422;
  border: 1px solid #a2845c;
  border-bottom: 3px solid #b39871;
  border-radius: 2px;
  background-color: #e8d3ae;
  background-image: url("data:image/svg+xml,%3Csvg width='180' height='42' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23b6936666' stroke-width='.8'%3E%3Cpath d='M-1 4C33 8 72 0 109 4s53 3 74 0M-1 12c38 2 44-5 77-1s65 4 107 1M-2 30c30-3 46 3 77 0s72-3 111 0M-2 37q21 2 54-1t61 0 73 1M117 19q15-5 27 1-14 3-27-1ZM106 20q24-10 46 0'/%3E%3C/g%3E%3C/svg%3E");
  line-height: 1;
  pointer-events: none;
}
.cs-timber.cs-pointed { clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%); }
.cs-timber.cs-pattern { clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }
.cs-timber strong { font: 600 15px/1 var(--mono); }
.cs-timber span { margin-top: 3px; font: 500 12px/1 var(--mono); }
.cs-segment:hover .cs-timber, .cs-segment:focus-visible .cs-timber { background-color: #dbe2cc; border-color: #6e8266; }
@container (max-width: 69px) { .cs-timber span { display: none; } }
@container (max-width: 34px) { .cs-timber strong { display: none; } }
.cs-labels { display: flex; flex-wrap: wrap; gap: 2px 8px; padding: 5px 12px; }
.cs-piece-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 5px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #354d3e;
  font: 500 14px/1.3 var(--mono);
}
.cs-drawing-cue {
  width: 26px;
  height: 22px;
  flex: none;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 24'%3E%3Ccircle cx='10' cy='12' r='9' fill='%23354d3e'/%3E%3Cpath d='m8 8 6 4-6 4z' fill='white'/%3E%3Cpath d='M18 12h8m-4-4 4 4-4 4' fill='none' stroke='%23354d3e' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.cs-piece-label strong { border-bottom: 1px solid #a9b8a7; }
.cs-piece-length { color: #494e43; }
.cs-piece-label small { color: #6b7065; font: 500 12px var(--body); }
.cs-piece-label:hover { background: var(--sage-soft); }
.cs-board-note { margin: 0; padding: 0 16px 13px; font-size: 14px; line-height: 1.4; }
.cs-empty { border-block: 1px solid var(--line); padding: 24px 0; }
.cs-empty h2 { font: 500 22px var(--display); margin: 0 0 12px; }
.cs-empty button, .cs-dismiss {
  min-height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--white); color: var(--ink);
}
.cs-empty button { padding-inline: 14px; }
.cs-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cs-dialog {
  width: min(800px, calc(100% - 28px));
  max-height: min(94dvh, 960px);
  overflow: hidden;
  color: var(--ink);
  background: var(--white);
  padding: clamp(16px, 3.5vw, 28px);
  border: 1px solid #bac5b7;
  border-radius: 17px;
  box-shadow: 0 20px 90px #1e302d38;
}
.cs-dialog[open] { display: flex; flex-direction: column; }
.cs-dialog:has(.cm-cut-list, .cm-face + .cm-face) { width: min(1060px, calc(100% - 28px)); }
@media (min-width: 720px) and (max-height: 850px) {
  .cs-dialog:has(.cm-cut-list) { padding: 15px 20px; }
  .cs-dialog:has(.cm-cut-list) .cs-dismiss { position: absolute; right: 16px; top: 12px; z-index: 1; }
  .cs-dialog:has(.cm-cut-list) .piece-title { margin: 4px 48px 6px 0; }
  .cs-dialog:has(.cm-cut-list) .cut-mark-guide { margin-block: 6px; }
  .cs-dialog:has(.cm-cut-list) .cm-title { display: none; }
  .cs-dialog:has(.cm-cut-list) .cs-step-link { margin-top: 8px; }
}
.cs-dialog-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.cs-dialog .cs-dialog-header { flex: none; }
.cs-dialog::backdrop { background: #24322883; }
body:has(.cs-dialog[open]) { overflow: hidden; }
.cs-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cs-saw-context { margin: 0; color: #4b6552; font: 600 14px/1.2 var(--body); }
.cs-dismiss { width: 44px; font: 400 26px/1 var(--body); }
.cs-saw-detail h3 { font: 500 clamp(22px, 3vw, 29px)/1.25 var(--display); margin: 7px 0 14px; }
.cs-dialog .piece-visual { overflow: hidden; background: #f6f5ed; border: 1px solid var(--line); border-radius: 10px; }
.cs-dialog .piece-visual svg { display: block; max-width: 100%; }
.cs-dialog .piece-buttons, .cs-dialog .piece-ends { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-dialog .piece-buttons button, .cs-dialog .piece-ends button {
  min-height: 44px; border-radius: 8px; padding: 7px 13px; border: 1px solid var(--line); background: var(--white); color: var(--ink);
}
.cs-dialog .piece-ends button[aria-pressed=true] { color: #263c2d; background: #e0e9de; border-color: #81997f; }
.cs-dialog .piece-notes { line-height: 1.5; }
.cs-step-link { display: inline-block; margin-top: 18px; padding-block: 5px; color: #385c49; font-weight: 600; text-underline-offset: 3px; }
@media (max-width: 680px) {
  .cs-grid { grid-template-columns: minmax(0, 1fr); }
}

.cs-sheet-layout{display:block;width:100%;height:auto;max-height:185px;background:#f7f2e6;border:1px solid #baac92}
.cs-sheet-layout text{text-anchor:middle;dominant-baseline:central;font:600 2.8px var(--mono);fill:#443422;pointer-events:none;paint-order:stroke;stroke:#e8d3ae;stroke-width:.5px}
.cs-sheet-layout path{fill:#e6cfaa;stroke:#856d50;stroke-width:.36}
.cs-sheet-layout g:not(.cs-other-piece){cursor:pointer}
.cs-sheet-layout g:not(.cs-other-piece):hover path{fill:#d3ddc5}
.cs-other-piece{opacity:.52}
.cs-strip-label{display:block;margin:6px 0 2px;color:#536353}
.cs-illustration+.cs-labels{padding-block:4px}
.cs-segment[aria-pressed=true] .cs-timber,.cs-piece-label[aria-pressed=true]{background-color:#dbe5d3}
