/* Thrifted Toy Safety Inspector */
:root {
  --bg: #fdf8f3;
  --surface: #ffffff;
  --surface-2: #f6ede2;
  --ink: #2b2a28;
  --ink-soft: #5c5a55;
  --line: #e6dccc;
  --accent: #e07a3b;
  --accent-dark: #b85d27;
  --safe: #4a8c5c;
  --warn: #c98a2b;
  --danger: #b23b3b;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(43, 42, 40, 0.04), 0 8px 24px rgba(43, 42, 40, 0.06);
  --max: 1120px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
}

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.1rem;
}
.brand-mark { display: block; }
.site-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--accent-dark); border-bottom-color: var(--accent); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: center;
  padding: 48px 0 24px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--accent-dark);
  font-weight: 700;
  margin: 0 0 8px;
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.15;
  margin: 0 0 14px;
}
.lede {
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin: 0 0 20px;
  max-width: 52ch;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: center;
}
.hero-stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-dark);
  line-height: 1;
}
.stat-label { font-size: 0.85rem; color: var(--ink-soft); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--surface); color: var(--accent-dark); border-color: var(--accent); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }

/* Sections */
section { padding: 40px 0; }
.section-intro { color: var(--ink-soft); max-width: 60ch; margin: 0 0 24px; }
h2 { font-size: 1.6rem; margin: 0 0 8px; }
h3 { font-size: 1.1rem; margin: 0 0 8px; }

/* Inspector */
.inspector-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 24px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.setup-panel h3, .result-panel h3 { margin-bottom: 16px; }
.field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 0.92rem; }
.field input[type="text"],
.field input[type="number"],
.field select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.field small { color: var(--ink-soft); font-size: 0.85rem; }
.checkbox-row { flex-direction: row; align-items: center; gap: 10px; }
.checkbox-row label { font-weight: 500; }
.setup-actions { display: flex; gap: 10px; margin-top: 8px; }

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.score-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  min-width: 90px;
}
.score-num { font-size: 1.6rem; font-weight: 800; color: var(--accent-dark); line-height: 1; }
.score-label { font-size: 0.75rem; color: var(--ink-soft); }

.empty-state {
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  color: var(--ink-soft);
}

.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.check-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--surface);
}
.check-item.pass { border-left: 4px solid var(--safe); }
.check-item.fail { border-left: 4px solid var(--danger); }
.check-item.unsure { border-left: 4px solid var(--warn); }
.check-text { font-weight: 600; margin-bottom: 8px; display: block; }
.check-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.check-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--ink-soft);
}
.check-btn:hover { background: var(--surface-2); }
.check-btn.active-pass { background: var(--safe); color: #fff; border-color: var(--safe); }
.check-btn.active-fail { background: var(--danger); color: #fff; border-color: var(--danger); }
.check-btn.active-unsure { background: var(--warn); color: #fff; border-color: var(--warn); }

.warnings { margin-top: 20px; background: #fdf2f2; border: 1px solid #e9c5c5; border-radius: var(--radius-sm); padding: 16px; }
.warnings h4 { margin: 0 0 8px; color: var(--danger); }
.warnings ul { margin: 0; padding-left: 20px; }
.warnings li { margin-bottom: 6px; }

.cleaning { margin-top: 16px; background: #f3f7f4; border: 1px solid #c5dccb; border-radius: var(--radius-sm); padding: 16px; }
.cleaning h4 { margin: 0 0 8px; color: var(--safe); }
.cleaning ol { margin: 0; padding-left: 20px; }
.cleaning li { margin-bottom: 6px; }

.result-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

/* How it works */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  margin-bottom: 10px;
}
.step p { color: var(--ink-soft); margin: 0; font-size: 0.95rem; }
.scenario {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--line);
}
.scenario h3 { margin-top: 0; }
.scenario p { color: var(--ink-soft); margin: 0; }

/* Hazards */
.hazard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.hazard-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.hazard-card h3 { color: var(--accent-dark); }
.hazard-card p { color: var(--ink-soft); margin: 0; font-size: 0.95rem; }
.note {
  background: #fef9f0;
  border: 1px solid #e8d8b8;
  border-radius: var(--radius);
  padding: 18px;
}
.note h3 { margin-top: 0; color: var(--warn); }
.note p { color: var(--ink-soft); margin: 0; }

/* Cleaning table */
.cleaning-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.cleaning-table th, .cleaning-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.cleaning-table th { background: var(--surface-2); font-weight: 700; }
.cleaning-table tr:last-child td { border-bottom: none; }
.cleaning-table td { color: var(--ink-soft); }
.cleaning-table td:first-child { color: var(--ink); font-weight: 600; }

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 28px 0;
}
.footer-inner { display: flex; flex-direction: column; gap: 10px; }
.footer-note { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; }
.footer-links a:hover { color: var(--accent-dark); }
.footer-meta { margin: 0; color: var(--ink-soft); font-size: 0.8rem; }

/* About page */
.about-panel { max-width: 720px; margin: 0 auto; }
.about-panel p { color: var(--ink-soft); }

/* Responsive */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .inspector-grid { grid-template-columns: 1fr; }
  .hero-card { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .site-nav { gap: 12px; }
  .hero { padding-top: 28px; }
  .result-actions { flex-direction: column; }
  .result-actions .btn, .result-actions a { width: 100%; }
  .setup-actions { flex-direction: column; }
  .setup-actions .btn { width: 100%; }
}

@media print {
  .site-header, .site-footer, .hero, .how-it-works, .hazards, .cleaning-guide, .setup-panel, .result-actions { display: none; }
  .inspector-grid { grid-template-columns: 1fr; }
  .panel { box-shadow: none; border: none; padding: 0; }
  body { background: #fff; }
}



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