/* 31-10-2026 owner: Invoice & PO builder - one question at a time on the left, the live document on the right */
body.bd { overflow-x: hidden; }
.bd-wrap { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(340px, 470px) minmax(0, 1fr); gap: 18px; padding: 14px 16px 24px; max-width: 1500px; margin: 0 auto; align-items: start; }
.bd-form { position: sticky; top: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 18px; min-height: 420px; display: flex; flex-direction: column; }
.bd-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.bd-progress { flex: 1 1 100%; height: 4px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.bd-bar { height: 100%; width: 0; background: var(--accent); transition: width .25s; }
.bd-crumbs { flex: 1 1 auto; font-size: 12px; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-link { background: none; border: 0; color: var(--text-3); font-size: 12px; cursor: pointer; padding: 2px 0; text-decoration: underline; }
.bd-link:hover { color: var(--text-2); }
.bd-step { flex: 1 1 auto; animation: bdIn .22s ease; }
@keyframes bdIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.bd-q { font-size: 21px; font-weight: 600; line-height: 1.25; margin: 4px 0 6px; }
.bd-q .n { color: var(--accent); font-size: 14px; margin-right: 8px; font-weight: 500; }
.bd-help { color: var(--text-2); font-size: 13.5px; margin: 0 0 14px; line-height: 1.45; }
.bd-cards { display: grid; gap: 10px; }
.bd-card { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 13px 14px; color: var(--text); cursor: pointer; font-size: 15px; }
.bd-card:hover, .bd-card:focus-visible { border-color: var(--accent); outline: none; }
.bd-card.on { border-color: var(--accent); background: rgba(201,169,110,.10); }
.bd-card .k { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text-2); }
.bd-card.on .k { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.bd-card .t { flex: 1 1 auto; min-width: 0; }
.bd-card .s { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.bd-field { margin: 0 0 12px; }
.bd-field label { display: block; font-size: 12.5px; color: var(--text-2); margin: 0 0 5px; }
.bd-field .opt { color: var(--text-3); font-size: 11.5px; margin-left: 4px; }
.bd-in, .bd-ta, .bd-sel { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; color: var(--text); padding: 10px 12px; font: inherit; font-size: 15px; }
.bd-ta { min-height: 92px; resize: vertical; line-height: 1.4; }
.bd-ta.tall { min-height: 140px; }
.bd-in:focus, .bd-ta:focus, .bd-sel:focus { outline: none; border-color: var(--accent); }
.bd-in.bad, .bd-ta.bad, .bd-sel.bad { border-color: var(--danger); }
.bd-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bd-row3 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.bd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bd-chip { border: 1px solid var(--line-2); background: transparent; color: var(--text-2); border-radius: 999px; padding: 7px 13px; font-size: 14px; cursor: pointer; }
.bd-chip.on { border-color: var(--accent); color: var(--accent-ink); background: var(--accent); }
.bd-chip:disabled { opacity: .35; cursor: default; }
.bd-search { margin-bottom: 8px; }
.bd-list { max-height: 330px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.bd-li { display: block; width: 100%; text-align: left; background: transparent; border: 0; border-top: 1px solid var(--line); color: var(--text); padding: 9px 12px; cursor: pointer; font-size: 14.5px; }
.bd-li:first-child { border-top: 0; }
.bd-li:hover, .bd-li.hi { background: rgba(201,169,110,.10); }
.bd-li.on { background: rgba(201,169,110,.18); }
.bd-li .s { display: block; font-size: 12px; color: var(--text-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-li.new { color: var(--accent-2); }
.bd-calc { font-size: 13px; color: var(--text-2); margin: -4px 0 12px; min-height: 18px; }
.bd-calc b { color: var(--text); font-weight: 600; }
.bd-err { color: var(--danger); font-size: 13px; margin: 4px 0 10px; min-height: 0; }
.bd-items { margin: 0 0 12px; }
.bd-item { display: flex; gap: 10px; align-items: flex-start; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; margin-bottom: 6px; }
.bd-item .no { color: var(--text-3); font-size: 12px; padding-top: 2px; }
.bd-item .tx { flex: 1 1 auto; min-width: 0; font-size: 13.5px; }
.bd-item .tx .d { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-item .tx .m { color: var(--text-2); font-size: 12.5px; }
.bd-item .am { font-size: 13.5px; white-space: nowrap; }
.bd-item .act { display: flex; gap: 4px; }
.bd-mini { background: none; border: 1px solid var(--line-2); color: var(--text-2); border-radius: 8px; padding: 3px 8px; font-size: 12px; cursor: pointer; }
.bd-mini:hover { color: var(--text); border-color: var(--text-3); }
.bd-box { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 12px 4px; margin-bottom: 12px; }
.bd-box h3 { font-size: 13px; color: var(--text-2); font-weight: 500; margin: 0 0 10px; }
.bd-sum { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 12px; }
.bd-sum td { padding: 6px 2px; border-top: 1px solid var(--line); vertical-align: top; }
.bd-sum td:last-child { text-align: right; white-space: nowrap; }
.bd-sum tr.big td { font-weight: 600; font-size: 16px; }
.bd-warn { background: rgba(229,100,107,.10); border: 1px solid rgba(229,100,107,.35); border-radius: 10px; padding: 9px 12px; font-size: 13.5px; margin-bottom: 12px; }
.bd-warn a { color: var(--accent-2); cursor: pointer; text-decoration: underline; }
.bd-okbox { background: rgba(111,207,151,.08); border: 1px solid rgba(111,207,151,.35); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 12px; line-height: 1.5; }
.bd-okbox a { color: var(--accent-2); }
.bd-note { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.bd-nav { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.bd-btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 10px 18px; font-size: 15px; font-weight: 600; cursor: pointer; }
.bd-btn:disabled { opacity: .4; cursor: default; }
.bd-btn.ghost { background: transparent; color: var(--text-2); border: 1px solid var(--line-2); font-weight: 500; }
.bd-btn.wide { width: 100%; margin-bottom: 8px; }
.bd-hint { font-size: 12px; color: var(--text-3); margin-left: auto; }
.bd-doc { min-width: 0; }
.bd-doc-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-2); margin: 2px 2px 8px; gap: 10px; }
.bd-busy { color: var(--accent-2); }
.bd-totals { font-size: 13px; color: var(--text-2); margin: 0 2px 8px; min-height: 18px; }
.bd-totals b { color: var(--text); }
.bd-pages { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.bd-pages img { position: relative; z-index: 2; width: 100%; max-width: 820px; height: auto; background: #fff; border-radius: 4px; box-shadow: var(--shadow-2); display: block; }
.bd-pages.stale img { opacity: .55; transition: opacity .15s; }
.bd-empty { color: var(--text-3); border: 1px dashed var(--line-2); border-radius: 14px; padding: 60px 24px; text-align: center; width: 100%; max-width: 820px; font-size: 14px; }
.bd-toggle { display: none; }
@media (max-width: 900px) {
  .bd-wrap { grid-template-columns: minmax(0, 1fr); padding: 10px 12px 90px; }
  .bd-form { position: static; min-height: 0; }
  .bd-doc { display: none; }
  body.bd-show .bd-doc { display: block; }
  body.bd-show .bd-form { display: none; }
  .bd-toggle { display: block; position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--sab)); z-index: 70; background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2); border-radius: 999px; padding: 10px 20px; font-size: 14px; box-shadow: var(--shadow-1); }
  .bd-hint { display: none; }
  .bd-q { font-size: 19px; }
  .bd-row, .bd-row3 { grid-template-columns: 1fr; gap: 0; }
}
.bd-back { display: inline-block; font-size: 13px; color: var(--text-2); text-decoration: none; margin: 0 0 10px; }
.bd-back:hover { color: var(--text); }
.bd-savebox { background: rgba(201,169,110,.10); border: 1px solid rgba(201,169,110,.45); border-radius: 12px; padding: 12px 14px; margin: 6px 0 10px; animation: bdIn .2s ease; }
.bd-savebox p { margin: 0 0 10px; font-size: 14px; line-height: 1.45; }
.bd-savebtns { display: flex; flex-wrap: wrap; gap: 8px; }
.bd-li .s .sv { color: var(--accent-2); }
