/* ═══════════════════════════════════
   FREE BILL / INVOICE GENERATOR TOOL
   Extends style.css design tokens, doesn't override it.
   ═══════════════════════════════════ */

.bg-tool-sec { background: var(--bg); }

/* ── TABS ── */
.bg-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 0;
}
.bg-tab {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 16px;
  font-family: var(--f-display);
  font-size: 0.86rem; font-weight: 700;
  color: var(--mute);
  cursor: pointer;
  transition: var(--trans);
}
.bg-tab i { font-size: 0.82rem; }
.bg-tab:hover { color: var(--navy); }
.bg-tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }

/* ── DATA NOTE BANNER (used in Saved Bills / Catalog / Report) ── */
.bg-data-note {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(217,119,6,0.07);
  border: 1px solid rgba(217,119,6,0.25);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 0.82rem; line-height: 1.65; color: var(--text-2);
}
.bg-data-note i { color: var(--amber); font-size: 1rem; margin-top: 2px; flex-shrink: 0; }
.bg-data-note strong { color: var(--navy); }

.bg-upsell-note {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(37,211,102,0.07);
  border: 1px solid rgba(37,211,102,0.28);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 0.82rem; line-height: 1.65; color: var(--text-2);
}
.bg-upsell-note i { color: #25d366; font-size: 1rem; margin-top: 2px; flex-shrink: 0; }
.bg-upsell-note strong { color: var(--navy); }
.bg-upsell-note a { color: #25d366; font-weight: 700; text-decoration: none; }
.bg-upsell-note a:hover { text-decoration: underline; }

/* ── SAVED BILLS ── */
.bg-saved-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.bg-saved-toolbar input {
  flex: 1; min-width: 200px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-family: var(--f-body);
  font-size: 0.85rem; color: var(--navy);
}
.bg-btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 10px 16px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: var(--trans);
  white-space: nowrap;
}
.bg-btn-secondary:hover { border-color: var(--cyan); color: var(--cyan); }

.bg-empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--mute);
  font-size: 0.86rem;
  background: var(--bg-2);
  border-radius: var(--r-md);
  border: 1px dashed var(--line-3);
}

.bg-saved-list { display: flex; flex-direction: column; gap: 10px; }
.bg-saved-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 12px 16px;
  flex-wrap: wrap;
}
.bsi-main { flex: 1; min-width: 160px; }
.bsi-inv { font-family: var(--f-mono); font-size: 0.84rem; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.bsi-badge { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 20px; background: rgba(14,165,233,0.1); color: var(--cyan); }
.bsi-badge.thermal { background: rgba(217,119,6,0.1); color: var(--amber); }
.bsi-meta { font-size: 0.78rem; color: var(--mute); margin-top: 2px; }
.bsi-total { font-family: var(--f-mono); font-weight: 700; color: var(--navy); font-size: 0.9rem; }
.bsi-actions { display: flex; gap: 8px; }
.bsi-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: var(--trans);
}
.bsi-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.bsi-btn.danger:hover { border-color: #e11d48; color: #e11d48; }

/* ── PRODUCT CATALOG ── */
.bg-panel-body .cf-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.bg-catalog-form { margin-bottom: 22px; }
.bg-catalog-hint { margin-top: 12px; font-size: 0.78rem; color: var(--mute); }
.bg-catalog-hint i { color: var(--amber-2); margin-right: 4px; }
.bg-catalog-hint a { color: var(--cyan); text-decoration: none; font-weight: 600; }
.bg-catalog-list { display: flex; flex-direction: column; gap: 8px; }
.bg-catalog-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 12px 16px;
}
.bci-name { font-weight: 700; color: var(--navy); font-size: 0.85rem; min-width: 160px; }
.bci-detail { flex: 1; font-size: 0.8rem; color: var(--mute); }
.bci-del {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: var(--trans);
}
.bci-del:hover { border-color: #e11d48; color: #e11d48; }

/* ── SALES REPORT ── */
.bg-report-range { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.bg-range-btn {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.8rem; font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: var(--trans);
}
.bg-range-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.bg-range-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.bg-report-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 30px; }
.bg-report-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 18px;
}
.brc-label { font-size: 0.74rem; color: var(--mute); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.brc-value { font-family: var(--f-mono); font-size: 1.25rem; font-weight: 700; color: var(--navy); }

.bg-report-top h4 { font-family: var(--f-display); font-size: 0.92rem; font-weight: 700; color: var(--navy); margin-bottom: 14px; }
.bg-top-product-row {
  display: grid; grid-template-columns: 1fr 2fr auto; align-items: center; gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.bg-top-product-row:last-child { border-bottom: none; }
.btp-info { display: flex; flex-direction: column; gap: 2px; }
.btp-name { font-size: 0.84rem; font-weight: 600; color: var(--navy); }
.btp-qty { font-size: 0.74rem; color: var(--mute); }
.btp-bar-track { height: 8px; background: var(--bg-2); border-radius: 20px; overflow: hidden; }
.btp-bar-fill { height: 100%; background: var(--gradient-1, var(--cyan)); border-radius: 20px; }
.btp-revenue { font-family: var(--f-mono); font-weight: 700; color: var(--navy); font-size: 0.85rem; white-space: nowrap; }

@media (max-width: 768px) {
  .bg-report-cards { grid-template-columns: 1fr 1fr; }
  .bg-top-product-row { grid-template-columns: 1fr; gap: 6px; }
  .bsi-actions { width: 100%; justify-content: flex-end; }
}

/* ── UPGRADE OPTIONS (Offline POS vs Online Cloud plan) ── */
.bg-upgrade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  align-items: stretch;
}
.bg-upgrade-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  padding: 32px 28px;
  display: flex; flex-direction: column;
  box-shadow: var(--sh-sm);
}
.bg-upgrade-card.featured {
  border-color: var(--cyan);
  box-shadow: 0 16px 40px rgba(14,165,233,0.14);
}
.buc-badge {
  position: absolute; top: -12px; right: 24px;
  background: var(--gradient-1, var(--cyan));
  color: #fff;
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 5px 14px;
  border-radius: 20px;
}
.buc-icon {
  width: 52px; height: 52px;
  border-radius: var(--r-md);
  background: rgba(14,165,233,0.1);
  color: var(--cyan);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 18px;
}
.bg-upgrade-card h3 { font-family: var(--f-display); font-size: 1.15rem; font-weight: 800; color: var(--navy); margin-bottom: 10px; }
.bg-upgrade-card > p { font-size: 0.87rem; color: var(--text-2); line-height: 1.7; margin-bottom: 18px; }
.buc-feats { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 9px; }
.buc-feats li { display: flex; align-items: flex-start; gap: 9px; font-size: 0.83rem; color: var(--text-2); }
.buc-feats li i { color: var(--emerald); margin-top: 3px; font-size: 0.76rem; flex-shrink: 0; }
.buc-pricing {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.buc-price-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.buc-price { font-family: var(--f-mono); font-size: 1.35rem; font-weight: 800; color: var(--navy); }
.buc-price small { font-size: 0.72rem; font-weight: 600; color: var(--mute); }
.buc-price-note { font-size: 0.76rem; color: var(--cyan); font-weight: 600; }
.buc-price-note strong { color: var(--navy); }
.buc-price-alt { font-size: 0.76rem; color: var(--mute); margin-top: 8px; line-height: 1.5; }
.buc-currency-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.buc-currency-row label {
  font-size: 0.66rem; font-weight: 600; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.buc-currency-row select {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.buc-currency-row select:focus { outline: none; border-color: var(--cyan); }
.buc-currency-note {
  font-size: 0.7rem; color: var(--mute); margin-top: 10px; line-height: 1.5;
}
.bg-upgrade-card .btn-primary { margin-top: auto; justify-content: center; }
.bg-upgrade-card .btn-primary i { margin-right: 2px; }

@media (max-width: 900px) {
  .bg-upgrade-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .bg-upgrade-card .btn-primary { width: 100%; white-space: normal; text-align: center; }
}

.bg-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 32px;
  align-items: start;
}

/* ── LEFT: FORM PANELS ── */
.bg-form-col { display: flex; flex-direction: column; gap: 18px; }

.bg-panel {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.bg-panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 24px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-2);
}
.bg-panel-head .bph-num {
  width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-family: var(--f-mono);
  font-size: 0.75rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.bg-panel-head h3 {
  font-family: var(--f-display);
  font-size: 0.98rem; font-weight: 700;
  color: var(--navy);
}
.bg-panel-head p { font-size: 0.78rem; color: var(--mute); margin-top: 1px; }
.bg-panel-body { padding: 22px 24px; }

/* Reuse .cf-group / .cf-row from style.css for inputs */
.bg-panel-body .cf-row { grid-template-columns: 1fr 1fr; }
.bg-panel-body .cf-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.bg-panel-body .cf-group { margin-bottom: 12px; }
.bg-panel-body .cf-group:last-child { margin-bottom: 0; }

/* Logo uploader */
.bg-logo-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.bg-logo-preview {
  width: 64px; height: 64px;
  border-radius: var(--r-md);
  border: 1.5px dashed var(--line-3);
  background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  color: var(--mute-2);
  font-size: 1.3rem;
}
.bg-logo-preview img { width: 100%; height: 100%; object-fit: cover; }
.bg-logo-actions { display: flex; flex-direction: column; gap: 8px; }
.bg-btn-upload {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 9px 16px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: var(--trans);
  width: fit-content;
}
.bg-btn-upload:hover { border-color: var(--cyan); color: var(--cyan); }
.bg-logo-remove {
  font-size: 0.76rem;
  color: var(--rose-2);
  cursor: pointer;
  width: fit-content;
  background: none; border: none;
}

/* Bill-type toggle */
.bg-type-toggle {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.bg-type-toggle input { display: none; }
.bg-type-toggle label {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 10px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: var(--trans);
  text-align: center;
}
.bg-type-toggle label i { font-size: 1.05rem; color: var(--mute); }
.bg-type-toggle label span { font-size: 0.82rem; font-weight: 600; color: var(--text-2); }
.bg-type-toggle label small { font-size: 0.68rem; color: var(--mute-2); font-family: var(--f-mono); }
.bg-type-toggle input:checked + label {
  border-color: var(--cyan);
  background: rgba(14,165,233,0.06);
}
.bg-type-toggle input:checked + label i,
.bg-type-toggle input:checked + label span { color: var(--cyan); }

/* Items table */
.bg-items-table { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.bg-item-row {
  display: grid;
  grid-template-columns: 1.6fr 0.7fr 0.9fr 0.85fr 0.7fr auto;
  gap: 8px;
  align-items: end;
  padding: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  position: relative;
}
.bg-item-row .bi-field { display: flex; flex-direction: column; gap: 4px; }
.bg-item-row .bi-field label {
  font-size: 0.66rem; font-weight: 600; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.bg-item-row input, .bg-item-row select {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 7px;
  padding: 8px 9px;
  font-size: 0.83rem;
  color: var(--text);
  width: 100%;
}
.bg-item-row input:focus, .bg-item-row select:focus {
  outline: none; border-color: var(--cyan);
}
.bg-row-remove {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(225,29,72,0.08);
  color: var(--rose-2);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--trans);
  flex-shrink: 0;
}
.bg-row-remove:hover { background: var(--rose-2); color: #fff; }
.bg-row-total {
  font-family: var(--f-mono);
  font-size: 0.86rem; font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

.bg-add-row {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(5,150,105,0.08);
  color: var(--emerald);
  border: 1px dashed rgba(5,150,105,0.35);
  border-radius: var(--r-sm);
  padding: 11px 18px;
  font-size: 0.85rem; font-weight: 600;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: var(--trans);
}
.bg-add-row:hover { background: rgba(5,150,105,0.14); }

/* Actions */
.bg-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.bg-actions button, .bg-actions a { flex: 1; min-width: 160px; justify-content: center; }
.bg-btn-download {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 20px;
  background: var(--navy);
  color: #fff;
  font-family: var(--f-display);
  font-weight: 600; font-size: 0.92rem;
  border-radius: var(--r-md);
  border: none; cursor: pointer;
  transition: var(--trans);
}
.bg-btn-download:hover { background: var(--gradient-1); transform: translateY(-2px); box-shadow: 0 12px 32px rgba(14,165,233,0.25); }
.bg-btn-print {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 20px;
  background: transparent;
  color: var(--navy);
  font-family: var(--f-display);
  font-weight: 600; font-size: 0.92rem;
  border-radius: var(--r-md);
  border: 2px solid var(--line-3);
  cursor: pointer;
  transition: var(--trans);
}
.bg-btn-print:hover { border-color: var(--cyan); color: var(--cyan); }
.bg-btn-reset {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 15px 16px;
  background: transparent;
  color: var(--rose-2);
  font-family: var(--f-display);
  font-weight: 600; font-size: 0.85rem;
  border-radius: var(--r-md);
  border: 1px solid rgba(225,29,72,0.25);
  cursor: pointer;
  transition: var(--trans);
  flex: 0 0 auto !important;
  min-width: auto !important;
}
.bg-btn-reset:hover { background: rgba(225,29,72,0.06); }

.bg-autosave-note {
  font-size: 0.75rem;
  color: var(--mute-2);
  display: flex; align-items: center; gap: 6px;
  margin-top: 12px;
}
.bg-autosave-note i { color: var(--emerald); }

/* ── RIGHT: LIVE PREVIEW ── */
.bg-preview-col { position: sticky; top: 100px; }
.bg-preview-wrap {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md);
  padding: 20px;
}
.bg-preview-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.bg-preview-toolbar span {
  font-family: var(--f-mono);
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--mute);
}
.bg-preview-toolbar .bpt-dots { display: flex; gap: 5px; }
.bg-preview-toolbar .bpt-dots i { width: 8px; height: 8px; border-radius: 50%; display: block; }

.bg-preview-scroll {
  max-height: 640px;
  overflow-y: auto;
  background: #e9edf2;
  border-radius: var(--r-md);
  padding: 24px 12px;
  display: flex;
  justify-content: center;
}

/* The actual bill/invoice surface (this is what gets captured to PDF) */
#billSurface {
  background: #ffffff;
  color: #111827;
  font-family: 'DM Sans', -apple-system, sans-serif;
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}
/* A4 invoice mode */
#billSurface.mode-a4 { width: 480px; padding: 32px 30px; border-radius: 6px; }
/* Thermal receipt mode */
#billSurface.mode-thermal { width: 300px; padding: 20px 16px; font-family: 'JetBrains Mono', monospace; }

.bs-logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
#billSurface.mode-thermal .bs-logo-row { flex-direction: column; text-align: center; }
.bs-logo-img { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; flex-shrink: 0; }
.bs-shop-name { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; }
#billSurface.mode-thermal .bs-shop-name { font-size: 1.05rem; }
.bs-tagline { font-size: 0.74rem; color: #374151; margin-top: 1px; }
.bs-contact { font-size: 0.72rem; color: #374151; line-height: 1.5; margin-top: 6px; }
#billSurface.mode-thermal .bs-contact { text-align: center; }

.bs-doctitle {
  text-align: center; font-weight: 800; letter-spacing: 0.08em;
  font-size: 1rem; text-transform: uppercase; color: #111827;
  margin: 14px 0 10px;
}

.bs-divider { border: none; border-top: 1.5px dashed #111827; margin: 10px 0; }
.bs-divider.solid { border-top: 1.5px solid #111827; }

.bs-meta-row { display: flex; justify-content: space-between; gap: 10px; font-size: 0.76rem; color: #111827; padding: 2px 0; }
.bs-meta-row span:first-child { font-weight: 700; }
.bs-meta-row span:last-child { font-weight: 700; text-align: right; }

.bs-section-title {
  text-align: center; font-weight: 800; letter-spacing: 0.06em;
  font-size: 0.82rem; text-transform: uppercase; color: #111827;
  margin: 12px 0 8px;
}

.bs-cust-line { font-size: 0.76rem; color: #111827; line-height: 1.6; }
.bs-cust-line strong { font-weight: 700; }

.bs-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.76rem; }
.bs-table th {
  text-align: left; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.03em;
  font-weight: 800; color: #111827; padding: 4px 4px 8px; border-bottom: 2px solid #111827;
}
.bs-table td { padding: 7px 4px; border-bottom: 1px dashed #cbd5e1; vertical-align: top; color: #111827; }
.bs-table th.num, .bs-table td.num { text-align: right; white-space: nowrap; }
.bs-item-name { font-weight: 700; color: #111827; }
.bs-item-unit { font-size: 0.65rem; font-weight: 500; color: #6b7280; }

.bs-totals { margin-top: 10px; }
.bs-total-row { display: flex; justify-content: space-between; font-size: 0.8rem; padding: 3px 0; color: #111827; font-weight: 600; }
.bs-total-row.strip {
  font-weight: 800; text-transform: uppercase; font-size: 0.8rem;
  border-top: 1.5px dashed #111827; border-bottom: 1.5px dashed #111827;
  padding: 8px 2px; margin-top: 6px;
}
.bs-total-row.grand {
  font-weight: 800; font-size: 1.08rem; color: #111827;
  border-top: 3px double #111827; border-bottom: 3px double #111827;
  margin-top: 8px; padding: 10px 2px;
}

.bs-thankyou { text-align: center; font-size: 0.85rem; font-weight: 700; font-style: italic; color: #b45309; margin-top: 18px; }
.bs-footnote { text-align: center; font-size: 0.64rem; color: #6b7280; margin-top: 6px; }
.bs-powered { text-align: center; font-size: 0.68rem; font-weight: 700; color: #111827; margin-top: 16px; letter-spacing: 0.02em; border-top: 1px dashed #cbd5e1; padding-top: 10px; }
.bs-powered a { color: #111827; text-decoration: none; }

/* ── THERMAL RECEIPT: force bold, solid-black text everywhere.
   Thin/light-weight and gray text fades out fast on thermal printers —
   only fully bold, pure-black ink stays legible over time. ── */
#billSurface.mode-thermal,
#billSurface.mode-thermal * {
  font-weight: 700 !important;
  color: #000 !important;
}
#billSurface.mode-thermal .bs-shop-name,
#billSurface.mode-thermal .bs-doctitle,
#billSurface.mode-thermal .bs-section-title,
#billSurface.mode-thermal .bs-table th,
#billSurface.mode-thermal .bs-total-row.strip,
#billSurface.mode-thermal .bs-total-row.grand,
#billSurface.mode-thermal .bs-thankyou,
#billSurface.mode-thermal .bs-powered {
  font-weight: 800 !important;
}
#billSurface.mode-thermal .bs-divider { border-color: #000 !important; }
#billSurface.mode-thermal .bs-table th { border-bottom-color: #000 !important; }
#billSurface.mode-thermal .bs-table td { border-bottom-color: #000 !important; border-bottom-style: dashed !important; }
#billSurface.mode-thermal .bs-total-row.strip { border-color: #000 !important; }
#billSurface.mode-thermal .bs-total-row.grand { border-color: #000 !important; }
#billSurface.mode-thermal .bs-powered { border-top-color: #000 !important; }

/* ── SEO CONTENT STRIP BELOW TOOL ── */
.bg-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.bg-info-item {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: 24px;
}
.bg-info-item i { color: var(--cyan); font-size: 1.1rem; margin-bottom: 10px; }
.bg-info-item h4 { font-family: var(--f-display); font-size: 0.98rem; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.bg-info-item p { font-size: 0.85rem; color: var(--text-2); line-height: 1.65; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .bg-layout { grid-template-columns: 1fr; }
  .bg-preview-col { position: static; }
  .bg-info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .bg-panel-body .cf-row, .bg-panel-body .cf-row.cols-3, .bg-panel-body .cf-row.cols-4 { grid-template-columns: 1fr; }
  .bg-item-row { grid-template-columns: 1fr 1fr; }
  .bg-item-row .bi-field.bi-name { grid-column: 1 / -1; }
  .bg-row-remove { position: absolute; top: 10px; right: 10px; }
  .bg-actions button, .bg-actions a { min-width: 100%; }
  #billSurface.mode-a4 { width: 100%; max-width: 400px; }
  #billSurface.mode-thermal { width: 100%; max-width: 300px; }
}

/* ── CTN / PACK MODE TOGGLE ── */
.bg-ctn-toggle {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  cursor: pointer;
}
.bg-ctn-toggle input { width: 17px; height: 17px; accent-color: var(--cyan); flex-shrink: 0; }
.bg-ctn-toggle div span { display: block; font-size: 0.84rem; font-weight: 600; color: var(--text-2); }
.bg-ctn-toggle div small { font-size: 0.72rem; color: var(--mute); }
.bg-item-row.ctn-on { grid-template-columns: 1.4fr 0.6fr 0.6fr 0.9fr 0.75fr 0.6fr auto; }

/* ── PRINT-ONLY: fallback if the page itself is printed directly (Ctrl+P).
   The dedicated "Print" button uses an isolated iframe instead, which is
   the reliable path — this is just a safety net. ── */
@media print {
  * { transform: none !important; animation: none !important; }
  body * { visibility: hidden; }
  #billSurface, #billSurface * { visibility: visible; }
  #billSurface {
    position: absolute; top: 0; left: 0;
    box-shadow: none !important;
    margin: 0 !important;
  }
}
