:root {
  --green: #16a34a;
  --green-dark: #15803d;
  --green-light: #dcfce7;
}

html { scroll-behavior: smooth; }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #111827;
  background: #ffffff;
}

.tab-rail::-webkit-scrollbar { display: none; }
.tab-rail { -ms-overflow-style: none; scrollbar-width: none; }

.tab-btn {
  color: #4b5563;
  transition: background 0.15s ease, color 0.15s ease;
}
.tab-btn:hover { background: #f3f4f6; }
.tab-btn.active {
  color: var(--green);
  background: var(--green-light);
}

.result-card {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.result-card.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.field-input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 1rem;
  color: #111827;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
}
.field-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}
select.field-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.4rem;
}

.btn-primary {
  width: 100%;
  background: var(--green);
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  transition: background 0.15s ease;
  cursor: pointer;
  border: 0;
}
.btn-primary:hover { background: var(--green-dark); }
.btn-primary:active { transform: translateY(1px); }

.faq-item + .faq-item { border-top: 1px solid #e5e7eb; }
.faq-q {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  font-weight: 600;
  color: #111827;
  cursor: pointer;
  background: transparent;
  border: 0;
}
.faq-icon { transition: transform 0.25s ease; color: #16a34a; flex-shrink: 0; }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-a-wrap {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-a { padding: 0 0 1rem 0; color: #4b5563; line-height: 1.6; }

.ad-slot {
  min-height: 90px;
  margin: 24px 0;
  display: block;
}
.ad-slot ins {
  display: block;
  min-height: 90px;
}

/* Sidebar ads — desktop only.
   Content max-width is 768px (max-w-3xl). At ≥1280px viewports there's
   enough room for a 160x600 skyscraper on each side with a 32px gutter.
   Below 1280px they hide entirely so the layout stays clean on tablet/mobile. */
.side-ad { display: none; }

@media (min-width: 1280px) {
  .side-ad {
    display: block;
    position: fixed;
    top: 96px;
    width: 160px;
    height: 600px;
    z-index: 10;
  }
  .side-ad ins { display: block; width: 160px; height: 600px; }
  .side-ad-left  { left: calc(50% - 576px); }
  .side-ad-right { left: calc(50% + 416px); }
}

/* Dev-only: outline empty ad slots so placement is visible on localhost.
   Stripped automatically in production — AdSense fills the <ins>, so :empty
   no longer matches. The .dev class is added by app.js only on localhost. */
html.dev .ad-slot ins:empty,
html.dev .side-ad ins:empty {
  border: 2px dashed #d1d5db;
  background: #f3f4f6;
  border-radius: 8px;
  position: relative;
}
html.dev .ad-slot ins:empty::before,
html.dev .side-ad ins:empty::before {
  content: "Ad slot (visible only on localhost)";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 13px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  pointer-events: none;
  text-align: center;
  padding: 0 8px;
}
html.dev .side-ad ins:empty::before { content: "Sidebar ad\A(localhost only)"; white-space: pre; }

.prose-page h2 { font-size: 1.25rem; font-weight: 700; color: #111827; margin-top: 1.75rem; margin-bottom: 0.5rem; }
.prose-page h3 { font-size: 1.05rem; font-weight: 600; color: #111827; margin-top: 1.25rem; margin-bottom: 0.25rem; }
.prose-page p { color: #374151; line-height: 1.7; margin-bottom: 0.75rem; }
.prose-page ul { list-style: disc; padding-left: 1.25rem; color: #374151; margin-bottom: 0.75rem; }
.prose-page ul li { margin-bottom: 0.25rem; }
.prose-page a { color: var(--green); text-decoration: underline; }
