:root {
  --bg: #f9fafb;
  --surface: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #1f2937;
  --accent-soft: #f3f4f6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}

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

a { color: inherit; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--accent-soft);
}
.brand-text { font-size: 17px; }
.brand-sub {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 2px;
}
.nav a:hover { color: var(--ink); }

main { padding-top: 32px; padding-bottom: 64px; }
section { margin-bottom: 56px; }
.section-head { max-width: 720px; margin-bottom: 24px; }
.section-head h2 {
  font-size: 24px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.section-head p { color: var(--muted); margin: 0; }

.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: center;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero h1 {
  font-size: 34px;
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.lead { color: var(--muted); font-size: 17px; margin: 0 0 18px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.hero-stats {
  list-style: none;
  display: flex;
  gap: 24px;
  padding: 0;
  margin: 0;
}
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 20px; }
.hero-stats span { color: var(--muted); font-size: 13px; }
.hero-art { display: flex; justify-content: center; }
.hero-svg { width: 100%; max-width: 320px; height: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: #111827; border-color: #111827; }
.btn-ghost { background: transparent; }

.planner-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  align-items: start;
}
.worksheet {
  display: grid;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.field-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin: 0;
}
.field-card legend {
  font-weight: 600;
  font-size: 14px;
  padding: 0 6px;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.row:last-child { margin-bottom: 0; }
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--ink);
}
label span { color: var(--muted); font-size: 13px; }
input[type="number"], select {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
}
input[type="number"]:focus, select:focus {
  outline: 2px solid #111827;
  outline-offset: 1px;
}
.slider-label {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.slider-label span { grid-column: 1 / -1; }
.slider-label input[type="range"] { grid-column: 1 / 2; }
.slider-label output {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 14px;
  padding: 2px 8px;
  background: var(--accent-soft);
  border-radius: 999px;
}
.toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.toggle input { width: 16px; height: 16px; accent-color: #111827; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-top: 4px;
}
.check input { width: 16px; height: 16px; accent-color: #111827; }
.preset-row { display: flex; gap: 8px; flex-wrap: wrap; }
.preset {
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}
.preset:hover { border-color: var(--ink); }
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.save-status {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  min-height: 18px;
}

.preview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 80px;
}
.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.preview-head h3 { margin: 0; font-size: 16px; }
.preview-caption { color: var(--muted); font-size: 13px; }
.preview-stage {
  background: #f9fafb;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 8px;
}
.stage { width: 100%; height: auto; display: block; }
.preview-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.preview-legend .sw {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}
.sw-hook { background: #1f2937; }
.sw-tray { background: #6b7280; }
.sw-rack { background: #9ca3af; }
.sw-bin { background: #d1d5db; }

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.scenario {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.scenario h3 { margin: 0 0 8px; font-size: 17px; }
.scenario p { color: var(--muted); margin: 0 0 10px; }
.scenario ul { padding-left: 18px; margin: 0 0 10px; }
.scenario li { margin-bottom: 4px; font-size: 14px; }
.scenario-tag {
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin: 0;
}

.checklist-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.check-list, .mistake-list {
  padding-left: 20px;
  margin: 0;
}
.check-list li, .mistake-list li {
  margin-bottom: 8px;
  font-size: 14px;
}
.checklist-side h3 { margin: 0 0 10px; font-size: 16px; }

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.note h3 { margin: 0 0 6px; font-size: 15px; }
.note p { color: var(--muted); margin: 0; font-size: 14px; }
.assumptions {
  background: var(--accent-soft);
  border-left: 3px solid var(--ink);
  border-radius: 6px;
  padding: 14px 16px;
}
.assumptions h3 { margin: 0 0 6px; font-size: 15px; }
.assumptions p { margin: 0; color: var(--ink); font-size: 14px; }

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 24px 0;
  margin-top: 32px;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.footer-row p { margin: 0; color: var(--muted); font-size: 13px; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}
.footer-links a:hover { color: var(--ink); }
.footer-meta { width: 100%; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 20px; }
  .hero h1 { font-size: 28px; }
  .planner-grid { grid-template-columns: 1fr; }
  .preview { position: static; }
  .scenario-grid { grid-template-columns: 1fr; }
  .checklist-grid { grid-template-columns: 1fr; }
  .notes-grid { grid-template-columns: 1fr; }
  .toggle-grid { grid-template-columns: repeat(2, 1fr); }
  .row { grid-template-columns: 1fr; }
  .nav { gap: 12px; }
  .nav a { font-size: 13px; }
  .brand-sub { display: none; }
}

@media print {
  body { background: #fff; }
  .site-header, .site-footer, .hero-actions, .actions, .preview-legend, .hero-art { display: none; }
  main { padding: 0; }
  section { margin-bottom: 24px; break-inside: avoid; }
  .worksheet, .scenario, .checklist-grid, .note, .assumptions { box-shadow: none; border: 1px solid #ccc; }
}



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