/*
 * Barcode Generator (inc/barcode-tool.inc.php). The shared layout is
 * pt-ui.css; this is the format grid, the data field, the colours and the
 * preview. Sizes in px: the theme's rem is 20px.
 */
.bc-editor [hidden] { display: none !important; }

/* ── The format and the data ──────────────────────────────────────────── */
/* Three columns: each name with what it is for under it. */
.bc-formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.bc-format {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 58px;
  padding: 7px 6px;
  border: 1px solid var(--pt-line, #e3e7ee);
  border-radius: 12px;
  background: #fff;
  color: var(--pt-ink, #343f52);
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  min-width: 0;
}
.bc-format-name { font-size: 14px; font-weight: 800; white-space: nowrap; }
.bc-format-note { font-size: 11.5px; font-weight: 500; opacity: 0.75; overflow-wrap: break-word; max-width: 100%; hyphens: auto; }
.bc-format:hover { border-color: var(--pt-accent, #0f70e6); }
.bc-format.active { border-color: var(--pt-accent, #0f70e6); background: var(--pt-accent-soft, #e8f0fc); color: var(--pt-accent, #0f70e6); box-shadow: inset 0 0 0 1px var(--pt-accent, #0f70e6); }
.bc-format:focus-visible { outline: 3px solid var(--pt-accent, #0f70e6); outline-offset: 2px; }
.bc-data { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.02em; text-align: left; }
.bc-hint { font-size: 12.5px; color: #6c757d; line-height: 1.4; }
.bc-error { font-size: 13px; font-weight: 600; color: #c0392b; line-height: 1.4; }

/* ── How it looks ──────────────────────────────────────────────────────── */
.bc-colors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
.bc-range .form-label { margin-bottom: 2px; }
.bc-color-row { display: flex; gap: 6px; }
.bc-color-row .form-control { min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; direction: ltr; }
.bc-swatch { position: relative; flex: 0 0 44px; height: 36px; margin: 0; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); cursor: pointer; }
.bc-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.bc-swatch:focus-within { outline: 3px solid var(--pt-accent, #0f70e6); outline-offset: 2px; }

/* ── The barcode ───────────────────────────────────────────────────────── */
.bc-viewport { display: flex; align-items: center; justify-content: center; padding: 20px; overflow: hidden; }
/* At its saved size, shrunk only to fit. */
.bc-canvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; box-shadow: 0 6px 24px rgba(30, 34, 40, 0.12); }
.bc-clear .bc-canvas { background: repeating-conic-gradient(#e6e9ee 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.bc-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 300px; text-align: center; }
.bc-ghost { width: 120px; height: 80px; color: #c9d0da; }
.bc-check { font-size: 14px; font-weight: 600; color: #237032; text-align: center; }
.bc-check.is-bad { color: #b23c0c; }
.bc-qr-link { font-size: 14px; text-align: center; }

@media (max-width: 767px) {
  .bc-viewport { padding: 14px; min-height: 200px !important; height: auto !important; }
  .bc-format { min-height: 56px; }
}
@media (max-width: 359px) {
  .bc-formats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bc-colors { grid-template-columns: minmax(0, 1fr); }
}
