.cc-calculator {
  --cc-primary: #00796b;
  --cc-primary-dark: #004d40;
  --cc-soft: #e8f5f2;
  --cc-border: #d8e7e4;
  --cc-text: #173b40;
  --cc-muted: #647876;
  color: var(--cc-text);
}

.cc-calculator,
.cc-calculator * {
  box-sizing: border-box;
}

.cc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(340px, 0.62fr);
  align-items: start;
  gap: 24px;
}

.cc-form,
.cc-summary,
.cc-summary-placeholder {
  border: 1px solid var(--cc-border);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(15, 77, 68, 0.08);
}

.cc-form {
  min-width: 0;
  padding: 28px;
}

.cc-step + .cc-step {
  margin-top: 30px;
  padding-top: 28px;
  border-top: 1px solid #edf3f2;
}

.cc-step-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 20px;
}

.cc-step-number {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--cc-primary);
  background: var(--cc-soft);
  font-size: 13px;
  font-weight: 700;
}

.cc-step-heading h3 {
  margin: 0 0 4px;
  color: var(--cc-primary-dark);
  font-size: 18px;
  font-weight: 700;
}

.cc-step-heading p {
  margin: 0;
  color: var(--cc-muted);
  font-size: 13px;
  line-height: 1.55;
}

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

.cc-field-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cc-field-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cc-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  margin: 0;
}

.cc-field > span:first-child {
  color: #385854;
  font-size: 13px;
  font-weight: 600;
}

.cc-field small {
  color: #849593;
  font-size: 11px;
}

.cc-field select,
.cc-input-wrap {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--cc-border);
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cc-field select {
  padding: 0 34px 0 12px;
  color: var(--cc-text);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.cc-field select.cc-native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.cc-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.cc-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 11px 0 13px;
  border: 1px solid var(--cc-border);
  border-radius: 10px;
  color: var(--cc-text);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cc-select-trigger:hover {
  border-color: #9fc7c1;
  background: #fcfefe;
}

.cc-select-trigger:focus-visible,
.cc-select.is-open .cc-select-trigger {
  border-color: var(--cc-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 121, 107, 0.13);
}

.cc-select-value {
  min-width: 0;
  overflow: hidden;
  color: #294e49;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-select-trigger > svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: #78908c;
  transition: transform 0.2s ease, color 0.2s ease;
}

.cc-select.is-open .cc-select-trigger > svg {
  color: var(--cc-primary);
  transform: rotate(180deg);
}

.cc-select-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 7px);
  left: 0;
  width: 100%;
  min-width: 230px;
  max-height: 250px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--cc-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(20, 66, 60, 0.16);
  animation: ccSelectOpen 0.16s ease both;
}

.cc-select-menu[hidden] {
  display: none !important;
}

@keyframes ccSelectOpen {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cc-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: #315650;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: color 0.15s ease, background 0.15s ease;
}

.cc-select-option + .cc-select-option {
  margin-top: 2px;
}

.cc-select-option > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.cc-select-option strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-select-option small {
  color: #849794;
  font-size: 11px;
  line-height: 1.35;
}

.cc-select-option > svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: var(--cc-primary);
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.cc-select-option:hover,
.cc-select-option:focus-visible {
  color: var(--cc-primary-dark);
  background: #f0f8f6;
  outline: none;
}

.cc-select-option.is-selected {
  color: var(--cc-primary-dark);
  background: var(--cc-soft);
}

.cc-select-option.is-selected strong,
.cc-select-option.is-selected small {
  color: var(--cc-primary-dark);
}

.cc-select-option.is-selected > svg {
  opacity: 1;
  transform: scale(1);
}

.cc-select-menu::-webkit-scrollbar {
  width: 5px;
}

.cc-select-menu::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: #b9ceca;
}

.cc-input-wrap {
  display: flex;
  align-items: center;
  overflow: hidden;
}

.cc-input-wrap:focus-within,
.cc-field select:focus {
  border-color: var(--cc-primary);
  box-shadow: 0 0 0 3px rgba(0, 121, 107, 0.13);
}

.cc-input-wrap input {
  min-width: 0;
  flex: 1;
  height: 42px;
  padding: 0 8px 0 12px;
  border: 0;
  outline: 0;
  color: var(--cc-text);
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

.cc-input-wrap em {
  flex: 0 0 auto;
  padding-right: 11px;
  color: #788b88;
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.cc-switch-row {
  display: flex;
  align-items: end;
  gap: 20px;
  margin-top: 16px;
}

.cc-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0;
  color: #385854;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.cc-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cc-switch-track {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 24px;
  border-radius: 30px;
  background: #c9d5d3;
  transition: background 0.2s ease;
}

.cc-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease;
}

.cc-switch input:checked + .cc-switch-track {
  background: var(--cc-primary);
}

.cc-switch input:checked + .cc-switch-track::after {
  transform: translateX(18px);
}

.cc-switch input:focus-visible + .cc-switch-track {
  box-shadow: 0 0 0 3px rgba(0, 121, 107, 0.18);
}

.cc-field--compact {
  width: min(240px, 100%);
}

.cc-package-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 17px;
}

.cc-package-card {
  min-width: 0;
  margin: 0;
  cursor: pointer;
}

.cc-package-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cc-package-card > span {
  display: flex;
  min-height: 68px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--cc-border);
  border-radius: 11px;
  background: #fff;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.cc-package-card strong {
  color: #365853;
  font-size: 13px;
  font-weight: 700;
}

.cc-package-card small {
  color: var(--cc-muted);
  font-size: 11px;
}

.cc-package-card input:checked + span {
  border-color: var(--cc-primary);
  color: var(--cc-primary-dark);
  background: var(--cc-soft);
  transform: translateY(-1px);
}

.cc-package-card input:checked + span strong,
.cc-package-card input:checked + span small {
  color: var(--cc-primary-dark);
}

.cc-package-card input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(0, 121, 107, 0.15);
}

.cc-advanced {
  margin-top: 28px;
  border: 1px solid var(--cc-border);
  border-radius: 13px;
  background: #fbfdfd;
}

.cc-advanced summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

.cc-advanced summary::-webkit-details-marker {
  display: none;
}

.cc-advanced summary > span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--cc-primary-dark);
  font-size: 14px;
  font-weight: 700;
}

.cc-advanced summary svg {
  width: 20px;
  height: 20px;
  color: var(--cc-primary);
}

.cc-advanced summary small {
  color: var(--cc-muted);
  font-size: 11px;
  font-weight: 400;
}

.cc-advanced-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  padding: 0 16px 18px;
}

.cc-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.cc-btn svg {
  width: 18px;
  height: 18px;
}

.cc-btn--ghost {
  border-color: var(--cc-border);
  color: #506c68;
  background: #fff;
}

.cc-btn--primary {
  color: #fff;
  background: var(--cc-primary-dark);
}

.cc-summary,
.cc-summary-placeholder {
  position: sticky;
  top: 90px;
  min-width: 0;
  padding: 26px;
  overflow: hidden;
}

.cc-summary[hidden],
.cc-summary-placeholder[hidden] {
  display: none !important;
}

.cc-summary-placeholder {
  display: flex;
  min-height: 430px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 28px;
  text-align: center;
}

.cc-summary-placeholder::before {
  content: "";
  position: absolute;
  top: -90px;
  right: -90px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: rgba(0, 121, 107, 0.07);
  pointer-events: none;
}

.cc-placeholder-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  margin-bottom: 20px;
  border-radius: 20px;
  color: var(--cc-primary);
  background: var(--cc-soft);
  box-shadow: 0 10px 24px rgba(0, 121, 107, 0.1);
}

.cc-placeholder-icon svg {
  width: 34px;
  height: 34px;
}

.cc-summary-placeholder > span {
  color: var(--cc-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.cc-summary-placeholder h3 {
  max-width: 280px;
  margin: 8px 0 10px;
  color: var(--cc-primary-dark);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
}

.cc-summary-placeholder p {
  max-width: 290px;
  margin: 0;
  color: var(--cc-muted);
  font-size: 12px;
  line-height: 1.65;
}

.cc-placeholder-lines {
  display: grid;
  width: min(250px, 90%);
  gap: 8px;
  margin-top: 26px;
}

.cc-placeholder-lines i {
  height: 8px;
  border-radius: 10px;
  background: linear-gradient(90deg, #edf4f2, #f6f9f8);
}

.cc-placeholder-lines i:nth-child(2) {
  width: 78%;
}

.cc-placeholder-lines i:nth-child(3) {
  width: 56%;
}

.cc-summary::before {
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: rgba(0, 121, 107, 0.08);
  pointer-events: none;
}

.cc-summary-eyebrow {
  position: relative;
  display: block;
  margin-bottom: 7px;
  color: var(--cc-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.cc-total {
  position: relative;
  display: block;
  color: var(--cc-primary-dark);
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.18;
  word-break: break-word;
}

.cc-budget-range {
  position: relative;
  margin: 8px 0 22px;
  color: var(--cc-muted);
  font-size: 12px;
  line-height: 1.5;
}

.cc-budget-range b {
  color: #365853;
  font-weight: 600;
}

.cc-summary-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--cc-border);
  border-radius: 12px;
  background: var(--cc-border);
}

.cc-summary-metrics > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 13px;
  background: #fbfdfd;
  font-size: 12px;
}

.cc-summary-metrics span {
  color: var(--cc-muted);
}

.cc-summary-metrics b {
  flex: 0 0 auto;
  color: var(--cc-text);
  font-weight: 700;
  text-align: right;
}

.cc-cost-chart {
  display: grid;
  gap: 13px;
  margin: 23px 0;
}

.cc-chart-row {
  display: grid;
  grid-template-columns: 78px minmax(60px, 1fr) auto;
  align-items: center;
  gap: 9px;
  font-size: 11px;
}

.cc-chart-row > span {
  color: var(--cc-muted);
}

.cc-chart-row > i {
  height: 7px;
  overflow: hidden;
  border-radius: 10px;
  background: #edf3f2;
}

.cc-chart-row > i b {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--cc-primary);
  transition: width 0.35s ease;
}

.cc-chart-row:nth-child(2) > i b {
  background: #56a79d;
}

.cc-chart-row:nth-child(3) > i b {
  background: #e4ae39;
}

.cc-chart-row > em {
  color: #385854;
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.cc-breakdown {
  border-top: 1px solid #edf3f2;
  border-bottom: 1px solid #edf3f2;
}

.cc-breakdown summary {
  padding: 15px 0;
  color: var(--cc-primary-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.cc-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  color: #47635f;
  font-size: 11px;
}

.cc-breakdown-row + .cc-breakdown-row {
  border-top: 1px dashed #e1ebe9;
}

.cc-breakdown-row span {
  min-width: 0;
}

.cc-breakdown-row small {
  display: block;
  margin-top: 2px;
  color: #8a9a98;
  font-size: 10px;
}

.cc-breakdown-row b {
  flex: 0 0 auto;
  color: var(--cc-text);
  font-weight: 700;
}

.cc-summary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 18px;
}

.cc-summary-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  border: 1px solid var(--cc-border);
  border-radius: 9px;
  color: #45645f;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.cc-summary-actions button:hover {
  border-color: var(--cc-primary);
  color: var(--cc-primary);
  background: var(--cc-soft);
}

.cc-summary-actions svg {
  width: 17px;
  height: 17px;
}

.cc-disclaimer {
  margin: 15px 0 0;
  color: #879895;
  font-size: 10px;
  line-height: 1.55;
}

.cc-material-result {
  margin-top: 24px;
  padding: 26px;
  border: 1px solid var(--cc-border);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(15, 77, 68, 0.08);
}

.cc-material-result[hidden] {
  display: none !important;
}

.cc-material-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.cc-material-heading h3 {
  margin: 0 0 5px;
  color: var(--cc-primary-dark);
  font-size: 21px;
  font-weight: 700;
}

.cc-material-heading p {
  margin: 0;
  color: var(--cc-muted);
  font-size: 12px;
}

.cc-material-total {
  flex: 0 0 auto;
  padding: 12px 15px;
  border-radius: 11px;
  background: var(--cc-soft);
  text-align: right;
}

.cc-material-total span {
  display: block;
  margin-bottom: 4px;
  color: var(--cc-muted);
  font-size: 10px;
}

.cc-material-total strong {
  color: var(--cc-primary-dark);
  font-size: 17px;
  font-weight: 700;
}

.cc-material-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--cc-border);
  border-radius: 12px;
}

.cc-material-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 12px;
}

.cc-material-table th {
  padding: 11px 13px;
  color: #315b55;
  background: #e8f5f2;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
}

.cc-material-table th:not(:first-child),
.cc-material-table td:not(:first-child) {
  text-align: right;
}

.cc-material-table td {
  padding: 10px 13px;
  border-top: 1px solid #e5eeec;
  color: #496661;
}

.cc-material-table td strong {
  color: #244b46;
  font-weight: 600;
}

.cc-material-table tbody tr:hover {
  background: #f8fbfa;
}

.cc-material-note {
  margin: 14px 0 0;
  padding: 11px 13px;
  border-left: 3px solid #d7a229;
  color: #6e5a20;
  background: #fff9e8;
  font-size: 11px;
  line-height: 1.55;
}

@media (max-width: 1024px) {
  .cc-layout {
    grid-template-columns: 1fr;
  }

  .cc-summary,
  .cc-summary-placeholder {
    position: static;
  }

  .cc-field-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .cc-form,
  .cc-summary,
  .cc-summary-placeholder {
    padding: 20px 14px;
    border-radius: 16px;
  }

  .cc-field-grid,
  .cc-field-grid--3,
  .cc-field-grid--4,
  .cc-advanced-fields {
    grid-template-columns: 1fr;
  }

  .cc-package-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cc-switch-row {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .cc-field--compact {
    width: 100%;
  }

  .cc-advanced summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .cc-material-result {
    padding: 20px 14px;
    border-radius: 16px;
  }

  .cc-material-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .cc-material-total {
    text-align: left;
  }

  .cc-material-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .cc-material-table {
    display: block;
    min-width: 0;
    border-collapse: separate;
  }

  .cc-material-table thead {
    display: none;
  }

  .cc-material-table tbody {
    display: grid;
    gap: 10px;
  }

  .cc-material-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--cc-border);
    border-radius: 11px;
    background: #fff;
  }

  .cc-material-table td,
  .cc-material-table td:not(:first-child) {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
    padding: 9px 11px;
    border-top: 0;
    border-bottom: 1px solid #e7efed;
    color: #496661;
    text-align: left;
  }

  .cc-material-table td:nth-child(even) {
    border-right: 1px solid #e7efed;
  }

  .cc-material-table td::before {
    content: attr(data-label);
    color: #82938f;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .cc-material-table td:first-child {
    grid-column: 1 / -1;
    padding: 11px;
    border-bottom: 1px solid #d8e7e4;
    color: var(--cc-primary-dark);
    background: #f2f8f6;
    font-size: 13px;
  }

  .cc-material-table td:first-child::before {
    display: none;
  }

  .cc-material-table td:last-child {
    align-items: flex-start;
    justify-content: flex-start;
    border-bottom: 0;
    color: var(--cc-primary-dark);
    background: #fbfdfd;
    text-align: left;
  }

  .cc-material-table td:nth-last-child(2) {
    border-bottom: 0;
  }
}

@media (max-width: 430px) {
  .cc-step-heading {
    gap: 10px;
  }

  .cc-step-number {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }

  .cc-price-fields {
    grid-template-columns: 1fr;
  }

  .cc-form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .cc-btn {
    padding: 0 10px;
  }

  .cc-chart-row {
    grid-template-columns: 68px minmax(40px, 1fr) auto;
  }
}

@media print {
  body > *:not(main),
  .cc-form,
  .cc-summary-actions {
    display: none !important;
  }

  .cc-layout {
    display: block;
  }

  .cc-summary {
    position: static;
    border: 0;
    box-shadow: none;
  }
}
