.sheets-workspace { display: grid; grid-template-columns: 258px minmax(0, 1fr); min-height: calc(100dvh - 67px); }
.showing-sheets .workspace { display: none; }
.sheets-controls { position: sticky; top: 0; align-self: start; max-height: 100dvh; overflow: auto; padding: 1rem; border-right: 1px solid var(--line); background: var(--panel); }
.sheets-head h2 { font-size: 1.13rem; }
.sheets-head p { font-size: .82rem; color: var(--muted); margin: .35rem 0 1rem; }
.sheets-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.sheets-actions button { font-size: .82rem; }
#sheet-settings { margin-top: .95rem; display: grid; gap: .65rem; }
#sheet-settings label { display: grid; gap: .25rem; color: #c2cede; font-size: .86rem; }
#sheet-settings label[hidden] { display: none; }
#sheet-settings #sheet-foundation-visibility { display: flex; align-items: center; gap: .45rem; }
#sheet-show-foundations { width: auto; margin: 0; }
#sheet-settings .sheet-check { grid-template-columns: auto 1fr; align-items: baseline; gap: .45rem; }
#sheet-settings .sheet-check input { width: auto; }
#sheet-settings input, #sheet-settings select, #sheet-settings textarea, #sheet-settings button { font-size: .88rem; }
#sheet-settings textarea { width: 100%; resize: vertical; padding: .45rem; color: inherit; background: var(--control); border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.sheet-status, .sheet-fields small { color: var(--muted); font-size: .78rem; }
.sheet-status { margin: .65rem 0 0; }
.sheet-status[data-error] { color: #ffb7ad; }
#sheet-settings details { border-top: 1px solid var(--line); padding-top: .55rem; min-width: 0; }
#sheet-settings summary { cursor: pointer; font-size: .88rem; }
.sheet-fields { display: grid; gap: .55rem; margin-top: .65rem; }
.sheet-fields input { min-width: 0; }
#sheet-logo { max-width: 100%; }
#center-section { justify-self: start; }
#pick-section { justify-self: start; }
#jog-section { justify-self: start; }
#section-jog-list:empty { display: none; }
#section-jog-list { display: grid; gap: .35rem; }
#section-jog-list > div { display: flex; align-items: center; justify-content: space-between; gap: .45rem; }
[data-section-marker] { cursor: move; touch-action: none; }
.picking-section [data-cut-plan], .picking-section [data-section-marker] { cursor: crosshair; }
.dragging-section [data-cut-plan] { cursor: grabbing; }
.sheet-jumps { display: grid; gap: .65rem; margin-top: 1.2rem; padding-top: .85rem; border-top: 1px solid var(--line); }
.sheet-jumps a { color: var(--accent); font-size: .875rem; text-underline-offset: .2em; }
.sheet-pages { min-width: 0; padding: clamp(.5rem, 2.6vw, 2rem); background: var(--toolbar); }
.sheet-page { width: 100%; max-width: 1280px; margin: 0 auto 1.25rem; aspect-ratio: 420 / 297; background: #fff; color: #21323e; box-shadow: 0 8px 26px #10172380; scroll-margin-top: 1rem; }
.sheet-page:last-child { margin-bottom: 0; }
.sheet-page > svg { display: block; width: 100%; height: 100%; }
#sheet-cover { position: relative; }
.sheet-live-map { position: absolute; border: 0; background: #f2f6f8; }
.render-dialog { width: min(800px, 94vw); }
#render-status { margin: .55rem 0; color: var(--muted); font-size: .9rem; }
#render-preview { display: block; width: 100%; height: auto; max-height: 65dvh; object-fit: contain; margin: .8rem 0; border-radius: 4px; }
.render-actions { flex-wrap: wrap; }
.render-actions a { padding: .48rem .7rem; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: inherit; }
.render-actions a:hover, .render-actions a:focus-visible { border-color: var(--accent); }
.render-actions [download] { background: var(--accent); color: #161c35; font-weight: 650; }
.sheet-page svg text { font-family: 'Arial', system-ui, sans-serif; }
.sheet-page [data-view-title] { cursor: grab; touch-action: none; user-select: none; outline: none; }
.sheet-page [data-view-title]:is(:hover, :focus-visible, [data-dragging]) .view-title-hit { fill: #21708d12; stroke: #21708d; stroke-width: .25; }
.sheet-page [data-view-title][data-dragging] { cursor: grabbing; }
.sheet-page :is([data-grid-band], [data-move-drawing]) { cursor: grab; touch-action: none; user-select: none; }
.sheet-page :is([data-grid-band], [data-move-drawing])[data-dragging] { cursor: grabbing; }
.sheet-page [data-grid-band]:hover circle { stroke: #21708d; stroke-width: .5; }
.sheet-page svg[data-grid-dragging] { overflow: visible; }
.sheet-page [data-move-drawing] { opacity: .85; }
.sheet-page [data-move-drawing]:is(:hover, [data-dragging]) { opacity: 1; }
.view-title-offsets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.view-title-actions { flex-wrap: wrap; }
@media (max-width: 760px) {
  .sheets-workspace { grid-template-columns: minmax(0, 1fr); }
  .sheets-controls { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
  #sheet-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet-jumps { display: flex; flex-wrap: wrap; }
}
@page { size: A3 landscape; margin: 0; }
@media print {
  html, body.showing-sheets { margin: 0; padding: 0; background: #fff; color-scheme: light; }
  .showing-sheets .topbar, .showing-sheets .workspace, .showing-sheets .sheets-controls { display: none !important; }
  .sheets-workspace, .sheet-pages { display: block; width: auto; min-height: 0; padding: 0; margin: 0; background: #fff; }
  .sheet-page { width: 419.8mm; height: 296.8mm; max-width: none; margin: 0; overflow: hidden; box-shadow: none; break-inside: avoid; break-after: page; print-color-adjust: exact; }
  .sheet-page > svg { width: 420mm; height: 297mm; max-width: none; }
  .view-title-hit, [data-move-drawing] { display: none; }
  .sheet-live-map { display: none; }
  .sheet-page:last-child { break-after: auto; }
}
