.production-dialog {
  box-sizing: border-box;
  width: min(940px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 0;
  color: #e7f2fc;
  background: #101e30;
  border: 1px solid #38536f;
  border-radius: 14px;
  box-shadow: 0 22px 80px #030a15bd;
}
.production-dialog::backdrop { background: #040b14c9; }
.production-dialog label { font-size: .875rem; }
.production-head, .production-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
}
.production-head { border-bottom: 1px solid #2a415a; }
.production-footer { border-top: 1px solid #2a415a; }
.production-head h2 { margin: 0 0 3px; color: #eef6ff; font-size: 1.25rem; }
.production-head p, .production-footer p { margin: 0; color: #afc5da; font-size: .875rem; }
.production-footer .btn, .production-head .btn { flex: none; }
.cut-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px 20px; }
.cut-toolbar label { width: min(250px,100%); }
.cut-status { flex: 1 1 150px; color: #a0e1ff; font-size: .875rem; }
.cut-status.cut-error { color: #ffb6bf; }
.cut-scroll {
  display: grid;
  justify-items: safe center;
  max-height: 49dvh;
  overflow: auto;
  padding: 16px;
  margin: 0 20px 16px;
  border: 1px solid #293f56;
  border-radius: 9px;
  background: #071322;
}
#cutGrid { display: grid; gap: 3px; width: max-content; }
#cutGrid button {
  width: 36px;
  min-width: 0;
  padding: 1px;
  border: 1px solid #4998bf;
  border-radius: 4px;
  background: #183f58;
  color: #dff6ff;
  font: 600 11px system-ui, sans-serif;
}
#cutGrid button:hover { border-color: #bcefff; background: #265673; }
#cutGrid button:focus-visible { outline: 2px solid #ffd680; outline-offset: -2px; }
#cutGrid button[aria-pressed="true"] { background: #111e2d; color: #a2b7cd; border-color: #64768a; border-style: dashed; }
.sheet-dialog { width: min(1330px,calc(100vw - 24px)); }
.sheet-workspace { display: grid; grid-template-columns: minmax(245px,300px) minmax(0,1fr); }
.sheet-controls {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  background: #102034;
  border-right: 1px solid #2a415a;
}
.sheet-blocks { min-inline-size: 0; border: 1px solid #38536f; border-radius: 9px; margin: 0; padding: 4px 8px; }
.sheet-blocks legend { color: #c5d8ed; font-size: .8125rem; padding: 0 4px; }
.sheet-row { display: flex; align-items: center; gap: 7px; justify-content: space-between; }
.sheet-row .tick { margin: 6px 0; }
.sheet-row-buttons { display: flex; gap: 4px; }
.sheet-row-buttons button {
  min-width: 26px;
  height: 27px;
  color: #e0f2ff;
  background: #163049;
  border: 1px solid #3d5972;
  border-radius: 4px;
}
.sheet-view { min-width: 0; overflow: auto; height: min(69dvh,850px); padding: 20px; background: #091521; }
.sheet-view .blue-drawing { min-width: 500px; }

.blue-drawing {
  box-sizing: border-box;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
  background: #fff;
  color: #17314a;
  font: 13px/1.42 system-ui, sans-serif;
  text-align: left;
}
.blue-drawing .drawing-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 0 0 14px;
  border-bottom: 3px solid #1487ba;
}
.blue-drawing .drawing-head h1 { margin: 0 0 4px; font-size: 23px; line-height: 1.15; overflow-wrap: anywhere; }
.blue-drawing .drawing-head p { margin: 2px 0 0; color: #405b71; overflow-wrap: anywhere; }
.drawing-head img { display: block; width: min(146px,30%); height: auto; flex: none; }
.drawing-totals { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 6px; margin: 12px 0 20px; break-inside: avoid; }
.drawing-totals div { border: 1px solid #c7d8e9; background: #f3f8fd; padding: 6px 8px; }
.drawing-totals dt { color: #456077; font-size: 11px; }
.drawing-totals dd { margin: 2px 0 0; color: #173b60; font-weight: 750; }
.drawing-section { margin-top: 15px; }
.blue-drawing .drawing-section h2 {
  margin: 0 0 6px;
  padding: 0 0 4px;
  border-bottom: 1px solid #c2d4e6;
  color: #0c416b;
  font-size: 15px;
  break-after: avoid;
}
.drawing-vector { break-inside: avoid; }
.drawing-vector svg { display: block; width: 100%; height: auto; max-height: 380px; }
.blue-drawing table { width: 100%; border-collapse: collapse; font-size: 11px; }
.blue-drawing th, .blue-drawing td {
  padding: 5px 6px;
  border: 1px solid #c5d6e7;
  color: #17314a;
  text-align: left;
  overflow-wrap: anywhere;
}
.blue-drawing th { background: #e7f0f9; color: #16436d; }
.blue-drawing tr { break-inside: avoid; }
.drawing-table-note, .drawing-empty { color: #49657c; margin: 5px 0; font-size: 11px; }
.drawing-notes p { white-space: pre-wrap; overflow-wrap: anywhere; }
.drawing-alerts { margin-top: 6px; font-size: 11px; color: #69420e; }
.drawing-alerts ul { padding-left: 18px; }
.drawing-footer { margin-top: 16px; padding-top: 5px; border-top: 1px solid #a8bdcf; color: #435f76; font-size: 11px; }
.drawing-print { margin: 0; background: #e2ebf3; }
.drawing-print-tools {
  position: sticky;
  top: 0;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  color: #e6f1ff;
  background: #152d46;
  font: 13px system-ui, sans-serif;
}
.drawing-print-tools button {
  background: #056ab1;
  color: #fff;
  border: 1px solid #55b3f0;
  border-radius: 5px;
  padding: 7px 10px;
  font: 600 13px system-ui, sans-serif;
  cursor: pointer;
}
@media (max-width: 760px) {
  .sheet-workspace { grid-template-columns: 1fr; }
  .sheet-controls { grid-template-columns: repeat(2,minmax(0,1fr)); border-right: 0; }
  .sheet-blocks { grid-column: 1/-1; }
  .sheet-view { height: 52dvh; padding: 10px; }
  .production-head, .production-footer { padding-inline: 12px; }
}
@media print {
  .drawing-print { background: #fff; }
  .drawing-print-tools { display: none; }
  .drawing-print .blue-drawing { width: auto; max-width: none; padding: 0; margin: 0; print-color-adjust: exact; }
  .drawing-print .drawing-vector svg { max-height: 92mm; }
  .drawing-print .drawing-head { break-inside: avoid; }
}
