/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; color: #1b1b1b; background: #f8f9fa; line-height: 1.6; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -100%; left: 1rem; background: #2d6a4f; color: #fff; padding: 0.5rem 1rem; border-radius: 0 0 0.5rem 0.5rem; z-index: 100; text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 0; }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

/* === Header === */
.site-header { background: #fff; border-bottom: 1px solid #dee2e6; position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; }
.logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: #1b1b1b; }
.logo-text { font-size: 1.25rem; font-weight: 700; color: #2d6a4f; }
.site-nav { display: flex; gap: 1.25rem; }
.site-nav a { text-decoration: none; color: #495057; font-size: 0.9rem; font-weight: 500; padding: 0.25rem 0; border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s; }
.site-nav a:hover, .site-nav a:focus { color: #2d6a4f; border-bottom-color: #2d6a4f; }
.site-nav a[aria-current="page"] { color: #2d6a4f; border-bottom-color: #2d6a4f; }

/* === Hero === */
.hero { background: linear-gradient(135deg, #d8f3dc 0%, #b7e4c7 50%, #95d5b2 100%); padding: 3rem 0 2.5rem; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; color: #1b4332; line-height: 1.2; margin-bottom: 0.75rem; }
.hero-sub { font-size: 1.05rem; color: #2d6a4f; max-width: 600px; margin-bottom: 0.5rem; }
.last-updated { font-size: 0.8rem; color: #52796f; }

/* === Checker === */
.checker { padding: 2.5rem 0; }
.checker-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
@media (max-width: 800px) { .checker-layout { grid-template-columns: 1fr; } }

.control-group { border: none; margin-bottom: 1.5rem; }
.control-group legend { font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: #495057; margin-bottom: 0.5rem; }

.seg { display: flex; gap: 0.5rem; }
.seg-btn { flex: 1; padding: 0.6rem 1rem; border: 2px solid #adb5bd; border-radius: 0.5rem; background: #fff; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.seg-btn:hover { border-color: #2d6a4f; }
.seg-btn.active { background: #2d6a4f; color: #fff; border-color: #2d6a4f; }

select, input[type="text"] { width: 100%; padding: 0.65rem 0.75rem; border: 2px solid #ced4da; border-radius: 0.5rem; font-size: 0.95rem; background: #fff; color: #1b1b1b; transition: border-color 0.15s; }
select:focus, input[type="text"]:focus { outline: none; border-color: #2d6a4f; box-shadow: 0 0 0 3px rgba(45,106,79,0.15); }

.control-group label { display: block; font-size: 0.85rem; font-weight: 600; color: #495057; margin-bottom: 0.35rem; }

/* === Result Panel === */
.checker-result { background: #fff; border: 1px solid #dee2e6; border-radius: 0.75rem; padding: 1.5rem; min-height: 200px; position: sticky; top: 80px; }
.result-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 160px; color: #6c757d; text-align: center; gap: 0.75rem; }
.result-empty p { font-size: 0.95rem; }

.risk-badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 1rem; border-radius: 2rem; font-weight: 700; font-size: 0.9rem; margin-bottom: 0.75rem; }
.risk-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.risk-low { background: #d8f3dc; color: #1b4332; }
.risk-low .risk-dot { background: #40916c; }
.risk-medium { background: #fff3bf; color: #5c4800; }
.risk-medium .risk-dot { background: #f59f00; }
.risk-high { background: #ffe3e3; color: #8b0000; }
.risk-high .risk-dot { background: #e03131; }
.risk-danger { background: #fa5252; color: #fff; }
.risk-danger .risk-dot { background: #fff; }

.result-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; color: #1b1b1b; }
.result-section { margin-bottom: 1rem; }
.result-section h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: #868e96; margin-bottom: 0.3rem; }
.result-section p, .result-section li { font-size: 0.92rem; color: #343a40; }
.result-section ul { padding-left: 1.25rem; }
.result-section li { margin-bottom: 0.25rem; }

.result-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid #e9ecef; }
.btn { padding: 0.55rem 1.1rem; border-radius: 0.5rem; font-size: 0.88rem; font-weight: 600; cursor: pointer; border: 2px solid transparent; transition: all 0.15s; }
.btn-primary { background: #2d6a4f; color: #fff; border-color: #2d6a4f; }
.btn-primary:hover { background: #1b4332; border-color: #1b4332; }
.btn-secondary { background: #e9ecef; color: #343a40; border-color: #ced4da; }
.btn-secondary:hover { background: #dee2e6; }
.btn-ghost { background: transparent; color: #2d6a4f; border-color: #2d6a4f; }
.btn-ghost:hover { background: #d8f3dc; }

/* === Content Sections === */
section { padding: 2.5rem 0; }
section h2 { font-size: 1.4rem; font-weight: 700; color: #1b4332; margin-bottom: 1rem; }
section p { margin-bottom: 0.75rem; color: #343a40; font-size: 0.95rem; max-width: 70ch; }

.why-this-exists { background: #fff; border-top: 1px solid #dee2e6; border-bottom: 1px solid #dee2e6; }

.mistake-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; margin-top: 1.25rem; }
.mistake-card { background: #fff; border: 1px solid #e9ecef; border-radius: 0.75rem; padding: 1.25rem; border-left: 4px solid #f59f00; }
.mistake-card h3 { font-size: 1rem; font-weight: 700; color: #343a40; margin-bottom: 0.4rem; }
.mistake-card p { font-size: 0.9rem; color: #495057; }

/* === Table === */
.table-note { font-size: 0.85rem; color: #6c757d; margin-bottom: 0.75rem; }
.table-wrap { overflow-x: auto; border: 1px solid #dee2e6; border-radius: 0.5rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { background: #f1f3f5; text-align: left; padding: 0.65rem 0.75rem; font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: #495057; border-bottom: 2px solid #dee2e6; }
td { padding: 0.6rem 0.75rem; border-bottom: 1px solid #e9ecef; color: #343a40; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8f9fa; }

/* === Print Card === */
.print-card { border: 2px solid #2d6a4f; border-radius: 0.75rem; padding: 1.25rem; margin-top: 1rem; background: #fff; max-width: 480px; }
.print-card-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #dee2e6; padding-bottom: 0.5rem; margin-bottom: 0.75rem; font-size: 0.9rem; }
.print-card-body { font-size: 0.9rem; color: #343a40; }
.print-card-body p { margin-bottom: 0.5rem; }
.print-placeholder { color: #adb5bd; font-style: italic; }
.print-card-footer { display: flex; justify-content: space-between; border-top: 1px solid #dee2e6; padding-top: 0.5rem; margin-top: 0.75rem; font-size: 0.7rem; color: #adb5bd; }

/* === FAQ === */
.faq details { border: 1px solid #dee2e6; border-radius: 0.5rem; margin-bottom: 0.5rem; overflow: hidden; }
.faq summary { padding: 0.75rem 1rem; font-weight: 600; cursor: pointer; color: #2d6a4f; background: #f8f9fa; }
.faq summary:hover { background: #e9ecef; }
.faq details[open] summary { border-bottom: 1px solid #dee2e6; }
.faq details p { padding: 0.75rem 1rem; font-size: 0.92rem; color: #343a40; }

/* === Sources === */
.sources { background: #fff; border-top: 1px solid #dee2e6; }
.sources a { color: #2d6a4f; }

/* === Footer === */
.site-footer { background: #1b4332; color: #b7e4c7; padding: 2rem 0; }
.footer-inner { display: flex; flex-direction: column; gap: 1rem; }
.footer-brand { display: flex; flex-direction: column; gap: 0.25rem; }
.footer-brand strong { font-size: 1.1rem; color: #d8f3dc; }
.footer-brand span { font-size: 0.85rem; color: #95d5b2; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-links a { color: #95d5b2; text-decoration: none; font-size: 0.85rem; }
.footer-links a:hover { color: #d8f3dc; text-decoration: underline; }
.footer-note { font-size: 0.78rem; color: #52796f; }

/* === Print Styles === */
@media print {
  .site-header, .site-footer, .checker-controls, .result-actions, .hero-sub, .last-updated, .skip-link { display: none !important; }
  .checker-result { position: static; border: none; padding: 0; }
  body { background: #fff; font-size: 12pt; }
  .print-card { border: 2px solid #000; }
}

/* === Toast === */
.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; background: #1b4332; color: #d8f3dc; padding: 0.75rem 1.25rem; border-radius: 0.5rem; font-size: 0.88rem; font-weight: 600; z-index: 200; opacity: 0; transform: translateY(10px); transition: opacity 0.3s, transform 0.3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); }



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
