:root {
  --ic-red: #c31823;
  --ic-red-dark: #a0121c;
  --ic-text: #2a2a2a;
  --ic-muted: #6b6b6b;
  --ic-bg: #fff;
  --ic-bg-soft: #f7f7f7;
  --ic-border: #e6e6e6;
  --ic-card: #fff;
  --ic-header: #fff;
  --ic-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  --ic-radius: 12px;
  --ic-max: 1080px;
}

html[data-theme="dark"] {
  --ic-red: #e14b4b;
  --ic-red-dark: #c31823;
  --ic-text: #f2f2f2;
  --ic-muted: #b5b5b5;
  --ic-bg: #121212;
  --ic-bg-soft: #1a1a1a;
  --ic-border: #333;
  --ic-card: #1e1e1e;
  --ic-header: #181818;
  --ic-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body.site-body {
  font-family: Inter, "Segoe UI", sans-serif;
  color: var(--ic-text);
  background: var(--ic-bg);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--ic-red);
  text-decoration: none;
}

img {
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ic-header);
  border-bottom: 1px solid var(--ic-border);
}

.site-header__inner {
  max-width: var(--ic-max);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ic-text);
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 14px;
  white-space: nowrap;
}

.brand svg {
  width: 32px;
  height: 32px;
  display: block;
  color: var(--ic-red);
}

.search {
  position: relative;
  flex: 1;
  min-width: 0;
}

.site-header .search {
  flex: 1 1 220px;
  min-width: 140px;
}

.search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--ic-border);
  border-radius: 999px;
  padding: 0 42px 0 16px;
  font: inherit;
  background: var(--ic-bg);
  color: var(--ic-text);
}

.search input:focus {
  outline: 2px solid color-mix(in srgb, var(--ic-red) 35%, transparent);
  border-color: var(--ic-red);
}

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ic-muted);
  pointer-events: none;
}

.search-results {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--ic-card);
  border: 1px solid var(--ic-border);
  border-radius: 10px;
  box-shadow: var(--ic-shadow);
  overflow: hidden;
  z-index: 50;
}

.search-results.open {
  display: block;
}

.search-results a,
.search-results .empty {
  display: block;
  padding: 10px 14px;
  color: var(--ic-text);
}

.search-results a:hover {
  background: var(--ic-bg-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-wrap {
  position: relative;
}

.nav-btn,
.icon-btn {
  border: 0;
  background: transparent;
  color: var(--ic-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
}

.nav-btn:hover,
.icon-btn:hover {
  background: var(--ic-bg-soft);
}

.nav-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 280px;
  background: var(--ic-card);
  border: 1px solid var(--ic-border);
  border-radius: 10px;
  box-shadow: var(--ic-shadow);
  padding: 8px;
  z-index: 50;
}

.nav-menu.open {
  display: block;
}

.nav-menu a {
  display: block;
  padding: 8px 10px;
  color: var(--ic-text);
  border-radius: 8px;
}

.nav-menu a:hover {
  background: var(--ic-bg-soft);
}

.hero {
  text-align: center;
  padding: 56px 20px 28px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 56px);
  color: var(--ic-red);
  letter-spacing: -0.03em;
}

.hero p {
  max-width: 640px;
  margin: 12px auto 0;
  color: var(--ic-muted);
  font-size: 18px;
}

.hero p strong {
  color: var(--ic-red);
  font-weight: 700;
}

.hero-search {
  max-width: 560px;
  margin: 28px auto 0;
}

.category-grid {
  max-width: var(--ic-max);
  margin: 12px auto 0;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 12px 20px;
  background: var(--ic-card);
  border: 1px solid var(--ic-border);
  border-radius: var(--ic-radius);
  color: var(--ic-muted);
  text-align: center;
  min-height: 160px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.cat-card:hover {
  box-shadow: var(--ic-shadow);
  transform: translateY(-2px);
  color: var(--ic-text);
}

.cat-card svg {
  width: 56px;
  height: 56px;
  color: var(--ic-red);
}

.cat-card span {
  font-size: 15px;
}

.cta-wrap {
  text-align: center;
  padding: 28px 20px 48px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 280px;
  height: 52px;
  padding: 0 24px;
  background: var(--ic-red);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--ic-red-dark);
  color: #fff;
}

.section {
  max-width: var(--ic-max);
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.section h2 {
  margin: 0 0 8px;
  font-size: 32px;
}

.kicker {
  color: var(--ic-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.featured-calc {
  background: var(--ic-bg-soft);
  border-top: 1px solid var(--ic-border);
  border-bottom: 1px solid var(--ic-border);
}

.featured-calc h2 {
  color: var(--ic-text);
}

.calc-form {
  display: flex;
  gap: 0;
  margin: 20px 0 8px;
  max-width: 760px;
}

.calc-form input,
.field input,
.field select {
  flex: 1;
  height: 52px;
  border: 1px solid var(--ic-border);
  border-radius: 8px 0 0 8px;
  padding: 0 14px;
  font: inherit;
  background: var(--ic-card);
  color: var(--ic-text);
}

.calc-form button {
  width: 64px;
  border: 0;
  background: var(--ic-red);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
}

.calc-error {
  color: var(--ic-red);
  min-height: 1.4em;
}

.results {
  margin-top: 16px;
}

.results-primary {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 8px 0 20px;
}

.result-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.result-cols h3 {
  margin: 0 0 10px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  border-bottom: 1px solid var(--ic-border);
}

.popular-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.popular-col h3 {
  margin: 0 0 12px;
}

.popular-col a {
  display: flex;
  justify-content: space-between;
  color: var(--ic-text);
  padding: 8px 0;
  border-bottom: 1px solid var(--ic-border);
}

.popular-col a:hover {
  color: var(--ic-red);
}

.site-footer {
  background: var(--ic-bg-soft);
  border-top: 1px solid var(--ic-border);
  padding: 40px 20px;
}

.site-footer__inner {
  max-width: var(--ic-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.site-footer small {
  color: var(--ic-muted);
}

.calc-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 36px 20px 64px;
}

.calc-page h1 {
  margin: 0 0 8px;
  font-size: 40px;
}

.fields {
  display: grid;
  gap: 14px;
  margin: 24px 0;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input,
.field select {
  width: 100%;
  border-radius: 8px;
}

.crumb {
  color: var(--ic-muted);
  font-size: 14px;
  margin-bottom: 12px;
}

.crumb a {
  color: var(--ic-muted);
}

.list-page {
  max-width: var(--ic-max);
  margin: 0 auto;
  padding: 36px 20px 64px;
}

.list-page ul {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.list-page li a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--ic-border);
  color: var(--ic-text);
  font-weight: 600;
}

.list-page li a:hover {
  color: var(--ic-red);
}

.list-page li span {
  display: block;
  font-weight: 400;
  color: var(--ic-muted);
  font-size: 14px;
}

.seo-article {
  max-width: var(--ic-max);
  margin: 0 auto;
  padding: 12px 20px 48px;
}

.seo-article h2 {
  font-size: 28px;
  margin: 0 0 16px;
}

.seo-article p {
  margin: 0 0 14px;
  color: var(--ic-text);
  line-height: 1.7;
}

.legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 36px 20px 64px;
}

.legal-page h1 {
  margin: 0 0 8px;
  font-size: 40px;
}

.legal-page h2 {
  margin: 28px 0 10px;
  font-size: 22px;
}

.legal-page p,
.legal-page li {
  line-height: 1.7;
}

.legal-page ul {
  padding-left: 20px;
}

.contact-form {
  display: grid;
  gap: 12px;
  margin: 24px 0 32px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--ic-border);
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  background: var(--ic-card);
  color: var(--ic-text);
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-success {
  display: none;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ic-bg-soft);
  border: 1px solid var(--ic-border);
}

.site-footer__inner {
  grid-template-columns: 1.4fr 1fr 1fr;
}

.site-footer nav {
  display: grid;
  gap: 8px;
}

.site-footer a {
  color: var(--ic-text);
}

.site-footer a:hover {
  color: var(--ic-red);
}

.page-picker .seo-wrap,
.page-picker #site-footer {
  width: 100%;
  background: var(--ic-bg);
  color: var(--ic-text);
}

.search input,
.hero-search input,
.calc-form input,
.field input,
.field select,
.contact-form input,
.contact-form textarea {
  font-size: 16px;
}

.btn-primary {
  max-width: 100%;
}

.result-row strong,
.results-primary {
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .category-grid,
  .popular-grid,
  .site-footer__inner,
  .result-cols {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .site-header__inner {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }

  .brand span {
    display: inline;
    font-size: 12px;
  }

  .site-header .search {
    flex: 1 1 100%;
    min-width: 100%;
    order: 3;
  }

  .header-actions {
    margin-left: auto;
  }

  .nav-btn {
    font-size: 14px;
    padding: 8px 8px;
  }

  .hero {
    padding-top: 28px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero h1 {
    font-size: clamp(28px, 8vw, 40px);
  }

  .hero p {
    font-size: 16px;
  }

  .category-grid,
  .popular-grid,
  .site-footer__inner,
  .result-cols {
    grid-template-columns: 1fr;
  }

  .cat-card {
    min-height: 132px;
    padding: 20px 10px 16px;
  }

  .btn-primary {
    min-width: 0;
    width: 100%;
  }

  .calc-form {
    flex-direction: column;
  }

  .calc-form input,
  .calc-form button {
    width: 100%;
    border-radius: 8px;
  }

  .calc-form button {
    height: 48px;
    margin-top: 8px;
  }

  .results-primary {
    font-size: 28px;
  }

  .calc-page,
  .legal-page,
  .list-page {
    padding: 24px 16px 48px;
  }

  .calc-page h1,
  .legal-page h1,
  .list-page h1 {
    font-size: clamp(26px, 8vw, 36px);
  }

  .section h2,
  .seo-article h2 {
    font-size: 22px;
  }

  .seo-article,
  .section {
    padding-left: 16px;
    padding-right: 16px;
  }
}
