:root {
  --bg: #fdf8f2;
  --surface: #ffffff;
  --surface-alt: #f7f0e6;
  --border: #e4d9c7;
  --text: #2e2418;
  --text-muted: #6b5c48;
  --accent: #c0531f;
  --accent-dark: #9a3f14;
  --accent-light: #fbe4d2;
  --hot-1: #f9d5a6;
  --hot-2: #f2a964;
  --hot-3: #e07a35;
  --hot-4: #b5441a;
  --cool: #f3ecd8;
  --neutral: #e8e0d2;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(46, 36, 24, 0.06);
  --shadow-md: 0 4px 16px rgba(46, 36, 24, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
}
.brand-icon { width: 32px; height: 32px; color: var(--accent); }
.site-nav { display: flex; gap: 20px; }
.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s;
}
.site-nav a:hover { color: var(--accent); }

/* Hero */
.hero {
  padding: 72px 0 48px;
  background: linear-gradient(180deg, var(--surface-alt) 0%, var(--bg) 100%);
  text-align: center;
}
.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  margin: 0 0 16px;
  color: var(--text);
  letter-spacing: -0.02em;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat strong { font-size: 1.8rem; color: var(--accent); font-weight: 700; }
.stat span { font-size: 0.85rem; color: var(--text-muted); }

/* Section basics */
section { padding: 64px 0; }
section h2 {
  font-size: 1.75rem;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.section-intro {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 0 32px;
}

/* Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.step-num {
  position: absolute;
  top: -14px;
  left: 20px;
  background: var(--accent);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.step-card h3 { margin: 8px 0 8px; font-size: 1.05rem; }
.step-card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }
.step-visual {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.viz-label { font-weight: 600; margin-bottom: 4px; }
.viz-row { display: flex; gap: 4px; }
.viz-cell {
  width: 40px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-alt);
}

/* Results section */
.results-section { background: var(--surface-alt); }
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.results-header h2 { margin: 0; }
.results-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--surface-alt); border-color: var(--text-muted); }
.btn-ghost { background: transparent; }
.btn-subtle { background: var(--surface-alt); color: var(--text-muted); }

.mapper-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

.mapper-hint {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.oven-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.grid-row { display: flex; gap: 8px; }
.grid-cell {
  flex: 1;
  aspect-ratio: 1;
  min-height: 80px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--neutral);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: border-color 0.15s, transform 0.1s;
  position: relative;
  font-family: inherit;
}
.grid-cell:hover { border-color: var(--accent); transform: scale(1.02); }
.grid-cell:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.cell-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); }
.cell-indicator {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--neutral);
  border: 2px solid var(--border);
}

.grid-cell[data-level="1"] { background: var(--cool); }
.grid-cell[data-level="1"] .cell-indicator { background: var(--hot-1); border-color: var(--hot-2); }
.grid-cell[data-level="2"] { background: var(--hot-1); }
.grid-cell[data-level="2"] .cell-indicator { background: var(--hot-2); border-color: var(--hot-3); }
.grid-cell[data-level="3"] { background: var(--hot-2); }
.grid-cell[data-level="3"] .cell-indicator { background: var(--hot-3); border-color: var(--hot-4); }
.grid-cell[data-level="4"] { background: var(--hot-3); }
.grid-cell[data-level="4"] .cell-indicator { background: var(--hot-4); border-color: var(--accent-dark); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.legend-swatch.level-0 { background: var(--neutral); }
.legend-swatch.level-1 { background: var(--cool); }
.legend-swatch.level-2 { background: var(--hot-1); }
.legend-swatch.level-3 { background: var(--hot-2); }
.legend-swatch.level-4 { background: var(--hot-3); }

/* Results panel */
.results-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.results-panel h3 { margin: 0 0 16px; font-size: 1.05rem; }
.profile-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.profile-form label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}
.profile-form input,
.profile-form select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
}
.profile-form input:focus,
.profile-form select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.analysis-output {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 0.88rem;
  min-height: 120px;
}
.analysis-placeholder { color: var(--text-muted); margin: 0; }
.analysis-output p { margin: 0 0 8px; }
.analysis-output p:last-child { margin-bottom: 0; }
.analysis-output strong { color: var(--accent-dark); }

/* Print card */
.print-card { display: none; }
@media print {
  .site-header, .site-footer, .results-actions, .mapper-hint, .legend, .results-panel, .guides-section, .about-section, .troubleshoot-section, .hero { display: none !important; }
  .results-section { display: block !important; padding: 0; }
  .print-card { display: block !important; }
  .print-card-inner { border: 2px solid #000; padding: 24px; border-radius: 8px; }
  .print-card-inner h3 { margin: 0 0 8px; }
  .print-meta { color: #666; font-size: 0.85rem; margin: 0 0 16px; }
  .print-grid { display: grid; grid-template-columns: repeat(3, 60px); gap: 6px; margin-bottom: 16px; }
  .print-cell { width: 60px; height: 60px; border: 1px solid #000; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; }
  .print-note { font-size: 0.8rem; color: #666; margin: 0; }
}

/* Guides */
.guides-section { background: var(--surface); }
.guide-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.tab {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panel h3 { margin: 0 0 12px; font-size: 1.15rem; }
.tab-panel ul { margin: 0; padding-left: 20px; }
.tab-panel li { margin-bottom: 10px; color: var(--text-muted); font-size: 0.92rem; }
.tab-panel li strong { color: var(--text); }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.about-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.about-card h3 { margin: 0 0 10px; font-size: 1rem; }
.about-card p, .about-card li { font-size: 0.9rem; color: var(--text-muted); }
.about-card ul { margin: 0; padding-left: 18px; }
.about-card li { margin-bottom: 6px; }

/* Troubleshoot */
.troubleshoot-section { background: var(--surface-alt); }
.troubleshoot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.troubleshoot-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.troubleshoot-item h3 { margin: 0 0 8px; font-size: 0.98rem; }
.troubleshoot-item p { margin: 0; font-size: 0.88rem; color: var(--text-muted); }

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 32px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-brand { display: flex; flex-direction: column; gap: 4px; }
.footer-brand .brand-name { font-weight: 700; font-size: 1rem; }
.footer-tag { font-size: 0.82rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 16px; }
.footer-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--accent); }
.footer-meta { font-size: 0.78rem; color: var(--text-muted); margin: 0; }

/* Responsive */
@media (max-width: 768px) {
  .mapper-layout { grid-template-columns: 1fr; }
  .results-header { flex-direction: column; align-items: flex-start; }
  .hero-stats { gap: 24px; }
  .site-nav { gap: 12px; }
  .site-nav a { font-size: 0.82rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .grid-cell { min-height: 60px; }
  .cell-indicator { width: 18px; height: 18px; }
  .hero { padding: 48px 0 32px; }
  section { padding: 48px 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;
}
