/* barcode.css (W1, barcode_maker): the form stage (mode, symbology, data + live preview; list + mini A4), the side
   options and the result box. Builds on tool.css + local.css. */
.bc { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
/* six options = 3 × 2, the second row ruled like the first (as .seg--pos) */
.bc__sym .seg__o:nth-child(n+4), .bc__sheets .seg__o:nth-child(n+4) { border-top: 1px solid var(--ink); }
.bc__sym .seg__o:nth-child(4), .bc__sheets .seg__o:nth-child(4) { border-inline-start: 0; }
.bc__sheets .seg__o { min-height: 58px; }

/* data field: big, mono, the check-digit line under it */
.bc__data { font-family: var(--f-code); font-size: clamp(20px, 2.2vw, 28px); letter-spacing: .06em; min-height: 58px; }
.bc__data::placeholder { color: var(--ink-3); opacity: .7; letter-spacing: .02em; }
.bc__hint { min-height: 1.45em; font-size: var(--t-meta); color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.bc__hint:empty { visibility: hidden; }
.bc__hint::before { content: ""; width: 7px; height: 7px; flex: none; background: var(--ink-3); }
.bc__hint.is-add { color: var(--ink); }
.bc__hint.is-add::before, .bc__hint:not(.is-bad):not(.is-add)::before { background: var(--ok); }
.bc__hint.is-bad { color: var(--signal-ink); font-weight: 560; }
.bc__hint.is-bad::before { background: var(--signal); }

/* live preview: the label on a cutting mat */
.bc__prev { margin: 0; display: grid; gap: 10px; }
.bc__prev, .bc__a4 { padding: 22px; border: 1px solid var(--rule); background: var(--paper-2);
  background-image: linear-gradient(var(--rule-2) 1px, transparent 1px), linear-gradient(90deg, var(--rule-2) 1px, transparent 1px); background-size: 16px 16px; }
.bc__card { position: relative; justify-self: center; width: 100%; max-width: 460px; padding: 12px; background: #fff; box-shadow: 6px 6px 0 var(--ink); transition: opacity .35s var(--e-out); overflow: hidden; }
[dir="rtl"] .bc__card { box-shadow: -6px 6px 0 var(--ink); }
.bc__card svg { display: block; width: 100%; height: auto; max-height: 300px; }
.bc__card.is-ghost { box-shadow: none; outline: 1px dashed var(--ink-3); }
.bc__card.is-ghost svg { opacity: .2; }
.bc__cd { fill: var(--signal-ink); }
.bc__laser { position: absolute; inset-inline: 4%; top: 42%; height: 2px; background: var(--signal); box-shadow: 0 0 10px 1px rgba(229, 58, 36, .55); opacity: 0; pointer-events: none; }
.motion .bc__card.is-ok .bc__laser { animation: bcScan 1.5s var(--e-io) 2 alternate; }
.motion .bc__card.is-ok:hover .bc__laser { animation: bcScan 1.5s var(--e-io) infinite alternate; }
@keyframes bcScan { 0% { opacity: 0; transform: translateY(-30px); } 20% { opacity: .9; } 100% { opacity: .9; transform: translateY(34px); } }
.bc__dim { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: var(--t-meta); color: var(--ink-2); }
.bc__dim .side__k { margin: 0; }

/* sheet mode */
.bc__list { font-family: var(--f-code); font-size: 15px; line-height: 1.5; min-height: 168px; resize: vertical; }
.bc__lrow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
.bc__lrow .link-arrow { font-size: 15px; }
.bc__lrow .ico { width: 14px; height: 14px; }
.bc__count { font-size: var(--t-meta); color: var(--ink-2); min-height: 1.4em; }
.bc__count.is-bad { color: var(--signal-ink); font-weight: 600; }
.bc__lerr { margin-top: 4px; }
.bc__custom { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.bc__custom .lfield__i { min-height: 44px; font-size: 16px; }
.bc__a4 { margin: 0; display: grid; gap: 10px; }
.bc__sheet { justify-self: center; width: min(100%, 300px); }
.bc__sheet svg { display: block; width: 100%; height: auto; box-shadow: 6px 6px 0 var(--ink); }
[dir="rtl"] .bc__sheet svg { box-shadow: -6px 6px 0 var(--ink); }
.bc__pg { fill: #fff; }
.bc__lb { fill: none; stroke: rgba(15, 15, 14, .28); stroke-width: .5; stroke-dasharray: 2 1.5; }
.bc__lb.is-bad { stroke: var(--signal); stroke-width: 1; stroke-dasharray: none; fill: rgba(229, 58, 36, .08); }
.bc__sheet.is-bad svg { outline: 2px solid var(--signal); }

/* side options */
.bc__size { border: 0; padding: 0; margin: 0; min-width: 0; }
.bc__wh { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bc__wh .lfield__i { min-height: 44px; font-size: 16px; font-family: var(--f-code); }
.bc__x { margin-top: 8px; }
.bc__gs1 { border-inline-start-color: var(--ok); margin: 4px 0 0; }

/* result */
.bc__res { margin: 0 0 14px; padding: 12px; background: #fff; box-shadow: 5px 5px 0 var(--ink); max-width: 420px; }
[dir="rtl"] .bc__res { box-shadow: -5px 5px 0 var(--ink); }
.bc__res img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.bc__bad { margin-top: 14px; padding: 10px 12px; border-inline-start: 3px solid var(--signal); background: var(--paper-2); }
.bc__bad ul { margin-top: 6px; font-size: var(--t-meta); line-height: 1.45; color: var(--ink-2); }
.bc__bad li + li { margin-top: 3px; }
.bc__lbad { margin: 10px 0 22px; }
.bc__lbad .side__k { margin: 0; color: var(--signal-ink); }

@media (max-width: 719.98px) {
  .bc { gap: 16px; }
  .bc__prev, .bc__a4 { padding: 14px; }
  .bc__card { padding: 8px; box-shadow: 4px 4px 0 var(--ink); }
  .bc__custom { grid-template-columns: 1fr 1fr; }
  .bc__lbad { margin-bottom: 16px; }
  .bc__sym .seg__n, .bc__sheets .seg__n { font-size: 14px; }
}
