.label-editor { min-width: 0; }
.label-editor h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 1.875rem); font-weight: 900; letter-spacing: -.025em; }
.label-editor h2 { margin: 0; font-size: 1.08rem; font-weight: 800; }
.label-editor-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.label-editor-heading p { margin: .4rem 0 0; color: var(--color-ink-700); font-size: .95rem; }
.label-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 1rem; }
.label-editor-controls { display: grid; gap: 1rem; min-width: 0; }
.label-editor .card { min-width: 0; }
.label-editor-templates { position: relative; padding: .125rem 1rem; margin-bottom: .5rem; }
.label-editor-templates[open] { padding-bottom: 1rem; }
.label-editor-templates > summary { cursor: pointer; min-height: 44px; align-content: center; font-size: 1.08rem; font-weight: 800; }
.label-editor-templates[open] > summary { padding-right: 9rem; margin-bottom: .5rem; }
.label-editor-templates > summary:focus-visible { outline: 2px solid var(--color-brand-600); outline-offset: 2px; border-radius: .25rem; }
.label-editor-template-actions { position: absolute; top: .125rem; right: 1rem; }
.label-editor-template-actions button { padding: .4rem .7rem; font-size: .85rem; }
.label-editor-template-picker { display: flex; gap: .65rem; align-items: stretch; }
.label-editor-template-picker select { flex: 1; width: 0; text-overflow: ellipsis; }
.label-editor-template-picker button { flex-shrink: 0; }
#label-template-name { width: 100%; max-width: 38rem; }
.label-editor-section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .8rem; }
.label-editor-presets, .label-editor-small-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0 1rem; }
.label-editor-presets .btn-secondary { flex: 1 1 auto; padding-inline: .65rem; }
.label-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.label-editor input, .label-editor textarea, .label-editor select { min-width: 0; }
.label-editor-bottom { align-self: end; }
.label-editor-note { margin: .65rem 0; color: var(--color-ink-500); font-size: .85rem; line-height: 1.6; overflow-wrap: anywhere; }
.label-editor-fields { display: grid; gap: .85rem; min-width: 0; border: 0; padding: 0; margin: 0; }
.label-editor-fields:disabled { opacity: .5; }
.label-editor-checkbox { display: flex; align-items: center; align-self: end; gap: .55rem; min-height: 48px; margin: 0; cursor: pointer; }
.label-editor-checkbox input { width: 1.15rem; height: 1.15rem; accent-color: var(--color-brand-600); }
.label-editor-position summary, .label-editor-draft-tools summary { cursor: pointer; min-height: 44px; padding-block: .65rem; color: var(--color-ink-700); font-size: .9rem; font-weight: 700; }
.label-editor-position summary:focus-visible, .label-editor-draft-tools summary:focus-visible { outline: 2px solid var(--color-brand-600); outline-offset: 2px; border-radius: .25rem; }
.label-editor-preview-stage { display: flex; justify-content: center; align-items: center; padding: 1rem; min-height: 240px; overflow: hidden; background: #e8eeeb; border: 1px solid var(--color-line); border-radius: .85rem; }
.label-editor-paper { position: relative; flex: 0 1 auto; width: 100%; aspect-ratio: 5 / 3; background: white; box-shadow: 0 4px 20px rgb(23 33 34 / 14%); }
#label-preview-art, #label-preview-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
#label-preview-art { overflow: hidden; }
#label-preview-art svg { display: block; width: 100%; height: 100%; }
#label-preview-overlay { overflow: visible; touch-action: none; }
.label-editor-hit { fill: transparent; stroke: transparent; stroke-width: 1.5px; vector-effect: non-scaling-stroke; cursor: grab; outline: none; }
.label-editor-hit:hover { stroke: #78a696; stroke-dasharray: 4 3; }
.label-editor-hit[aria-pressed="true"], .label-editor-hit:focus-visible { stroke: #216555; stroke-dasharray: 4 3; }
.label-editor-hit[data-overflow="true"] { stroke: #a52c27; stroke-dasharray: 4 3; }
.label-editor-hit:active { cursor: grabbing; }
.label-editor-error { color: var(--color-danger-700); background: var(--color-danger-100); padding: .8rem; border-radius: .7rem; margin: .8rem 0; font-size: .9rem; line-height: 1.6; overflow-wrap: anywhere; }
.label-editor [hidden] { display: none !important; }
#label-print { width: 100%; }
.label-editor-draft-tools { margin-top: 1rem; border-top: 1px solid var(--color-line); padding-top: .3rem; }
@media (min-width: 960px) {
  .label-editor-layout { grid-template-columns: minmax(330px, 410px) minmax(0, 1fr); gap: 1.25rem; }
  .label-editor-preview-card { position: sticky; top: 1rem; }
  .label-editor-preview-stage { min-height: 340px; padding: 1.5rem; }
}
@media (max-width: 599px) {
  .label-editor-template-picker { flex-wrap: wrap; }
  .label-editor-template-picker select { width: 100%; flex-basis: 100%; }
  .label-editor-template-picker button { width: 100%; }
  .label-editor-preview-card { grid-row: 1; }
  .label-editor-preview-stage { min-height: 180px; padding: .75rem; }
}
