@font-face { font-family: "Jost"; font-style: normal; font-weight: 400; font-display: swap; src: url("./assets/fonts/jost-400.ttf") format("truetype"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 500; font-display: swap; src: url("./assets/fonts/jost-500.ttf") format("truetype"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 600; font-display: swap; src: url("./assets/fonts/jost-600.ttf") format("truetype"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 700; font-display: swap; src: url("./assets/fonts/jost-700.ttf") format("truetype"); }
:root {
  --ink: #000;
  --muted: #61666e;
  --soft: #f5f6f7;
  --line: #dee1e5;
  --panel: #fff;
  --canvas: #eceef0;
  --accent: #000;
  --accent-dark: #35383c;
  --navy: #000;
  --success: #216247;
  --shadow: 0 16px 40px rgba(24, 25, 27, .09), 0 2px 8px rgba(24, 25, 27, .04);
  --radius: 14px;
}
* { box-sizing: border-box; }
html { font-size: 16px; color-scheme: light; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); font-family: "Jost", "Century Gothic", sans-serif; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, input, select, textarea { touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #244b78; outline-offset: 3px; }
button { transition: background .15s ease, border-color .15s ease, box-shadow .15s ease; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.6rem, 2vw, 2.1rem); line-height: 1.2; font-weight: 700; letter-spacing: .01em; text-transform: uppercase; }
h2 { margin-bottom: 3px; font-size: 1.05rem; font-weight: 650; letter-spacing: -.015em; }
h3 { font-size: .875rem; }
.app-header { min-height: 94px; padding: 16px clamp(20px, 3vw, 48px); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #000; border-bottom: 1px solid #000; }
.brand-lockup, .header-actions, .button-group, .editor-topline, .preview-toolbar, .section-heading, .line-heading, .heading-with-step, .form-actions, .tax-status { display: flex; align-items: center; }
.brand-lockup { gap: 25px; min-width: 0; }
.brand-logo { display: block; width: 190px; height: auto; flex-shrink: 0; }
.brand-divider { height: 32px; width: 1px; background: #555; }
.product-name { color: #fff; font-size: .9375rem; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; }
.header-actions { gap: 12px; }
.environment-pill, .check-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 6px; font-size: .75rem; font-weight: 600; }
.environment-pill { color: #dedede; background: transparent; border-color: #555; border-radius: 100px; }
.app-header .icon-button { color: #fff; background: #000; border-color: #555; border-radius: 50%; }
.app-header .icon-button:hover { background: #252525; }
.status-dot { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: #858b94; }
.icon-button { flex-shrink: 0; width: 42px; height: 42px; display: grid; place-items: center; color: #545a63; background: #fff; border: 1px solid var(--line); border-radius: 7px; font-size: 1.5rem; }
.icon-button:hover { color: var(--ink); background: var(--soft); }
.icon-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.workspace { width: 100%; max-width: 1900px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.editor-panel { min-width: 0; padding: 32px clamp(20px, 2.4vw, 42px) 40px; }
.editor-topline { justify-content: space-between; flex-wrap: wrap; gap: 18px; margin-bottom: 25px; }
.eyebrow { margin: 0 0 7px; color: var(--muted); font-size: .75rem; font-weight: 650; letter-spacing: .14em; }
.document-switcher { display: inline-flex; padding: 4px; background: #dde0e4; border: 1px solid #d7dbe0; border-radius: 9px; }
.switch-button { min-height: 40px; padding: 8px 12px; color: #545a63; background: transparent; border: 0; border-radius: 6px; font-size: .875rem; font-weight: 600; white-space: nowrap; }
.switch-button.active { color: #fff; background: var(--ink); box-shadow: 0 2px 5px #00000012; }
#documentForm { background: var(--panel); border: 1px solid #d8dce1; border-radius: var(--radius); box-shadow: 0 4px 18px #18191b04; }
.form-section { padding: 26px; border-bottom: 1px solid var(--line); }
.section-heading { gap: 13px; margin-bottom: 22px; align-items: flex-start; }
.section-heading p { margin-bottom: 0; color: var(--muted); font-size: .875rem; }
.step-number { flex: 0 0 auto; display: grid; place-items: center; width: 31px; height: 31px; color: #545a63; background: #fff; border: 1px solid #d8dce1; border-radius: 50%; font-size: .75rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.line-heading { justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.heading-with-step { gap: 13px; align-items: flex-start; }
.catalog-badge { display: inline-block; margin-top: 8px; color: #525961; font-size: .75rem; font-weight: 500; }
.field-grid { display: grid; gap: 21px 18px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; align-content: start; gap: 8px; color: #3c424a; font-size: .875rem; font-weight: 600; }
.field small { display: inline-block; margin-left: 5px; color: var(--muted); font-size: .75rem; font-weight: 400; }
.full-width { grid-column: 1 / -1; }
.field input, .field select, .field textarea, .cell-input { width: 100%; min-width: 0; min-height: 46px; padding: 11px 12px; color: var(--ink); background: #fbfcfc; border: 1px solid #c8cdd4; border-radius: 7px; font-size: 1rem; font-weight: 400; line-height: 1.4; }
.field select, select.cell-input { padding-right: 25px; }
.field textarea, textarea.cell-input { resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover, .cell-input:hover { border-color: #9199a5; }
.field input:focus, .field select:focus, .field textarea:focus, .cell-input:focus { border-color: #5a6779; background: #fff; box-shadow: 0 0 0 3px #244b7810; }
.field input[readonly] { color: var(--muted); background: #f0f2f4; }
.line-table-wrap { min-width: 0; }
.line-table { display: block; width: 100%; border-collapse: collapse; }
.line-table thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.line-table tbody { display: grid; gap: 16px; }
.line-table tr { display: grid; grid-template-columns: minmax(55px, .7fr) minmax(75px, 1fr) 42px minmax(94px, 1.2fr) 30px; gap: 14px 10px; padding: 17px; background: #f7f8f9; border: 1px solid var(--line); border-radius: 9px; }
.line-table tbody tr:nth-child(odd) { background: #fff; }
.line-table tbody tr:nth-child(even) { background: #f2f2f2; }
.line-table td { display: block; padding: 0; min-width: 0; }
.line-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 7px; color: #61666e; font-size: .875rem; font-weight: 500; }
.item-service { grid-column: 1 / 5; grid-row: 1; }
.item-action { grid-column: 5; grid-row: 1; padding-top: 26px !important; }
.item-description { grid-column: 1 / -1; }
.line-table .item-quantity { grid-column: 1; }
.cell-input { padding: 9px 10px; background: #fff; min-height: 44px; }
textarea.cell-input { display: block; }
.amount-cell { grid-column: 4 / 6; text-align: right; font-variant-numeric: tabular-nums; font-size: 1rem; font-weight: 650; white-space: nowrap; line-height: 44px; }
.amount-cell::before { line-height: 21px; }
.align-right { text-align: right !important; }
.tax-column { text-align: center; }
.tax-check { width: 19px; height: 19px; margin: 12px 0; accent-color: var(--accent); }
.document-po .tax-column { display: none; }
.document-po .amount-cell { grid-column: 3 / 6; }
.remove-line { width: 30px; height: 38px; padding: 0; color: #717985; background: transparent; border: 0; border-radius: 5px; font-size: 1.4rem; }
.remove-line:hover { color: #a72335; background: #fce9ec; }
.primary-button, .secondary-button { min-height: 44px; padding: 10px 15px; border-radius: 100px; font-size: .875rem; font-weight: 500; line-height: 1.4; letter-spacing: .025em; }
.primary-button { color: #fff; background: var(--ink); border: 1px solid var(--ink); box-shadow: 0 2px 3px #0000000d; }
.primary-button:hover { background: #383d45; border-color: #383d45; }
.secondary-button { color: #343b45; background: #fff; border: 1px solid #c8cdd4; }
.secondary-button:hover { background: #f0f2f4; border-color: #9da5b1; }
.button-group { gap: 10px; flex-wrap: wrap; }
.form-actions { justify-content: flex-end; flex-wrap: wrap; gap: 16px; padding: 22px 26px; background: #fcfcfd; border-radius: 0 0 var(--radius) var(--radius); }
.save-state { flex: 1 0 100%; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8125rem; }
.locked-message { padding: 17px 19px; color: #3f4752; background: #f5f6f7; border-left: 3px solid var(--ink); border-radius: 0 5px 5px 0; font-size: .875rem; line-height: 1.65; }
.hidden { display: none !important; }
.preview-panel { min-width: 0; padding: 32px clamp(18px, 2.4vw, 42px) 40px 0; }
.preview-toolbar { justify-content: space-between; gap: 15px; margin-bottom: 25px; min-height: 57px; }
.preview-toolbar h2 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.check-pill { color: #34614d; background: #edf4ef; border-color: #d6e3da; }
.check-pill svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.paper-scroll { overflow-x: auto; padding: 1px 1px 18px; }
.paper-preview { --paper-pad: clamp(26px, 2.7vw, 46px); container-type: inline-size; min-width: 490px; min-height: 740px; padding: var(--paper-pad); color: #000; background: #fff; border: 1px solid #d9dde2; box-shadow: var(--shadow); font-family: "Jost", "Century Gothic", sans-serif; }
.paper-brand { position: relative; margin: 0; padding: 0 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 22px; color: #000; background: #fff; border-bottom: 1px solid #aaa; }
.paper-brand::before { content: ""; position: absolute; left: 0; bottom: -1px; width: 64px; border-bottom: 3px solid #111; }
.paper-brand::after { content: ""; position: absolute; left: 70px; bottom: -1px; width: 26px; border-bottom: 3px solid #b8b8b8; }
.paper-logo { display: block; width: 142px; height: auto; flex-shrink: 0; }
.paper-document-id { position: relative; min-width: 0; padding-left: 18px; text-align: right; }
.paper-document-id::before { content: ""; position: absolute; left: 2px; top: 2px; bottom: 2px; border-left: 2px solid #c8c8c8; transform: skewX(-18deg); }
.paper-demo { margin-top: 4px; color: #666; font-size: .75rem; font-weight: 400; letter-spacing: .09em; text-transform: uppercase; text-align: right; }
.paper-heading { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; gap: 18px; padding: 12px 0; border-bottom: 1px solid #bbb; }
.paper-type { margin: 0; color: inherit; font-size: 1.4rem; font-size: clamp(1.25rem, 4cqi, 1.75rem); font-weight: 600; line-height: 1.15; letter-spacing: .01em; text-transform: uppercase; }
.paper-field-label { color: #616161; font-size: .75rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.paper-field-value { margin-top: 3px; font-size: .875rem; font-weight: 400; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere; }
.paper-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.paper-dates .paper-field-value { font-size: .875rem; }
.paper-project { min-width: 0; }
.paper-project .paper-field-value { font-size: .9375rem; line-height: 1.3; font-weight: 500; }
.paper-meta { padding: 12px 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; }
.paper-recipient .paper-field-value { font-size: .9375rem; font-weight: 500; }
.paper-team { display: grid; align-content: start; gap: 8px; }
.paper-lines { width: 100%; table-layout: fixed; margin-top: 4px; border-collapse: collapse; font-size: .875rem; line-height: 1.45; }
.service-col { width: 23%; }
.description-col { width: 29%; }
.quantity-col { width: 9%; }
.rate-col { width: 18%; }
.amount-col { width: 21%; }
.paper-lines th { padding: 7px 6px; color: #000; background: #fff; border-top: 2px solid #000; border-bottom: 1px solid #000; font-size: .75rem; font-weight: 500; letter-spacing: .045em; text-align: left; text-transform: uppercase; }
.paper-lines td { padding: 10px 6px; border-bottom: 1px solid #ccc; vertical-align: top; overflow-wrap: anywhere; }
.paper-lines th:first-child, .paper-lines td:first-child { padding-left: 8px; }
.paper-lines th:last-child, .paper-lines td:last-child { padding-right: 8px; }
.paper-lines tbody tr:nth-child(odd) > td { background-color: #fff; }
.paper-lines tbody tr:nth-child(even) > td { background-color: #f2f2f2; }
.paper-lines td:first-child { font-weight: 500; }
.paper-lines td:nth-child(2) { color: #505050; white-space: pre-line; }
.paper-lines th:nth-last-child(-n+3), .paper-lines td:nth-last-child(-n+3) { text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.paper-totals { width: 100%; margin: 20px 0 0 auto; font-size: .9375rem; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; padding: 7px 0; }
.total-row:not(.grand) { margin-left: 25%; }
.total-row > span:last-child { text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.total-row.grand { align-items: center; margin-top: 14px; padding: 16px 20px; color: #fff; background: #000; border: 2px solid #000; }
.total-row.grand > span:first-child { max-width: 55%; font-size: .8125rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.total-row.grand > span:last-child { font-size: 1.6rem; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.tax-pending { color: #666; font-size: .8125rem; }
.paper-instructions { margin-top: 28px; padding: 19px 0 0; color: #454545; border-top: 1px solid #aaa; font-size: .8125rem; line-height: 1.6; overflow-wrap: anywhere; }
.paper-instructions h3 { margin: 0 0 10px; color: #000; font-size: .75rem; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; }
.paper-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.paper-footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 34px; padding-top: 15px; border-top: 2px solid #000; color: #000; font-size: .75rem; }
.paper-footer > span { font-weight: 500; letter-spacing: .11em; }
.paper-footer a { color: #454545; text-decoration: none; letter-spacing: .025em; }
.paper-footer a:hover { text-decoration: underline; }
.output-rules { margin-top: 8px; }
.output-rules h3 { margin-bottom: 10px; color: #606772; font-size: .8125rem; font-weight: 500; }
.rule-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.rule-chip { padding: 5px 8px; color: #606772; background: #f6f7f8; border: 1px solid #d6dae0; border-radius: 4px; font-size: .75rem; }
.tax-status { gap: 11px; margin-top: 20px; padding-top: 18px; border-top: 1px solid #d2d7de; }
.avalara-mark { flex: 0 0 32px; display: grid; place-items: center; height: 32px; color: #fff; background: #bd5024; border-radius: 7px; font-weight: 700; }
.tax-status strong, .tax-status span { display: block; }
.tax-status strong { font-size: .8125rem; font-weight: 600; }
.tax-status div span { margin-top: 2px; color: #606772; font-size: .75rem; }
.preview-dialog, .mapping-dialog { padding: 0; color: var(--ink); background: #fff; border: 1px solid #d4d9df; border-radius: 14px; box-shadow: 0 30px 90px #00000040; }
.preview-dialog { width: min(960px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.mapping-dialog { width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
dialog::backdrop { background: #161c28ad; backdrop-filter: blur(3px); }
.dialog-header { padding: 20px 26px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.dialog-body { padding: 28px; overflow: auto; background: var(--canvas); }
.dialog-body .paper-preview { --paper-pad: 45px; width: 100%; max-width: 780px; min-height: 930px; margin: 0 auto; padding: var(--paper-pad); }
.dialog-body .paper-logo { width: 155px; }
.dialog-body .paper-heading { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.dialog-body .paper-lines { font-size: .875rem; }
.dialog-actions { padding: 18px 24px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }
.dialog-actions > span { margin-right: auto; color: var(--muted); font-size: .8125rem; }
.mapping-content { padding: 26px; }
.mapping-content > p { color: #525b68; font-size: 1rem; }
.mapping-row { margin-top: 10px; padding: 15px; display: grid; grid-template-columns: 1fr 26px 1fr; gap: 7px; align-items: center; background: #f5f6f7; border: 1px solid var(--line); border-radius: 7px; font-size: .875rem; }
.mapping-source { color: #626b78; }
.mapping-arrow { text-align: center; }
.mapping-note { margin: 20px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: .875rem !important; }
.catalog-admin { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.catalog-admin h3 { margin-bottom: 15px; font-size: 1rem; }
.catalog-rule-list { margin-top: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.catalog-rule { padding: 12px; display: flex; align-items: center; gap: 9px; color: #3f4957; background: #f7f8f9; border: 1px solid var(--line); border-radius: 6px; font-size: .875rem; }
.catalog-rule input { flex-shrink: 0; width: 18px; height: 18px; accent-color: var(--accent); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: min(420px, calc(100vw - 32px)); padding: 15px 19px; color: #fff; background: #252a32; border: 1px solid #464c56; border-radius: 9px; box-shadow: var(--shadow); font-size: .875rem; opacity: 0; transform: translateY(14px); pointer-events: none; transition: .2s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (min-width: 1600px) { .workspace { grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); } }
@media (max-width: 1120px) { .workspace { grid-template-columns: 1fr; max-width: 880px; } .preview-panel { padding: 0 clamp(20px, 2.4vw, 42px) 40px; } .editor-topline { flex-wrap: nowrap; } .paper-preview { --paper-pad: 40px; min-height: 890px; } }
@media (max-width: 680px) {
  .app-header { padding: 17px 18px; min-height: 80px; gap: 12px; }
  .brand-lockup { gap: 12px; }
  .brand-logo { width: 146px; }
  .brand-divider { display: none; }
  .product-name { max-width: 80px; font-size: .8125rem; }
  .environment-pill { display: none; }
  .editor-panel { padding: 25px 14px 30px; }
  .preview-panel { padding: 0 14px 30px; }
  .editor-topline { align-items: flex-start; flex-direction: column; gap: 20px; }
  .document-switcher { width: 100%; }
  .switch-button { flex: 1; }
  .form-section { padding: 22px 16px; }
  .two-columns { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .line-table tr { padding: 13px; gap: 13px 8px; grid-template-columns: minmax(50px, .8fr) minmax(70px, 1fr) 32px minmax(55px, 1fr) 26px; }
  .cell-input { padding: 9px 7px; }
  .form-actions { align-items: stretch; flex-direction: column; padding: 20px 16px; }
  .button-group { display: grid; grid-template-columns: 1fr; }
  .paper-preview { --paper-pad: 26px; min-height: 740px; }
  .dialog-body { padding: 14px; }
  .dialog-body .paper-preview { --paper-pad: 35px; min-width: 600px; }
  .dialog-header { padding: 18px; }
  .dialog-actions { padding: 16px; flex-wrap: wrap; }
  .dialog-actions > span { width: 100%; margin-bottom: 7px; }
  .mapping-content { padding: 20px; }
  .catalog-rule-list { grid-template-columns: 1fr; }
  .toast { right: 16px; bottom: 16px; }
}
@media (max-width: 380px) {
  .product-name { display: none; }
  .line-table tr { grid-template-columns: repeat(3, minmax(0, 1fr)) 26px; }
  .item-service { grid-column: 1 / 4; }
  .item-action { grid-column: 4; }
  .item-rate { grid-column: 2; }
  .line-table .tax-column { grid-column: 3 / 5; }
  .line-table .amount-cell, .document-po .amount-cell { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
@container (max-width: 540px) {
  .paper-meta { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 18px; }
  .paper-team { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; padding-top: 8px; border-top: 1px solid #ddd; }
}

.delivery-panel { margin-top: 22px; padding: 22px 24px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.delivery-panel-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.delivery-panel-heading h2 { margin: 0; }
.delivery-panel > p { margin: 12px 0 0; color: #5b6068; font-size: .875rem; }
.delivery-lock { padding: 4px 9px; color: #684c24; background: #fcf6e9; border: 1px solid #e8d9ba; border-radius: 4px; font-size: .8125rem; }
.delivery-checks { margin: 15px 0 0; padding: 0; list-style: none; }
.delivery-checks li { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 11px 0; border-bottom: 1px solid #e7e8eb; font-size: .875rem; }
.delivery-step-number { color: #737982; font-size: .75rem; }
.delivery-status { color: #696f77; font-size: .8125rem; text-align: right; }
.delivery-panel .delivery-connection-note { font-size: .8125rem; }
.email-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.email-content { padding: 22px 26px; }
.email-party { font-size: .875rem; color: #535b65; }
.email-verification { padding: 12px 15px; color: #684c24; background: #fcf6e9; border-left: 3px solid #c4a36d; font-size: .875rem; margin-bottom: 20px; }
.email-field-grid { display: grid; gap: 15px; }
.email-help { margin: 0; color: #666d76; font-size: .8125rem; }
.email-recipient-confirm { display: flex; align-items: flex-start; gap: 10px; color: #454e59; font-size: .875rem; }
.email-recipient-confirm input { flex-shrink: 0; width: 18px; height: 18px; accent-color: #000; }
.email-attachment { display: grid; gap: 4px; margin: 20px 0 14px; padding: 14px 16px; background: #f5f6f7; border: 1px solid var(--line); font-size: .875rem; }
.email-attachment span { color: #636b76; font-size: .8125rem; }
.email-dialog .dialog-actions { flex-wrap: wrap; }
.email-dialog .dialog-actions > span { flex-basis: 100%; }
button:disabled { cursor: not-allowed; opacity: .5; box-shadow: none; }
@media (max-width: 680px) { .delivery-panel, .email-content { padding: 18px 16px; } .delivery-checks li { grid-template-columns: 20px minmax(0, 1fr); } .delivery-status { grid-column: 2; text-align: left; } }

@page { size: letter; margin: 0.5in; }
@media print {
  html { font-size: 12px; }
  body { background: #fff; }
  body > * { display: none !important; }
  body > #previewDialog[open], body > #printPreviewRoot { display: block !important; position: static; inset: auto; width: 100%; max-width: none; max-height: none; height: auto; margin: 0; overflow: visible; border: 0; border-radius: 0; box-shadow: none; }
  dialog::backdrop, .dialog-header, .dialog-actions { display: none !important; }
  .dialog-body { padding: 0; background: #fff; overflow: visible; }
  .dialog-body .paper-preview { --paper-pad: 0px; display: block; container-type: normal; width: 100%; max-width: none; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0; box-shadow: none; }
  .paper-brand { margin: 0; padding: 0 0 10px; color: #000; background: #fff; border-bottom: 1px solid #aaa; break-after: avoid; }
  .dialog-body .paper-logo { width: 138px; }
  .paper-demo { color: #666; }
  .dialog-body .paper-heading { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; padding: 8px 0; break-after: avoid; }
  .paper-type { font-size: 19pt; }
  .paper-project { padding: 0; }
  .paper-meta { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; padding: 9px 0; }
  .paper-team { grid-column: auto; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 0; border: 0; }
  .paper-lines thead { display: table-header-group; }
  .paper-lines tr, .paper-brand, .paper-heading, .paper-project, .paper-meta, .paper-team, .paper-totals, .paper-instructions, .paper-footer { break-inside: avoid; }
  .paper-lines td, .dialog-body .paper-lines, .paper-field-value, .paper-dates .paper-field-value { font-size: 10pt; }
  .paper-field-label, .paper-instructions, .paper-demo, .paper-footer { font-size: 9pt; }
  .paper-field-value { line-height: 1.3; margin-top: 2px; }
  .paper-lines th { padding-top: 6px; padding-bottom: 6px; }
  .paper-lines td { padding-top: 8px; padding-bottom: 8px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .paper-totals { width: 100%; }
  .total-row.grand { color: #000; background: #fff; border-width: 2px 0; padding: 13px 0; }
  .total-row.grand > span:last-child { font-size: 20pt; }
  .paper-instructions { margin-top: 22px; }
  .paper-footer { margin-top: 28px; }
}

/* Local test workspace; document styling stays compact and economical to print. */
.testbox-panel { max-width: 1816px; margin: 26px auto 0; padding: 24px 28px 15px; background: #fff; border: 1px solid #d8dce1; border-top: 3px solid #ac874b; border-radius: 12px; }
.testbox-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.testbox-intro h2 { font-size: clamp(1.4rem, 2vw, 1.8rem); line-height: 1.2; margin-bottom: 8px; letter-spacing: -.025em; }
.testbox-intro p:last-child { color: #60646a; margin-bottom: 18px; font-size: .9375rem; }
.sandbox-label { flex-shrink: 0; color: #63491e; font-weight: 500; font-size: .875rem; text-align: right; }
.sandbox-label small { color: #60646a; font-weight: 400; font-size: .75rem; }
.sandbox-dot { display: inline-block; width: 7px; height: 7px; border-radius: 100%; background: #a67c35; margin-right: 6px; }
.testbox-controls { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto; gap: 18px; align-items: end; }
.testbox-controls .field { gap: 5px; }
.testbox-controls .field select { font-size: .875rem; }
.scenario-help { color: #69542f; background: #faf7f0; padding: 9px 12px; border-left: 2px solid #c6aa78; margin: 14px 0 8px; font-size: .875rem; }
.testbox-utilities { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.text-button { display: inline-block; background: transparent; border: 0; padding: 7px 2px; color: #484e56; font-size: .8125rem; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: #000; }
.storage-status { color: #6a7078; font-size: .75rem; margin: 8px 0 0; padding-top: 9px; border-top: 1px solid #ececec; }
.storage-warning { color: #9b302c; font-weight: 500; }
.validation-message { margin: 0; padding: 12px 25px; background: #fff4ee; color: #893728; border-radius: 14px 14px 0 0; font-size: .875rem; }
.delivery-status.passed { color: #216247; font-weight: 500; }
.recovery-actions { display: flex; gap: 10px; margin-top: 14px; }
.recovery-actions:has(button:not([hidden])) { margin-bottom: 12px; }
.test-records { margin-top: 22px; scroll-margin-top: 20px; }
.test-records details { margin-top: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.test-records summary { padding: 16px 22px; font-weight: 600; cursor: pointer; }
.test-records summary span { font-size: .75rem; color: #737982; font-weight: 400; margin-left: 10px; }
#outboxList { max-height: 420px; overflow: auto; padding: 0 22px; }
.test-record { padding: 14px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.test-record div { min-width: 0; }
.test-record strong { display: block; font-size: .875rem; font-weight: 500; overflow-wrap: anywhere; }
.test-record span { display: block; margin-top: 4px; color: #717781; font-size: .75rem; overflow-wrap: anywhere; }
.test-record button { flex-shrink: 0; }
.empty-state { padding: 2px 0 16px; color: #777c84; font-size: .875rem; }
.activity-list { max-height: 320px; overflow: auto; margin: 0; padding: 0 22px 16px; list-style: none; }
.activity-list li { display: grid; grid-template-columns: 105px 1fr; gap: 12px; border-top: 1px solid var(--line); padding: 11px 0; font-size: .8125rem; }
.activity-list time { color: #737982; font-size: .6875rem; }
.activity-list .empty-state { display: block; }
#outboxMessage dl { display: grid; grid-template-columns: 80px 1fr; gap: 10px; font-size: .875rem; }
#outboxMessage dt { color: #737982; }
#outboxMessage dd { margin: 0; overflow-wrap: anywhere; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; padding: 18px; background: #f6f6f6; border: 1px solid var(--line); font-size: .9375rem; }
@media (max-width: 1870px) { .testbox-panel { margin-left: 28px; margin-right: 28px; } }
@media (max-width: 1120px) { .testbox-panel { max-width: 824px; margin: 22px auto 0; } .testbox-controls { grid-template-columns: 1fr 1fr; } .testbox-controls > .button-group { grid-column: 1 / -1; } }
@media (max-width: 880px) { .testbox-panel { margin-left: 20px; margin-right: 20px; } }
@media (max-width: 680px) { .testbox-panel { margin: 16px 14px 0; padding: 18px 16px 13px; } .testbox-intro { align-items: flex-start; flex-direction: column; gap: 0; } .sandbox-label { text-align: left; margin-bottom: 18px; } .testbox-controls { grid-template-columns: 1fr; gap: 13px; } .testbox-controls > .button-group { display: flex; } .testbox-utilities .button-group { display: flex; gap: 12px; } .test-records summary { padding: 16px; } .test-records summary span { display: block; margin-left: 0; } .activity-list li { grid-template-columns: 1fr; gap: 4px; } }
@media print { .testbox-panel { display: none !important; } }
