.nmw-estimator {
  --nmw-estimator-navy: #0b1f33;
  --nmw-estimator-blue: #0977d1;
  --nmw-estimator-blue-dark: #075ca2;
  --nmw-estimator-orange: #fc7010;
  --nmw-estimator-orange-accessible: #c64d00;
  --nmw-estimator-text: #172536;
  --nmw-estimator-muted: #5c6b7a;
  --nmw-estimator-border: #d7e1eb;
  --nmw-estimator-soft: #f5f8fb;
  width: 100%;
  color: var(--nmw-estimator-text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.nmw-estimator *,
.nmw-estimator *::before,
.nmw-estimator *::after {
  box-sizing: border-box;
}

.nmw-estimator__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.92fr);
  gap: 32px;
  align-items: stretch;
}

.nmw-estimator__form,
.nmw-estimator__result {
  min-width: 0;
  border-radius: 22px;
}

.nmw-estimator__form {
  padding: clamp(26px, 4vw, 36px);
  border: 1px solid var(--nmw-estimator-border);
  background: #fff;
  box-shadow: 0 18px 44px rgba(11, 31, 51, 0.06);
}

.nmw-estimator__header {
  margin-bottom: 24px;
}

.nmw-estimator__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  color: var(--nmw-estimator-blue-dark);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.nmw-estimator__eyebrow::before {
  width: 31px;
  height: 2px;
  background: var(--nmw-estimator-orange);
  content: "";
}

.nmw-estimator__eyebrow--light {
  color: #ffb079;
}

.nmw-estimator__header h2 {
  margin: 0;
  color: var(--nmw-estimator-navy);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.nmw-estimator__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 16px;
}

.nmw-estimator__field {
  min-width: 0;
}

.nmw-estimator__field label {
  display: block;
  margin: 0 0 8px;
  color: var(--nmw-estimator-navy);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.4;
}

.nmw-estimator__field input,
.nmw-estimator__field select {
  display: block;
  width: 100%;
  height: 49px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #bdcbd9;
  border-radius: 8px;
  outline: none;
  background-color: #fff;
  color: var(--nmw-estimator-text);
  box-shadow: inset 0 1px 2px rgba(11, 31, 51, 0.02);
  font: inherit;
  font-size: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.nmw-estimator__field select {
  padding-right: 38px;
  cursor: pointer;
}

.nmw-estimator__field input:focus,
.nmw-estimator__field select:focus {
  border-color: var(--nmw-estimator-blue);
  box-shadow: 0 0 0 3px rgba(9, 119, 209, 0.14);
}

.nmw-estimator__hint {
  margin: 26px 0 16px;
  color: var(--nmw-estimator-muted);
  font-size: 14px;
  line-height: 1.65;
}

.nmw-estimator__message {
  margin: 0 0 16px;
  padding: 11px 13px;
  border-left: 3px solid #b7791f;
  border-radius: 5px;
  background: #fff8e6;
  color: #714b0b;
  font-size: 14px;
}

.nmw-estimator__message[data-type="error"] {
  border-color: #b42318;
  background: #fff0ef;
  color: #8f1d14;
}

.nmw-estimator__submit,
.nmw-estimator__print,
.nmw-estimator__contact {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0;
  padding: 12px 19px;
  border-radius: 8px;
  box-shadow: none;
  font: inherit;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nmw-estimator__submit {
  border: 1px solid var(--nmw-estimator-blue);
  background: var(--nmw-estimator-blue);
  color: #fff;
}

.nmw-estimator__submit svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.nmw-estimator__submit:hover,
.nmw-estimator__submit:focus-visible {
  border-color: var(--nmw-estimator-blue-dark);
  background: var(--nmw-estimator-blue-dark);
  color: #fff;
  transform: translateY(-1px);
}

.nmw-estimator__result {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: clamp(28px, 5vw, 48px);
  background: var(--nmw-estimator-navy);
  color: #fff;
}

.nmw-estimator__metric {
  margin-top: 5px;
}

.nmw-estimator__metric > span {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 17px;
  font-weight: 600;
}

.nmw-estimator__metric output {
  display: block;
  color: #ff9a61;
  font-size: clamp(38px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.nmw-estimator__metric--cost {
  margin-top: 34px;
}

.nmw-estimator__metric--cost strong {
  display: block;
  color: #fff;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.nmw-estimator__metric--cost small {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.nmw-estimator__breakdown {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.nmw-estimator__breakdown li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
}

.nmw-estimator__breakdown strong {
  flex: 0 0 auto;
  color: #fff;
  font-weight: 780;
  text-align: right;
}

.nmw-estimator__notice {
  margin: 25px 0 18px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 1.65;
}

.nmw-estimator__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.nmw-estimator__print {
  border: 1px solid #fff;
  background: #fff;
  color: var(--nmw-estimator-navy);
}

.nmw-estimator__contact {
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: transparent;
  color: #fff;
}

.nmw-estimator__print:hover,
.nmw-estimator__print:focus-visible {
  border-color: #e8eef4;
  background: #e8eef4;
  color: var(--nmw-estimator-navy);
  transform: translateY(-1px);
}

.nmw-estimator__contact:hover,
.nmw-estimator__contact:focus-visible {
  border-color: #fff;
  background: #fff;
  color: var(--nmw-estimator-navy);
  transform: translateY(-1px);
}

.nmw-estimator__phone {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 16px;
  color: #ffb079;
  font-size: 14px;
  font-weight: 720;
  text-decoration: none;
}

.nmw-estimator__phone:hover,
.nmw-estimator__phone:focus-visible {
  color: #fff;
}

.nmw-estimator button:focus-visible,
.nmw-estimator a:focus-visible {
  outline: 3px solid rgba(252, 112, 16, 0.42);
  outline-offset: 3px;
}

.nmw-estimator__print-sheet {
  display: none !important;
}

/* Bản 1.4.0 đã bỏ chức năng in. Quy tắc này ẩn cả nút còn sót trong HTML cache cũ. */
.nmw-estimator .nmw-estimator__print,
.nmw-estimator [data-nmw-print] {
  display: none !important;
}

@media (max-width: 849px) {
  .nmw-estimator__layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .nmw-estimator__result {
    min-height: auto;
  }
}

@media (max-width: 549px) {
  .nmw-estimator__form,
  .nmw-estimator__result {
    padding: 23px 19px;
    border-radius: 16px;
  }

  .nmw-estimator__fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .nmw-estimator__header h2 {
    font-size: 34px;
  }

  .nmw-estimator__submit,
  .nmw-estimator__print,
  .nmw-estimator__contact {
    width: 100%;
  }

  .nmw-estimator__breakdown li {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .nmw-estimator__breakdown strong {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nmw-estimator *,
  .nmw-estimator *::before,
  .nmw-estimator *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm;
  }

  html,
  body.nmw-estimator-printing {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #fff !important;
  }

  body.nmw-estimator-printing > *:not([data-nmw-print-portal="true"]) {
    display: none !important;
  }

  body.nmw-estimator-printing > [data-nmw-print-portal="true"] {
    display: block !important;
    width: 100%;
    max-height: 265mm;
    overflow: hidden;
    color: #172536;
    background: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10pt;
    line-height: 1.35;
    break-inside: avoid;
    break-after: avoid-page;
    page-break-inside: avoid;
    page-break-after: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .nmw-estimator__print-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12mm;
    padding-bottom: 5mm;
    border-bottom: 2px solid #0977d1;
  }

  .nmw-estimator__print-header img {
    display: block;
    width: auto;
    max-width: 58mm;
    height: 18mm;
    object-fit: contain;
    object-position: left center;
  }

  .nmw-estimator__print-header div {
    text-align: right;
  }

  .nmw-estimator__print-header span,
  .nmw-estimator__print-header strong {
    display: block;
  }

  .nmw-estimator__print-header span {
    margin-bottom: 1mm;
    color: #5c6b7a;
    font-size: 9pt;
    text-transform: uppercase;
  }

  .nmw-estimator__print-header strong {
    color: #c64d00;
    font-size: 14pt;
  }

  .nmw-estimator__print-title {
    padding: 6mm 0 4mm;
    text-align: center;
  }

  .nmw-estimator__print-title h1 {
    margin: 0;
    color: #0b1f33;
    font-size: 18pt;
    line-height: 1.2;
    letter-spacing: 0;
  }

  .nmw-estimator__print-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    table-layout: fixed;
    color: #172536;
    font-size: 9.5pt;
  }

  .nmw-estimator__print-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .nmw-estimator__print-table th,
  .nmw-estimator__print-table td {
    padding: 2.5mm;
    border: 1px solid #cbd6e1;
    vertical-align: middle;
    word-break: break-word;
  }

  .nmw-estimator__print-table th {
    width: 21%;
    background: #eef4f9;
    color: #0b1f33;
    font-weight: 700;
    text-align: left;
  }

  .nmw-estimator__print-table td {
    width: 29%;
  }

  .nmw-estimator__print-table .nmw-estimator__print-section th {
    width: auto;
    padding: 2.5mm 3mm;
    border-color: #0b1f33;
    background: #0b1f33;
    color: #fff;
    font-size: 9pt;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .nmw-estimator__print-table .nmw-estimator__print-total th,
  .nmw-estimator__print-table .nmw-estimator__print-total td {
    border-color: #fc7010;
    background: #fff4ec;
  }

  .nmw-estimator__print-table .nmw-estimator__print-total td {
    color: #c64d00;
    font-size: 13pt;
    font-weight: 800;
  }

  .nmw-estimator__print-footer {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    margin-top: 5mm;
    padding-top: 4mm;
    border-top: 1px solid #cbd6e1;
  }

  .nmw-estimator__print-footer strong {
    flex: 0 0 auto;
    color: #0977d1;
    font-size: 10pt;
    white-space: nowrap;
  }
}
