:is(.label-shell, .label-workshop .header-inner) { width: min(1360px, calc(100% - 56px)); }
.label-shell { padding-bottom: 26px; }
.label-intro { min-height: 144px; }
.label-intro h1 { font-size: clamp(33px, 4vw, 43px); }
.label-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.label-workspace { display: grid; grid-template-columns: 244px minmax(0, 1fr) 250px; align-items: start; gap: 15px; }
.label-workspace .panel-heading { padding-inline: 17px; min-height: 56px; }
.label-controls { display: grid; gap: 16px; padding: 17px 16px; }
.tool-group { display: grid; gap: 10px; min-width: 0; }
.tool-group h3 { margin: 0; font-size: 13px; font-weight: 750; }
.label-tools .tool-group + .tool-group, .layer-group { padding-top: 16px; border-top: 1px solid var(--line); }
.paper-presets, .add-row, .mark-grid { display: grid; gap: 6px; }
.paper-presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.add-row, .mark-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.paper-presets .preset { min-height: 33px; padding-inline: 3px; border-color: var(--line); font-size: 11px; color: var(--body); }
.preset[aria-pressed="true"], .preset:hover { color: var(--purple-dark); background: var(--purple-light); border-color: #d3c6fb; }
.label-controls .unit-input input { padding-right: 31px !important; }
.label-controls .unit-input span { right: 8px; }
.add-row .button, .import-button { min-height: 38px; font-size: 12px; }
.add-row .icon, .import-button .icon { width: 15px; height: 15px; }
.mark-button { min-width: 0; min-height: 73px; padding: 8px 2px; border-color: var(--line); background: #faf9fd; color: var(--body); flex-direction: column; gap: 7px; font-size: 10px; line-height: 1.25; }
.mark-button:hover { border-color: #d3c6fb; background: var(--purple-light); color: var(--purple-dark); }
.mark-button svg { width: 29px; height: 27px; overflow: visible; }
.mark-button[draggable="true"] { cursor: grab; }
#mark-grid .mark-button[id] { border-style: dashed; }
.origin-button { min-height: 37px; font: 700 12px/1 Arial, sans-serif; letter-spacing: .035em; }
.label-controls .hint { margin-top: 0; }
.label-controls .hint a { display: inline-block; color: var(--purple-dark); text-underline-offset: 2px; }
.design-area { padding: 14px; }
.design-stage {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(390px, 59vh, 633px);
  overflow: hidden;
  border: 1px solid #e2deee;
  border-radius: 10px;
  background: radial-gradient(circle, #d2c9e8 1px, transparent 1px) 0 0 / 16px 16px #f4f2fa;
}
.sheet-holder { position: relative; margin-left: 18px; margin-top: 24px; }
#design-sheet { display: block; width: 100%; height: 100%; background: white; box-shadow: 0 0 0 1px #e2deeb, 0 9px 25px #26165022; touch-action: none; user-select: none; }
.ruler { display: flex; position: absolute; justify-content: space-between; color: var(--muted); font: 10px/1 Consolas, monospace; pointer-events: none; }
.ruler-width { left: 0; right: 0; top: -19px; height: 12px; border-bottom: 1px solid #c5bcd8; }
.ruler-width::before, .ruler-width::after { content: ""; height: 4px; width: 1px; background: #aba0c2; position: absolute; bottom: -1px; }
.ruler-width::after { right: 0; }
.ruler-height { flex-direction: column; align-items: end; padding-right: 4px; right: calc(100% + 7px); top: 0; bottom: 0; border-right: 1px solid #c5bcd8; }
.design-object { cursor: grab; }
#design-sheet.dragging .design-object { cursor: grabbing; }
.selection-outline { fill: none; stroke: var(--purple); stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.drawn-item { pointer-events: none; }
.shrink-handle { fill: var(--purple); stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; cursor: nwse-resize; }
.design-hint { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 11px; padding: 10px 1px 0; font-size: 12px; line-height: 1.55; color: var(--muted); }
.label-status { background: #f5f0ff; color: var(--purple-dark); border-radius: 7px; margin-top: 9px; padding: 7px 9px; font-size: 12px; line-height: 1.55; }
.label-status[data-error="true"] { background: #fdf0f2; color: #a5243c; }
#selection-fields { display: grid; gap: 14px; }
.placement-fields { gap: 9px; }
.label-inspector .field :is(input, select) { min-height: 38px; }
.layer-list { display: grid; gap: 3px; max-height: 232px; overflow: auto; }
.layer-entry { margin: 0 2px; justify-content: flex-start; min-width: 0; min-height: 34px; gap: 7px; padding: 4px 7px; font-size: 12px; color: var(--body); text-align: left; }
.layer-entry span { overflow: hidden; text-overflow: ellipsis; }
.layer-entry .icon { width: 15px; height: 15px; }
.layer-entry:hover, .layer-entry[aria-pressed="true"] { background: var(--purple-light); color: var(--purple-dark); }
.remove-element:not(:disabled):hover { color: #a5243c; background: #fdf0f2; }

@media (max-width: 1100px) {
  .label-workspace { grid-template-columns: 210px minmax(0, 1fr) 214px; gap: 11px; }
  :is(.label-shell, .label-workshop .header-inner) { width: calc(100% - 36px); }
  .label-controls { padding-inline: 12px; }
  .label-workspace .panel-heading { padding-inline: 13px; }
}
@media (max-width: 900px) {
  .label-workspace { grid-template-columns: 220px minmax(0, 1fr); }
  .label-inspector { grid-column: 1 / -1; }
}
@media (max-width: 660px) {
  :is(.label-shell, .label-workshop .header-inner) { width: calc(100% - 26px); }
  .label-intro { align-items: flex-start; flex-direction: column; gap: 12px; }
  .label-actions .button { min-height: 38px; font-size: 12px; }
  .label-workspace { grid-template-columns: minmax(0, 1fr); }
  .label-preview { grid-row: 1; }
  .label-inspector { grid-row: 2; }
  .design-stage { height: clamp(225px, 65vw, 380px); }
  .label-preview .panel-heading { min-height: 50px; }
  .design-area { padding: 10px; }
  .label-inspector .field :is(input, select), .label-tools .field input { font-size: 16px; }
}

@media print {
  body.label-workshop { margin: 0; }
  .label-workshop #print-area svg { max-width: none; height: revert; }
}
