/* Independent editor and physical print geometry. Existing product labels keep their rules. */
.module-suspended { display: none !important; }
.module-nav { display: flex; gap: 4px; padding: 4px; margin: 0 0 28px; width: fit-content; background: #e7e9ee; border-radius: 9px; }
.module-nav button { padding: 9px 18px; border: 0; background: transparent; border-radius: 6px; color: var(--muted); font-weight: 600; font-size: 13px; }
.module-nav button.is-active { background: white; color: var(--ink); box-shadow: var(--shadow-sm); }
.custom-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 8px 0 24px; }
.custom-heading h2 { margin: 6px 0 8px; font-size: 27px; font-weight: 650; letter-spacing: -.03em; }
.custom-heading p { margin: 0; color: var(--muted); }
.custom-paper-badge { display: inline-block; flex-shrink: 0; padding: 5px 10px; color: #536176; background: #e9edf2; border-radius: 5px; font-size: 12px; font-variant-numeric: tabular-nums; }
.custom-workspace { display: grid; grid-template-columns: minmax(420px, 1.3fr) minmax(370px, 1fr); gap: 20px; align-items: start; }
.custom-card { background: white; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-xs); }
.custom-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; min-height: 58px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
.custom-card h3 { margin: 0; font-size: 14px; font-weight: 650; }
.custom-inline { display: flex; gap: 8px; align-items: center; }
.custom-library { padding: 16px 20px 12px; background: #f7f8fa; border-bottom: 1px solid var(--line-soft); }
.custom-library > label, .custom-editor-body > label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 7px; }
.custom-library select { min-width: 0; flex: 1; }
#customModule input[type=text], #customModule input[type=number], #customModule textarea, #customModule select { border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px 10px; background: white; min-height: 36px; box-shadow: none; }
#customModule input:focus-visible, #customModule textarea:focus-visible, #customModule select:focus-visible, #customModule button:focus-visible, .module-nav button:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
#customModule button:disabled { opacity: .45; }
#customModule .ghost-btn, #customModule .primary-btn { min-height: 34px; height: auto; white-space: nowrap; }
.custom-note { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.custom-note button { font-size: inherit; }
.custom-library p { margin: 8px 0 0; min-height: 17px; }
.custom-editor-body { padding: 18px 20px; }
#customName { width: 100%; }
.custom-blocks { display: grid; gap: 12px; margin: 20px 0 12px; }
.custom-block { padding: 12px; border: 1px solid #e4e7ec; border-radius: 7px; background: #fbfcfd; }
.custom-block-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.custom-block-head > label { color: #536176; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
#customModule .custom-block-head select { min-height: 26px; padding: 3px 6px; width: auto; font-size: 11px; }
.custom-block-actions { display: flex; gap: 8px; margin-left: auto; white-space: nowrap; }
.custom-text-button { border: 0; background: transparent; padding: 4px 0; color: #526582; font-size: 11.5px; text-decoration: underline; text-underline-offset: 3px; }
.custom-text-button:hover { color: #142d50; }
.custom-block textarea, .custom-block > input { width: 100%; resize: vertical; line-height: 1.5; }
.custom-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.custom-block .custom-check { margin-top: 9px; color: var(--muted); }
#customModule .custom-check input { width: 14px; min-height: 14px; height: 14px; padding: 0; margin: 0; accent-color: #1e293b; }
.custom-save-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.custom-save-actions > .custom-text-button { margin-left: auto; color: #b42318; }
.custom-status { margin: 0; padding: 0 20px 12px; font-size: 12px; color: var(--muted); min-height: 20px; overflow-wrap: anywhere; }
.custom-status:empty { display: none; }
.is-error { color: #b42318 !important; }
.custom-conflict { margin: 0 20px 12px; padding: 12px; border: 1px solid #f7d7a8; background: #fff8ed; border-radius: 6px; font-size: 12px; }
.custom-conflict p { margin: 0 0 8px; }
.custom-preview-card { position: sticky; top: 20px; }
.custom-preview-stage { min-height: 235px; display: flex; align-items: center; justify-content: center; padding: 30px 15px; background-color: #eef0f3; background-image: radial-gradient(#d7dce3 .8px, transparent .8px); background-size: 12px 12px; }
.custom-preview-label { width: 42mm; height: 15mm; transform: scale(2.1); box-shadow: 0 1mm 4mm #26344c1a; }
.custom-preview-placeholder { padding: 25px; text-align: center; color: #66748a; font-size: 13px; }
.custom-fit-status { padding: 14px 20px 0; margin: 0; font-size: 12px; color: #30654c; }
.custom-queue-add { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 20px; }
.custom-queue-add label { color: var(--muted); font-size: 12px; }
#customQty { width: 70px; }
.custom-queue-add button { flex: 1; }
#customQueueEdit { padding: 0 20px; margin: 0 0 10px; }
.custom-preview-note { margin: 0; padding: 0 20px 20px; font-size: 11.5px; line-height: 1.8; color: var(--muted); }
.custom-queue-card { margin-top: 20px; }
.custom-queue { padding: 0 20px; }
.custom-empty { margin: 0; padding: 25px 0; text-align: center; font-size: 12px; color: var(--muted); }
.custom-queue-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.custom-queue-number { font-size: 11px; color: #9ca3af; font-variant-numeric: tabular-nums; }
.custom-queue-title { min-width: 0; flex: 1; display: grid; gap: 3px; }
.custom-queue-title strong { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.custom-queue-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.custom-queue-row label { font-size: 12px; color: var(--muted); }
.custom-queue-row input { width: 70px; }
.custom-print-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; padding: 20px; }
.custom-print-controls > label:not(.custom-check) { display: grid; gap: 6px; font-size: 11.5px; color: var(--muted); }
.custom-print-controls input[type=number] { width: 95px; }
.custom-print-controls .custom-check { padding-bottom: 9px; }
#customSheetToggle { margin-left: auto; }
.custom-print-note { margin: 0; padding: 0 20px 18px; font-size: 11.5px; color: var(--muted); }
.custom-sheet-preview { background: #e9ecf0; padding: 24px; overflow: auto; max-height: 720px; }
.custom-page { width: 210mm; height: 297mm; position: relative; background: white; overflow: hidden; margin: 0 auto 16px; box-shadow: 0 2px 14px #1720301a; flex-shrink: 0; }
.custom-page-grid { position: absolute; width: 210mm; height: 285mm; display: grid; grid-template-columns: repeat(5, 42mm); grid-template-rows: repeat(19, 15mm); }
.custom-cell { width: 42mm; height: 15mm; position: relative; flex-shrink: 0; background: white; font-family: LabelTC, sans-serif; color: black; box-sizing: border-box; }
.custom-cell.with-border::after { content: ""; position: absolute; inset: 0; border: .15mm solid #9ca3af; pointer-events: none; }
.custom-safe { position: absolute; left: 2mm; top: 1mm; width: 38mm; height: 13mm; }
.custom-content-block { position: absolute; left: 0; width: 38mm; text-align: center; letter-spacing: 0; font-family: LabelTC, sans-serif; }
.custom-text-line { white-space: pre; padding: 0; margin: 0; }
.custom-barcode { display: block; margin: 0 auto; }
.custom-barcode-value { position: absolute; left: 0; width: 38mm; text-align: center; font-size: 6pt; font-weight: 400; white-space: pre; }
#customPrintRoot { display: none; }
@media (max-width: 1050px) { .custom-workspace { grid-template-columns: 1fr; } .custom-preview-card { position: static; } }
@media (max-width: 600px) {
  .custom-heading h2 { font-size: 22px; } .custom-heading { align-items: start; }
  .custom-library .custom-inline { flex-wrap: wrap; } .custom-library select { flex-basis: 100%; }
  .custom-block-head { gap: 6px; } .custom-block-actions { gap: 10px; }
  .custom-preview-label { transform: scale(1.7); }
  .custom-queue-row { flex-wrap: wrap; gap: 10px; } .custom-queue-title { flex-basis: calc(100% - 40px); }
  #customSheetToggle { margin-left: 0; } .custom-queue-row > .custom-block-actions { margin-left: auto; }
  .module-nav { width: 100%; } .module-nav button { flex: 1; padding: 9px 8px; }
}
@page custom-label-page { size: A4 portrait; margin: 0; }
@media print {
  body.print-labels #moduleNav, body.print-labels #customModule, body.print-labels #customPrintRoot { display: none !important; }
  body.print-custom-labels > * { display: none !important; }
  body.print-custom-labels > #customPrintRoot { display: block !important; }
  #customPrintRoot .custom-page { page: custom-label-page; margin: 0; box-shadow: none; break-inside: avoid; break-after: page; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  #customPrintRoot .custom-page:last-child { break-after: auto; }
}
.custom-batch { margin: 16px 20px 4px; padding: 12px 14px; border: 1px solid #e4e7ec; border-radius: 7px; background: #fbfcfd; }
.custom-batch summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.custom-batch[open] { display: grid; gap: 10px; }
.custom-batch textarea { width: 100%; resize: vertical; line-height: 1.5; font-family: ui-monospace, Menlo, monospace; tab-size: 12; }
.custom-batch .custom-inline { justify-content: space-between; flex-wrap: wrap; }
.custom-batch p { margin: 0; }
#customBatchStatus { padding: 0; }
