.pricing-lab {
  min-width: 320px;
  background: #f3f6f3;
  color: #17211f;
}

.pricing-lab button,
.pricing-lab input,
.pricing-lab select {
  letter-spacing: 0;
}

.pricing-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 12px clamp(18px, 3.2vw, 42px);
  border-bottom: 1px solid #d9e3de;
  background: rgba(243, 246, 243, 0.96);
  backdrop-filter: blur(14px);
}

.pricing-header .brand-link {
  color: inherit;
  text-decoration: none;
}

.pricing-header h1 {
  font-size: 20px;
}

.pricing-header-meta {
  display: flex;
  align-items: center;
  gap: 9px;
}

.pricing-version {
  padding-right: 4px;
  color: #63716d;
  font-size: 12px;
  font-weight: 680;
}

.icon-action,
.secondary-action {
  min-height: 38px;
  border: 1px solid #cfdad4;
  border-radius: 7px;
  background: #ffffff;
  color: #24302d;
  font-weight: 720;
  transition: border-color 150ms ease, background-color 150ms ease, transform 120ms ease;
}

.icon-action:hover,
.secondary-action:hover {
  border-color: #8fa59a;
  background: #f8faf8;
}

.icon-action:active,
.secondary-action:active {
  transform: scale(0.98);
}

.icon-action {
  display: grid;
  width: 38px;
  padding: 0;
  place-items: center;
  font-size: 19px;
}

.secondary-action {
  padding: 0 14px;
  font-size: 13px;
}

.pricing-shell {
  max-width: 1540px;
  margin: 0 auto;
  padding: 24px clamp(18px, 3.2vw, 42px) 64px;
}

.pricing-titlebar,
.matrix-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.pricing-titlebar h2,
.matrix-header h2 {
  margin-top: 4px;
  font-size: 23px;
  line-height: 1.18;
}

.pricing-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #d4ded9;
  border-radius: 7px;
  background: #ffffff;
  color: #63716d;
  font-size: 12px;
}

.pricing-status > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8b9894;
}

.pricing-status[data-tone="pass"] {
  border-color: #b9d5c4;
  background: #edf7f0;
  color: #205d3b;
}

.pricing-status[data-tone="pass"] > span {
  background: #286b46;
}

.pricing-status[data-tone="review"] {
  border-color: #dfc99c;
  background: #fff8e8;
  color: #7f581c;
}

.pricing-status[data-tone="review"] > span {
  background: #a56f24;
}

.pricing-status[data-tone="block"] {
  border-color: #dfbab6;
  background: #fff1ef;
  color: #8a362f;
}

.pricing-status[data-tone="block"] > span {
  background: #a2443b;
}

.pricing-tabs {
  display: flex;
  gap: 22px;
  margin-top: 24px;
  border-bottom: 1px solid #d9e3de;
}

.pricing-tabs button {
  position: relative;
  min-height: 42px;
  padding: 0 1px;
  border: 0;
  background: transparent;
  color: #63716d;
  font-size: 13px;
  font-weight: 720;
}

.pricing-tabs button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
  content: "";
}

.pricing-tabs button.is-active {
  color: #1f5f3e;
}

.pricing-tabs button.is-active::after {
  background: #286b46;
}

.pricing-view {
  margin-top: 22px;
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.pricing-controls {
  position: sticky;
  top: 94px;
  overflow: hidden;
  border: 1px solid #d6e0db;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(26, 43, 38, 0.06);
}

.control-section {
  padding: 18px;
  border-bottom: 1px solid #e2e9e5;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.section-heading > div > span {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border: 1px solid #c7d7cf;
  border-radius: 6px;
  color: #286b46;
  font-size: 10px;
  font-weight: 800;
}

.section-heading h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.section-heading small,
.section-heading > strong {
  color: #63716d;
  font-size: 11px;
  font-weight: 680;
}

.field-stack {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.field-stack > span,
.field-stack legend {
  color: #42504c;
  font-size: 12px;
  font-weight: 720;
}

.field-stack select {
  width: 100%;
  min-height: 42px;
  padding: 0 35px 0 11px;
  border: 1px solid #cfdad4;
  border-radius: 7px;
  background: #ffffff;
  color: #17211f;
  font-size: 13px;
}

.field-stack select:focus,
.stepper input:focus,
.pricing-segmented button:focus-visible,
.pricing-tabs button:focus-visible,
.icon-action:focus-visible,
.secondary-action:focus-visible {
  outline: 3px solid rgba(46, 102, 128, 0.18);
  outline-offset: 2px;
}

.channel-fieldset {
  padding: 0;
  border: 0;
}

.channel-fieldset legend {
  margin-bottom: 7px;
}

.pricing-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border: 1px solid #d6e0db;
  border-radius: 7px;
  background: #f2f5f3;
}

.pricing-segmented button {
  min-width: 0;
  min-height: 34px;
  padding: 0 5px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #63716d;
  font-size: 11px;
}

.pricing-segmented button.is-active {
  background: #ffffff;
  color: #205d3b;
  box-shadow: 0 2px 7px rgba(30, 57, 47, 0.08);
}

.pricing-segmented button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-label-row output {
  color: #286b46;
  font-weight: 800;
}

.field-stack input[type="range"] {
  width: 100%;
  accent-color: #286b46;
}

.field-stack > small {
  color: #788480;
  font-size: 10px;
}

.stepper-list {
  display: grid;
  gap: 6px;
}

.stepper-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 46px;
  border-bottom: 1px solid #edf1ef;
}

.stepper-row:last-child {
  border-bottom: 0;
}

.stepper-copy {
  min-width: 0;
}

.stepper-copy strong,
.stepper-copy small {
  display: block;
}

.stepper-copy strong {
  font-size: 12px;
}

.stepper-copy small {
  margin-top: 2px;
  color: #788480;
  font-size: 10px;
}

.stepper {
  display: grid;
  grid-template-columns: 29px 50px 29px;
  align-items: center;
  overflow: hidden;
  border: 1px solid #cfdad4;
  border-radius: 6px;
  background: #ffffff;
}

.stepper button {
  width: 29px;
  height: 32px;
  padding: 0;
  border: 0;
  background: #f7f9f7;
  color: #33413d;
  font-size: 17px;
  line-height: 1;
}

.stepper button:hover {
  background: #edf3ef;
}

.stepper input {
  width: 50px;
  height: 32px;
  padding: 0 3px;
  border: 0;
  border-right: 1px solid #e0e7e3;
  border-left: 1px solid #e0e7e3;
  outline: 0;
  color: #17211f;
  text-align: center;
  font-size: 12px;
  font-weight: 760;
  appearance: textfield;
}

.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.assumption-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: #e0e7e3;
}

.assumption-strip > div {
  min-width: 0;
  padding: 11px 9px;
  background: #f7f9f7;
  text-align: center;
}

.assumption-strip span,
.assumption-strip strong {
  display: block;
}

.assumption-strip span {
  overflow: hidden;
  color: #788480;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assumption-strip strong {
  margin-top: 3px;
  font-size: 11px;
}

.pricing-results {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}

.pricing-results > * {
  min-width: 0;
}

.kpi-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #d6e0db;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(26, 43, 38, 0.05);
}

.kpi-band article {
  min-width: 0;
  min-height: 112px;
  padding: 18px;
  border-right: 1px solid #e0e7e3;
}

.kpi-band article:last-child {
  border-right: 0;
}

.kpi-band span,
.kpi-band small,
.kpi-band strong {
  display: block;
}

.kpi-band span {
  color: #63716d;
  font-size: 11px;
  font-weight: 680;
}

.kpi-band strong {
  margin-top: 9px;
  font-size: clamp(22px, 2.25vw, 31px);
  line-height: 1;
}

.kpi-band small {
  margin-top: 8px;
  color: #788480;
  font-size: 10px;
}

.kpi-band article[data-tone="pass"] strong {
  color: #286b46;
}

.kpi-band article[data-tone="review"] strong {
  color: #96631f;
}

.kpi-band article[data-tone="block"] strong {
  color: #a2443b;
}

.margin-panel,
.result-section,
.recommendation-panel {
  border: 1px solid #d6e0db;
  border-radius: 8px;
  background: #ffffff;
}

.margin-panel,
.result-section {
  padding: 17px 18px;
}

.inline-heading {
  margin-bottom: 14px;
}

.margin-scale {
  padding: 5px 2px 0;
}

.margin-track {
  position: relative;
  height: 13px;
  border-radius: 7px;
  background: linear-gradient(to right, #f3d8d5 0 60%, #f4e7c8 60% 70%, #d8eadf 70% 100%);
}

.margin-floor,
.margin-target,
.margin-value {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.margin-floor,
.margin-target {
  width: 2px;
  height: 21px;
  background: #52605c;
}

.margin-target {
  background: #286b46;
}

.margin-value {
  width: 13px;
  height: 13px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #2e6680;
  box-shadow: 0 0 0 2px #2e6680;
}

.margin-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: #7a8783;
  font-size: 9px;
}

.results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(290px, 0.95fr);
  gap: 16px;
}

.economics-table {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid #e0e7e3;
  border-radius: 6px;
  background: #e0e7e3;
}

.economics-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 33px;
  padding: 0 10px;
  background: #ffffff;
  font-size: 11px;
}

.economics-row span {
  color: #52605c;
}

.economics-row strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.economics-row.is-subtotal,
.economics-row.is-total {
  background: #f3f7f4;
  font-weight: 760;
}

.economics-row.is-total {
  min-height: 38px;
  color: #205d3b;
}

.guardrail-list {
  display: grid;
  gap: 8px;
}

.guardrail-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
  min-height: 41px;
  padding: 8px;
  border: 1px solid #e0e7e3;
  border-radius: 6px;
  background: #fbfcfb;
}

.guardrail-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #e7f2eb;
  color: #286b46;
  font-size: 11px;
  font-weight: 840;
}

.guardrail-item[data-tone="review"] .guardrail-icon {
  background: #fff0cf;
  color: #8b5d1d;
}

.guardrail-item[data-tone="block"] .guardrail-icon {
  background: #f9dfdc;
  color: #963d35;
}

.guardrail-copy strong,
.guardrail-copy small {
  display: block;
}

.guardrail-copy strong {
  font-size: 11px;
}

.guardrail-copy small {
  margin-top: 2px;
  color: #73807c;
  font-size: 9px;
  line-height: 1.35;
}

.guardrail-item > b {
  padding-top: 3px;
  color: #63716d;
  font-size: 9px;
  text-transform: uppercase;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.pricing-table th,
.pricing-table td {
  padding: 10px 11px;
  border-bottom: 1px solid #e2e9e5;
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

.pricing-table th:first-child,
.pricing-table td:first-child,
.pricing-table th:last-child,
.pricing-table td:last-child {
  text-align: left;
}

.pricing-table th {
  background: #f3f6f4;
  color: #52605c;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.pricing-table tbody tr:last-child td {
  border-bottom: 0;
}

.scope-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 5px;
  background: #e8f3ec;
  color: #286b46;
  font-size: 9px;
  font-weight: 780;
}

.scope-status[data-tone="overage"] {
  background: #fff1d5;
  color: #8a5b19;
}

.scope-status[data-tone="block"] {
  background: #f9dfdc;
  color: #963d35;
}

.recommendation-panel {
  display: grid;
  grid-template-columns: minmax(210px, 0.45fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 18px;
  border-left: 4px solid #286b46;
}

.recommendation-panel[data-tone="review"] {
  border-left-color: #a56f24;
  background: #fffdf7;
}

.recommendation-panel[data-tone="block"] {
  border-left-color: #a2443b;
  background: #fffafa;
}

.recommendation-kicker {
  color: #63716d;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.recommendation-panel h3 {
  margin: 4px 0 0;
  font-size: 15px;
}

.recommendation-panel p {
  color: #52605c;
  font-size: 11px;
  line-height: 1.5;
}

.matrix-header {
  padding: 4px 0 15px;
}

.matrix-header > span {
  max-width: 420px;
  color: #63716d;
  font-size: 11px;
  text-align: right;
}

.secondary-matrix-header {
  margin-top: 30px;
}

.matrix-table-wrap {
  border: 1px solid #d6e0db;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(26, 43, 38, 0.04);
}

.matrix-table-wrap .pricing-table td,
.matrix-table-wrap .pricing-table th {
  padding-top: 13px;
  padding-bottom: 13px;
}

.plans-table td:first-child,
.overage-table td:first-child,
.partner-table td:first-child {
  color: #1f5f3e;
  font-weight: 760;
}

.overage-table th:last-child,
.overage-table td:last-child,
.partner-table th:last-child,
.partner-table td:last-child {
  min-width: 250px;
  white-space: normal;
}

.partner-table th:nth-child(3),
.partner-table td:nth-child(3) {
  min-width: 180px;
  text-align: left;
  white-space: normal;
}

.partner-policy-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.partner-policy-band article {
  min-height: 132px;
  padding: 16px;
  border: 1px solid #d6e0db;
  border-radius: 8px;
  background: #ffffff;
}

.partner-policy-band span,
.partner-policy-band strong,
.partner-policy-band p {
  display: block;
}

.partner-policy-band span {
  color: #2e6680;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.partner-policy-band strong {
  margin-top: 7px;
  font-size: 13px;
}

.partner-policy-band p {
  margin-top: 7px;
  color: #63716d;
  font-size: 10px;
  line-height: 1.5;
}

.pricing-error {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #dfbab6;
  border-radius: 7px;
  background: #fff1ef;
  color: #8a362f;
  font-size: 12px;
}

@media (max-width: 1120px) {
  .calculator-layout {
    grid-template-columns: 310px minmax(0, 1fr);
  }

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

  .kpi-band article:nth-child(2) {
    border-right: 0;
  }

  .kpi-band article:nth-child(-n + 2) {
    border-bottom: 1px solid #e0e7e3;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .pricing-header {
    position: static;
  }

  .pricing-version {
    display: none;
  }

  .calculator-layout {
    grid-template-columns: 1fr;
  }

  .pricing-controls {
    position: static;
  }

  .partner-policy-band {
    grid-template-columns: 1fr;
  }

  .recommendation-panel {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 580px) {
  .pricing-header {
    align-items: flex-start;
    min-height: 66px;
    padding: 11px 14px;
  }

  .pricing-header .brand-mark {
    width: 38px;
    height: 38px;
  }

  .pricing-header h1 {
    font-size: 17px;
  }

  .secondary-action {
    width: 38px;
    overflow: hidden;
    padding: 0;
    color: transparent;
    font-size: 0;
  }

  .secondary-action::after {
    color: #24302d;
    content: "⇩";
    font-size: 18px;
  }

  .pricing-shell {
    padding: 18px 14px 44px;
  }

  .pricing-titlebar,
  .matrix-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .pricing-titlebar h2,
  .matrix-header h2 {
    font-size: 20px;
  }

  .pricing-status {
    align-self: stretch;
    justify-content: center;
  }

  .pricing-tabs {
    gap: 16px;
    overflow-x: auto;
  }

  .pricing-tabs button {
    flex: 0 0 auto;
  }

  .kpi-band {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-band article {
    min-height: 103px;
    padding: 14px;
  }

  .kpi-band strong {
    font-size: 22px;
  }

  .assumption-strip {
    grid-template-columns: 1fr;
  }

  .assumption-strip > div {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    text-align: left;
  }

  .assumption-strip span,
  .assumption-strip strong {
    margin: 0;
  }

  .scope-output-section {
    padding-right: 0;
    padding-left: 0;
  }

  .scope-output-section .section-heading {
    padding: 0 16px;
  }

  .matrix-header > span {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pricing-lab *,
  .pricing-lab *::before,
  .pricing-lab *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
