/* Reset and base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #1e1e1e;
  background: #f9faf8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #dde5d9;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  color: #2d5a27;
}

.logo svg {
  flex-shrink: 0;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.main-nav a {
  text-decoration: none;
  color: #3d4f3a;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  border-bottom-color: #b33a2a;
  outline: none;
}

/* Main content */
main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  width: 100%;
}

/* Checker section */
.checker-section {
  background: #ffffff;
  border: 1px solid #dde5d9;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.checker-intro h1 {
  font-size: 1.8rem;
  color: #2d5a27;
  margin-bottom: 0.5rem;
}

.checker-subtitle {
  color: #4a5b45;
  font-size: 1.05rem;
  max-width: 650px;
}

.checker-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0;
}

.btn-secondary {
  background: #f0f4f0;
  border: 1px solid #c2d1be;
  color: #2d5a27;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:hover {
  background: #e2ece0;
  border-color: #a3b89e;
}

.btn-primary {
  background: #2d5a27;
  border: 1px solid #1f421b;
  color: #ffffff;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: #1f421b;
}

.checklist fieldset {
  border: 1px solid #e2ece0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  background: #fafcfa;
}

.checklist legend {
  font-weight: 700;
  color: #2d5a27;
  padding: 0 0.5rem;
  font-size: 1rem;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.6rem 0;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0f4f0;
}

.check-item:last-child {
  border-bottom: none;
}

.check-item input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: #b33a2a;
  cursor: pointer;
}

.check-item label {
  cursor: pointer;
  font-size: 0.95rem;
  color: #2e3d2b;
}

.results-panel {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: #fff9f7;
  border: 1px solid #f0d6cf;
  border-radius: 8px;
  min-height: 80px;
}

.empty-state {
  color: #6e7a68;
  font-style: italic;
}

.result-summary p {
  margin: 0.3rem 0;
}

.result-summary .flag-count {
  font-size: 1.8rem;
  font-weight: 700;
}

.result-summary .flag-count.high {
  color: #b33a2a;
}

.result-summary .flag-count.medium {
  color: #c47a1a;
}

.result-summary .flag-count.low {
  color: #2d5a27;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Comparison table */
.comparison-section {
  margin-bottom: 2rem;
}

.comparison-section h2 {
  font-size: 1.5rem;
  color: #2d5a27;
  margin-bottom: 1rem;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid #dde5d9;
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.95rem;
}

.comparison-table th {
  background: #f0f4f0;
  color: #2d5a27;
  font-weight: 700;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 2px solid #c2d1be;
}

.comparison-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #eef3ec;
  vertical-align: top;
}

.comparison-table tbody tr:hover {
  background: #fafcfa;
}

.comparison-table td:nth-child(3) {
  color: #b33a2a;
  font-weight: 500;
}

/* Scenario */
.scenario-section {
  margin-bottom: 2rem;
}

.scenario-section h2 {
  font-size: 1.5rem;
  color: #2d5a27;
  margin-bottom: 1rem;
}

.scenario-card {
  background: #ffffff;
  border: 1px solid #dde5d9;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  font-size: 0.98rem;
  line-height: 1.7;
}

.scenario-moral {
  margin-top: 0.75rem;
  font-weight: 600;
  color: #2d5a27;
  background: #f0f4f0;
  padding: 0.5rem 1rem;
  border-radius: 4px;
}

/* Harm reduction */
.harm-section {
  margin-bottom: 2rem;
}

.harm-section h2 {
  font-size: 1.5rem;
  color: #2d5a27;
  margin-bottom: 1rem;
}

.harm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.harm-card {
  background: #ffffff;
  border: 1px solid #dde5d9;
  border-radius: 8px;
  padding: 1.25rem;
}

.harm-card h3 {
  font-size: 1.1rem;
  color: #2d5a27;
  margin-bottom: 0.5rem;
}

.harm-card p {
  font-size: 0.93rem;
  color: #3d4f3a;
}

/* Supporting content */
.supporting-section {
  margin-bottom: 2rem;
}

.supporting-section h2 {
  font-size: 1.5rem;
  color: #2d5a27;
  margin-bottom: 1rem;
}

.supporting-content {
  background: #ffffff;
  border: 1px solid #dde5d9;
  border-radius: 8px;
  padding: 1.5rem;
}

.supporting-content h3 {
  font-size: 1.15rem;
  color: #2d5a27;
  margin: 1.25rem 0 0.5rem;
}

.supporting-content p {
  margin-bottom: 0.9rem;
  font-size: 0.98rem;
  color: #2e3d2b;
  line-height: 1.7;
}

/* Footer */
.site-footer {
  background: #ffffff;
  border-top: 1px solid #dde5d9;
  padding: 1.5rem 1.25rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.9rem;
  color: #5a6b54;
}

.footer-inner p {
  margin-bottom: 0.5rem;
}

.footer-inner a {
  color: #2d5a27;
  text-decoration: underline;
  font-weight: 500;
}

.footer-inner nav {
  margin-top: 0.75rem;
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-inner nav a {
  text-decoration: none;
  color: #4a5b45;
}

.footer-inner nav a:hover {
  text-decoration: underline;
}

.ecosystem-link {
  font-size: 0.85rem;
  color: #6e7a68;
}

/* Responsive */
@media (max-width: 700px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .main-nav ul {
    gap: 0.75rem;
  }

  .checker-container {
    padding: 0;
  }

  .checker-section {
    padding: 1rem;
  }

  .checklist fieldset {
    padding: 0.75rem;
  }

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

  .comparison-table {
    font-size: 0.85rem;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 0.5rem 0.65rem;
  }
}

/* Print styles */
@media print {
  .site-header,
  .site-footer,
  .checker-controls,
  .result-actions {
    display: none;
  }

  body {
    background: #ffffff;
    color: #000;
  }

  .checker-section,
  .comparison-section,
  .scenario-section,
  .harm-section,
  .supporting-section {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}



/* 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;
}
