.calculator-page {
  overflow: hidden;
  background: #fff;
}

.calc-hero {
  position: relative;
  padding-top: 58px;
  background:
    radial-gradient(circle at 82% 18%, rgba(220, 20, 127, 0.09), transparent 30%),
    linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.calc-hero::after {
  position: absolute;
  right: -120px;
  bottom: -180px;
  width: 420px;
  height: 420px;
  background: rgba(30, 58, 138, 0.06);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.calc-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(430px, 0.88fr);
  gap: 54px;
  align-items: center;
}

.calc-hero-copy {
  display: grid;
  gap: 20px;
}

.calc-hero h1 {
  max-width: 760px;
  font-size: clamp(44px, 5.4vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.calc-hero .hero-subtitle {
  max-width: 670px;
  color: var(--color-text-muted);
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.55;
}

.calc-hero-points {
  display: grid;
  gap: 9px;
  margin: 2px 0 4px;
  padding: 0;
  list-style: none;
}

.calc-hero-points li {
  position: relative;
  padding-left: 29px;
  color: #334155;
  font-weight: 600;
}

.calc-hero-points li::before {
  position: absolute;
  top: 0.15em;
  left: 0;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #fff;
  background: var(--color-brand-primary);
  border-radius: 50%;
  content: "✓";
  font-size: 12px;
  line-height: 1;
}

.calc-workbook {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  box-shadow: 0 32px 80px rgba(23, 37, 84, 0.16);
  transform: rotate(0.7deg);
}

.calc-workbook::before {
  position: absolute;
  top: 0;
  left: 52px;
  z-index: 2;
  width: 126px;
  height: 3px;
  background: var(--color-signature);
  border-radius: 0 0 99px 99px;
  content: "";
}

.calc-workbook-bar {
  display: grid;
  grid-template-columns: 10px 10px 10px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 15px 18px;
  color: #475569;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.calc-workbook-bar > span {
  width: 10px;
  height: 10px;
  background: #cbd5e1;
  border-radius: 50%;
}

.calc-workbook-bar > span:first-child {
  background: #f9a8d4;
}

.calc-workbook-bar strong {
  overflow: hidden;
  margin-left: 4px;
  font-size: 12px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calc-formula {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  min-height: 40px;
  color: #475569;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.calc-formula span {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--color-brand-secondary);
  background: #eef2ff;
  border-right: 1px solid #e2e8f0;
  font-size: 12px;
  font-style: italic;
  font-weight: 700;
}

.calc-formula code {
  overflow: hidden;
  padding: 0 12px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calc-sheet-wrap {
  overflow-x: auto;
}

.calc-sheet {
  width: 100%;
  min-width: 490px;
  border-spacing: 0;
  border-collapse: collapse;
  font-size: 12px;
}

.calc-sheet caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.calc-sheet th,
.calc-sheet td {
  padding: 11px 9px;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
  white-space: nowrap;
}

.calc-sheet th:first-child,
.calc-sheet td:first-child {
  padding-left: 14px;
  text-align: left;
}

.calc-sheet thead th {
  color: #172554;
  background: #f1f5f9;
  font-weight: 700;
}

.calc-sheet tbody tr:nth-child(even) td {
  background: #fbfdff;
}

.calc-sheet .is-yes {
  color: #166534;
  background: #ecfdf5;
  font-weight: 700;
}

.calc-sheet .is-no {
  color: #b91c1c;
  background: #fef2f2;
  font-weight: 700;
}

.calc-sheet .is-abstain {
  color: #92400e;
  background: #fffbeb;
  font-weight: 700;
}

.calc-sheet tfoot th,
.calc-sheet tfoot td {
  color: #fff;
  background: #172554;
  border-color: rgba(255, 255, 255, 0.15);
  font-weight: 700;
}

.calc-result-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 1px 0 0;
  background: #e2e8f0;
}

.calc-result-row div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  background: #fff;
}

.calc-result-row span {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.calc-result-row strong {
  color: #172554;
  font-size: 20px;
}

.calc-result-row .calc-status {
  color: #166534;
  font-size: 14px;
  text-transform: uppercase;
}

.calc-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.calc-feature-grid article {
  min-height: 250px;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-brand-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.calc-feature-grid article > span {
  display: inline-flex;
  margin-bottom: 42px;
  color: var(--color-signature-text);
  font-size: 13px;
  font-weight: 800;
}

.calc-feature-grid h3,
.calc-variant-grid h3 {
  margin-bottom: 12px;
}

.calc-feature-grid p,
.calc-variant-grid p,
.calc-steps p {
  color: var(--color-text-muted);
}

.calc-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.calc-steps li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 26px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.calc-steps li > span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #fff;
  background: var(--color-brand-primary);
  border-radius: 50%;
  font-weight: 800;
}

.calc-steps h3 {
  margin-bottom: 8px;
}

.calc-variant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.calc-variant-grid article {
  position: relative;
  padding: 32px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.calc-variant-grid article.is-featured {
  border-color: #a5b4fc;
  box-shadow: 0 24px 56px rgba(23, 37, 84, 0.12);
}

.calc-variant-grid .small-badge {
  margin-bottom: 22px;
}

.calc-variant-grid ul {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.calc-variant-grid li {
  position: relative;
  padding-left: 26px;
  font-weight: 600;
}

.calc-variant-grid li::before {
  position: absolute;
  left: 0;
  color: #15803d;
  content: "✓";
  font-weight: 900;
}

.calc-data-note {
  margin-top: 20px;
  padding: 16px 18px;
  color: #475569;
  background: #fff;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-brand-secondary);
  border-radius: var(--radius-md);
  font-size: 14px;
}

.calc-included-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: 62px;
  align-items: start;
}

.calc-included-card {
  padding: 8px 30px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.calc-check-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.calc-check-list li {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 22px 10px 22px 44px;
  border-bottom: 1px solid var(--color-border);
}

.calc-check-list li:last-child {
  border-bottom: 0;
}

.calc-check-list li::before {
  position: absolute;
  top: 22px;
  left: 8px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: #fff;
  background: var(--color-brand-primary);
  border-radius: 50%;
  content: "✓";
  font-size: 13px;
  font-weight: 800;
}

.calc-check-list strong {
  color: var(--color-brand-primary);
}

.calc-check-list span {
  color: var(--color-text-muted);
}

@media (max-width: 980px) {
  .calc-hero-grid,
  .calc-included-grid {
    grid-template-columns: 1fr;
  }

  .calc-workbook {
    max-width: 720px;
    transform: none;
  }

  .calc-feature-grid,
  .calc-steps {
    grid-template-columns: 1fr;
  }

  .calc-feature-grid article {
    min-height: auto;
  }

  .calc-feature-grid article > span {
    margin-bottom: 22px;
  }
}

@media (max-width: 700px) {
  .calc-hero {
    padding-top: 42px;
  }

  .calc-hero-grid {
    gap: 34px;
  }

  .calc-hero h1 {
    font-size: 42px;
  }

  .calc-variant-grid {
    grid-template-columns: 1fr;
  }

  .calc-result-row {
    grid-template-columns: 1fr;
  }

  .calc-steps li {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 22px;
  }

  .calc-steps li > span {
    width: 40px;
    height: 40px;
  }

  .calc-variant-grid article,
  .calc-feature-grid article {
    padding: 24px;
  }

  .calc-included-card {
    padding: 4px 18px;
  }
}

@media (max-width: 480px) {
  .calc-hero h1 {
    font-size: 36px;
  }

  .calc-hero .hero-subtitle {
    font-size: 17px;
  }

  .calc-workbook-bar strong {
    text-align: left;
  }

  .calc-formula code {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .calc-workbook {
    transform: none;
  }
}
