:root {
  --ink: #20233a;
  --muted: #65708a;
  --red: #fe3f40;
  --blue: #03a4ed;
  --paper: #ffffff;
  --line: #e8edf5;
}

body {
  color: var(--ink);
}

.header-area {
  background: var(--paper);
}

.main-nav .logo h4 {
  font-size: 24px;
}

.main-nav .image-logo {
  display: flex;
  align-items: center;
  height: 100px;
}

.main-nav .image-logo img {
  width: 190px;
  max-width: 100%;
  max-height: 72px;
  height: auto;
  display: block;
  object-fit: contain;
}

.main-banner.calculator-hero {
  padding-top: 170px;
}

.calculator-hero h1,
.content-hero h1 {
  font-size: 54px;
  font-weight: 800;
  line-height: 1.08;
}

.calculator-hero p,
.content-hero p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
  margin-top: 20px;
}

.hero-image img,
.feature-image {
  max-width: 100%;
  height: auto;
}

.limit-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 28px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  background: #f8fbff;
  font-weight: 600;
}

.tool-section,
.content-section,
.contact-section {
  padding: 70px 0;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 28px;
  align-items: start;
}

.calculator-panel,
.result-panel,
.contact-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 30px;
  box-shadow: 0 20px 50px rgba(32, 35, 58, 0.08);
}

.compact-heading {
  margin-bottom: 22px;
}

.compact-heading h2 {
  font-size: 30px;
  line-height: 1.25;
}

.calculator-panel label,
.contact-panel label {
  display: block;
  margin: 16px 0 8px;
  font-weight: 600;
}

.calculator-panel input,
.contact-panel input,
.contact-panel textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fbfcff;
}

.contact-panel textarea {
  resize: vertical;
}

.main-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 20px;
  border: 0;
  border-radius: 23px;
  padding: 0 24px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}

.main-button:hover {
  color: #fff;
  background: var(--red);
}

.math-result {
  margin: 20px 0;
  padding: 20px;
  border-radius: 8px;
  background: #f0f9ff;
  color: #123f5f;
  font-size: 20px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.supported-box {
  margin-top: 28px;
}

.supported-box h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

.supported-box li,
.db-content li {
  list-style: disc;
  margin-left: 22px;
  color: var(--muted);
  line-height: 1.8;
}

.feature-band {
  margin-top: 30px;
}

.content-hero {
  padding: 140px 0 28px;
  background: linear-gradient(180deg, #f6fbff 0%, #ffffff 100%);
}

.contact-hero {
  background: #f8fbff url('../images/contact-bg.png') center right / auto 100% no-repeat;
}

.narrow {
  max-width: 880px;
}

.content-section {
  padding-top: 24px;
}

.calculators-hero {
  background:
    url('../images/baner-dec-left.png') left 98px / 96px auto no-repeat,
    linear-gradient(180deg, #f6fbff 0%, #ffffff 100%);
}

.calculators-section {
  padding: 42px 0 78px;
  background: #f6f7fb;
}

.calculator-group-block {
  margin-bottom: 34px;
}

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

.calculator-group-heading h2 {
  font-size: 26px;
  font-weight: 800;
}

.calculator-group-heading span {
  border: 1px solid rgba(3, 164, 237, 0.18);
  border-radius: 999px;
  background: #eef9ff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  padding: 7px 12px;
}

.calculator-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.calculator-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 15px;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 20px;
  box-shadow: 0 16px 36px rgba(32, 35, 58, 0.07);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.calculator-card:hover {
  color: var(--ink);
  border-color: rgba(3, 164, 237, 0.28);
  box-shadow: 0 22px 44px rgba(32, 35, 58, 0.11);
  transform: translateY(-3px);
}

.calculator-card-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 20px;
}

.calculator-card:nth-child(3n + 2) .calculator-card-icon {
  background: var(--red);
}

.calculator-card:nth-child(3n) .calculator-card-icon {
  background: var(--ink);
}

.calculator-card-copy strong,
.calculator-card-copy span {
  display: block;
}

.calculator-card-copy strong {
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.35;
}

.calculator-card-copy span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.db-content h2,
.db-content h3 {
  margin: 28px 0 12px;
}

.db-content p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.9;
}

.db-content a {
  color: var(--blue);
}

.alert p {
  margin: 0;
}

.form-row {
  margin-bottom: 4px;
}

.site-footer {
  padding: 42px 0 28px;
  border-top: 1px solid var(--line);
  background: #fbfcff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: start;
}

.footer-grid p,
.copyright {
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  justify-content: flex-end;
}

.footer-links a {
  color: var(--ink);
  font-weight: 600;
}

.copyright {
  margin-top: 24px;
  font-size: 14px;
}

@media (max-width: 991px) {
  .main-banner.calculator-hero,
  .content-hero {
    padding-top: 130px;
  }

  .calculator-hero h1,
  .content-hero h1 {
    font-size: 42px;
  }

  .tool-grid,
  .footer-grid,
  .calculator-card-grid {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 575px) {
  .calculator-panel,
  .result-panel,
  .contact-panel {
    padding: 22px;
  }

  .calculator-hero h1,
  .content-hero h1 {
    font-size: 34px;
  }
}

.calculus-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 130px 24px 70px;
  background: #f6f7fb;
}

.home-intro {
  position: relative;
  overflow: hidden;
  padding: 142px 24px 34px;
  background:
    url('../images/baner-dec-left.png') left 98px / 112px auto no-repeat,
    url('../images/baner-dec-right.png') right 104px / 70px auto no-repeat,
    linear-gradient(180deg, #ffffff 0%, #f6fbff 52%, #f6f7fb 100%);
}

.home-intro-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.home-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-bottom: 18px;
  border: 1px solid rgba(3, 164, 237, 0.22);
  border-radius: 999px;
  background: #eef9ff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.4;
  padding: 8px 14px;
  text-transform: uppercase;
}

.home-intro h1 {
  max-width: 960px;
  margin-bottom: 16px;
  color: var(--ink);
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
}

.home-intro h1 em,
.home-intro h1 span {
  font-style: normal;
}

.home-intro h1 em {
  color: var(--blue);
}

.home-intro h1 span {
  color: var(--red);
}

.home-intro p {
  max-width: 960px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.home-intro .home-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 1120px;
  margin: 28px 0 0;
}

.home-intro .home-highlights li {
  position: relative;
  min-height: 76px;
  overflow: hidden;
  border: 1px solid rgba(3, 164, 237, 0.12);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.45;
  padding: 18px 18px 18px 68px;
  box-shadow: 0 16px 36px rgba(32, 35, 58, 0.07);
}

.home-intro .home-highlights li::before {
  position: absolute;
  left: 18px;
  top: 18px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  content: "\f1ec";
  font-family: FontAwesome;
  font-size: 16px;
}

.home-intro .home-highlights li:nth-child(2)::before {
  background: var(--red);
  content: "\f11c";
}

.home-intro .home-highlights li:nth-child(3)::before {
  background: #20233a;
  content: "\f02d";
}

.home-intro .home-highlights li::after {
  position: absolute;
  right: -28px;
  bottom: -34px;
  color: rgba(3, 164, 237, 0.08);
  content: "\222B";
  font-family: Georgia, serif;
  font-size: 94px;
  line-height: 1;
}

.home-intro .home-highlights li:nth-child(2)::after {
  color: rgba(254, 63, 64, 0.08);
  content: "\2211";
}

.home-intro .home-highlights li:nth-child(3)::after {
  color: rgba(32, 35, 58, 0.08);
  content: "\2202";
}

.home-calculus-shell {
  padding-top: 34px;
}

.tool-sidebar {
  position: sticky;
  top: 110px;
  align-self: start;
  max-height: calc(100vh - 130px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
}

.tool-sidebar h2 {
  font-size: 22px;
  margin-bottom: 18px;
}

.tool-group {
  margin-bottom: 20px;
}

.tool-group h3 {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.tool-group a {
  display: block;
  border-radius: 6px;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35;
  padding: 9px 10px;
}

.tool-group a.active,
.tool-group a:hover {
  color: #fff;
  background: var(--red);
}

.calculator-workspace {
  min-width: 0;
}

.tool-heading {
  margin-bottom: 22px;
}

.tool-heading h1 {
  font-size: 44px;
  font-weight: 800;
}

.tool-heading p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
  max-width: 860px;
  margin-top: 12px;
}

.math-solver,
.solution-panel,
.examples-panel,
.concept-panel {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 14px 34px rgba(32, 35, 58, 0.06);
}

.examples-panel button {
  border: 0;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.math-solver {
  margin-top: 22px;
  padding: 0;
}

.math-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 96px;
  align-items: stretch;
  min-height: 76px;
}

math-field {
  width: 100%;
  border: 0;
  padding: 18px 24px;
  font-size: 28px;
  background: #fff;
}

.icon-button,
.solve-button {
  border: 0;
  font-weight: 800;
}

.icon-button {
  background: #fff;
  color: var(--muted);
  font-size: 15px;
  border-left: 1px solid var(--line);
}

.solve-button {
  background: var(--red);
  color: #fff;
  font-size: 18px;
  border-radius: 0 8px 8px 0;
}

.solver-options {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

.solver-options label {
  color: var(--muted);
  font-weight: 700;
}

.solver-options input {
  width: 74px;
  min-height: 36px;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
}

.solution-panel,
.examples-panel,
.concept-panel {
  margin-top: 26px;
  padding: 28px;
}

.solution-panel h2,
.examples-panel h2,
.concept-panel h2 {
  font-size: 24px;
  margin-bottom: 16px;
}

.concept-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.language-select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
}

.language-select select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  padding: 0 12px;
}

.concept-copy {
  display: none;
}

.concept-copy.active {
  display: block;
}

.solution-line {
  overflow-x: auto;
  padding: 12px 0;
}

.solution-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfcff;
}

.solution-summary p {
  margin: 10px 0 6px;
}

.final-answer {
  overflow-x: auto;
  padding: 12px;
  border-radius: 6px;
  background: #f0f9ff;
}

.solution-steps {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.solution-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 800;
}

.solution-step h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.solution-step p,
.solution-notes {
  color: var(--muted);
}

.step-math {
  overflow-x: auto;
}

.solver-loading {
  color: var(--blue);
  font-weight: 800;
}

.solver-error {
  color: var(--red);
  font-weight: 700;
}

.examples-panel {
  display: grid;
  gap: 12px;
}

.examples-panel button {
  min-height: 62px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 18px;
}

@media (max-width: 1100px) {
  .calculus-shell {
    grid-template-columns: 1fr;
  }

  .tool-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 700px) {
  .calculus-shell {
    padding: 120px 12px 50px;
  }

  .home-intro {
    padding: 120px 14px 24px;
    background:
      url('../images/baner-dec-right.png') right 96px / 52px auto no-repeat,
      linear-gradient(180deg, #ffffff 0%, #f6fbff 54%, #f6f7fb 100%);
  }

  .home-intro h1 {
    font-size: 36px;
  }

  .home-intro .home-highlights {
    grid-template-columns: 1fr;
  }

  .home-calculus-shell {
    padding-top: 20px;
  }

  .tool-heading h1 {
    font-size: 34px;
  }

  .math-input-row {
    grid-template-columns: 1fr;
  }

  .icon-button,
  .solve-button {
    min-height: 54px;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
  }

  .concept-header {
    display: block;
  }

  .language-select {
    margin-top: 12px;
  }
}
