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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

.page-container,
.content-wrap,
.main-content {
  width: 100%;
}

.content-container {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0 14px 24px;
  gap: 0;
}

.middle-section {
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
}

.calculators-section {
  min-height: clamp(320px, 44svh, 430px);
  padding: 76px 18px 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calculators-section .calculators-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.calculators-hero-content {
  max-width: 700px;
  margin: 0 auto;
}

.calculators-kicker {
  display: inline-block;
  margin-bottom: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calculators-title {
  font-size: clamp(32px, 6vw, 42px);
  font-weight: 800;
  line-height: 1.08;
  margin: 0;
  color: #111;
}

.calculators-divider {
  width: 72px;
  height: 4px;
  margin: 14px auto 16px;
  border-radius: 999px;
}

.calculators-description {
  max-width: 54ch;
  margin: 0 auto;
  font-size: clamp(14px, 2vw, 16px);
  line-height: 1.55;
  color: #222;
}

.topics-container {
  width: 100%;
  padding: 26px 0 40px;
}

.topic-group {
  margin-bottom: 34px;
}

.topic-group:last-child {
  margin-bottom: 0;
}

.topic-group-header {
  text-align: left;
  margin-bottom: 14px;
  padding: 0 2px;
}

.topic-group-title {
  font-size: clamp(1.14rem, 2.8vw, 1.45rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 6px;
  color: #1f1f1f;
}

.topic-group-description {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #5e5e5e;
}

.calculator-search-wrap {
  margin-bottom: 14px;
}

.calculator-search {
  height: 46px;
  padding: 0 14px;
  font-size: 16px;
  border-radius: 10px;
}

.topics-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.topic-card {
  min-width: 0;
  min-height: 76px;
  padding: 8px 6px;
  border: 1px solid #dddddd;
  border-radius: 10px;
  background: #f4f4f4;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.topic-card a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100%;
  text-decoration: none;
  color: inherit;
}

.topic-title {
  margin: 0;
  font-size: clamp(0.66rem, 1.4vw, 0.78rem);
  line-height: 1.16;
  color: #111;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.no-results-message {
  margin-top: 14px;
  font-size: 0.88rem;
}

@media (max-width: 768px) {
  .content-container {
    padding: 0 12px 22px;
  }

  .calculators-section {
    min-height: clamp(300px, 43svh, 390px);
    padding: 68px 16px 64px;
  }

  .calculators-title {
    font-size: clamp(30px, 7vw, 38px);
  }

  .calculators-description {
    font-size: 0.93rem;
    line-height: 1.5;
  }

  .topics-container {
    padding: 22px 0 34px;
  }

  .topic-group {
    margin-bottom: 30px;
  }

  .topic-group-title {
    font-size: 1.08rem;
  }

  .topic-group-description {
    font-size: 0.84rem;
  }

  .topics-cards {
    gap: 7px;
  }

  .topic-card {
    min-height: 72px;
    padding: 7px 5px;
    border-radius: 9px;
  }

  .topic-title {
    font-size: 0.64rem;
    line-height: 1.14;
  }
}

@media (max-width: 480px) {
  .content-container {
    padding: 0 12px 20px;
  }

  .calculators-section {
    min-height: clamp(285px, 42svh, 350px);
    padding: 60px 16px 56px;
  }

  .calculators-kicker {
    font-size: 0.62rem;
    padding: 4px 10px;
    margin-bottom: 10px;
  }

  .calculators-title {
    font-size: 28px;
  }

  .calculators-divider {
    width: 64px;
    margin: 12px auto 14px;
  }

  .calculators-description {
    font-size: 0.88rem;
    line-height: 1.45;
    max-width: 34ch;
  }

  .topics-container {
    padding: 18px 0 30px;
  }

  .topic-group-header {
    margin-bottom: 12px;
  }

  .topic-group-title {
    font-size: 1rem;
    margin-bottom: 5px;
  }

  .topic-group-description {
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .topics-cards {
    gap: 6px;
  }

  .topic-card {
    min-height: 68px;
    padding: 6px 4px;
  }

  .topic-title {
    font-size: 0.58rem;
    line-height: 1.12;
  }
}

@media (max-width: 360px) {
  .content-container {
    padding: 0 10px 18px;
  }

  .calculators-section {
    min-height: 270px;
    padding: 54px 14px 50px;
  }

  .calculators-title {
    font-size: 25px;
  }

  .calculators-description {
    font-size: 0.82rem;
  }

  .topic-card {
    min-height: 64px;
    padding: 5px 4px;
  }

  .topic-title {
    font-size: 0.54rem;
  }
}