* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #f3f4f6;
  color: #111827;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
}

.ad-banner-top {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 15px;
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px;
}

.nav {
  margin-bottom: 24px;
}

.nav a {
  color: #6b7280;
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.nav a:hover {
  color: #111827;
}

.header {
  margin-bottom: 28px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e5f2ff;
  color: #1d4ed8;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.logo-wordmark {
  font-weight: 700;
  letter-spacing: -0.06em;
}

.header h1 {
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.subtitle {
  color: #4b5563;
  font-size: 0.95rem;
  max-width: 560px;
}

/* Two-column inputs grid */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }
}

.variant-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: 24px;
}

.variant-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.variant-label.control {
  color: #6b7280;
}

.variant-label.variant {
  color: #1d4ed8;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 5px;
  font-size: 0.875rem;
  color: #374151;
}

input[type="number"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  background: #ffffff;
  color: #111827;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="number"]::placeholder {
  color: #9ca3af;
}

.rate-display {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 12px;
  text-align: center;
}

.rate-number {
  font-size: 1.4rem;
  font-weight: 700;
  color: #111827;
  display: block;
}

.input-error {
  font-size: 0.8rem;
  color: #ef4444;
  margin-top: 6px;
  min-height: 1em;
}

/* Calculate button */
.btn-calculate {
  width: 100%;
  padding: 12px;
  background: #1d4ed8;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 20px;
  transition: background 0.15s;
  font-family: inherit;
}

.btn-calculate:hover {
  background: #1e40af;
}

/* Results card */
.results-card {
  background: #fff;
  border-radius: 14px;
  border: 2px solid #e5e7eb;
  padding: 28px;
  text-align: center;
  margin-bottom: 20px;
  transition: border-color 0.3s;
}

.results-card.significant {
  border-color: #10b981;
}

.results-card.not-significant {
  border-color: #f59e0b;
}

.result-verdict {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.result-confidence {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 12px 0 4px;
}

.result-confidence.sig {
  color: #10b981;
}

.result-confidence.not-sig {
  color: #f59e0b;
}

.result-confidence-label {
  font-size: 0.8rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.result-meta {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.result-meta-item {
  text-align: center;
}

.result-meta-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #111827;
}

.result-meta-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 2px;
}

.threshold-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.threshold-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.threshold-pass {
  background: #dcfce7;
  color: #15803d;
}

.threshold-fail {
  background: #f3f4f6;
  color: #9ca3af;
}

/* Sample size note */
.sample-size-note {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 0.875rem;
  color: #92400e;
  margin-bottom: 20px;
}

.sample-size-note strong {
  color: #78350f;
}

/* FAQ accordion */
.faq {
  margin-top: 40px;
}

.faq-title {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 14px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.faq-question {
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #111827;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  user-select: none;
}

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

.faq-question::after {
  content: '+';
  font-size: 1.1rem;
  color: #9ca3af;
  flex-shrink: 0;
  line-height: 1;
}

details[open] > .faq-question::after {
  content: '−';
}

.faq-answer {
  padding: 12px 16px 14px;
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.65;
  border-top: 1px solid #f3f4f6;
}

/* Related tools */
.related-tools {
  margin-top: 32px;
}

.related-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.related-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.related-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.1);
  transform: translateY(-1px);
}

.related-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1d4ed8;
}

.related-desc {
  font-size: 0.82rem;
  color: #6b7280;
}

/* Bottom ad + footer */
.ad-banner-bottom {
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  padding: 20px;
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 32px;
}

.footer {
  margin-top: 12px;
  text-align: center;
  font-size: 0.78rem;
  color: #9ca3af;
}

@media (max-width: 640px) {
  .page {
    padding: 24px 16px;
  }

  .header h1 {
    font-size: 1.6rem;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .result-meta {
    gap: 20px;
  }
}
