/* Form-document pages: contracts, lien waivers, punch lists, reports, receipts */
.crumbs { font-size: 0.875rem; color: var(--ink-3); margin: 36px 0 14px; }
.crumbs a { color: var(--ink-3); }
.page-head { margin-bottom: 24px; display: grid; gap: 14px; }
.page-head .lede { margin: 0; }
.legal-note { font-size: 0.9rem; background: var(--canary); color: var(--canary-ink); border-radius: var(--r-md); padding: 12px 14px; max-width: 760px; }

.builder { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 1000px) { .builder { grid-template-columns: 1fr; } }
#editor { display: grid; gap: 14px; }
#editor .panel h2 { margin-bottom: 14px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 420px) { .fields { grid-template-columns: 1fr; } }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)) 32px; gap: 6px; padding: 10px 0; border-top: 1px solid var(--rule); }
.form-row .wide { grid-column: 1 / -2; }
.form-row label { font-size: 0.72rem; color: var(--ink-3); margin-bottom: 2px; }
.form-row input, .form-row select { min-height: 42px; padding: 6px 8px; font-size: 0.95rem; }
.x { background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 1.2rem; min-height: 42px; align-self: end; }
.x:hover { color: var(--carbon-red); }
.link-btn { background: none; border: 0; color: var(--chalk); font: 600 0.9rem var(--font); cursor: pointer; padding: 8px 0 0; }

.preview-wrap { position: sticky; top: 76px; }
.preview-bar { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.preview-bar .saved { margin-right: auto; font-size: 0.85rem; color: var(--ink-3); }

/* The document itself prints as-is, so its colors are fixed rather than themed */
.sheet { background: #fff; color: #18202B; border: 1px solid var(--rule); border-radius: 2px; padding: 44px 48px; box-shadow: 0 18px 40px -28px rgba(20, 30, 50, .45); font-size: 0.95rem; line-height: 1.6; }
@media (max-width: 600px) { .sheet { padding: 22px 16px; font-size: 0.88rem; } }
.sheet h2 { font-size: 1.5rem; font-stretch: 112%; font-weight: 800; margin: 0 0 4px; line-height: 1.2; letter-spacing: 0; }
.sheet h3 { font-size: 1rem; margin: 22px 0 6px; }
.sheet p { margin: 0 0 10px; }
.sheet .doc-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 3px solid #18202B; padding-bottom: 14px; margin-bottom: 18px; }
.sheet .doc-meta { color: #4B5666; font-size: 0.88rem; }
.sheet .doc-no { color: #B02A18; font-weight: 700; letter-spacing: .04em; }
.sheet .doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; margin: 10px 0 16px; }
.sheet .doc-grid .lbl, .sheet .lbl { font-size: 0.75rem; color: #6B7585; font-weight: 600; display: block; }
.sheet table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; }
.sheet th { text-align: left; font-size: 0.75rem; color: #6B7585; font-weight: 600; border-bottom: 1px solid #D8DEE6; padding: 6px 8px 6px 0; }
.sheet td { padding: 7px 8px 7px 0; border-bottom: 1px solid #EEF1F5; vertical-align: top; }
.sheet .num { text-align: right; white-space: nowrap; }
.sheet .total td { font-weight: 800; border-top: 2px solid #18202B; }
.sheet .box { display: inline-block; width: 13px; height: 13px; border: 1.5px solid #18202B; vertical-align: -2px; margin-right: 6px; }
.sheet .box.on { background: #18202B; }
.sheet .fill { display: inline-block; border-bottom: 1px solid #18202B; height: 1.1em; vertical-align: -3px; }
.sheet .small-print { font-size: 0.8rem; color: #4B5666; }
.doc-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 40px; font-size: 0.8rem; color: #4B5666; }
.doc-sign div { border-top: 1px solid #18202B; padding-top: 6px; }

.send-bar { display: none; }
@media (max-width: 1000px) {
  .preview-wrap { position: static; }
  .preview-bar > .btn { display: none; }
  .send-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; gap: 8px; align-items: center; justify-content: flex-end; background: var(--surface); border-top: 1px solid var(--rule); padding: 10px var(--gutter); }
  body { padding-bottom: 72px; }
}

dialog { border: 0; padding: 0; border-radius: var(--r-md); max-width: 460px; width: calc(100% - 32px); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(10, 15, 25, .55); }
.dlg { padding: 24px; display: grid; gap: 14px; }
.linkbox { display: flex; gap: 8px; }

.article { max-width: 720px; margin-top: 80px; }
.article h2 { margin: 44px 0 14px; }
.article ul, .article ol { padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); }
.article table { width: 100%; border-collapse: collapse; margin: 8px 0 20px; font-size: 0.95rem; background: var(--surface); }
.article th, .article td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.article th { font-weight: 700; border-bottom: 2px solid var(--rule-strong); }
details.faq { border-bottom: 1px solid var(--rule); padding: 14px 0; }
details.faq summary { cursor: pointer; font-weight: 700; }
details.faq p { margin: 10px 0 0; color: var(--ink-2); }
.related { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 600 0.85rem var(--font); border: 1.5px solid var(--rule-strong); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 5px 12px; text-decoration: none; min-height: 34px; display: inline-flex; align-items: center; }
.ad-slot { min-height: 280px; margin: 32px 0; border: 1px dashed var(--rule-strong); border-radius: var(--r-md); display: grid; place-items: center; color: var(--ink-3); font-size: 0.8rem; }

@media print {
  body { background: #fff; padding: 0; }
  .site-head, .site-foot, .crumbs, .page-head, #editor, .preview-bar, .send-bar, .article, .toast, .legal-note { display: none !important; }
  .builder { display: block; }
  .sheet { border: 0; box-shadow: none; padding: 0; }
}
