.quote-paper{
  --doc-accent:var(--nb-ink);
  padding:58px 62px;
  color:#242424;
  font-family:Manrope,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
}
.quote-paper.font-manrope{font-family:Manrope,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif}
.quote-paper.font-inter{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif}
.quote-paper.font-ibmplex{font-family:"IBM Plex Sans",Inter,Arial,sans-serif}
.quote-paper.font-sourceserif{font-family:"Source Serif 4",Georgia,"Times New Roman",serif}


.document-header{
  display:grid;
  grid-template-columns:1fr auto;
  gap:32px;
  align-items:start;
  padding-bottom:26px;
  border-bottom:2px solid var(--doc-accent);
}
.document-brand{
  min-width:0;
}
.document-logo{
  display:block;
  max-width:150px;
  max-height:58px;
  object-fit:contain;
  object-position:left center;
  margin-bottom:12px;
}
.preview-business-name{
  color:#171717;
  font-size:24px;
  line-height:1.15;
  font-weight:800;
  letter-spacing:-.025em;
}
.document-contact{
  margin-top:7px;
  color:var(--nb-muted);
  white-space:pre-line;
  font-size:10px;
  line-height:1.55;
}
.document-title-block{
  min-width:180px;
  text-align:right;
}
.document-title-block p{
  margin:0 0 7px;
  color:var(--doc-accent);
  font-size:30px;
  line-height:1;
  font-weight:800;
  letter-spacing:.08em;
}
.document-title-block strong{
  color:#555;
  font-size:11px;
  font-weight:700;
}

.document-meta{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(250px,.78fr);
  gap:48px;
  padding:28px 0;
}
.meta-label{
  margin:0 0 7px;
  color:var(--nb-document-muted);
  font-size:9px;
  font-weight:700;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.document-meta>div>strong{
  display:block;
  color:#1f1f1f;
  font-size:16px;
}
.document-meta dl{
  margin:0;
}
.document-meta dl div{
  display:grid;
  grid-template-columns:86px 1fr;
  gap:14px;
  padding:4px 0;
  font-size:10px;
}
.document-meta dt{color:var(--nb-document-muted)}
.document-meta dd{
  margin:0;
  text-align:right;
  font-weight:700;
  overflow-wrap:anywhere;
}

.document-items table{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
}
.document-items th{
  padding:9px 8px;
  border-bottom:1px solid #d8d8d8;
  color:#555;
  font-size:8.5px;
  font-weight:700;
  letter-spacing:.08em;
  text-align:left;
  text-transform:uppercase;
}
.document-items th:first-child{width:46%}
.document-items th:nth-child(2){width:12%}
.document-items th.numeric{text-align:right}
.document-items td{
  padding:11px 8px;
  border-bottom:1px solid #ececec;
  vertical-align:top;
  color:#333;
  font-size:9.5px;
  line-height:1.45;
}
.document-items td.numeric{text-align:right;white-space:nowrap}
.item-name{
  display:block;
  color:#222;
  font-weight:700;
}
.item-detail{
  display:block;
  margin-top:3px;
  color:var(--nb-document-muted);
  font-size:8.5px;
  white-space:pre-line;
}
.empty-item{
  padding:26px 8px!important;
  color:#999!important;
  text-align:center!important;
}

.totals-wrap{
  display:flex;
  justify-content:flex-end;
  padding:22px 0 28px;
}
.totals{
  width:285px;
  margin:0;
}
.totals div{
  display:flex;
  justify-content:space-between;
  gap:18px;
  padding:5px 0;
  color:var(--nb-muted);
  font-size:9.5px;
}
.totals dd{
  margin:0;
  color:#222;
  font-weight:700;
}
.totals .total-row{
  margin-top:6px;
  padding-top:11px;
  border-top:2px solid var(--doc-accent);
  color:#171717;
  font-size:13px;
  font-weight:800;
}
.totals .total-row dd{
  color:var(--doc-accent);
  font-size:15px;
}
.totals .deposit-row{
  color:#444;
  font-weight:700;
}

.document-copy{
  margin-top:20px;
  padding-top:16px;
  border-top:1px solid #ececec;
}
.document-copy h3{
  margin:0 0 7px;
  color:#555;
  font-size:8.5px;
  font-weight:700;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.document-copy p{
  margin:0;
  color:var(--nb-muted);
  font-size:9.5px;
  line-height:1.55;
  white-space:pre-line;
}
.document-footer{
  margin-top:38px;
  padding-top:13px;
  border-top:1px solid #ececec;
  color:var(--nb-document-muted);
  font-size:8.5px;
  text-align:center;
}

/* Generated-document templates intentionally vary without changing NineBrief chrome. */
.quote-paper.template-minimal{
  padding:64px 68px;
}
.quote-paper.template-minimal .document-header{
  border-bottom:1px solid #e5e5e5;
}
.quote-paper.template-minimal .document-title-block p{
  color:#171717;
  letter-spacing:.04em;
}
.quote-paper.template-minimal .document-items th{
  background:transparent;
  border-bottom:1px solid #bdbdbd;
}
.quote-paper.template-minimal .totals .total-row{
  border-top:1px solid #bdbdbd;
}
.quote-paper.template-minimal .totals .total-row dd{color:#171717}

.quote-paper.template-classic{
  font-family:Georgia,"Times New Roman",serif;
}
.quote-paper.template-classic .document-title-block p{
  font-family:Manrope,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
}
.quote-paper.template-classic .document-items th{
  background:#f3f3f3;
  border-bottom:0;
}
.quote-paper.template-classic .document-header{
  border-bottom:3px double var(--doc-accent);
}

.adjustment-heading{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:16px;
  margin:20px 0 10px;
  padding-top:16px;
  border-top:1px solid var(--nb-border);
}
.adjustment-heading strong{font-size:13px}
.adjustment-heading span{color:var(--nb-muted);font-size:10px}
.design-section{margin-bottom:18px}
.design-label{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:16px;
  margin-bottom:9px;
}
.design-label strong{font-size:12px}
.design-label span{color:var(--nb-muted);font-size:9px}
.design-fields{padding-top:4px}
.editor-quick-actions .create-invoice-action{
  border-color:var(--nb-green);
  background:color-mix(in srgb,var(--nb-green) 18%,#fff);
  color:var(--nb-ink);
  font-weight:750;
}

.editor-footer-actions{
  display:flex;
  justify-content:flex-end;
  padding:4px 2px 0;
}
.danger-action{color:#a40000}

.content-section{
  width:min(1200px,calc(100% - 40px));
  margin:0 auto;
  padding:72px 0;
  border-top:1px solid var(--nb-border);
}
.content-kicker{
  margin:0;
  color:var(--nb-muted);
  font-size:12px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.content-section h2{
  max-width:680px;
  margin:9px 0 0;
  color:var(--nb-ink);
  font-size:36px;
  line-height:1.14;
  letter-spacing:-.025em;
}
.steps-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:24px;
  margin-top:32px;
}
.steps-grid article{
  padding-top:20px;
  border-top:2px solid var(--nb-ink);
}
.steps-grid article>span{
  color:var(--nb-document-muted);
  font-size:11px;
  font-weight:700;
  letter-spacing:.1em;
}
.steps-grid h3{
  margin:24px 0 8px;
  font-size:21px;
  line-height:1.22;
}
.steps-grid p{
  max-width:34ch;
  margin:0;
  color:var(--nb-muted);
  font-size:14px;
  line-height:1.65;
}
.content-split{
  display:grid;
  grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);
  gap:72px;
}
.prose{
  max-width:680px;
}
.prose p{
  margin:0 0 16px;
  color:var(--nb-muted);
  font-size:16px;
  line-height:1.75;
}
.related-section{
  display:grid;
  grid-template-columns:minmax(0,.8fr) minmax(0,1.1fr);
  gap:64px;
  align-items:center;
}
.related-card{
  min-height:96px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:16px;
  padding:20px;
  border:1px solid var(--nb-border);
  border-radius:16px;
  background:var(--nb-white);
  text-decoration:none;
  transition:transform 160ms ease,border-color 160ms ease;
}
.related-card:hover{
  transform:translateY(-1px);
  border-color:#bdbdbd;
}
.related-icon{width:46px;height:46px;flex-basis:46px;border-radius:12px}
.related-card strong{font-size:14px;text-underline-offset:5px}
.related-card p{
  margin:5px 0 0;
  color:var(--nb-muted);
  font-size:12px;
  line-height:1.5;
}

@media (max-width:900px){
  .content-split,.related-section{grid-template-columns:1fr;gap:28px}
}
@media (max-width:720px){
  .quote-paper{
    padding:34px 26px;
  }
  .document-header,.document-meta{
    grid-template-columns:1fr;
    gap:20px;
  }
  .document-title-block{text-align:left}
  .document-items{
    overflow:auto;
  }
  .document-items table{
    min-width:580px;
  }
  .steps-grid{grid-template-columns:1fr}
  .content-section{padding:56px 0}
  .content-section h2{font-size:30px}
}
@media print{
  .quote-paper{
    width:210mm!important;
    min-height:297mm!important;
    padding:16mm 17mm!important;
  }
}
/* Step 8H1A Quote/Estimate workspace command hierarchy. Original writers,
 * document state, sidebar and preview toolbar remain authoritative. */
#quote-studio .quote-workspace-command-bar{
  grid-column:1/-1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px;
  padding:12px 16px;
  min-width:0;
  border-bottom:1px solid var(--nb-border);
  background:var(--nb-surface);
}
#quote-studio .quote-workspace-modes,
#quote-studio .quote-workspace-primary-actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  min-width:0;
}
#quote-studio .quote-workspace-modes .toolbar-button,
#quote-studio .quote-workspace-primary-actions .toolbar-button{
  min-height:44px;
  flex-shrink:0;
}
#quote-studio .quote-workspace-modes [aria-pressed="true"]{
  border-color:var(--nb-green);
  background:var(--nb-green);
  color:var(--nb-ink);
}
#quote-studio .quote-workspace-primary-actions .save-status{
  max-width:none;
  text-align:left;
  flex:initial;
}
@media (max-width:620px){
  #quote-studio .quote-workspace-command-bar{align-items:stretch;}
  #quote-studio .quote-workspace-modes{width:100%;justify-content:space-between;}
  #quote-studio .quote-workspace-modes .toolbar-button{flex:1 1 auto;}
  #quote-studio .quote-workspace-primary-actions{width:100%;justify-content:space-between;}
}
@media print{
  #quote-studio .quote-workspace-command-bar{display:none!important;}
}

/* Step 8H1B-1: classes derive from the initialized mode and native Design
 * disclosure. Screen-only rules preserve no-JS fallback and customer print. */
@media screen{
  #quote-studio.quote-preview-primary{min-height:0;}
  #quote-studio.quote-preview-primary:not(.quote-design-open)>.document-editor,
  #quote-studio.quote-preview-primary.quote-design-open>#document-preview,
  #quote-studio.quote-preview-primary.quote-design-open .document-editor-head,
  #quote-studio.quote-preview-primary.quote-design-open #quote-form>:not(#card-design){display:none;}
}

/* H1B-2: the page owns vertical scrolling. Measured chrome follows wrapping,
 * language and viewport changes without adding another document/mode owner. */
@media screen{
  html:has(#quote-studio.quote-workspace-ready){scroll-padding-top:0;}
  #quote-studio.quote-workspace-ready{
    min-height:0;
    overflow:clip;
    align-items:start;
    scroll-margin-top:var(--quote-header-clearance,0px);
  }
  #quote-studio.quote-workspace-ready>.document-editor,
  #quote-studio.quote-workspace-ready>.document-preview,
  #quote-studio.quote-workspace-ready #preview-scroll{
    max-height:none;
    overflow:visible;
    overscroll-behavior:auto;
  }
  #quote-studio.quote-workspace-ready .document-editor-head,
  #quote-studio.quote-workspace-ready .preview-toolbar{position:static;}
  #quote-studio.quote-workspace-ready .quote-workspace-command-bar{
    scroll-margin-top:var(--quote-header-clearance,0px);
  }
  #quote-studio.quote-pinned-actions .quote-workspace-command-bar{
    position:sticky;
    top:var(--quote-header-clearance,0px);
    z-index:60;
  }
  #quote-studio.quote-workspace-ready .document-editor :is([id],details,summary),
  #quote-studio.quote-workspace-ready .document-preview [id]{
    scroll-margin-top:var(--quote-content-clearance,0px);
  }
}

/* Step 8H1B-3: the existing live document is the default compact Edit
 * surface. Fields reveals the same full form and owners, never a copy.
 * Screen-only and post-init; no-JS/failed-init/print fallback is unchanged. */
#quote-studio .quote-edit-surfaces{display:none;gap:6px;min-width:0;align-items:center;}
#quote-studio .quote-edit-surfaces[hidden]{display:none!important;}
#quote-studio .quote-edit-surfaces .toolbar-button{
  min-height:44px;min-width:0;flex:1 1 0;white-space:normal;
}
#quote-studio .quote-edit-surfaces [aria-pressed="true"]{
  border-color:var(--nb-green);background:var(--nb-green);color:var(--nb-ink);
}
@media screen and (max-width:900px){
  #quote-studio.quote-workspace-ready:is(.quote-edit-document-primary,.quote-edit-fields-primary) .quote-edit-surfaces{
    display:flex;flex:1 1 190px;
  }
  #quote-studio.quote-workspace-ready.quote-edit-document-primary>.document-editor,
  #quote-studio.quote-workspace-ready.quote-edit-fields-primary>#document-preview{display:none;}
}
@media print{#quote-studio .quote-edit-surfaces{display:none!important;}}
