:root {
    --dpaq-blue: #174f9a;
    --dpaq-blue-dark: #123d78;
    --dpaq-blue-light: #eef5fd;
    --dpaq-green: #08783e;
	--dpaq-orange: #FF5001;
	--dpaq-pdf-yellow: #FF5001;
	--dpaq-pdf-yellow-hover: #CC4000;
    --dpaq-red: #c62828;
    --dpaq-text: #202936;
    --dpaq-muted: #667386;
    --dpaq-line: #d8e2ee;
    --dpaq-surface: #f7faff;
    --dpaq-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

html.dpaq-modal-open,
html.dpaq-modal-open body {
    overflow: hidden;
}

.dpaq-calculator,
.dpaq-calculator *,
.dpaq-calculator *::before,
.dpaq-calculator *::after {
    box-sizing: border-box;
}

.dpaq-modal,
.dpaq-modal *,
.dpaq-modal *::before,
.dpaq-modal *::after {
    box-sizing: border-box;
}

.dpaq-calculator button,
.dpaq-calculator input,
.dpaq-calculator select,
.dpaq-modal button,
.dpaq-modal input {
	touch-action: manipulation;
}

.dpaq-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;
}

.dpaq-calculator {
    flex: 0 0 100%;
    order: -20;
    width: 100%;
    margin: 0 0 10px;
    padding: 10px;
    border: 1px solid var(--dpaq-line);
    border-radius: 8px;
    background: var(--dpaq-surface);
    color: var(--dpaq-text);
}

.dpaq-label {
    display: block;
    margin: 0 0 5px;
    color: #173e72;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.3;
}

.dpaq-input-wrap {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 42px;
    overflow: hidden;
    border: 1px solid #b8c6d9;
    border-radius: 7px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.dpaq-input-wrap:focus-within {
    border-color: var(--dpaq-blue);
    box-shadow: 0 0 0 3px rgba(23, 79, 154, .13);
}

.dpaq-calculator.has-error .dpaq-input-wrap {
    border-color: var(--dpaq-red);
    box-shadow: 0 0 0 3px rgba(198, 40, 40, .10);
}

.dpaq-area-input {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    min-height: 40px;
    margin: 0;
    padding: 6px 10px;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: var(--dpaq-text);
    font: inherit;
    font-size: 15px;
}

.dpaq-unit {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 0 10px;
    border-left: 1px solid var(--dpaq-line);
    background: #eef3f9;
    color: var(--dpaq-blue);
    font-size: 13.5px;
    font-weight: 750;
}

.dpaq-result {
    min-height: 0;
    margin: 5px 0 0;
    color: #174f9a;
    font-size: 12.5px;
    font-weight: 750;
    line-height: 1.4;
}

.dpaq-result.is-success {
    color: var(--dpaq-green);
    font-weight: 650;
}

.dpaq-result.is-error {
    color: var(--dpaq-red);
    font-weight: 650;
}

.dpaq-formula-switch {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    margin: 0 0 9px;
    padding: 9px 10px;
    border: 1px solid #cbd8e8;
    border-radius: 8px;
    background: #fff;
}

.dpaq-formula-switch label {
    margin: 0;
    color: #173e72;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.3;
}

.dpaq-formula-switch select {
    width: 100%;
    min-height: 40px;
    margin: 0;
    padding: 6px 34px 6px 10px;
    border: 1px solid #b8c6d9;
    border-radius: 6px;
    background-color: #fff;
    color: var(--dpaq-text);
    font-size: 14px;
}

.dpaq-formula-switch p {
    margin: 0;
    color: var(--dpaq-muted);
    font-size: 11.5px;
    line-height: 1.35;
}

.dpaq-recommendations {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #cbd8e8;
    border-radius: 8px;
    background: #fff;
}

.dpaq-recommendations[hidden],
.dpaq-modal[hidden],
.dpaq-view-result[hidden] {
    display: none;
}

.dpaq-recommendations-title {
    display: block;
    margin: 0 0 9px;
    color: #173e72;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
}

.dpaq-material-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dpaq-material-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 7px;
    background: #eff9f3;
}

.dpaq-material-name {
    flex: 0 0 108px;
    color: #173e72;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
}

.dpaq-material-content {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    color: #2e3743;
    font-size: 13px;
    line-height: 1.45;
}

.dpaq-material-amount {
    font-weight: 650;
}

.dpaq-material-plan {
    color: var(--dpaq-green);
}

.dpaq-recommendations-note {
    margin: 9px 0 0;
    padding-top: 8px;
    border-top: 1px dashed #d5dde8;
    color: var(--dpaq-muted);
    font-size: 12px;
    line-height: 1.45;
}

.dpaq-view-result {
    width: 100%;
    min-height: 44px;
    margin: 11px 0 0;
    padding: 9px 14px;
    border: 0;
    border-radius: 6px;
    background: var(--dpaq-blue);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.dpaq-view-result:hover,
.dpaq-view-result:focus-visible {
    background: var(--dpaq-blue-dark);
}

.dpaq-modal {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
}

.dpaq-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 25, 48, .70);
    backdrop-filter: blur(2px);
}

.dpaq-modal-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(900px, 100%);
    max-height: min(92vh, 920px);
    max-height: min(94dvh, 920px);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #cbd8e8;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(7, 24, 48, .28);
    font-family: var(--dpaq-font);
    font-weight: 400;
}

.dpaq-modal-header {
    position: relative;
    z-index: 3;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--dpaq-line);
    background: var(--dpaq-blue);
    color: #fff;
}

.dpaq-modal-header > div {
    flex: 1 1 auto;
    min-width: 0;
}

.dpaq-modal-header span {
    display: block;
    margin-bottom: 2px;
    color: #cfe0f7;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
}

.dpaq-modal-header h2 {
    margin: 0;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.dpaq-modal-close {
    display: grid;
    z-index: 4;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.dpaq-modal-close:hover,
.dpaq-modal-close:focus-visible {
    background: rgba(255, 255, 255, .24);
}

.dpaq-modal-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 18px;
    overscroll-behavior: contain;
}

.dpaq-report-sheet {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--dpaq-line);
    border-radius: 10px;
    background: #fff;
    color: #17202c;
    font-family: var(--dpaq-font);
    font-weight: 400;
}

.dpaq-report-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--dpaq-blue);
}

.dpaq-report-logo {
    flex: 0 0 auto;
    max-width: 132px;
    max-height: 74px;
    object-fit: contain;
}

.dpaq-report-head h3 {
    margin: 0 0 4px;
    color: var(--dpaq-blue);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}

.dpaq-report-head strong {
    font-size: 14px;
    font-weight: 600;
}

.dpaq-report-head p {
    margin: 3px 0 0;
    color: #4f5e70;
    font-size: 12px;
}

.dpaq-report-meta {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 6px 16px;
    margin: 11px 0;
    color: #3d4b5d;
    font-size: 13px;
}

.dpaq-report-meta strong,
.dpaq-report-package strong,
.dpaq-report-materials strong {
    font-weight: 600;
}

.dpaq-report-sheet table {
    width: 100%;
    margin: 0 0 10px;
    border-collapse: collapse;
    table-layout: fixed;
}

.dpaq-report-sheet th,
.dpaq-report-sheet td {
    padding: 7px 10px;
    border: 1px solid #cfd9e6;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
    font-size: 12.5px;
    line-height: 1.4;
}

.dpaq-report-sheet th {
    font-weight: 600;
}

.dpaq-report-summary th {
    width: 20%;
    background: #eff5fb;
    color: #173e72;
}

.dpaq-report-sheet h4 {
    margin: 10px 0 7px;
    color: #173e72;
    font-size: 14.5px;
    font-weight: 600;
}

.dpaq-report-materials thead th {
    background: var(--dpaq-blue);
    color: #fff;
}

.dpaq-report-materials th:first-child,
.dpaq-report-materials td:first-child {
    width: 22%;
}

.dpaq-report-materials th:nth-child(2),
.dpaq-report-materials td:nth-child(2) {
    width: 26%;
}

/* Khoảng đệm rõ ràng ở cột đầu giúp chữ không dính đường viền trái của bảng. */
.dpaq-report-sheet tr > :first-child {
    padding-left: 11px;
}

.dpaq-report-package {
    margin: 7px 0;
    color: #354255;
    font-size: 12.5px;
    line-height: 1.45;
}

.dpaq-report-note {
    margin: 8px 0 0;
    padding: 8px 10px;
    border-left: 4px solid var(--dpaq-orange);
    background: #fff8ef;
    color: #5a4a35;
    font-size: 12px;
    line-height: 1.45;
}

.dpaq-export-actions {
    display: grid;
    gap: 9px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--dpaq-line);
    border-radius: 8px;
    background: #f8fbff;
}

.dpaq-email-title {
    color: #173e72;
    font-size: 14px;
    font-weight: 700;
}

.dpaq-export-row {
    display: grid;
    grid-template-columns: minmax(155px, .72fr) minmax(0, 1fr) minmax(0, 1fr) minmax(112px, .58fr);
    gap: 10px;
    align-items: end;
}

.dpaq-download-pdf {
    display: inline-flex;
    align-self: end;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 9px 14px;
    border: 0;
	border-radius: 7px;
	background-color: var(--dpaq-pdf-yellow);
	color: #ffffff;
    font-family: var(--dpaq-font);
	font-size: 15px;
	font-weight: 700;
    line-height: 1.2;
	letter-spacing: .01em;
	text-align: center;
	text-shadow: 0 1px 1px rgba(0, 0, 0, .24);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    cursor: pointer;
    transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.dpaq-download-pdf:hover,
.dpaq-download-pdf:focus-visible,
.dpaq-download-pdf:active {
	background-color: var(--dpaq-pdf-yellow-hover);
	color: #ffffff;
	box-shadow: 0 6px 18px rgba(255, 80, 1, .34);
    transform: translateY(-1px);
}

.dpaq-download-pdf:disabled {
	opacity: .7;
	cursor: wait;
	box-shadow: none;
	transform: none;
}

.dpaq-contact-field {
    display: grid;
    gap: 5px;
    min-width: 0;
    margin: 0;
    color: #173e72;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
}

.dpaq-required-mark {
	color: var(--dpaq-red);
	font-weight: 700;
}

.dpaq-contact-label-text {
	display: inline-flex;
	align-items: baseline;
	gap: 3px;
}

.dpaq-contact-field input {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    margin: 0;
    padding: 9px 11px;
    border: 1px solid #b8c6d9;
    border-radius: 7px;
    background: #fff;
    color: var(--dpaq-text);
    font-family: var(--dpaq-font);
    font-size: 13.5px;
    font-weight: 400;
}

.dpaq-export-actions.is-validated .dpaq-contact-field input:invalid,
.dpaq-contact-field input[aria-invalid="true"] {
	border-color: var(--dpaq-red);
	box-shadow: 0 0 0 3px rgba(198, 40, 40, .10);
}

.dpaq-modal .dpaq-download-pdf:focus-visible,
.dpaq-modal .dpaq-send-email:focus-visible,
.dpaq-modal .dpaq-contact-field input:focus-visible {
	outline: 3px solid #174f9a;
    outline-offset: 2px;
}

.dpaq-modal .dpaq-modal-close:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

@media (hover: none) and (pointer: coarse) {
	.dpaq-area-input,
	.dpaq-formula-switch select,
	.dpaq-contact-field input {
		font-size: 16px;
		line-height: 1.25;
	}
}

.dpaq-send-email {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 9px 14px;
    border: 0;
    border-radius: 7px;
    background: var(--dpaq-blue);
    color: #fff;
    font-family: var(--dpaq-font);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}

.dpaq-send-email:hover,
.dpaq-send-email:focus-visible {
    background: var(--dpaq-blue-dark);
}

.dpaq-send-email:disabled {
    cursor: wait;
    opacity: .65;
}

.dpaq-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.dpaq-pdf-status,
.dpaq-email-status {
    margin: 0;
    color: var(--dpaq-muted);
    font-size: 12px;
    line-height: 1.45;
}

.dpaq-email-privacy {
	margin: 0;
	color: var(--dpaq-muted);
	font-size: 11.5px;
	font-weight: 400;
	line-height: 1.45;
}

.dpaq-pdf-status:empty,
.dpaq-email-status:empty {
    display: none;
}

.dpaq-pdf-status:not(:empty),
.dpaq-email-status:not(:empty) {
    margin-top: 1px;
}

.dpaq-pdf-status.is-success,
.dpaq-email-status.is-success {
    color: var(--dpaq-green);
    font-weight: 600;
}

.dpaq-pdf-status.is-error,
.dpaq-email-status.is-error {
    color: var(--dpaq-red);
    font-weight: 600;
}

@media (max-width: 767px) {
    .dpaq-calculator {
        margin-bottom: 8px;
        padding: 9px;
        border-radius: 8px;
    }

    .dpaq-label {
        font-size: 14px;
    }

    .dpaq-input-wrap,
    .dpaq-area-input {
        min-height: 40px;
    }

	.dpaq-area-input,
	.dpaq-formula-switch select,
	.dpaq-contact-field input {
		font-size: 16px;
		line-height: 1.25;
	}

    .dpaq-result {
        margin-top: 4px;
        font-size: 12.25px;
    }

    .dpaq-material-row {
        flex-direction: column;
        gap: 3px;
    }

    .dpaq-material-name {
        flex-basis: auto;
        width: 100%;
    }

    .dpaq-modal {
        inset: auto;
        top: var(--dpaq-modal-vv-top, 0px);
        right: auto;
        bottom: auto;
        left: var(--dpaq-modal-vv-left, 0px);
        width: var(--dpaq-modal-vv-width, 100vw);
        height: 100vh;
        height: 100svh;
        height: 100dvh;
        height: var(--dpaq-modal-vv-height, 100dvh);
        max-width: 100vw;
        align-items: stretch;
        padding: var(--dpaq-modal-vv-padding-top, max(6px, env(safe-area-inset-top))) env(safe-area-inset-right) 0 env(safe-area-inset-left);
        overflow: hidden;
    }

    .dpaq-modal-backdrop {
        backdrop-filter: none;
    }

    .dpaq-modal-dialog {
        width: 100%;
        height: 100%;
        min-height: 0;
        max-height: none;
        border-radius: 12px 12px 0 0;
    }

    .dpaq-modal-header {
        padding: 13px 14px;
    }

    .dpaq-modal-header h2 {
        font-size: 18px;
    }

    .dpaq-modal-scroll {
        padding: 10px 10px calc(12px + env(safe-area-inset-bottom));
    }

    .dpaq-report-sheet {
        padding: 11px;
        border-radius: 8px;
    }

    .dpaq-report-head {
        gap: 10px;
    }

    .dpaq-report-logo {
        max-width: 86px;
        max-height: 55px;
    }

    .dpaq-report-head h3 {
        font-size: 16px;
    }

    .dpaq-report-meta {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .dpaq-report-summary,
    .dpaq-report-summary tbody,
    .dpaq-report-summary tr,
    .dpaq-report-summary th,
    .dpaq-report-summary td {
        display: block;
        width: 100%;
    }

    .dpaq-report-summary tr {
        display: grid;
        grid-template-columns: 42% 58%;
    }

    .dpaq-report-summary th,
    .dpaq-report-summary td {
        min-height: 34px;
        padding: 6px 8px;
    }

    .dpaq-report-materials th,
    .dpaq-report-materials td {
        padding: 6px 7px;
        font-size: 11.5px;
        line-height: 1.38;
    }

    .dpaq-report-materials th:first-child,
    .dpaq-report-materials td:first-child {
        width: 24%;
    }

    .dpaq-report-materials th:nth-child(2),
    .dpaq-report-materials td:nth-child(2) {
        width: 25%;
    }

    .dpaq-report-sheet tr > :first-child {
        padding-left: 11px;
    }

    .dpaq-download-pdf {
        min-height: 48px;
		font-size: 15px;
    }

    .dpaq-export-actions {
        gap: 10px;
        padding: 10px;
    }

    .dpaq-export-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .dpaq-contact-field input,
    .dpaq-send-email,
    .dpaq-download-pdf {
        width: 100%;
        min-height: 48px;
    }
}

@media (min-width: 768px) and (max-width: 1100px) and (hover: none) and (pointer: coarse) {
    .dpaq-modal {
        inset: auto;
        top: var(--dpaq-modal-vv-top, 0px);
        right: auto;
        bottom: auto;
        left: var(--dpaq-modal-vv-left, 0px);
        width: var(--dpaq-modal-vv-width, 100vw);
        height: 100vh;
        height: 100svh;
        height: 100dvh;
        height: var(--dpaq-modal-vv-height, 100dvh);
        max-width: 100vw;
        padding: var(--dpaq-modal-vv-padding-top, max(14px, env(safe-area-inset-top))) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
        overflow: hidden;
    }
}

@media (max-width: 430px) {
    .dpaq-modal-header {
        gap: 10px;
        padding: 11px 12px;
    }

    .dpaq-modal-header h2 {
        font-size: 17px;
    }

    .dpaq-report-head {
        gap: 8px;
    }

    .dpaq-report-logo {
        max-width: 72px;
    }
}

.dpaq-pdf-stage {
    position: fixed;
    z-index: -1;
    top: 0;
    left: -10000px;
    width: 794px;
    padding: 0;
    background: #fff;
    pointer-events: none;
}

.dpaq-pdf-stage .dpaq-report-sheet {
    box-sizing: border-box;
    width: 794px;
    padding: 20px;
    border-radius: 8px;
    font-family: var(--dpaq-font);
    font-weight: 400;
}

.dpaq-pdf-stage .dpaq-report-head {
    gap: 14px;
    padding-bottom: 10px;
}

.dpaq-pdf-stage .dpaq-report-logo {
    max-width: 110px;
    max-height: 64px;
}

.dpaq-pdf-stage .dpaq-report-head h3 {
    font-size: 18px;
}

.dpaq-pdf-stage .dpaq-report-meta {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 6px 16px;
    margin: 11px 0;
    font-size: 12.5px;
}

.dpaq-pdf-stage .dpaq-report-summary,
.dpaq-pdf-stage .dpaq-report-materials {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.dpaq-pdf-stage .dpaq-report-summary tbody,
.dpaq-pdf-stage .dpaq-report-materials tbody {
    display: table-row-group;
}

.dpaq-pdf-stage .dpaq-report-summary thead,
.dpaq-pdf-stage .dpaq-report-materials thead {
    display: table-header-group;
}

.dpaq-pdf-stage .dpaq-report-summary tr,
.dpaq-pdf-stage .dpaq-report-materials tr {
    display: table-row;
}

.dpaq-pdf-stage .dpaq-report-summary th,
.dpaq-pdf-stage .dpaq-report-summary td,
.dpaq-pdf-stage .dpaq-report-materials th,
.dpaq-pdf-stage .dpaq-report-materials td {
    display: table-cell;
    min-height: 0;
    padding: 7px 9px;
    font-size: 12px;
    line-height: 1.38;
}

.dpaq-pdf-stage .dpaq-report-summary th {
    width: 20%;
}

.dpaq-pdf-stage .dpaq-report-summary td {
    width: auto;
}

.dpaq-pdf-stage .dpaq-report-materials th:nth-child(1),
.dpaq-pdf-stage .dpaq-report-materials td:nth-child(1) {
    width: 22%;
}

.dpaq-pdf-stage .dpaq-report-materials th:nth-child(2),
.dpaq-pdf-stage .dpaq-report-materials td:nth-child(2) {
    width: 26%;
}

.dpaq-pdf-stage .dpaq-report-materials th:nth-child(3),
.dpaq-pdf-stage .dpaq-report-materials td:nth-child(3) {
    display: table-cell;
    width: 52%;
}

@media (prefers-reduced-motion: reduce) {
    .dpaq-input-wrap,
    .dpaq-view-result,
    .dpaq-modal-dialog,
    .dpaq-download-pdf {
        transition: none;
    }

	.dpaq-download-pdf {
		transform: none;
	}
}
