:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #1a1d26;
  --muted: #5c6378;
  --border: #e6e9f2;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --accent: #7c3aed;
  --shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Noto Sans', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: linear-gradient(180deg, #eef1fa 0%, var(--bg) 28%, #f8f9fd 100%);
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration-skip-ink: auto;
}

a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 1000;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.brand__mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.nav-muted {
  font-size: 0.9rem;
  color: var(--muted);
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.hero {
  text-align: center;
  padding: 12px 0 32px;
}

.hero__title {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero__subtitle {
  margin: 0 auto;
  max-width: 640px;
  color: var(--muted);
  font-size: 1.05rem;
}

.calc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

@media (min-width: 960px) {
  .calc-layout {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 24px;
}

.card__title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.card__hint {
  margin: 0 0 18px;
  font-size: 0.9rem;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 520px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field--full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}

.field input,
.field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: #fafbff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(79, 70, 229, 0.55);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
  background: #fff;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.btn {
  appearance: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.35);
}

.btn--primary:hover {
  filter: brightness(1.03);
}

.btn--ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  border-color: #cfd6ea;
}

.form-errors {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.9rem;
}

.form-errors[hidden] {
  display: none !important;
}

.form-errors ul {
  margin: 0;
  padding-left: 18px;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 520px) {
  .results-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.stat {
  padding: 14px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
}

.stat--highlight {
  grid-column: 1 / -1;
  border-color: rgba(79, 70, 229, 0.35);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(124, 58, 237, 0.06));
}

.stat__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat__value {
  margin-top: 4px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat--highlight .stat__value {
  font-size: 1.65rem;
}

.section-block {
  margin-top: 28px;
}

.section-head {
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 520px;
}

thead th {
  text-align: left;
  padding: 12px 14px;
  background: #f3f4fb;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #eef0f7;
}

tbody tr:last-child td {
  border-bottom: none;
}

.toggle-row {
  margin-top: 14px;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn:hover {
  color: var(--primary-dark);
}

.article-card {
  padding: 26px 24px;
}

.article-card h2 {
  margin-top: 0;
}

.article-card h3 {
  margin-top: 22px;
  font-size: 1.05rem;
}

.article-card p {
  color: #3b4155;
}

.article-disclaimer {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
  background: #f5f6ff;
  color: var(--muted);
  font-size: 0.92rem;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--surface);
}

.faq-item h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.faq-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.ad-slot {
  margin: 22px 0;
}

.ad-slot__inner {
  border-radius: var(--radius-sm);
  border: 1px dashed #cfd6ea;
  background: #fafbff;
  min-height: 110px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
  user-select: none;
  pointer-events: none;
}

.ad-slot__hint {
  display: block;
  max-width: 36rem;
  margin: 0 auto;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #94a3b8;
  font-weight: 500;
}

.ad-slot__hint code {
  font-size: 0.85em;
  padding: 0 0.25em;
  border-radius: 4px;
  background: #eef1f8;
  color: #64748b;
}

.ad-slot__inner--live {
  border-style: solid;
  border-color: var(--border);
  background: #fff;
  pointer-events: auto;
  min-height: 100px;
}

.ad-slot__label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 6px;
}

.ad-slot__placeholder-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #cbd5e1;
}

.ad-slot ins.adsbygoogle {
  display: block !important;
  min-height: 90px;
  width: 100%;
  max-width: 100%;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
  margin-top: 40px;
}

.site-footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 36px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn {
    transition: none;
  }
}
