:root {
  --ink: #152238;
  --muted: #64748b;
  --paper: #ffffff;
  --canvas: #f5f7fb;
  --orange: #e85d04;
  --orange-dark: #c94d00;
  --blue: #275dad;
  --line: #dce3ed;
  --green: #147d64;
}

html, body { min-height: 100%; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
}
h1, h2, h3, h4, h5, h6 { font-family: inherit; }
code, pre, .brand-mark, .eyebrow, .compact-quote, .trust-panel li > span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.bslib-page-fill { min-height: 100vh; }
.app-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 26px 0 18px; }
.site-header { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.site-header h1 { margin: 0; font-size: 1.35rem; letter-spacing: -0.03em; }
.site-header p { margin: 1px 0 0; color: var(--muted); font-size: .91rem; }
.brand-mark { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: white; background: var(--ink); font-size: .92rem; font-weight: 800; line-height: 1; box-shadow: 0 8px 22px rgba(21,34,56,.16); }
.brand-mark span { color: #ff9f52; }
.header-actions { margin-left: auto; display: flex; align-items: flex-end; flex-direction: column; gap: 6px; }
.availability-pill { border: 1px solid #cfe3dc; background: #effaf6; color: #176a57; border-radius: 999px; padding: 8px 12px; font-weight: 700; font-size: .78rem; }
.support-phone { color: var(--blue); font-size: .76rem; font-weight: 750; text-decoration: none; }
.support-phone:hover, .support-phone:focus, .support-phone:visited { color: var(--blue); text-decoration: underline; }
.pulse { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #20a17e; margin-right: 7px; box-shadow: 0 0 0 4px rgba(32,161,126,.12); }
.connection-status { display: flex; align-items: center; gap: 8px; width: fit-content; margin: -10px 0 16px 60px; border-radius: 999px; padding: 6px 10px; color: #805719; background: #fff8e8; border: 1px solid #f0dbad; font-size: .76rem; font-weight: 700; }
.connection-status.is-connected { color: #176a57; background: #effaf6; border-color: #cfe3dc; }
.connection-status.is-disconnected { color: #a3332b; background: #fff1f0; border-color: #f4ccc8; }
.connection-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(128,87,25,.1); }
.connection-status.is-connected .connection-dot { box-shadow: 0 0 0 4px rgba(32,161,126,.12); }

.main-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .72fr); gap: 22px; align-items: start; }
.order-panel, .trust-panel { border: 1px solid var(--line); background: var(--paper); box-shadow: 0 18px 50px rgba(30,52,78,.08); }
.order-panel { border-radius: 22px; overflow: hidden; }
.panel-intro { padding: 34px 38px 25px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #fff 65%, #fff3ea 100%); }
.eyebrow { color: var(--orange-dark); font-size: .72rem; font-weight: 800; line-height: 1.2; letter-spacing: .12em; margin-bottom: 10px; }
.panel-intro h2, .confirmation-card h2 { margin: 0 0 8px; font-size: clamp(1.65rem, 3vw, 2.45rem); letter-spacing: -.04em; }
.panel-intro p { color: var(--muted); margin: 0; max-width: 650px; line-height: 1.55; }
.use-cases { margin-top: 9px; color: var(--blue); font-size: .78rem; font-weight: 700; }
.form-stage { padding: 29px 38px 36px; }
.form-label, .control-label { font-weight: 750; font-size: .9rem; margin-bottom: 7px; }
.form-control, .form-select { min-height: 46px; border-color: #cbd5e1; border-radius: 9px; }
textarea.form-control { min-height: auto; }
.form-control:focus, .form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(39,93,173,.14); }
.shiny-input-container:not(.shiny-input-container-inline) { width: 100%; }
.field-row { display: grid; grid-template-columns: minmax(130px, .42fr) minmax(260px, 1fr); gap: 18px; }
.field-row.two { grid-template-columns: 1fr 1fr; }
.field-row.three { grid-template-columns: 1.2fr .45fr .6fr; }
.radio-inline { margin-right: 17px; }
#delivery .form-check { margin: 0 0 7px; }
#delivery .form-check-label { line-height: 1.35; }
.print-options { margin-top: 4px; }
.scope-note { color: var(--muted); font-size: .82rem; margin: -4px 0 17px; }
.upload-disclosure { font-size: .82rem; color: var(--muted); }
.upload-summary { margin: -6px 0 3px; font-weight: 700; }
.upload-disclosure details { margin: 0 0 14px; }
.upload-disclosure summary { cursor: pointer; }
.upload-disclosure details p { margin: 6px 0 0; padding-left: 10px; border-left: 2px solid var(--line); line-height: 1.45; }
.safety-note { font-size: .78rem; line-height: 1.4; color: #78512f; background: #fff8ee; border-left: 3px solid #e8a25a; padding: 8px 10px; margin: 7px 0 13px; }
.file-alert { border-radius: 9px; padding: 10px 12px; margin: 8px 0 15px; font-weight: 650; font-size: .88rem; }
.file-alert.success { background: #effaf6; color: #176a57; border: 1px solid #cfe3dc; }
.file-alert.error { background: #fff1f0; color: #a3332b; border: 1px solid #f4ccc8; }
.file-alert.quote-needed { background: #fff8ee; color: #78512f; border: 1px solid #f0d2ad; }
.quote-link { display: inline-block; margin: 8px 0 1px 15px; color: var(--blue); font-weight: 800; }
.file-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 8px; }
.estimate-card { padding: 16px 18px; border: 1px solid #f0c8a9; border-radius: 12px; background: #fff8f2; margin: 15px 0 19px; }
.estimate-card > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.estimate-card strong { color: var(--orange-dark); font-size: 1.55rem; font-weight: 800; line-height: 1; }
.estimate-card p { margin: 8px 0 2px; font-weight: 700; font-size: .9rem; }
.estimate-card small { color: var(--muted); line-height: 1.35; display: block; }
.quote-destination { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 18px; align-items: center; margin: 16px 0 19px; }
.quote-destination > * { min-width: 0; }
.quote-destination .estimate-card { margin: 0; }
.destination-zip .shiny-input-container { margin-bottom: 8px; }
.destination-zip .scope-note { margin: 0; line-height: 1.45; }
.zip-error, .zip-success { display: block; margin-top: 8px; font-size: .82rem; line-height: 1.4; }
.zip-error { color: #a3332b; font-weight: 700; }
.zip-success { color: #176a57; }
.estimate-card .estimate-destination-note { margin-bottom: 8px; }
.compact-quote { display: flex; flex-direction: column; gap: 2px; }
.compact-quote strong { color: var(--orange-dark); font-size: 1.25rem; }
.compact-quote span { color: var(--muted); font-size: .84rem; }
.btn { border-radius: 9px; font-weight: 750; }
.btn-primary { background: var(--orange); border-color: var(--orange); box-shadow: 0 9px 20px rgba(232,93,4,.2); }
.btn-primary:hover, .btn-primary:focus { background: var(--orange-dark); border-color: var(--orange-dark); }
.btn:disabled, .btn.disabled { cursor: not-allowed; box-shadow: none; opacity: .62; }
.button-spinner { display: inline-block; width: 1em; height: 1em; margin-right: .55em; vertical-align: -.14em; border: .15em solid currentColor; border-right-color: transparent; border-radius: 50%; animation: hcn-spin .75s linear infinite; }
@keyframes hcn-spin { to { transform: rotate(360deg); } }
.checkout-progress { min-height: 1.35em; margin: 9px 2px 0; color: var(--muted); font-size: .8rem; line-height: 1.35; text-align: center; }
.checkout-progress:empty { display: none; }
.checkout-receipt-note { margin: 8px 2px 0; color: var(--muted); font-size: .78rem; line-height: 1.4; text-align: center; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--blue); font-weight: 700; text-decoration: none; }
.stage-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.stage-heading h3 { margin: 0; font-size: 1.45rem; }
.compact-quote { font-size: .82rem; font-weight: 700; line-height: 1; color: var(--orange-dark); }

.trust-panel { border-radius: 22px; padding: 28px; position: sticky; top: 20px; overflow: hidden; }
.trust-panel h3 { margin: 21px 0 18px; font-size: 1.25rem; }
.trust-panel ol { list-style: none; padding: 0; margin: 0; }
.trust-panel li { display: grid; grid-template-columns: 29px 1fr; gap: 10px; margin-bottom: 18px; }
.trust-panel li > span { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; line-height: 1; }
.trust-panel li strong { font-size: .92rem; }
.trust-panel li p { color: var(--muted); margin: 3px 0 0; font-size: .82rem; line-height: 1.4; }
.paper-stack { height: 110px; border-radius: 14px; background: #eaf0f8; display: grid; place-items: center; position: relative; overflow: hidden; }
.paper-sheet { width: 72px; height: 90px; background: white; border: 1px solid #cbd5e1; border-radius: 3px; transform: rotate(-4deg); box-shadow: 7px 8px 0 #d6dfeb, 14px 15px 0 #c4d0df; padding: 15px 11px; position: relative; }
.paper-lines { height: 38px; background: repeating-linear-gradient(to bottom, #c4d0df 0 2px, transparent 2px 8px); }
.route-line { position: absolute; left: 11px; right: 11px; bottom: 14px; height: 17px; border-bottom: 3px solid var(--orange); border-right: 3px solid var(--orange); transform: skewX(-24deg); }
.trust-rule { border-top: 1px solid var(--line); margin: 20px 0; }
.privacy-note { color: var(--muted); font-size: .82rem; line-height: 1.45; }
.privacy-note strong { color: var(--ink); }
.price-promise { display: grid; gap: 3px; margin-top: 13px; padding: 11px 12px; border-radius: 10px; background: #effaf6; border: 1px solid #cfe3dc; }
.price-promise strong { color: #176a57; font-size: .84rem; }
.price-promise span { color: var(--muted); font-size: .76rem; line-height: 1.4; }
.promise-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.promise-grid div { border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.promise-grid strong, .promise-grid span { display: block; }
.promise-grid strong { font-size: .86rem; }
.promise-grid span { color: var(--muted); font-size: .72rem; margin-top: 2px; }

.confirmation-card { padding: 45px 38px 50px; text-align: center; }
.confirmation-card > p { color: var(--muted); max-width: 600px; margin: 0 auto 20px; }
.success-seal { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 17px; background: #eaf8f3; color: var(--green); font-size: 1.4rem; font-weight: 900; }
.order-ticket { max-width: 500px; margin: 24px auto; background: #f8fafc; border: 1px dashed #94a3b8; border-radius: 12px; padding: 6px 18px; text-align: left; }
.order-ticket > div { display: flex; justify-content: space-between; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.order-ticket > div:last-child { border-bottom: 0; }
.order-ticket span { color: var(--muted); }
.confirmation-help { font-size: .85rem; }

footer { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: .75rem; padding: 18px 4px 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 15px; }
.operator-link { color: var(--muted); text-decoration: none; }
.analytics-link { border: 0; padding: 0; background: transparent; font: inherit; cursor: pointer; }
.operator-link:hover, .operator-link:focus { color: var(--ink); text-decoration: underline; }
.analytics-consent { display: none; position: fixed; z-index: 1100; left: 16px; right: 16px; bottom: 16px; }
.analytics-consent.is-visible { display: block; }
.analytics-consent > div { width: min(760px, 100%); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 17px 18px; border: 1px solid #cbd5e1; border-radius: 14px; background: white; box-shadow: 0 18px 50px rgba(21,34,56,.2); }
.analytics-consent h2 { margin: 0 0 4px; font-size: 1rem; }
.analytics-consent p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.analytics-consent-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.analytics-consent button { border-radius: 8px; padding: 9px 12px; font-size: .78rem; font-weight: 750; cursor: pointer; }
.analytics-primary { border: 1px solid var(--orange); background: var(--orange); color: white; }
.analytics-primary:hover, .analytics-primary:focus { background: var(--orange-dark); border-color: var(--orange-dark); }
.analytics-secondary { border: 1px solid var(--line); background: white; color: var(--ink); }
.admin-drawer { position: fixed; z-index: 1040; top: 0; right: 0; bottom: 0; width: min(680px, 100%); background: white; padding: 28px; overflow: auto; box-shadow: -20px 0 60px rgba(21,34,56,.22); border-left: 1px solid var(--line); }
.admin-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 20px; }
.admin-head h2 { margin: 0; }
.admin-head p { color: var(--muted); }
.admin-head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.admin-refresh-note { margin: -8px 0 18px; padding: 10px 12px; border: 1px solid #cfe3dc; border-radius: 10px; background: #effaf6; color: #176a57; font-size: .8rem; line-height: 1.45; }
.admin-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 22px; }
.admin-summary > div { padding: 13px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; font-size: .86rem; overflow-wrap: anywhere; }
#order_fulfillment_record { margin-bottom: 20px; }
#order_fulfillment_record summary { cursor: pointer; margin-bottom: 12px; font-weight: 600; }
.admin-summary span { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 3px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.empty-state { color: var(--muted); padding: 40px 0; text-align: center; }
.policy-copy h4 { margin: 18px 0 4px; font-size: 1rem; }
.policy-copy h4:first-child { margin-top: 0; }
.policy-copy p { color: var(--muted); line-height: 1.55; }
.support-contact { display: grid; gap: 4px; padding: 14px 16px; margin-bottom: 18px; border: 1px solid #cfe3dc; border-radius: 10px; background: #effaf6; }
.support-contact strong { color: #176a57; }
.support-contact a { width: fit-content; color: var(--blue); font-weight: 750; }
.support-contact span { color: var(--muted); font-size: .78rem; }

@media (max-width: 850px) {
  .app-shell { width: min(100% - 20px, 700px); padding-top: 14px; }
  .main-grid { grid-template-columns: 1fr; }
  .trust-panel { position: static; }
  .site-header p { display: none; }
  .availability-pill { font-size: .7rem; }
  .support-phone { font-size: .7rem; }
}
@media (max-width: 560px) {
  .site-header { align-items: flex-start; }
  .availability-pill { max-width: 130px; text-align: center; }
  .panel-intro, .form-stage, .confirmation-card { padding-left: 20px; padding-right: 20px; }
  .field-row, .field-row.two, .field-row.three { grid-template-columns: 1fr; gap: 0; }
  .quote-destination { grid-template-columns: 1fr; gap: 14px; }
  .stage-heading { align-items: flex-start; flex-direction: column; }
  .admin-head { gap: 12px; flex-direction: column; }
  .admin-head-actions { justify-content: flex-start; }
  .admin-summary { grid-template-columns: 1fr; }
  .promise-grid { grid-template-columns: 1fr; }
  .connection-status { margin-left: 0; }
  footer { align-items: flex-start; flex-direction: column; }
  .footer-links { justify-content: flex-start; }
  .analytics-consent > div { align-items: stretch; flex-direction: column; gap: 13px; }
  .analytics-consent-actions { justify-content: flex-end; }
}

/* Customer-first document service treatment. */
.panel-intro { background: radial-gradient(ellipse at top right, #ffead9, transparent 68%), #fffdf9; }
.brand-mark { object-fit: contain; }
.privacy-assurance { color: #176a57; background: #effaf6; border-radius: 9px; padding: 10px 12px; margin: 8px 0 14px; font-size: .82rem; line-height: 1.45; }
.batch-summary { display: block; font-weight: 400; margin-top: 5px; line-height: 1.5; }
/* Explicit colors keep white action text readable in every Bootstrap state. */
.btn-primary { background: #ad4400; border-color: #ad4400; color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-primary.active, .btn-primary.show, .btn-primary:not(:disabled):not(.disabled):active, .btn-primary:focus-visible { background: #873500; border-color: #873500; color: #fff; }
.btn-primary:disabled, .btn-primary.disabled { background: #666; border-color: #666; color: #fff; opacity: 1; }
.btn-primary:focus-visible { outline: 3px solid #275dad; outline-offset: 3px; }

/* Session-only PDF list and single-page-at-a-time preview. */
.file-list { display: grid; gap: 10px; margin: 16px 0 8px; }
.file-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fff; }
.file-thumbnail { flex: 0 0 54px; width: 54px; height: 70px; padding: 2px; background: #f5f7fb; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); }
.file-thumbnail img { width: 100%; height: 100%; object-fit: contain; }
.file-description { flex: 1; min-width: 0; }
.file-description strong { display: block; overflow-wrap: anywhere; font-size: .88rem; }
.file-description span, .file-list-total { display: block; color: var(--muted); font-size: .78rem; }
.file-preview, .file-remove { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 9px; min-height: 44px; color: #275dad; font-size: .8rem; }
.file-preview { border: 0; padding: 8px 0; text-decoration: underline; }
.file-remove { color: #873500; }
.hcn-file-action:hover { background: #f5f7fb; }
.hcn-file-action:focus-visible { outline: 3px solid #275dad; outline-offset: 2px; }
.hcn-file-action:disabled { color: #666; cursor: wait; }
.preview-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.preview-controls .btn { min-height: 44px; }
#document_preview img { max-width: 100%; height: auto; display: block; margin: auto; }
.hcn-documents-busy #estimate { visibility: hidden; }
.hcn-documents-busy #continue, .hcn-documents-busy #submit_order { pointer-events: none; }
.purchase-feedback { margin-top: 1rem; font-size: .875rem; }
.purchase-feedback summary { cursor: pointer; text-decoration: underline; }
.purchase-feedback label { display: block; margin-top: .75rem; }
.purchase-feedback small { display: block; margin-top: .5rem; }
