.cutting-workspace {
  position: relative;
  min-width: 0;
  overflow: auto;
  padding: clamp(14px, 2.4vw, 36px);
}
.cutting-workspace > * {
  width: min(100%, 1460px);
  margin-inline: auto;
}
.cutting-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.cutting-heading h1,
.cutting-results h2,
.cutting-thickness h3,
.cutting-sheet h4,
.cutting-heading p {
  margin: 0;
}
.cutting-heading h1 { font-size: clamp(20px, 2vw, 27px); }
.cutting-heading p { color: var(--ab-accent); font-weight: 650; }
.cutting-settings {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  background: var(--ab-panel);
  border: 1px solid var(--ab-line);
  border-radius: 9px;
}
.cutting-rotate {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  font-size: 13px;
}
.cutting-rotate input { accent-color: var(--ab-accent); }
.cutting-results {
  display: grid;
  grid-template-columns: minmax(320px, .87fr) minmax(0, 1.13fr);
  gap: 24px;
  margin-top: 21px;
}
.cutting-results h2 { font-size: 16px; }
.cutting-caption { margin: 6px 0 0; color: var(--ab-muted); font-size: 13px; }
.cutting-thickness { margin-top: 14px; }
.cutting-thickness h3 { margin-bottom: 8px; color: var(--ab-muted); font-size: 13px; }
.cutting-list { overflow-x: auto; }
.cutting-table {
  width: 100%;
  border: 1px solid var(--ab-line);
  border-collapse: collapse;
  font-size: 13px;
}
.cutting-table th,
.cutting-table td {
  padding: 8px;
  border-bottom: 1px solid var(--ab-line);
  text-align: left;
  vertical-align: top;
}
.cutting-table th {
  background: var(--ab-panel);
  color: var(--ab-muted);
  font-size: 12px;
  font-weight: 600;
}
.cutting-table th:nth-child(n+2),
.cutting-table td:nth-child(n+2) {
  white-space: nowrap;
  text-align: right;
}
.cutting-table td:nth-child(n+2) { font-family: var(--ab-mono); }
.cutting-names { overflow-wrap: anywhere; }
.cutting-part {
  display: inline-block;
  margin: 0 6px 3px 0;
  padding: 2px 6px;
  border: 1px solid #3c6171;
  border-radius: 4px;
  color: var(--ab-accent);
  font: 12px var(--ab-mono);
}
.cutting-part:hover,
.cutting-part.is-selected { color: var(--ab-deep); background: var(--ab-accent); }
.cutting-unplaced { display: block; margin-top: 3px; color: #ffce9a; }
.cutting-sheet {
  margin-bottom: 12px;
  padding: 12px;
  background: var(--ab-panel);
  border: 1px solid var(--ab-line);
  border-radius: 8px;
}
.cutting-sheet header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 10px;
  font-size: 13px;
}
.cutting-sheet header span { color: var(--ab-muted); font-family: var(--ab-mono); }
.cutting-sheet svg {
  display: block;
  width: 100%;
  max-height: 63vh;
}
.cutting-stock { fill: #d3e2e8; }
.cutting-usable { fill: #f2f7fa; }
.cutting-piece { cursor: pointer; }
.cutting-piece rect {
  fill: #b6dadd;
  stroke: #2f6773;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.cutting-piece text {
  fill: #173c48;
  font-family: var(--ab-mono);
  font-weight: 650;
  pointer-events: none;
}
.cutting-piece:hover rect,
.cutting-piece.is-selected rect { fill: #ffdb8d; stroke: #795826; }
.cutting-cut {
  stroke: #a25422;
  stroke-width: 1;
  stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.cutting-instructions { margin-top: 10px; font-size: 13px; }
.cutting-instructions summary { cursor: pointer; width: fit-content; color: var(--ab-accent); }
.cutting-instructions p,
.cutting-instructions ol { margin: 8px 0 0; color: var(--ab-muted); line-height: 1.55; }
.cutting-instructions ol { padding-left: 22px; color: var(--ab-text); }
.cutting-alert,
.cutting-empty {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--ab-line);
  border-radius: 7px;
  font-size: 13px;
}
.cutting-alert { color: #ffce9a; }
.cutting-empty { color: var(--ab-muted); }
.cutting-message {
  position: sticky;
  bottom: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--ab-line);
  border-radius: 7px;
  background: var(--ab-panel);
  font-size: 13px;
}
@media (max-width: 900px) {
  .cutting-settings { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cutting-rotate { grid-column: 1 / -1; min-height: 0; }
  .cutting-results { gap: 16px; }
}
@media (max-width: 740px) {
  .cutting-results { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .cutting-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assembly-app { grid-template-rows: auto auto 34px; }
  .assembly-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 4px 8px;
    padding-block: 6px;
  }
  .assembly-mode-switch { grid-column: 2 / -1; grid-row: 1; justify-self: start; }
  .assembly-project { grid-column: 1 / 3; }
  .assembly-project input { width: 100%; }
  .assembly-file-actions { grid-column: 3; }
}
