/* Quote builder demo */
.qb-trades { display: flex; flex-wrap: wrap; gap: .45rem; }
.qb-trades .chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.qb-desc { min-height: 150px; resize: vertical; width: 100%; }
.qb-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.qb-row .field { min-width: 0; }
.qb-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; margin-bottom: .8rem; }
.qb-hint { font-size: .84rem; color: var(--muted); }
.qb-how { flex-basis: 100%; margin: 0; font-size: .84rem; line-height: 1.45; color: var(--muted); max-width: 62ch; }
.qb-doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: clamp(1rem, 3vw, 1.75rem); box-shadow: var(--shadow); color: var(--ink); }
.qb-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 2px solid var(--ink); }
.qb-biz { font: 700 1.3rem/1.2 var(--display); outline-offset: 3px; }
.qb-sub { font-size: .86rem; color: var(--muted); margin-top: .2rem; }
.qb-meta { display: grid; gap: .1rem; text-align: right; font-size: .86rem; color: var(--muted); }
.qb-meta b { font: 700 1.1rem/1.2 var(--display); letter-spacing: .12em; color: var(--ink); }
.qb-title { font: 650 1.1rem/1.3 var(--display); margin: 1rem 0 .3rem; }
.qb-summary { margin: 0 0 1rem; color: var(--muted); font-size: .95rem; }
.qb-scroll { overflow-x: auto; }
.qb-table { min-width: 520px; font-size: .9rem; }
.qb-table td, .qb-table th { padding: .5rem .4rem; }
.qb-d { min-width: 180px; }
.qb-kind { display: block; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.qb-table input.qb-in { width: 4.6rem; padding: .3rem .4rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; text-align: right; background: var(--paper); color: var(--ink); font-variant-numeric: tabular-nums; }
.qb-table input.qb-in-p { width: 5.6rem; }
.qb-in:focus-visible, .qb-rm:focus-visible { outline: 2px solid var(--sea); outline-offset: 1px; }
.qb-table input.qb-in[aria-invalid="true"] { border-color: #8f2d14; background: #fbe6e1; }
.qb-table:focus { outline: none; }
.qb-err { margin-bottom: .8rem; }
.demo[data-demo="quote"] .demo-bar .pill { white-space: nowrap; }
.qb-pv { display: none; }
.qb-cur { font-size: .85rem; color: var(--muted); margin-right: .2rem; }
.qb-u { font-size: .8rem; color: var(--muted); display: inline-block; min-width: 1.6rem; text-align: left; }
.qb-x { width: 1.8rem; padding-left: 0 !important; padding-right: 0 !important; text-align: center !important; }
.qb-rm { border: 0; background: none; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: .2rem .4rem; border-radius: 6px; }
.qb-rm:hover { background: var(--paper-2); color: #8f2d14; }
.qb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.5rem; margin-top: 1.2rem; }
.qb-cols h4 { font: 650 .76rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 .4rem; }
.qb-cols ul { margin: 0; padding-left: 1.1rem; font-size: .88rem; display: grid; gap: .25rem; }
.qb-foot { font-size: .8rem; color: var(--muted); margin: 1.2rem 0 0; padding-top: .8rem; border-top: 1px solid var(--line); }
.qb-actions { margin-top: 1rem; }
.qb-status { font-size: .86rem; color: var(--sea); font-weight: 600; }
/* Safety and "Check these" blocks sit above the quote, so a draft never looks finished */
.qb-alert { border-radius: var(--radius-sm); padding: .8rem 1rem; margin: 0 0 .9rem; border: 1px solid; }
.qb-alert h4 { font: 700 .95rem/1.3 var(--body); margin: 0 0 .4rem; }
.qb-alert ul { margin: 0; padding-left: 1.1rem; font-size: .88rem; display: grid; gap: .35rem; }
.qb-stop { background: #fbe6e1; border-color: #c4553a; color: #5c1a0a; }
.qb-stop h4 { color: #8f2d14; }
.qb-check { background: var(--sun-soft); border-color: var(--sun-2); color: var(--ink); }
.qb-src { display: block; font-size: .8rem; color: #6b2a17; margin-top: .15rem; overflow-wrap: anywhere; }
.qb-ok { font-size: .86rem; color: var(--sea); font-weight: 600; margin: 0 0 .8rem; }
.qb-none { font-size: .88rem; color: var(--muted); margin: .8rem 0 0; }
.qb-cols .qb-none { margin: 0; }
.demo-badge.qb-badge-stop { background: #fbe6e1; color: #8f2d14; }
@media (max-width: 560px) {
  .qb-cols { grid-template-columns: 1fr; }
  .qb-meta { text-align: left; }
  .qb-row { grid-template-columns: 1fr 1fr; }
}
@media print {
  .site-header, .site-footer, .page-hero, .skip-link, main > section:not(.demo-section), .demo-bar, .demo-in, .demo-disclaimer, .qb-top, .qb-actions, .demo-empty { display: none !important; }
  body { background: #fff !important; }
  .demo-section { padding: 0 !important; margin: 0 !important; }
  .demo-section .wrap { max-width: none; padding: 0; }
  .demo[data-demo="quote"] { border: 0; box-shadow: none; border-radius: 0; }
  .demo[data-demo="quote"] .demo-body { display: block; }
  .demo[data-demo="quote"] .demo-out { padding: 0; background: none; min-height: 0; }
  #qb-doc { border: 0; box-shadow: none; padding: 0; }
  .qb-x, .qb-hint, .qb-kind, .qb-err, .qb-cur, .qb-in-p { display: none !important; }
  .qb-pv { display: inline; }
  .qb-head { padding-bottom: .6rem; }
  .qb-table td, .qb-table th { padding: .3rem .4rem; }
  .qb-cols { margin-top: .8rem; }
  .qb-cols ul { gap: .1rem; font-size: .82rem; }
  .qb-foot { margin-top: .6rem; padding-top: .5rem; break-inside: avoid; break-before: avoid; }
  .qb-table tr { break-inside: avoid; }
  .qb-scroll { overflow: visible; }
  .qb-table { min-width: 0; }
  .qb-table input.qb-in { border: 0; background: none; padding: 0; width: 5rem; appearance: textfield; -moz-appearance: textfield; }
  .qb-in::-webkit-outer-spin-button, .qb-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
}
.demo[data-demo="quote"] .demo-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.demo[data-demo="quote"] .demo-in, .demo[data-demo="quote"] .demo-out { min-width: 0; }
@media (max-width: 900px) { .demo[data-demo="quote"] .demo-body { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .qb-trades .chip, .demo[data-demo="quote"] .demo-examples .chip { padding: .55rem .75rem; } }
@media (max-width: 640px) {
  .qb-table { min-width: 0; }
  .qb-table, .qb-table tbody, .qb-table tfoot { display: block; width: 100%; }
  .qb-table thead { display: none; }
  .qb-table tbody tr { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.1fr) minmax(0, 1.1fr) auto; gap: .2rem .4rem; align-items: end; padding: .6rem 0; border-bottom: 1px solid var(--line); }
  .qb-table tbody td { border: 0; padding: 0; }
  .qb-table tbody td.qb-d { grid-column: 1 / -1; }
  .qb-table tbody td[data-label]::before { content: attr(data-label); display: block; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; }
  .qb-table tbody td.num { text-align: left; }
  .qb-table tbody td .qb-in, .qb-table tbody td input.qb-in-p { width: 100%; max-width: 6.5rem; text-align: left; padding-left: .3rem; padding-right: .2rem; }
  .qb-table tbody td .qb-u { min-width: 0; margin-left: .2rem; }
  .qb-table tbody td.qb-lt { align-self: end; padding-bottom: .35rem; font-weight: 600; overflow-wrap: anywhere; }
  .qb-table tbody td.qb-x { align-self: end; }
  .qb-table tfoot tr { display: flex; justify-content: space-between; gap: 1rem; }
  .qb-table tfoot td.num:first-child { flex: 1; min-width: 0; text-align: right; }
  .qb-table tfoot td[data-sub], .qb-table tfoot td[data-gst], .qb-table tfoot td[data-tot] { white-space: nowrap; padding-left: 0; padding-right: 0; }
  .qb-table tfoot td.qb-x { display: none; }
}
@media print { .qb-table { display: table !important; } .qb-table tbody { display: table-row-group !important; } .qb-table tfoot { display: table-footer-group !important; } .qb-table tbody tr, .qb-table tfoot tr { display: table-row !important; } .qb-table thead { display: table-header-group !important; } .qb-table tbody td[data-label]::before { display: none; } }
@media (max-width: 640px) { .qb-table tbody td .qb-u, .qb-table tbody td .qb-cur { display: none; } }
.qb-actions[hidden], .qb-foot[hidden] { display: none; }
