/* ==========================================================================
   Tính chi phí — trang Bảng giá (template-parts/common/tinh-chi-phi.php)
   Dùng biến màu/chữ của style.css. Mobile trước, ≥1024px: 2 cột, ô kết quả ghim.
   ========================================================================== */
/* .calc__grid = cột chọn + ô kết quả (ô kết quả chỉ ghim trong khung này, không đè bảng chi tiết bên dưới) */
.calc__grid { display: grid; gap: 24px; align-items: start; }
.calc [hidden] { display: none !important; }

/* Trang Bảng giá: form cuối trang nằm trên nền kem (nút .price-calc-link ở style.css vì trang chủ cũng dùng) */
#tu-van.section--alt .form { background: #fff; }

/* Đầu trang gọn để vừa bấm menu "Tính chi phí" đã thấy Dự toán thiết kế; mục lục 01 · 02 · 03 */
.page-hero--calc { padding-block: clamp(1.75rem, 1.25rem + 2vw, 3rem); }
.page-hero--calc h1 { margin-bottom: 0.3em; font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.6rem); }
.section--calc-first .mag-head--center { margin-bottom: 2.25rem; }
.page-hero--calc p { margin-bottom: 0; font-size: 0.98rem; }
.calc-jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; margin-top: 1.25rem; }
.calc-jump a { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 18px 6px 8px; border: 1px solid var(--c-primary); border-radius: var(--radius-pill); background: #fff; color: var(--c-primary); font-size: 0.88rem; letter-spacing: 0.04em; text-decoration: none; transition: background 0.2s, color 0.2s; }
.calc-jump a span { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--c-primary); color: #fff; font-size: 0.75rem; }
.calc-jump a:hover { background: var(--c-primary); color: #fff; }
.calc-jump a:hover span { background: #fff; color: var(--c-primary); }
.section--calc-first { padding-top: clamp(3rem, 2rem + 3vw, 5rem); }
/* Khối tính trên nền trắng: cột chọn nền kem để tách khỏi nền trang */
.section:not(.section--alt) .calc__steps { background: var(--c-bg-alt); }
.section:not(.section--alt) .calc-step { border-bottom-color: #e2d9ce; }

/* ----- Dự toán thiết kế ----- */
.calc-opts--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.calc--tk .calc-opt__media { aspect-ratio: 16 / 10; } /* ảnh biệt thự / nhà phố ngang → khung rộng, không cắt mất nhà */
@media (max-width: 599px) { .calc-opts.tk-pkgs { grid-template-columns: 1fr; } .tk-rates__table th, .tk-rates__table td { padding: 8px; } }
.tk-floors { margin-top: 18px; }
.tk-area { margin: 14px 0 0; }
.tk-rates { margin-top: 20px; }
.tk-rates__title { margin: 0 0 8px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-text-muted); }
.tk-rates__table { width: 100%; border-collapse: collapse; background: #fff; font-size: 0.92rem; }
.tk-rates__table th, .tk-rates__table td { padding: 10px 12px; border: 1px solid var(--c-border); text-align: left; }
.tk-rates__table thead th { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-text-muted); }
.tk-rates__table tbody th { font-weight: 400; }
.tk-rates__table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tk-rates__table thead th.num { white-space: normal; line-height: 1.4; } /* tiêu đề cột dài được xuống dòng (điện thoại) */
.tk-rates__table tr.is-on th, .tk-rates__table tr.is-on td { background: #f7f3ee; }
.tk-rates__table td.is-on { background: var(--c-primary) !important; color: #fff; font-weight: 600; }
.tk-min { margin: 12px 0 0; font-size: 0.82rem; font-style: italic; color: rgba(255, 255, 255, 0.75); }
.tk-promo__title { margin: 22px 0 0; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 255, 255, 0.58); }
.calc--tk .calc-res__rows { margin-top: 8px; margin-bottom: 22px; }
.calc--tk .calc-res__btns .btn { text-decoration: none; }

/* Hồ sơ mỗi gói (mở/đóng) */
.tk-items { margin-top: 28px; background: #fff; border: 1px solid var(--c-border); scroll-margin-top: calc(var(--header-h) + 16px); }
.tk-items summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; font-weight: 600; letter-spacing: 0.03em; cursor: pointer; list-style: none; }
.tk-items summary::-webkit-details-marker { display: none; }
.tk-items summary span { margin-right: auto; font-weight: 400; color: var(--c-text-muted); }
.tk-items summary::after { content: "+"; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--c-primary); border-radius: 50%; font-size: 1.2rem; font-weight: 400; line-height: 1; }
.tk-items[open] summary::after { content: "−"; }
.tk-items__wrap { padding: 0 22px 22px; }
.tk-table { font-size: 0.92rem; }
.tk-table__mark { width: 26%; text-align: center !important; }
.tk-table thead .tk-table__mark { font-size: 0.68rem; line-height: 1.35; }
.tk-table__group th { padding-top: 22px; border-bottom: 1px solid var(--c-primary); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }
.tk-table__sub td { padding-top: 14px; font-style: italic; color: var(--c-text-muted); }
.tk-yes { display: inline-block; width: 20px; height: 20px; border-radius: 50%; background: var(--c-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center / 12px no-repeat; vertical-align: middle; }
.tk-no { color: #b9ad9f; }
/* Cột của gói đang chọn tô nền nhẹ */
.tk-table[data-pkg="0"] tr > :nth-child(2), .tk-table[data-pkg="1"] tr > :nth-child(3) { background: #f7f3ee; }
.tk-table .tk-table__group th, .tk-table .tk-table__sub td { background: none !important; }

/* ----- Các bước chọn ----- */
.calc__steps { counter-reset: calc-step; min-width: 0; padding: 4px 18px; background: #fff; }
.calc-step { min-width: 0; margin: 0; padding: 28px 0; border: 0; border-bottom: 1px solid var(--c-border); }
.calc-step:last-child { border-bottom: 0; }
.calc-step:not([hidden]) { counter-increment: calc-step; }
.calc-step__head + * { clear: both; }
/* legend thả nổi → nằm trong vùng nội dung của fieldset (không dính lên mép trên) */
.calc-step__head { float: left; display: flex; align-items: center; gap: 14px; width: 100%; margin: 0 0 18px; padding: 0; font-family: var(--f-heading); font-size: 1rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.calc-step__num::before { content: counter(calc-step, decimal-leading-zero); font-size: 2.5rem; font-weight: 500; line-height: 1; letter-spacing: -0.02em; color: var(--c-num); }
.calc-step__hint { margin: -6px 0 16px; font-size: 0.9rem; font-style: italic; line-height: 1.6; color: var(--c-text-muted); }

/* Ô chọn (radio/checkbox ẩn, khung hiện viền đen khi chọn) */
.calc-opts { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.calc-opt { position: relative; display: block; min-width: 0; cursor: pointer; }
.calc-opt__input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.calc-opt__body { position: relative; display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px 16px 18px; border: 1px solid var(--c-border); background: #fff; transition: border-color 0.2s, box-shadow 0.2s; }
.calc-opt:hover .calc-opt__body { border-color: #b3a796; }
.calc-opt__input:checked + .calc-opt__body { border-color: var(--c-primary); box-shadow: inset 0 0 0 1px var(--c-primary); }
/* Vòng chọn: ô chưa chọn có vòng rỗng (biết là bấm được), đã chọn → tròn đen + dấu ✓. Ô bật/tắt (gói thô) dùng ô vuông. */
.calc-opt__body::after { content: ""; position: absolute; z-index: 2; top: 10px; right: 10px; width: 24px; height: 24px; border: 1px solid #c4b8aa; border-radius: 50%; background: #fff center / 13px no-repeat; transition: background-color 0.2s, border-color 0.2s; }
.calc-opt--img .calc-opt__body::after { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); border-color: #fff; }
.calc-pkg .calc-opt__body::after { top: 20px; right: 20px; }
.calc-pkg input[type="checkbox"] + .calc-opt__body::after { border-radius: 5px; }
.calc-opt:hover .calc-opt__input:not(:checked) + .calc-opt__body::after { border-color: var(--c-primary); }
.calc-opt__input:checked + .calc-opt__body::after { border-color: var(--c-primary); background-color: var(--c-primary); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E"); }
.calc-opt__input:focus-visible + .calc-opt__body { outline: 2px solid var(--c-accent); outline-offset: 3px; }
.calc-opt__name { padding-right: 26px; font-weight: 600; line-height: 1.4; }
.calc-opt__note { font-size: 0.85rem; line-height: 1.55; color: var(--c-text-muted); }
.calc-opt__icon { width: 46px; height: 46px; margin-bottom: 6px; color: #a8998a; transition: color 0.2s; }
.calc-opt__input:checked + .calc-opt__body .calc-opt__icon { color: var(--c-primary); }

/* Ô có ảnh (kiểu nhà) */
.calc-opt--img .calc-opt__body { padding: 0; }
.calc-opt__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--c-bg-alt); }
.calc-opt__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.calc-opt:hover .calc-opt__media img { transform: scale(1.05); }
.calc-opt--img .calc-opt__name { padding: 12px 10px 14px; font-size: 0.85rem; letter-spacing: 0.08em; text-align: center; text-transform: uppercase; }

/* Kích thước */
.calc-dims { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: end; }
.calc-field { display: block; margin: 0; }
.calc-field > span { display: block; margin-bottom: 6px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-text-muted); }
.calc-field input, .calc-field select { width: 100%; min-height: 54px; padding: 10px 14px; border: 1px solid var(--c-border); border-radius: 0; background: #fff; color: var(--c-text); }
.calc-field input { font-size: 1.3rem; font-weight: 600; }
.calc-field select { font-size: 1rem; }
.calc-field input:focus, .calc-field select:focus { border-color: var(--c-primary); outline: none; }
.calc-dims__x { padding-bottom: 12px; font-size: 1.4rem; color: var(--c-text-muted); }
.calc-dims__area { grid-column: 1 / -1; margin: 4px 0 0; color: var(--c-text-muted); }
.calc-dims__area strong { font-size: 1.15rem; color: var(--c-text); }
.calc-err { grid-column: 1 / -1; margin: 0; font-size: 0.9rem; color: #8b1c1c; }
.calc-sizes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.calc-sizes__label { margin-right: 4px; font-size: 0.85rem; font-style: italic; color: var(--c-text-muted); }
.calc-size { min-height: 38px; padding: 6px 14px; border: 1px solid var(--c-border); border-radius: var(--radius-pill); background: #fff; color: var(--c-text); font-size: 0.9rem; cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.calc-size:hover { border-color: var(--c-primary); }
.calc-size[aria-pressed="true"] { border-color: var(--c-primary); background: var(--c-primary); color: #fff; }

/* Hình mặt cắt ngôi nhà (vẽ bằng JS) */
.calc-floors-wrap { display: grid; gap: 24px; }
.calc-house { margin: 0; padding: 18px 16px 12px; background: var(--c-bg-alt); }
.calc-house__svg svg { width: 100%; height: auto; max-height: 460px; margin: 0 auto; overflow: visible; }
.calc-house__n { font-family: var(--f-body); font-size: 12.5px; fill: var(--c-text-muted); }
.calc-house__v { font-family: var(--f-body); font-size: 12.5px; font-weight: 600; fill: var(--c-text); }
.calc-house figcaption { margin-top: 8px; font-size: 0.78rem; font-style: italic; text-align: center; color: var(--c-text-muted); }

/* Số tầng */
.calc-floors { display: grid; gap: 20px; }
.calc-stepper { display: flex; flex-wrap: wrap; align-items: stretch; }
.calc-stepper__label { flex-basis: 100%; margin-bottom: 6px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-text-muted); }
.calc-stepper button { width: 54px; height: 54px; padding: 0; border: 1px solid var(--c-primary); background: #fff; color: var(--c-primary); font-size: 1.5rem; line-height: 1; cursor: pointer; transition: background 0.2s, color 0.2s; }
.calc-stepper button:hover { background: var(--c-primary); color: #fff; }
.calc-stepper input { width: 76px; height: 54px; padding: 0; border: 1px solid var(--c-primary); border-inline: 0; border-radius: 0; background: #fff; text-align: center; font-size: 1.35rem; font-weight: 600; -moz-appearance: textfield; appearance: textfield; }
.calc-stepper input::-webkit-outer-spin-button, .calc-stepper input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.calc-stepper input:focus { outline: none; background: var(--c-bg-alt); }
.calc-checks { display: flex; flex-wrap: wrap; gap: 10px; }
.calc-check { position: relative; cursor: pointer; }
.calc-check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.calc-check span { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 20px 8px 14px; border: 1px solid var(--c-border); border-radius: var(--radius-pill); background: #fff; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.calc-check span::before { content: ""; flex: none; width: 18px; height: 18px; border: 1px solid #b3a796; border-radius: 50%; background: #fff center / 11px no-repeat; }
.calc-check:hover span { border-color: #b3a796; }
.calc-check input:checked + span { border-color: var(--c-primary); background: var(--c-primary); color: #fff; }
.calc-check input:checked + span::before { border-color: #fff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a0a0a' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E"); }
.calc-check input:focus-visible + span { outline: 2px solid var(--c-accent); outline-offset: 3px; }
.calc-field--select { max-width: 360px; }
.calc-floors__sum { margin: 0; color: var(--c-text-muted); }
.calc-floors__sum strong { color: var(--c-text); }

/* Gói thi công */
.calc-pkgs { display: grid; gap: 14px; }
.calc-pkg .calc-opt__body { gap: 6px; padding: 22px 22px 24px; }
.calc-pkg__title { padding: 0 30px 0 0; font-weight: 600; font-size: 1.05rem; letter-spacing: 0.03em; text-transform: uppercase; }
.calc-pkg__price { color: var(--c-text-muted); font-size: 0.95rem; }
.calc-pkg__price strong { font-size: 1.35rem; color: var(--c-text); }
.calc-pkg--finish { min-width: 0; margin: 0; padding: 22px; border: 1px solid var(--c-border); background: #fff; }
.calc-pkg--finish .calc-pkg__title { float: left; width: 100%; margin-bottom: 6px; }
.calc-pkg--finish .calc-pkg__title + * { clear: both; margin: 0; }
.calc-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 16px 0 0; border: 1px solid var(--c-primary); }
.calc-seg label { position: relative; min-width: 0; cursor: pointer; }
.calc-seg label + label { border-left: 1px solid var(--c-primary); }
.calc-seg input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.calc-seg span { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 60px; padding: 8px 6px; font-weight: 600; line-height: 1.3; text-align: center; transition: background 0.2s, color 0.2s; }
.calc-seg small { margin-top: 2px; font-size: 0.75rem; font-weight: 400; opacity: 0.75; }
.calc-seg label:hover span { background: var(--c-bg-alt); }
.calc-seg input:checked + span { background: var(--c-primary); color: #fff; }
.calc-seg input:focus-visible + span { outline: 2px solid var(--c-accent); outline-offset: -4px; }
.calc-pkg__items { margin: 14px 0 0; padding: 0; list-style: none; font-size: 0.92rem; color: var(--c-text-muted); }
.calc-pkg__items li { position: relative; padding: 4px 0 4px 22px; }
.calc-pkg__items li::before { content: ""; position: absolute; left: 0; top: 1.05em; width: 12px; height: 1px; background: currentColor; }

/* ----- Ô kết quả (nền đen) ----- */
.calc__result { position: relative; min-width: 0; padding: 32px 24px 28px; background: var(--c-primary); color: #fff; box-shadow: var(--shadow-deep); }
.calc-res__eyebrow { margin: 0 0 6px; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6); }
.calc-res__total { margin: 0; font-family: var(--f-heading); font-size: clamp(2rem, 1.6rem + 1.6vw, 2.5rem); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.calc-res__words { margin: 10px 0 0; font-size: 0.88rem; font-style: italic; line-height: 1.55; color: rgba(255, 255, 255, 0.7); }
.calc-res__words:empty, .calc-res__avg:empty { display: none; }
.calc-res__avg { display: inline-block; margin: 14px 0 0; padding: 5px 14px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: var(--radius-pill); font-size: 0.85rem; color: rgba(255, 255, 255, 0.8); }
.calc-res__avg strong { color: #fff; }
.calc-res__rows { margin: 22px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.18); }
.calc-res__rows > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
.calc-res__rows dt { font-size: 0.95rem; line-height: 1.45; }
.calc-res__rows dt small { display: block; margin-top: 2px; font-size: 0.78rem; color: rgba(255, 255, 255, 0.58); }
.calc-res__rows dd { margin: 0; font-weight: 600; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.calc-res__rows .calc-res__empty { display: block; }
.calc-res__rows .calc-res__empty dt { font-size: 0.85rem; font-style: italic; color: rgba(255, 255, 255, 0.7); }
.calc-res__areas { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0 24px; }
.calc-res__areas dt { font-size: 0.7rem; line-height: 1.45; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.58); }
.calc-res__areas dd { margin: 4px 0 0; font-size: 1.3rem; font-weight: 600; }
.calc-res__btns { display: grid; gap: 10px; }
.calc-res__btns .btn { width: 100%; padding-inline: 18px; }
.calc-res__call { margin: 18px 0 0; font-size: 0.92rem; color: rgba(255, 255, 255, 0.7); text-align: center; }
.calc-res__call a { color: #fff; font-weight: 600; }
.calc-res__call a:hover { color: #fff; opacity: 0.8; }
.calc-res__note { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.18); font-size: 0.8rem; font-style: italic; line-height: 1.6; color: rgba(255, 255, 255, 0.58); }

/* ----- Bảng dự toán chi tiết ----- */
.calc-sheet { min-width: 0; scroll-margin-top: calc(var(--header-h) + 16px); }
.calc-sheet__paper { max-width: 980px; margin: 40px auto 0; padding: clamp(22px, 4vw, 56px); background: #fff; box-shadow: var(--shadow); }
.calc-sheet__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; padding-bottom: 20px; border-bottom: 2px solid var(--c-primary); }
.calc-sheet__logo { width: 150px; height: auto; }
.calc-sheet__title { margin: 0; font-size: 1.2rem; letter-spacing: 0.04em; text-transform: uppercase; }
.calc-sheet__date { margin: 2px 0 0; font-size: 0.9rem; color: var(--c-text-muted); }
.calc-sheet__info { display: grid; gap: 0 36px; margin: 22px 0 8px; }
.calc-sheet__info > div { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--c-border); }
.calc-sheet__info > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.calc-sheet__info dt { font-size: 0.9rem; color: var(--c-text-muted); }
.calc-sheet__info dd { margin: 0; font-weight: 600; line-height: 1.5; }
.calc-sheet__paper h4 { margin: 34px 0 10px; font-size: 1rem; letter-spacing: 0.06em; text-transform: uppercase; }
.calc-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
/* Bảng diện tích + hình mặt cắt cạnh nhau (màn hình rộng và bản in), điện thoại: hình nằm dưới bảng */
.calc-sheet__area { display: grid; gap: 20px; align-items: start; }
.calc-sheet__house { max-width: 320px; width: 100%; margin: 0 auto; padding: 16px 12px 10px; background: var(--c-bg-alt); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.calc-sheet__house svg { display: block; width: 100%; height: auto; max-height: 420px; overflow: visible; }
.calc-house__n--lg, .calc-house__v--lg { font-size: 16px !important; }
.calc-sheet__house figcaption { margin-top: 4px; font-size: 0.72rem; font-style: italic; text-align: center; color: var(--c-text-muted); }
@media (min-width: 700px) { .calc-sheet__area { grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; } .calc-sheet__house { margin: 0; } }
.calc-table th, .calc-table td { padding: 11px 10px; border-bottom: 1px solid var(--c-border); text-align: left; vertical-align: top; }
.calc-table th:first-child, .calc-table td:first-child { padding-left: 0; }
.calc-table th:last-child, .calc-table td:last-child { padding-right: 0; }
.calc-table thead th { border-bottom-color: var(--c-primary); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-text-muted); }
.calc-table small { display: block; margin-top: 2px; font-size: 0.8rem; color: var(--c-text-muted); }
.calc-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.calc-table tfoot th, .calc-table tfoot td { border-top: 2px solid var(--c-primary); border-bottom: 0; font-weight: 600; }
.calc-table__stt { color: var(--c-text-muted); }
.calc-table__sum th, .calc-table__sum td { padding-block: 16px; font-size: 1.15rem; }
.calc-table tfoot tr + tr td { padding-top: 0; border-top: 0; font-weight: 400; }
.calc-table__words { font-style: italic; color: var(--c-text-muted); }
.calc-sheet__notes ul { margin: 0; padding-left: 1.1em; font-size: 0.9rem; line-height: 1.7; color: var(--c-text-muted); }
.calc-sheet__notes li + li { margin-top: 4px; }
.calc-sheet__foot { margin: 30px 0 0; padding-top: 14px; border-top: 1px solid var(--c-border); font-size: 0.82rem; text-align: center; color: var(--c-text-muted); }
.calc-sheet__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 24px 0 0; }

/* Gửi dự toán */
.calc-lead { max-width: 980px; margin: 32px auto 0; padding: clamp(22px, 4vw, 40px); background: #fff; scroll-margin-top: calc(var(--header-h) + 16px); }
.calc-lead__title { margin: 0; font-size: 1.2rem; letter-spacing: 0.04em; text-transform: uppercase; }
.calc-lead__lead { margin: 0; color: var(--c-text-muted); }
.calc-lead__status:empty { display: none; }
.calc-lead__status.notice { margin: 0; }
.calc-lead .btn[disabled] { opacity: 0.6; cursor: wait; transform: none; }

/* Thanh "Tạm tính" dưới đáy (điện thoại) — nằm trên thanh Gọi/Zalo */
.calc-bar { position: fixed; z-index: 190; left: 0; right: 0; bottom: 60px; display: flex; align-items: center; gap: 12px; padding: 10px var(--gutter); background: #fff; border-top: 1px solid var(--c-border); box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.1); }
.calc-bar__label { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-text-muted); }
.calc-bar__total { flex: 1; font-size: 1.15rem; }
.calc-bar__btn { padding: 8px 18px; border-radius: var(--radius-pill); background: var(--c-primary); color: #fff; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; }
.calc-bar__btn:hover { color: #fff; }

/* ----- Màn hình lớn hơn ----- */
/* Số tầng: điện thoại — hình mặt cắt trên, nút chọn dưới; ≥768px — nút chọn trái, hình phải */
@media (min-width: 768px) {
	.calc-floors-wrap { grid-template-columns: minmax(214px, 1fr) minmax(0, 1.25fr); align-items: start; }
	.calc-house { order: 2; }
}
@media (min-width: 600px) {
	.calc-opts--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.calc-opts--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.calc-sheet__info { grid-template-columns: 1fr 1fr; }
	.calc-lead__row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
	.calc__steps { padding: 8px 36px; }
	.calc-opts--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.calc-opts--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
	.calc-dims { max-width: 560px; }
	.calc-pkgs { grid-template-columns: 1fr 1fr; align-items: stretch; }
	.calc-step__num::before { font-size: 3rem; }
}
/* ≥1024: cột chọn hẹp lại vì có ô kết quả bên phải → phào chỉ 3 cột, gói thi công xếp dọc */
@media (min-width: 1024px) {
	.calc__grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; }
	.calc__result { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.3) transparent; }
	.calc-opts--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.calc-pkgs { grid-template-columns: 1fr; }
	.calc-bar { display: none !important; }
}
@media (min-width: 1200px) {
	.calc__grid { grid-template-columns: minmax(0, 1fr) 390px; gap: 40px; }
	.calc__steps { padding: 8px 44px; }
}

/* ----- In / lưu PDF: chỉ in tờ dự toán ----- */
#nvx-in { display: none; }
@media print {
	html.dang-in body > *:not(#nvx-in) { display: none !important; }
	html.dang-in #nvx-in { display: block; }
	#nvx-in .calc-sheet__paper { max-width: none; margin: 0; padding: 0; box-shadow: none; }
	#nvx-in .calc-sheet__info { grid-template-columns: 1fr 1fr; }
	#nvx-in .calc-sheet__area { grid-template-columns: minmax(0, 1fr) 62mm; gap: 7mm; }
	#nvx-in .calc-sheet__house { margin: 0; break-inside: avoid; }
	#nvx-in .calc-table tr { break-inside: avoid; }
	#nvx-in * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	@page { margin: 14mm; }
}
