:root {
  --bg: #04030c; --panel: rgba(16, 20, 42, .72); --line: rgba(120, 255, 190, .18); --text: #e9f2ff; --muted: #9fb0c8;
  --accent: #39ff8a; --accent-2: #8dffc0; --err: #ff8080; --cyan: #3ce7ff; --violet: #9b5cff;
}
body { background: var(--bg); }
body::before { content: ""; position: fixed; inset: -10%; z-index: -2; pointer-events: none;
  background: radial-gradient(40% 35% at 15% 15%, rgba(155, 92, 255, .25), transparent 70%),
              radial-gradient(35% 30% at 90% 25%, rgba(60, 231, 255, .16), transparent 70%),
              radial-gradient(45% 40% at 60% 100%, rgba(57, 255, 138, .14), transparent 70%);
  animation: nebula 40s ease-in-out infinite alternate; }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22240%22%20height%3D%22240%22%3E%3Cg%20fill%3D%22%23fff%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2220%22%20r%3D%221%22%20opacity%3D%22.7%22/%3E%3Ccircle%20cx%3D%2280%22%20cy%3D%2244%22%20r%3D%22.6%22%20opacity%3D%22.5%22/%3E%3Ccircle%20cx%3D%22150%22%20cy%3D%2216%22%20r%3D%221.2%22%20opacity%3D%22.8%22/%3E%3Ccircle%20cx%3D%22210%22%20cy%3D%2270%22%20r%3D%22.7%22%20opacity%3D%22.6%22/%3E%3Ccircle%20cx%3D%2240%22%20cy%3D%22120%22%20r%3D%22.8%22%20opacity%3D%22.5%22/%3E%3Ccircle%20cx%3D%22120%22%20cy%3D%22100%22%20r%3D%221%22%20opacity%3D%22.7%22/%3E%3Ccircle%20cx%3D%22190%22%20cy%3D%22150%22%20r%3D%22.6%22%20opacity%3D%22.5%22/%3E%3Ccircle%20cx%3D%2220%22%20cy%3D%22200%22%20r%3D%221.1%22%20opacity%3D%22.6%22/%3E%3Ccircle%20cx%3D%22100%22%20cy%3D%22190%22%20r%3D%22.7%22%20opacity%3D%22.6%22/%3E%3Ccircle%20cx%3D%22170%22%20cy%3D%22225%22%20r%3D%22.9%22%20opacity%3D%22.7%22/%3E%3Ccircle%20cx%3D%22230%22%20cy%3D%22200%22%20r%3D%22.5%22%20opacity%3D%22.4%22/%3E%3C/g%3E%3Ccircle%20cx%3D%2260%22%20cy%3D%2270%22%20r%3D%221%22%20fill%3D%22%2339ff8a%22%20opacity%3D%22.6%22/%3E%3Ccircle%20cx%3D%22200%22%20cy%3D%22110%22%20r%3D%22.9%22%20fill%3D%22%233ce7ff%22%20opacity%3D%22.6%22/%3E%3C/svg%3E"); animation: twinkle 6s ease-in-out infinite alternate; }
@keyframes nebula { to { transform: translate(3%, -3%) scale(1.06); } }
@keyframes twinkle { to { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { body::before, body::after { animation: none; } }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { padding: 14px 22px; border-bottom: 1px solid var(--line); background: rgba(4, 3, 12, .7); backdrop-filter: blur(8px); display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.brand { font: 800 22px Orbitron, system-ui, sans-serif; letter-spacing: .06em; display: flex; align-items: center; gap: 10px; }
.brand svg { width: 40px; height: 40px; filter: drop-shadow(0 0 10px rgba(57, 255, 138, .7)); }
.brand b { color: var(--accent); }
.brand small { font: 600 11px Inter, system-ui, sans-serif; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; margin-left: 4px; }
.brand small a { color: var(--accent); text-decoration: none; }
.logo { color: var(--accent); }
.sub { color: var(--muted); font-size: 14px; }
.layout { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 20px; padding: 20px; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }
.panel { background: var(--panel); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 40px rgba(57, 255, 138, .06); padding: 18px; align-self: start; }
.panel h3 { margin: 18px 0 8px; font: 700 12px Orbitron, system-ui, sans-serif; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.field { display: block; margin: 0 0 12px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 10px; border-radius: 9px; border: 1px solid var(--line); background: rgba(5, 7, 15, .85); color: var(--text); font: inherit;
}
.field textarea { min-height: 70px; resize: vertical; }
.field input[type=checkbox] { width: auto; margin-right: 6px; }
.check { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; color: var(--text); font-size: 14px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
button { font: inherit; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--text); cursor: pointer; transition: box-shadow .15s, border-color .15s; }
button:hover { border-color: var(--accent); box-shadow: 0 0 14px rgba(57, 255, 138, .25); }
button.primary { background: var(--accent); border-color: var(--accent); color: #031a0c; font-weight: 800; box-shadow: 0 0 22px rgba(57, 255, 138, .45); }
.msg { min-height: 1.4em; margin: 10px 0 0; color: var(--accent-2); font-size: 14px; }
.list { margin: 6px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.list summary { cursor: pointer; font-weight: 600; }
.note { color: var(--muted); font-size: 13px; margin: 6px 0; }
.help { margin-top: 12px; color: var(--muted); font-size: 13px; }
.help summary { cursor: pointer; color: var(--text); }
.preview-wrap { min-width: 0; }
.preview-head { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.err { color: var(--err); }
.stage { background: radial-gradient(60% 60% at 50% 50%, rgba(57, 255, 138, .08), transparent 70%), rgba(5, 7, 15, .55); backdrop-filter: blur(4px); border: 1px solid var(--line); border-radius: 14px; min-height: 420px; display: grid; place-items: center; padding: 24px; overflow: hidden; }
#scaler { transform-origin: center center; }
.hint { color: var(--muted); font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.label { box-shadow: 0 0 0 1px rgba(57, 255, 138, .25), 0 10px 40px rgba(57, 255, 138, .18); }

/* ---------- the label itself (real units) ---------- */
.label { background: #fff; color: #000; overflow: hidden; position: relative; font-family: Arial, Helvetica, sans-serif; box-shadow: 0 6px 30px rgba(0,0,0,.45); border-radius: 2px; }
.label .pad { position: absolute; inset: 0.06in; display: flex; flex-direction: column; }
.label .grow { flex: 1; min-height: 0; }
.label .center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.label .bc { width: 100%; display: block; }
.label .qr { display: block; }
.label .qr svg { width: 100%; height: 100%; display: block; }
.label .hr { border-top: 0.02in solid #000; margin: 0.04in 0; }
.label .small { font-size: 7pt; }
.label .tiny { font-size: 6pt; text-transform: uppercase; letter-spacing: .03em; }
.label .bold { font-weight: 700; }
.label .mono { font-family: "Courier New", monospace; }
.label .clip { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.label .band { color: #fff; font-weight: 700; text-align: center; }

/* ---------- printing ---------- */
#printArea { display: none; }
@media print {
  body::before, body::after { display: none !important; }
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block; }
  #printArea .label { box-shadow: none; border-radius: 0; }
  .sheet { position: relative; break-after: page; page-break-after: always; }
  .sheet .label { position: absolute; }
  .single { break-after: page; page-break-after: always; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
