  :root {
  --bg: #f3f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --border: #d1d5db;
  --accent: #eaf2ff;
  --success: #e8f7ee;
  --success-border: #22c55e;
  --warning-bg: #fff7ed;
  --warning-border: #fdba74;
  --warning-text: #9a3412;
  --info-bg: #eef5ff;
  --info-border: #cfe0ff;
  --info-text: #1e3a8a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 20px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 24px;
}

.logo {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 18px;
}

h1 {
  margin-top: 0;
  margin-bottom: 8px;
  color: #0f172a;
}

p.subtitle {
  margin-top: 0;
  color: var(--muted);
  line-height: 1.5;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.field {
  background: #fafcff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 14px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  background: #fff;
  outline: none;
  font-family: inherit;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.buttons,
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: #e5e7eb;
  color: #111827;
}

.btn-secondary:hover {
  background: #d1d5db;
}

.results {
  margin-top: 24px;
  background: var(--accent);
  border: 1px solid #cfe0ff;
  border-radius: 18px;
  padding: 18px;
}

.results h2 {
  margin-top: 0;
  margin-bottom: 14px;
  color: #0f172a;
}

.result-list,
.output-grid {
  display: grid;
  gap: 10px;
}

.result-item,
.output-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.result-item:last-child,
.output-row:last-child {
  border-bottom: 0;
}

.result-item span:first-child,
.output-row span:first-child {
  color: var(--muted);
}

.result-item span:last-child,
.output-row span:last-child {
  font-weight: 700;
  color: #0f172a;
}

.note,
.info-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--success);
  border: 1px solid var(--success-border);
  color: #166534;
  font-size: 14px;
  line-height: 1.5;
}

.warning {
  background: var(--warning-bg);
  border-color: #f59e0b;
  color: #92400e;
}

.info-box {
  background: var(--info-bg);
  border-color: var(--info-border);
  color: var(--info-text);
}

.small-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

footer {
  margin-top: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding-bottom: 8px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.back-link {
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
}

.back-link:hover {
  text-decoration: underline;
}

.page-title {
  margin: 0 0 8px;
  font-size: 30px;
  color: #0f172a;
  line-height: 1.2;
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 15px;
}

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

.calc-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.section-title {
  margin: 0 0 14px;
  font-size: 22px;
  color: #0f172a;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.calc-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
}

.calc-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
}

.calc-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #0f172a;
}

.calc-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.category {
  margin-top: 22px;
  margin-bottom: 12px;
  font-size: 18px;
  color: var(--primary);
  font-weight: 700;
}

.hero {
  background: linear-gradient(135deg, #ffffff, #eef5ff);
  border: 1px solid #dbe7fb;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  margin-bottom: 22px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.15;
  text-align: center;
}

.hero p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
  font-size: 15px;
}

.hero-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.section {
  margin-top: 28px;
}

.section h2 {
  margin: 0 0 14px;
  font-size: 24px;
  color: #0f172a;
}

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.step {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.step-number {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 12px;
}

.step h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #0f172a;
}

.step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.search-wrap {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 220px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-size: 15px;
  outline: none;
  background: #fff;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.no-results {
  display: none;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
  border-radius: 14px;
  padding: 14px;
  font-size: 14px;
  line-height: 1.5;
  margin-top: 14px;
}

.ad-box {
  background: linear-gradient(135deg, #fff7ed, #fff);
  border: 1px solid var(--warning-border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.ad-badge {
  display: inline-block;
  background: #fb923c;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.ad-box h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #0f172a;
}

.ad-box p {
  margin: 0;
  color: #7c2d12;
  line-height: 1.6;
  font-size: 14px;
}

.ad-box .btn {
  margin-top: 14px;
  width: 100%;
}

.faq {
  display: grid;
  gap: 12px;
}

.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: #0f172a;
  list-style: none;
  outline: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--primary);
  font-weight: 700;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-content {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

@media (min-width: 640px) {
  .hero {
    padding: 26px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .calc-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .calc-layout {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

@media (min-width: 1024px) {
  .hero h1 {
    font-size: 46px;
  }

  .calc-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 700px) {
  body {
    padding: 12px;
  }

  .container {
    padding: 16px
  }

  .page-title {
    font-size: 26px;
  }

  .actions {
    flex-direction: column;
  }

  .actions .btn,
  .ad-box .btn {
    width: 100%;
  }

  .result-item,
  .output-row {
    flex-direction: column;
  }

  .result-item span:last-child,
  .output-row span:last-child {
    text-align: left;
  }
}