.quote-generator-app { box-sizing: border-box; width: 100%; max-width: 100%; color: #172033; }
.quote-generator-app *, .quote-generator-app *::before, .quote-generator-app *::after { box-sizing: border-box; }
.quote-generator-app h2 { margin-top: 0; }
.quote-generator-intro { color: #536174; }
.quote-editor, .quote-preview-pane { min-width: 0; }
.quote-form { display: grid; gap: 18px; }
.quote-fieldset { min-width: 0; margin: 0; padding: 16px; border: 1px solid #dce3ec; border-radius: 9px; }
.quote-fieldset legend { padding: 0 7px; font-weight: 700; }
.quote-field { display: flex; min-width: 0; flex-direction: column; gap: 5px; margin: 0 0 12px; }
.quote-field:last-child { margin-bottom: 0; }
.quote-field label { font-size: .9rem; font-weight: 600; }
.quote-field input, .quote-field textarea, .quote-field select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #bac5d2; border-radius: 6px; background: #fff; color: #172033; font: inherit; }
.quote-field textarea { min-height: 68px; resize: vertical; }
.quote-field input[readonly] { background: #f5f7fa; color: #536174; }
.quote-field input:focus, .quote-field textarea:focus, .quote-field select:focus, .quote-button:focus-visible, .quote-remove-item:focus-visible { outline: 3px solid rgba(37, 99, 235, .25); outline-offset: 2px; border-color: #2563eb; }
.quote-field input[aria-invalid="true"] { border-color: #b42318; background: #fff8f7; }
.quote-validation { margin: 0; padding: 10px 12px; border-radius: 6px; background: #fff5f4; color: #8e2118; }
.quote-validation[hidden] { display: none; }
.quote-help { margin: 0 0 12px; color: #536174; font-size: .88rem; }
.quote-item-rows { display: grid; gap: 12px; }
.quote-item-editor { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(55px, .65fr) minmax(80px, 1fr) minmax(90px, 1fr); gap: 10px; align-items: end; padding: 12px; border: 1px solid #e2e8f0; border-radius: 8px; }
.quote-item-editor-head { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; }
.quote-remove-item { padding: 5px 8px; border: 0; background: transparent; color: #9b1c1c; font: inherit; font-size: .88rem; cursor: pointer; text-decoration: underline; }
.quote-remove-item:disabled { color: #7b8491; cursor: not-allowed; text-decoration: none; }
.quote-adjustments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quote-adjustments legend { grid-column: 1 / -1; }
.quote-adjustments .quote-field { margin: 0; }
.quote-button { min-height: 42px; padding: 9px 14px; border: 1px solid #c4ceda; border-radius: 7px; background: #fff; color: #172033; font: inherit; font-weight: 600; cursor: pointer; }
.quote-button:hover { background: #f5f7fa; }
.quote-button.is-primary { border-color: #1d4ed8; background: #1d4ed8; color: #fff; }
.quote-add-item { margin-top: 12px; }
.quote-editor-actions { display: flex; justify-content: flex-end; }
.quote-preview-pane { margin-top: 28px; }
.quote-preview-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.quote-preview-header h3 { margin: 0; }
.quote-preview-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.quote-print-hint { margin: 0 0 12px; color: #536174; font-size: .88rem; }
.quote-document { min-width: 0; padding: clamp(18px, 3vw, 36px); border: 1px solid #dce3ec; border-radius: 8px; background: #fff; box-shadow: 0 3px 16px rgba(15, 23, 42, .07); }
.quote-paper { width: 100%; max-width: 850px; margin: 0 auto; overflow-wrap: anywhere; }
.quote-document-top { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 22px; border-bottom: 1px solid #dce3ec; }
.quote-business-block { min-width: 0; }
.quote-business-name { min-height: 1em; margin: 0 0 8px; font-size: 1.25rem; }
.quote-business-block p, .quote-prepared-for p, .quote-extra p { margin: 4px 0; white-space: pre-line; }
.quote-title-block { min-width: 200px; text-align: right; }
.quote-title-block h1 { margin: 0 0 12px; color: #1d4ed8; font-size: 1.8rem; letter-spacing: .05em; }
.quote-meta { margin: 0; }
.quote-meta-row { display: grid; grid-template-columns: auto auto; justify-content: end; gap: 10px; margin: 5px 0; font-size: .88rem; }
.quote-meta-row dt { color: #536174; }
.quote-meta-row dd { margin: 0; text-align: right; font-weight: 600; }
.quote-prepared-for { padding: 20px 0; }
.quote-prepared-for h3, .quote-extra h3 { margin: 0 0 8px; font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; }
.quote-table-wrap { width: 100%; overflow-x: auto; }
.quote-items-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.quote-items-table th, .quote-items-table td { padding: 10px 8px; border-bottom: 1px solid #e2e8f0; text-align: right; overflow-wrap: anywhere; }
.quote-items-table th { background: #f5f7fa; font-size: .85rem; }
.quote-items-table .column-description { width: 48%; text-align: left; }
.quote-totals-section { width: min(100%, 360px); margin: 16px 0 0 auto; }
.quote-totals { margin: 0; }
.quote-totals .quote-meta-row { padding: 3px 0; }
.quote-estimated-total { display: flex; justify-content: space-between; gap: 16px; margin-top: 10px; padding: 12px 0; border-top: 2px solid #172033; font-size: 1.12rem; }
.quote-extra { margin-top: 22px; padding-top: 14px; border-top: 1px solid #e2e8f0; }

@media (min-width: 1050px) {
	.quote-generator-app { display: grid; grid-template-columns: minmax(360px, .85fr) minmax(0, 1.15fr); column-gap: 24px; align-items: start; }
	.quote-generator-app > h2, .quote-generator-app > .quote-generator-intro { grid-column: 1 / -1; }
	.quote-generator-app > h2 { margin-bottom: 0; }
	.quote-generator-app > .quote-generator-intro { margin-top: 5px; }
	.quote-editor, .quote-preview-pane { margin-top: 0; }
	.quote-editor { grid-column: 1; grid-row: 3; }
	.quote-preview-pane { grid-column: 2; grid-row: 3; }
}
@media (max-width: 680px) {
	.quote-item-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.quote-item-editor-head { grid-column: 1 / -1; }
	.quote-document { padding: 16px 12px; }
	.quote-document-top { gap: 12px; }
	.quote-title-block { min-width: 140px; }
	.quote-title-block h1 { font-size: 1.4rem; }
	.quote-items-table th, .quote-items-table td { padding: 8px 4px; font-size: .83rem; }
	.quote-items-table .column-description { width: 40%; }
	.quote-items-table { min-width: 520px; }
}
@media print {
	@page { size: auto; margin: 14mm; }
	body * { visibility: hidden !important; }
	#tool-engine-app, #tool-engine-app * { visibility: visible !important; }
	#tool-engine-app { position: absolute !important; inset: 0 auto auto 0 !important; width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
	.quote-generator-app { display: block !important; width: 100% !important; margin: 0 !important; padding: 0 !important; }
	.quote-generator-app > h2, .quote-generator-app > .quote-generator-intro { display: none !important; }
	.no-print, .quote-editor, .quote-preview-header, .quote-print-hint { display: none !important; }
	.quote-preview-pane { display: block !important; margin: 0 !important; }
	.quote-document { display: block !important; width: 100% !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
	.quote-paper { max-width: none !important; }
	.quote-items-table { min-width: 0 !important; page-break-inside: auto; }
	.quote-items-table tr { page-break-inside: avoid; }
}
