:root {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --surface-alt: #f0ece5;
  --text: #1f2530;
  --text-muted: #5c6370;
  --accent: #e85d3a;
  --accent-dark: #c94a2a;
  --border: #d9d3c7;
  --shadow-sm: 0 1px 2px rgba(31, 37, 48, 0.06);
  --shadow-md: 0 4px 14px rgba(31, 37, 48, 0.08);
  --radius: 10px;
  --radius-sm: 6px;
  --max-width: 960px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, 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;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.8rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.brand-icon { flex-shrink: 0; }
.brand-accent { color: var(--accent); }
.site-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { color: var(--accent); text-decoration: none; }

/* Hero */
.hero-section {
  background: linear-gradient(160deg, #1f2530 0%, #2c3345 60%, #3a4052 100%);
  color: #f2f0ec;
  padding: 4.5rem 1.25rem 5rem;
}
.hero-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.75rem;
}
.hero-section h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.2;
  margin: 0 0 1rem;
  font-weight: 700;
}
.hero-sub {
  font-size: 1.05rem;
  color: #c0c5ce;
  max-width: 520px;
  margin: 0 auto 2rem;
}
.hero-cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.hero-cta:hover { background: var(--accent-dark); text-decoration: none; }
.hero-note {
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: #8a909c;
}

/* Sections */
section { padding: 3.5rem 1.25rem; }
section:nth-child(odd) { background: var(--surface); }
section:nth-child(even) { background: var(--bg); }
section h2 {
  font-size: 1.55rem;
  margin: 0 0 0.6rem;
  line-height: 1.25;
}

/* Builder */
.builder-section { background: var(--surface) !important; }
.builder-inner { max-width: var(--max-width); margin: 0 auto; }
.builder-intro { margin-bottom: 1.75rem; max-width: 640px; }
.builder-intro p { color: var(--text-muted); margin: 0; }

.presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}
.preset-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.preset-btn:hover { border-color: var(--accent); color: var(--accent); }
.preset-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.signal-form { margin-bottom: 2rem; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.form-field {
  border: none;
  padding: 0;
  margin: 0;
}
.form-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-field select {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.95rem;
  color: var(--text);
  font-family: var(--font);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%235c6370' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}
.form-field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Result */
.result-area {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: none;
}
.result-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.result-header h3 { margin: 0; font-size: 1.15rem; }
.result-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.action-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); }

.plan-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}
.plan-step {
  display: flex;
  gap: 0.85rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}
.plan-step:last-child { border-bottom: none; }
.step-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  margin-top: 0.1rem;
}
.plan-step strong { display: block; font-size: 1rem; margin-bottom: 0.2rem; }
.step-why { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.plan-note {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Mistakes */
.mistakes-section { background: var(--bg) !important; }
.mistakes-inner { max-width: var(--max-width); margin: 0 auto; }
.mistakes-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.75rem;
}
.mistakes-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  font-size: 0.93rem;
  position: relative;
  padding-left: 1.75rem;
}
.mistakes-list li::before {
  content: '!';
  position: absolute;
  left: 0.75rem;
  top: 0.85rem;
  background: var(--accent);
  color: #fff;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}
.mistakes-list strong { color: var(--accent-dark); }

/* Reference */
.reference-section { background: var(--surface) !important; }
.reference-inner { max-width: var(--max-width); margin: 0 auto; }
.reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.ref-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.ref-card h4 {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  color: var(--accent-dark);
}
.ref-card ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.ref-card li { margin-bottom: 0.3rem; }

/* FAQ */
.faq-section { background: var(--bg) !important; }
.faq-inner { max-width: var(--max-width); margin: 0 auto; }
.faq-list { margin-top: 1.25rem; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin-bottom: 0.6rem;
}
.faq-item dt {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}
.faq-item dd {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Why */
.why-section { background: var(--surface) !important; }
.why-inner { max-width: var(--max-width); margin: 0 auto; }
.version-note {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Footer */
.site-footer {
  background: #1f2530;
  color: #c0c5ce;
  padding: 1.75rem 1.25rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
}
.footer-brand { display: flex; align-items: center; gap: 0.5rem; }
.footer-brand .brand-name { color: #f2f0ec; }
.footer-brand .brand-accent { color: var(--accent); }
.footer-dot { color: #5c6370; }
.footer-brand a { color: var(--accent); }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { color: #c0c5ce; }
.footer-links a:hover { color: var(--accent); }

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: #1f2530;
  color: #f2f0ec;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 200;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Print */
@media print {
  .site-header, .site-footer, .hero-section, .presets-row, .signal-form, .result-actions, .mistakes-section, .reference-section, .faq-section, .why-section { display: none !important; }
  .result-area { display: block !important; background: #fff; border: 2px solid #000; }
  .plan-step { break-inside: avoid; }
  body { background: #fff; }
}

/* Responsive */
@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .site-nav { gap: 0.85rem; }
  .hero-section { padding: 3rem 1rem 3.5rem; }
  section { padding: 2.5rem 1rem; }
  .result-area { padding: 1.25rem; }
  .form-grid { grid-template-columns: 1fr; }
  .reference-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}



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