.bl { padding: 22px 0 10px; }
.bl [hidden] { display: none !important; }
.bl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bl input[type=text], .bl input[type=number], .bl select, .bl textarea { width: 100%; font: inherit; font-size: 15px; border: 1px solid #ddd6cb; border-radius: 10px; padding: 8px 10px; background: var(--card); color: var(--text); min-height: 42px; box-sizing: border-box; }
.bl textarea { min-height: 64px; resize: vertical; line-height: 1.45; }
.bl input:focus, .bl select:focus, .bl textarea:focus { outline: 3px solid rgba(245, 158, 11, .35); border-color: var(--gold); }
.bl input[type=checkbox] { width: 18px; height: 18px; accent-color: #d97706; margin: 0; flex: none; }
.bl input[type=range] { width: 100%; accent-color: #d97706; }
.bl input[type=color] { width: 40px; height: 30px; border: 1px solid #ddd6cb; border-radius: 8px; padding: 2px; background: var(--card); cursor: pointer; flex: none; }
.bl-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bl-sp { flex: 1; }
.bl-link { font: inherit; font-size: 13.5px; border: 0; background: none; color: var(--gold-text); font-weight: 700; cursor: pointer; padding: 0; text-decoration: underline; }
.bl-del { color: #b42318; }
.bl-hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; line-height: 1.45; }
.bl-msg { min-height: 22px; font-size: 14px; font-weight: 700; color: #15803d; margin: 10px 0 4px; }
.bl-msg.bl-err { color: #b42318; } .bl-msg.bl-warn { color: #b45309; } .bl-msg.bl-stay { color: var(--muted); }
.bl-warnc { color: #b45309; font-weight: 700; } .bl-okc { color: #15803d; font-weight: 700; }
.bl-chk { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; margin: 6px 0; }
.bl-end { align-self: end; margin-bottom: 10px; }
.bl-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }

/* modes and steps */
.bl-modes { display: flex; gap: 10px; margin-bottom: 12px; }
.bl-modes button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 2px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px; font: inherit; font-weight: 800; font-size: 15px; color: var(--text); cursor: pointer; }
.bl-modes button small { font-weight: 600; font-size: 12px; color: var(--muted); }
.bl-modes button.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); }
.bl-steps { display: flex; border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; margin-bottom: 14px; }
.bl-steps button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: none; padding: 12px 10px; font: inherit; font-weight: 800; font-size: 14.5px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; }
.bl-steps i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; background: var(--soft); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.bl-steps .on { color: var(--text); border-bottom-color: var(--gold); }
.bl-steps .on i { background: var(--gold); border-color: var(--gold); color: #1f1d1a; }

.bl-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.bl-left { min-width: 0; }
.bl-right { position: sticky; top: 10px; max-height: calc(100vh - 20px); overflow: auto; background: #ebe7e0; border-radius: 16px; padding: 12px; }
:root[data-theme="dark"] .bl-right { background: #2a2723; }
.bl-pvbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.bl-pagewrap { display: flex; justify-content: center; }
.bl-pg { display: block; background: #fff; box-shadow: 0 6px 22px rgba(0, 0, 0, .16); border-radius: 2px; cursor: pointer; max-width: 100%; }
.bl-note { font-size: 12.5px; color: var(--muted); margin: 10px 2px 0; text-align: center; }

.bl-card { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 14px; margin-bottom: 12px; }
.bl-card h2 { font-size: 16px; margin: 0 0 12px; }
.bl-card h2 small { font-weight: 600; font-size: 12.5px; color: var(--muted); margin-left: 6px; }
.bl-f { min-width: 0; margin-bottom: 10px; }
.bl-f > label { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.bl-f > label output { margin-left: auto; color: var(--text); }
.bl-f small { display: block; font-size: 12px; color: var(--gold-text); font-weight: 600; margin-top: 4px; line-height: 1.4; }
.bl-same { font-weight: 600; font-size: 11px; color: var(--muted); background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }
.bl-g2, .bl-g3, .bl-g4 { display: grid; gap: 10px; }
.bl-g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bl-g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bl-g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bl-w2 { grid-column: span 2; }
.bl-next { margin-top: 6px; }

/* templates */
.bl-tpls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bl-tpl { border: 2px solid var(--line); background: var(--soft); border-radius: 12px; padding: 6px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; color: var(--text); display: flex; flex-direction: column; gap: 6px; align-items: center; min-width: 0; }
.bl-thb { display: flex; align-items: center; justify-content: center; width: 100%; height: 78px; }
.bl-tpl canvas { display: block; max-width: 100%; background: #fff; border-radius: 3px; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.bl-tpl span { line-height: 1.2; text-align: center; }
.bl-tpl.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245, 158, 11, .25); }

/* list */
.bl-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.bl-tools .btn { margin: 0 !important; }
.bl-panel { border: 1px solid var(--feat-line); background: var(--gold-soft); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.bl-panel > label { display: block; font-size: 12.5px; font-weight: 800; color: var(--gold-text); margin-bottom: 6px; }
.bl-tablewrap { overflow: auto; max-height: 420px; border: 1px solid var(--line); border-radius: 12px; }
.bl-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
.bl-table th { position: sticky; top: 0; z-index: 1; background: var(--soft); border-bottom: 1px solid var(--line); padding: 6px; text-align: left; vertical-align: top; min-width: 120px; }
.bl-table td { border-bottom: 1px solid var(--line); padding: 2px; }
.bl .bl-table input[type=text] { border: 1px solid transparent; border-radius: 7px; min-height: 34px; padding: 5px 7px; font-size: 14px; background: transparent; }
.bl .bl-table input[type=text]:hover { border-color: var(--line); }
.bl .bl-table input[type=text]:focus { background: var(--card); border-color: var(--gold); }
.bl .bl-table th input[type=text] { font-weight: 800; background: var(--card); border-color: var(--line); }
.bl-th { display: flex; gap: 4px; align-items: center; }
.bl-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.bl-tags em { font-style: normal; font-size: 11px; font-weight: 800; background: #1f1d1a; color: #fff; border-radius: 999px; padding: 1px 8px; }
.bl-table .bl-n { width: 34px; min-width: 34px; text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; }
.bl-table tr.bl-bad td { background: #fdecea; }
.bl-table tr.bl-bad .bl-n { color: #b42318; cursor: help; }
.bl-empty { padding: 18px !important; color: var(--muted); text-align: center; }
.bl-x { border: 0; background: none; color: #a39b8e; font-size: 18px; line-height: 1; width: 26px; height: 26px; border-radius: 6px; cursor: pointer; flex: none; }
.bl-x:hover { background: #fdecea; color: #b42318; }
.bl-under { margin-top: 8px; font-size: 13.5px; }
.bl-sum { color: var(--muted); }
.bl-pager { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); font-weight: 700; }
.bl-pager .btn { margin: 0 !important; }
.bl-drop { outline: 3px dashed var(--gold); outline-offset: 3px; }
.bl-qsel { flex: 1 1 200px; width: auto !important; }
.bl .bl-num { width: 90px; flex: none; }
.bl .bl-own { margin-top: 6px; }
.bl-logo { width: 46px; height: 46px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* designer */
.bl-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.bl-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 10px; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.bl-chip { border: 1px solid var(--line); background: var(--soft); border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 13px; font-weight: 700; color: var(--text); cursor: pointer; }
.bl-chips .bl-chip { padding: 3px 9px; font-size: 12px; }
.bl-chip:hover { border-color: var(--gold); }
.bl-editwrap { background: #ebe7e0 linear-gradient(45deg, rgba(0, 0, 0, .025) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, .025) 75%) 0 0 / 16px 16px; border-radius: 12px; }
:root[data-theme="dark"] .bl-editwrap { background-color: #2a2723; }
#blEdit { display: block; width: 100%; touch-action: none; border-radius: 12px; }
#blEdit:focus-visible { outline: 3px solid var(--gold); }
.bl-rownav { justify-content: center; margin: 8px 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.bl-rownav .btn { margin: 0 !important; }
.bl-props { border-top: 1px solid var(--line); padding-top: 10px; }
.bl-ph { margin-bottom: 8px; }
.bl-ib { border: 1px solid transparent; background: none; color: var(--muted); border-radius: 8px; width: 32px; height: 32px; font-size: 15px; cursor: pointer; flex: none; }
.bl-ib:hover { border-color: var(--line); background: var(--soft); }
.bl-ib:disabled { opacity: .3; cursor: default; }
.bl-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.bl-seg button { border: 0; background: var(--card); padding: 8px 12px; font: inherit; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; }
.bl-seg button.on { background: #1f1d1a; color: #fff; }
.bl-sm { flex: 1 1 120px; margin-bottom: 0; }
.bl-sm select { margin-bottom: 4px; }
.bl-pos { margin-top: 6px; }
.bl-sws { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bl-sw { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #c9c2b6; cursor: pointer; padding: 0; }
.bl-sw.on { box-shadow: 0 0 0 3px var(--gold); }

/* print */
.bl-dl { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.bl-dl .btn { margin: 0 !important; }
.bl-checks { list-style: none; padding: 0; margin: 6px 0 0; font-size: 13.5px; line-height: 1.7; }
.bl-checks .bl-warn { color: #b45309; font-weight: 700; } .bl-checks .bl-okc { color: #15803d; font-weight: 700; }

/* one barcode */
.bl-sggrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.bl-sgout { display: flex; flex-direction: column; align-items: stretch; }
.bl-sgbox { background: #ebe7e0 linear-gradient(45deg, rgba(0, 0, 0, .03) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, .03) 75%) 0 0 / 16px 16px; border-radius: 12px; padding: 12px; display: flex; justify-content: center; align-items: center; min-height: 180px; }
#sgCanvas { display: block; max-width: 100%; box-shadow: 0 4px 14px rgba(0, 0, 0, .1); }
.bl-sgmsg { font-size: 13.5px; margin: 10px 0 0; word-break: break-word; }
.bl-wide { width: 100%; margin: 0 !important; }

/* phone preview */
.bl-fab { display: none; }
.bl-pv { position: fixed; inset: 0; z-index: 90; background: #ebe7e0; display: flex; flex-direction: column; }
:root[data-theme="dark"] .bl-pv { background: #1f1d1a; }
.bl-pvhead { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--card); border-bottom: 1px solid var(--line); }
.bl-pvbody { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.bl-x2 { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 9px; width: 36px; height: 36px; font-size: 20px; cursor: pointer; }
body.bl-noscroll { overflow: hidden; }

@media (max-width: 980px) {
  .bl-grid, .bl-sggrid { grid-template-columns: minmax(0, 1fr); }
  .bl-right { display: none; }
  .bl-fab { display: flex; position: fixed; right: 14px; bottom: 14px; z-index: 60; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 12px 18px; background: #1f1d1a; color: #fff; font: inherit; font-weight: 800; font-size: 14.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); cursor: pointer; }
  #blSingle ~ .bl-fab, .bl-fab[hidden] { display: none; }
}
@media (max-width: 560px) {
  .bl-tpls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bl-g3, .bl-g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bl-steps button { font-size: 12.5px; padding: 10px 4px; gap: 5px; }
  .bl-modes button { font-size: 13.5px; }
  .bl-modes button small { display: none; }
}
