.neg-printer, .neg-printer-print-output {
    --logo-width: 18mm;
    --design-scale: 1;
    --height-scale: 1;
    --logo-left: 1.5mm;
    --logo-right: auto;
    --logo-top: 1.5mm;
    --logo-translate: 0;
    --page-w: 80mm;
    --page-h: 35mm;
    --font-size: 38pt;
    --label-bg: #fff;
    --label-fg: #000;
    --barcode-top: 68%;
    --barcode-width-percent: 85%;
    --barcode-text-scale: 0.68;
    --design-rotation: 0deg;
    --viewer-zoom: 1;
  }

.neg-printer {
    line-height: normal;
    font-family: Arial, Helvetica, sans-serif;
    background: #f3f3f3;
    color: #111;
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    min-height: 100vh;
    min-width: 0;
  }

.neg-printer-panel {
    background: #eef2f5;
    color: #172033;
    padding: 22px;
    overflow-y: auto;
    border-right: 1px solid #d7dde8;
  }

.neg-printer .section-title {
    margin: 0 0 12px;
    font-size: 15px;
    color: #172033;
    letter-spacing: 0.01em;
  }

.neg-printer-panel h1 {
    margin: 0 0 6px;
    font-size: 22px;
  }

.neg-printer-panel p {
    margin: 0 0 18px;
    color: #5f6c7b;
    line-height: 1.35;
    font-size: 13px;
  }

.neg-printer .group {
    border: 1px solid #d6e1ea;
    padding: 16px;
    margin-top: 16px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  }

.neg-printer .group:nth-of-type(1) { background: #8fc8ff; border-color: #5fa9f6; }
.neg-printer .group:nth-of-type(2) { background: #71ddb1; border-color: #44bd88; }
.neg-printer .group:nth-of-type(3) { background: #ffd6c2; border-color: #ff9f73; }
.neg-printer .group:nth-of-type(4) { background: #ffd15c; border-color: #dda418; }

.neg-printer label {
    display: block;
    margin: 11px 0 5px;
    font-size: 13px;
    color: #253247;
    font-weight: 700;
  }

.neg-printer input, .neg-printer select, .neg-printer textarea, .neg-printer button {
    width: 100%;
    font: inherit;
    border-radius: 8px;
  }

.neg-printer .group input, .neg-printer .group select, .neg-printer .group textarea, .neg-printer .group button {
    max-width: 100%;
  }

.neg-printer input, .neg-printer select, .neg-printer textarea {
    border: 1px solid #cbd5e1;
    background: rgba(255,255,255,0.86);
    color: #111827;
    padding: 10px;
  }

.neg-printer input:focus, .neg-printer select:focus, .neg-printer textarea:focus {
    outline: 2px solid #93c5fd;
    border-color: #60a5fa;
  }

.neg-printer textarea {
    min-height: 90px;
    resize: vertical;
  }

.neg-printer .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

.neg-printer button {
    border: 0;
    padding: 11px 12px;
    cursor: pointer;
    font-weight: 700;
    background: #fff;
    color: #111;
    margin-top: 10px;
  }

.neg-printer .printer-folders {
    display: flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid #b7c3cd;
    border-radius: 9px;
    background: #e5ebef;
  }

.neg-printer .printer-folders button {
    flex: 1;
    margin: 0;
    padding: 9px 4px;
    background: transparent;
    color: #263646;
  }

.neg-printer .printer-folders button[aria-pressed="true"] {
    background: #fff;
    box-shadow: 0 1px 3px #25324740;
    color: #172033;
  }

.neg-printer [data-printer-filters] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.neg-printer [data-printer-filters][hidden] { display: none; }

.neg-printer button.secondary {
    background: #415167;
    color: #fff;
  }

.neg-printer button.danger {
    background: #802020;
    color: #fff;
  }

.neg-printer .printer-admin-presets {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(37, 50, 71, .25);
  }

.neg-printer .printer-admin-presets summary {
    font-size: 13px;
    color: #253247;
    font-weight: 700;
    cursor: pointer;
  }

.neg-printer button.print {
    background: #18a558;
    color: white;
    font-size: 18px;
    padding: 14px;
  }

.neg-printer .barcode-section {
    margin-top: 14px;
    padding: 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.58);
    border: 1px solid rgba(90, 65, 45, 0.20);
  }

.neg-printer .barcode-section label {
    color: #3f1111;
  }

.neg-printer .barcode-section .hint {
    color: #5f1b1b;
  }

.neg-printer .hint {
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
  }

.neg-printer-workspace {
    padding: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    overflow: auto;
  }

.neg-printer .preview-title {
    font-weight: 700;
    color: #444;
  }

.neg-printer .sheet-wrap {
    background: #ddd;
    padding: 26px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    width: min(520px, 100%);
    height: var(--sheet-height, 195px);
    overflow: auto;
    flex: none;
    display: flex;
    justify-content: safe center;
    align-items: center;
  }

.neg-printer-label {
    position: relative;
    width: var(--page-w);
    height: var(--page-h);
    background: var(--label-bg);
    color: var(--label-fg);
    overflow: visible;
    border: 1px dashed #999;
  }

.neg-printer-lines {
    position: absolute;
    inset: calc(var(--text-center, 50%) - 50%) 0 calc(50% - var(--text-center, 50%));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: visible;
  }

.neg-printer-line {
    width: 100%;
    text-align: center;
    font-size: var(--font-size);
    font-family: var(--label-font-family, Arial, Helvetica, sans-serif);
    font-weight: var(--label-font-weight, 900);
    line-height: 0.95;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    padding: 0 1mm;
  }

.neg-printer-line [data-printer-earth] {
    display: block;
    width: 1em;
    height: 1em;
    margin: auto;
  }

.neg-printer-design {
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(var(--page-w) / var(--height-scale));
    height: calc(var(--page-h) / var(--height-scale));
    transform: translate(-50%, -50%) rotate(var(--design-rotation)) scale(calc(var(--height-scale) * var(--design-scale)));
    transform-origin: center center;
  }

.neg-printer-logo {
    position: absolute;
    top: var(--logo-top);
    left: var(--logo-left);
    right: var(--logo-right);
    transform: translateX(var(--logo-translate));
    width: var(--logo-width);
    display: none;
    fill: #000;
  }

.neg-printer-logo svg {
    width: 100%;
    height: auto;
    display: block;
  }

.neg-printer-label.show-logo .neg-printer-logo {
    display: block;
  }


.neg-printer-barcode {
    position: absolute;
    left: 50%;
    top: var(--barcode-top);
    transform: translate(-50%, -50%);
    width: var(--barcode-width-percent);
    display: none;
    background: transparent;
    line-height: 0;
  }

.neg-printer-label.show-barcode .neg-printer-barcode {
    display: block;
  }

.neg-printer-barcode svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
  }

.neg-printer-label.needs-barcode .neg-printer-barcode {
    min-height: var(--barcode-placeholder-height);
    box-sizing: border-box;
    border: 1px dashed #73808a;
  }

.neg-printer-label.needs-barcode .neg-printer-barcode svg { display: none; }

.neg-printer-barcode text {
    font-family: Arial, Helvetica, sans-serif !important;
  }

.neg-printer-barcode-caption {
    position: static;
    display: block;
    width: 100%;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    font-size: var(--barcode-caption-size, 14.35px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.5px;
    color: #000;
    white-space: nowrap;
    margin-top: 0.8mm;
  }


.neg-printer-label.show-barcode .neg-printer-lines {
    top: calc(var(--text-center, 26.5%) - 18.5%);
    bottom: calc(81.5% - var(--text-center, 26.5%));
    left: -3%;
    right: -3%;
    height: auto;
    justify-content: center;
    transform: scale(var(--barcode-text-scale));
    transform-origin: center center;
    z-index: 10;
    pointer-events: none;
  }

.neg-printer-label.show-barcode.show-logo .neg-printer-lines {
    top: calc(var(--text-center, 33%) - 13%);
    bottom: calc(87% - var(--text-center, 33%));
  }

.neg-printer-label.show-barcode .neg-printer-line {
    text-align: center;
    font-size: var(--font-size);
    line-height: 0.9;
    padding: 0 0.5mm;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }

.neg-printer-label.show-barcode .neg-printer-barcode {
    top: var(--barcode-top);
    z-index: 1;
  }


.neg-printer .viewer-utilities {
    width: min(520px, 100%);
    background: #ffffff;
    border: 1px solid #d6dde8;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10);
  }

.neg-printer .utility-header h2 {
    margin: 0;
    font-size: 17px;
    color: #172033;
  }

.neg-printer .utility-header p {
    margin: 3px 0 0;
    font-size: 12px;
    color: #64748b;
  }

.neg-printer .utility-row {
    margin-top: 12px;
  }

.neg-printer .utility-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 12px;
  }

.neg-printer .utility-grid label {
    margin-top: 0;
  }

.neg-printer .zoom-buttons {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    gap: 8px;
  }

.neg-printer .zoom-buttons button,
.neg-printer .utility-button,
.neg-printer .quick-print {
    background: #eef2f7;
    color: #172033;
    border: 1px solid #cbd5e1;
  }

.neg-printer .print-actions {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 12px;
    margin-top: 14px;
  }

.neg-printer .utility-print {
    margin-top: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, #21b66a, #128a4b);
    box-shadow: 0 5px 14px rgba(18, 138, 75, 0.25);
  }

.neg-printer .quick-print {
    margin-top: 0;
    border-radius: 12px;
    font-weight: 800;
  }

.neg-printer :is(input, select, textarea) {
  min-width: 0;
}

.neg-printer input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

.neg-printer .neg-printer-panel h1 {
  letter-spacing: normal;
  line-height: normal;
}

.neg-printer :is(.neg-printer-panel, .utility-header) p {
  overflow-wrap: normal;
}

.neg-printer .neg-printer-panel .neg-printer-status,
.neg-printer .viewer-utilities .neg-printer-status {
  margin: 8px 0 0;
  font-size: 13px;
  color: #172033;
}

.neg-printer .neg-printer-status:empty {
  display: none;
}

.neg-printer .neg-printer-status[data-error="true"] {
  color: #802020;
}

.neg-printer .viewer-utilities .neg-printer-warning {
  margin: 8px 0 0;
  color: #802020;
  font-size: 13px;
}

.neg-printer-sheet-content {
  display: grid;
  place-items: center;
  box-sizing: content-box;
  width: var(--viewer-width, var(--page-w));
  height: var(--viewer-height, var(--page-h));
  padding: var(--viewer-spill-top, 0) var(--viewer-spill-right, 0)
    var(--viewer-spill-bottom, 0) var(--viewer-spill-left, 0);
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  flex: none;
  margin: auto;
}

.neg-printer-sheet-content > .neg-printer-label {
  transform: scale(var(--viewer-zoom));
  transform-origin: center center;
}

.neg-printer-print-output {
  display: none;
  font: normal 16px Arial, Helvetica, sans-serif;
}

@media (max-width: 650px) {
  .neg-printer {
    grid-template-columns: minmax(0, 1fr);
  }

  .neg-printer-panel {
    border-right: 0;
  }

  .neg-printer-workspace {
    position: static;
    height: auto;
  }
}

@media print {
  body.neg-printer-printing {
    margin: 0 !important;
    background: #fff !important;
  }

  body.neg-printer-printing > :not(.neg-printer-print-output) {
    display: none !important;
  }

  body.neg-printer-printing > .neg-printer-print-output {
    display: block;
    width: var(--page-w);
  }

  .neg-printer-print-page {
    width: var(--page-w);
    height: var(--page-h);
    line-height: 0;
    overflow: clip;
    break-inside: avoid;
  }
  .neg-printer-print-page + .neg-printer-print-page {
    break-before: page;
  }
  .neg-printer-print-output .neg-printer-label {
    display: inline-block;
    vertical-align: top;
    contain: strict;
    box-sizing: border-box;
    line-height: normal;
    border: 1px solid transparent;
    transform: none;
    overflow: hidden;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

.neg-printer [data-printer-responsive] > summary,
.neg-printer-list > summary,
.neg-printer [data-printer-pattern] > summary {
  cursor: pointer;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 700;
}

.neg-printer [data-printer-responsive]:not(:first-child) {
  margin-top: 8px;
  border-top: 1px solid rgba(37, 50, 71, .22);
}

@media (max-width: 650px) {
  .neg-printer-panel, .neg-printer-workspace { padding: 14px; }
  .neg-printer .group { padding: 12px; margin-top: 10px; }
  .neg-printer-panel > p { margin-bottom: 8px; }
  .neg-printer textarea { min-height: 54px; }
  .neg-printer-workspace { gap: 10px; }
  .neg-printer .viewer-utilities { width: 100%; }
  .neg-printer .print-actions { margin-top: 0; }
  .neg-printer .print-actions button { min-height: 44px; }
}

.neg-printer .print-actions { grid-template-columns: minmax(0, 1fr); }
.neg-printer-list > summary { min-height: 44px; align-content: center; }
.neg-printer-list textarea { min-height: 70px; }
.neg-printer-list .hint { margin: 4px 0; }
.neg-printer-list select { min-height: 44px; }

.neg-printer-dialog {
  width: min(30rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 1.35rem;
  border: 1px solid var(--workshop-line, #dedcdc);
  border-radius: .75rem;
  background: #fff;
  color: var(--workshop-ink, #202024);
}
.neg-printer-dialog::backdrop { background: rgb(25 21 24 / .48); }
.neg-printer-dialog h2 { margin: 0 0 1rem; font-size: 1.25rem; }
.neg-printer-dialog h3 { margin: 0; font-size: 1rem; }
.neg-printer-dialog section + section { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--workshop-line, #dedcdc); }
.neg-printer-dialog p { margin: .4rem 0 .6rem; font-size: .9rem; line-height: 1.45; }
.neg-printer-dialog p:empty { display: none; }
.neg-printer-dialog a { display: block; color: #80172b; font-weight: 650; margin: .55rem 0; }
.neg-printer-dialog label { display: block; font-weight: 650; margin: .6rem 0 .25rem; }
.neg-printer-dialog input { width: 100%; padding: .65rem; margin-bottom: .5rem; font: inherit; border: 1px solid #817b7f; border-radius: .4rem; }
.neg-printer-dialog-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.neg-printer-dialog-close { display: block; margin: 1rem 0 0 auto; }
[data-helper-state="ready"] { color: #106239; }
[data-helper-state="attention"], [data-helper-state="offline"] { color: #941931; }
.neg-printer-print-output.neg-helper-render {
  display: block;
  position: fixed;
  left: -100000px;
  top: 0;
  pointer-events: none;
}
.neg-helper-render .neg-printer-label {
  display: inline-block;
  vertical-align: top;
  contain: strict;
  box-sizing: border-box;
  line-height: normal;
  border: 1px solid transparent;
  transform: none;
  overflow: hidden;
}
