.automation-calculator {
  --calc-surface: #ffffff;
  --calc-surface-soft: #f3f5f8;
  --calc-midnight: #0b1424;
  --calc-midnight-soft: #13213a;
  --calc-ink: #0a1528;
  --calc-body: #53627a;
  --calc-muted: #738096;
  --calc-line: #dfe4ec;
  --calc-line-strong: #c8d0dc;
  --calc-gold: #dcb46a;
  --calc-gold-bright: #efca7c;
  --calc-gold-soft: rgba(220, 180, 106, 0.15);
  --calc-danger: #f08a7c;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  scroll-margin-top: 76px;
  padding: 92px 28px 88px;
  background:
    radial-gradient(720px 360px at 82% 8%, rgba(220, 180, 106, 0.12), transparent 68%),
    linear-gradient(180deg, #0b0f1a 0%, #0e1525 52%, #11172a 100%);
}

.automation-calculator::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 82%, transparent);
}

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

.automation-calculator button,
.automation-calculator input,
.automation-calculator a {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.automation-calculator button:focus-visible,
.automation-calculator a:focus-visible,
.automation-calculator input:focus-visible,
.automation-calculator .calculator-workspace:focus-visible {
  outline: 3px solid rgba(220, 180, 106, 0.58);
  outline-offset: 3px;
}

.calculator-section-inner {
  width: min(100%, 1180px);
  margin: 0 auto;
}

.calculator-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(340px, 0.7fr);
  align-items: end;
  gap: 60px;
  margin-bottom: 38px;
}

.calculator-section-heading h2 {
  max-width: 780px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(2rem, 3.5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.calculator-section-heading > p {
  margin: 0 0 4px;
  color: #b8c2d2;
  font-size: 15px;
  line-height: 1.75;
}

.calculator-section-heading > p strong {
  color: #ffffff;
  font-weight: 600;
}

.calculator-shell {
  position: relative;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
}

.calculator-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--calc-line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.96);
}

.calculator-tabs button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  min-height: 60px;
  padding: 12px 13px;
  border: 0;
  border-right: 1px solid var(--calc-line);
  color: #69768c;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.calculator-tabs button:last-child {
  border-right: 0;
}

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

.calculator-tabs button:hover {
  color: var(--calc-ink);
  background: rgba(220, 180, 106, 0.08);
}

.calculator-tabs button[aria-selected="true"] {
  color: var(--calc-ink);
  background: #ffffff;
}

.calculator-tabs button[aria-selected="true"]::after {
  background: var(--calc-gold);
}

.calculator-tabs svg {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.calculator-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  gap: 12px;
  margin-top: 12px;
  outline: 0;
}

.input-panel,
.result-panel {
  min-width: 0;
  min-height: 560px;
  border-radius: 16px;
}

.input-panel {
  padding: 25px 28px 22px;
  border: 1px solid var(--calc-line);
  color: var(--calc-ink);
  background: rgba(255, 255, 255, 0.98);
}

.panel-heading,
.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel-heading {
  margin-bottom: 10px;
}

.panel-heading h3,
.result-heading h3 {
  margin: 0;
  font-size: clamp(1.12rem, 2vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.panel-heading p,
.result-heading p {
  margin: 5px 0 0;
  font-size: 12.5px;
}

.panel-heading p {
  color: var(--calc-muted);
}

.reset-button {
  flex: 0 0 auto;
  margin: 2px 0 0;
  padding: 6px 0;
  border: 0;
  color: #7a6847;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.reset-button:hover {
  color: var(--calc-ink);
}

.input-list {
  display: grid;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(135px, 0.86fr) 102px;
  align-items: center;
  gap: 16px;
  min-height: 66px;
  padding: 8px 0;
  border-top: 1px solid #edf0f4;
}

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

.input-copy label {
  display: block;
  color: var(--calc-ink);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
}

.input-copy small {
  display: block;
  margin-top: 4px;
  color: #657289;
  font-size: 11.5px;
  line-height: 1.4;
}

.range-input {
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.range-input::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background:
    linear-gradient(to right, var(--calc-midnight) 0 var(--range-fill), #e2e7ee var(--range-fill) 100%);
}

.range-input::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: #e2e7ee;
}

.range-input::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--calc-midnight);
}

.range-input::-webkit-slider-thumb {
  width: 19px;
  height: 19px;
  margin-top: -7.5px;
  appearance: none;
  border: 2px solid var(--calc-gold);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(10, 21, 40, 0.17);
}

.range-input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--calc-gold);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(10, 21, 40, 0.17);
}

.number-wrap {
  position: relative;
  min-width: 0;
}

.number-input {
  width: 100%;
  min-height: 43px;
  padding: 9px 30px 9px 11px;
  border: 1px solid var(--calc-line-strong);
  border-radius: 9px;
  color: var(--calc-ink);
  background: #ffffff;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.number-input:focus {
  border-color: var(--calc-gold);
  box-shadow: 0 0 0 3px var(--calc-gold-soft);
  outline: 0;
}

.input-suffix {
  position: absolute;
  top: 50%;
  right: 10px;
  color: #69768c;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
  transform: translateY(-50%);
}

.result-panel {
  display: flex;
  flex-direction: column;
  padding: 27px 28px 24px;
  color: #ffffff;
  background:
    radial-gradient(520px 260px at 100% 0, rgba(220, 180, 106, 0.11), transparent 70%),
    linear-gradient(145deg, #0b1424 0%, #101d32 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.result-heading {
  justify-content: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.result-heading p {
  color: #9aa7ba;
}

.result-icon {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(220, 180, 106, 0.55);
  border-radius: 50%;
  color: var(--calc-gold-bright);
}

.result-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.result-list {
  display: grid;
}

.result-metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  padding: 15px 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.result-metric span {
  display: block;
  color: #aeb9c9;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
}

.result-metric strong {
  display: block;
  margin-top: 6px;
  color: #ffffff;
  font-size: clamp(1.7rem, 3.1vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.result-metric.is-negative strong {
  color: #ff9c8f;
}

.result-metric small {
  align-self: center;
  max-width: 122px;
  color: #7f8da2;
  font-size: 11px;
  line-height: 1.4;
  text-align: right;
}

.result-note {
  position: relative;
  margin: auto 0 0;
  padding: 17px 0 17px 27px;
  color: #b5c0cf;
  font-size: 12px;
  line-height: 1.55;
}

.result-note::before {
  content: "i";
  position: absolute;
  top: 18px;
  left: 0;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid #8795aa;
  border-radius: 50%;
  color: #d1d7e0;
  font-size: 11px;
  font-weight: 700;
}

.result-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 18px;
  border-radius: 9px;
  color: var(--calc-midnight);
  background: linear-gradient(135deg, var(--calc-gold-bright), var(--calc-gold));
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(220, 180, 106, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.result-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(220, 180, 106, 0.26);
}

.result-cta svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.formula-band {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  padding: 13px 17px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 13px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.055);
}

.formula-icon {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(220, 180, 106, 0.48);
  border-radius: 50%;
  color: var(--calc-gold-bright);
}

.formula-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.formula-band strong {
  display: block;
  font-size: 11.5px;
}

.formula-band p {
  margin: 3px 0 0;
  color: #aeb9c9;
  font-size: 10.5px;
  line-height: 1.55;
}

.calculator-disclaimer {
  max-width: 900px;
  margin: 18px auto 0;
  color: #8e9aae;
  font-size: 11.5px;
  line-height: 1.65;
  text-align: center;
}

.automation-calculator .noscript-message {
  margin: 18px auto 0;
  padding: 14px;
  border: 1px solid rgba(240, 138, 124, 0.4);
  border-radius: 10px;
  color: #ffd1ca;
  background: rgba(240, 138, 124, 0.1);
  text-align: center;
}

@media (max-width: 1100px) {
  .calculator-section-heading {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .calculator-section-heading > p {
    max-width: 720px;
  }

}

@media (min-width: 901px) and (max-width: 1100px) {
  .input-panel { padding-inline: 20px; }
  .input-row {
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 7px 14px;
    padding: 12px 0;
  }
  .input-copy { grid-column: 1; }
  .number-wrap { grid-column: 2; grid-row: 1; }
  .range-input { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 900px) {
  .calculator-workspace { grid-template-columns: 1fr; }
  .input-panel,
  .result-panel { min-height: 0; }
  .result-note { margin-top: 12px; }
}

@media (max-width: 680px) {
  .automation-calculator {
    padding: 68px 14px 64px;
  }

  .calculator-section-heading {
    padding: 0 10px;
    margin-bottom: 28px;
  }

  .calculator-section-heading h2 {
    font-size: 2.15rem;
  }

  .calculator-section-heading > p {
    font-size: 14px;
  }

  .calculator-shell {
    padding: 7px;
    border-radius: 18px;
  }

  .calculator-tabs { border-radius: 11px; }

  .calculator-tabs button {
    justify-content: center;
    min-height: 55px;
    padding: 10px 8px;
    font-size: 11.5px;
  }

  .calculator-workspace {
    gap: 8px;
    margin-top: 8px;
  }

  .input-panel,
  .result-panel {
    padding: 22px 17px;
    border-radius: 13px;
  }

  .input-row {
    grid-template-columns: minmax(0, 1fr) 94px;
    gap: 7px 14px;
    padding: 14px 0;
  }

  .input-copy {
    grid-column: 1;
  }

  .range-input {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .number-wrap {
    grid-column: 2;
    grid-row: 1;
  }

  .input-copy small {
    display: none;
  }

  .result-metric strong {
    font-size: 1.78rem;
  }

  .formula-band {
    align-items: flex-start;
    padding: 15px;
  }

  .formula-icon {
    width: 36px;
    height: 36px;
  }
}

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

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

.number-input[type="number"] { appearance: textfield; }
body.automation-calculator-in-view .calendly-badge-widget { opacity: 0 !important; pointer-events: none !important; }

@media (max-width: 460px) {
  .panel-heading {
    align-items: center;
  }

  .result-heading {
    gap: 13px;
  }

  .result-icon {
    width: 38px;
    height: 38px;
  }

  .result-metric {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .result-metric small {
    max-width: none;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .automation-calculator *,
  .automation-calculator *::before,
  .automation-calculator *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
