:root {
  --bg: #fdf8f3;
  --surface: #ffffff;
  --surface-alt: #fef3e2;
  --text: #1f2937;
  --text-muted: #4b5563;
  --border: #e7d7c1;
  --primary: #ea580c;
  --primary-dark: #b45309;
  --accent: #f59e0b;
  --success: #15803d;
  --danger: #b91c1c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --max-width: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: #111827; line-height: 1.25; margin: 0 0 0.5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; color: var(--text-muted); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand h1 { margin: 0; font-size: 1.3rem; color: var(--primary-dark); }
.tagline { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

.site-nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-nav a {
  font-size: 0.95rem;
  color: var(--text);
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
}
.site-nav a:hover { background: var(--surface-alt); text-decoration: none; }

main { max-width: var(--max-width); margin: 0 auto; padding: 1.5rem; }

section { margin-bottom: 3rem; }

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.hero-text h2 { font-size: 2rem; }
.hero-text p { font-size: 1.05rem; }
.hero-actions { display: flex; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap; }

.hero-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.hero-card h3 { color: var(--primary-dark); }
.preview-list { list-style: none; padding: 0; margin: 0; }
.preview-list li { padding: 0.35rem 0; border-bottom: 1px dashed var(--border); font-size: 0.95rem; }
.preview-list li:last-child { border-bottom: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--surface-alt); }
.btn.small { padding: 0.4rem 0.75rem; font-size: 0.85rem; }

.builder-section { margin-top: 2rem; }
.section-note { font-size: 0.95rem; margin-bottom: 1.25rem; }

.builder-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.builder-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  background: var(--surface);
}

legend {
  font-weight: 700;
  color: var(--primary-dark);
  padding: 0 0.5rem;
  font-size: 0.95rem;
}

label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

label strong { color: var(--text); }

input[type="text"], input[type="tel"], input[type="date"], select, textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  margin-top: 0.25rem;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--primary);
  background: #fff;
}

.pet-entry {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--surface-alt);
}

.add-pet { margin-top: 0.5rem; }

.form-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.form-status {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--success);
  min-height: 1.25rem;
}
.form-status.error { color: var(--danger); }

.preview-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 5rem;
}

.preview-panel h2 { color: var(--primary-dark); }
.preview-controls { margin-bottom: 1rem; display: flex; justify-content: flex-end; }

.preview-output {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.9rem;
  max-height: 70vh;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  line-height: 1.45;
}

.preview-empty { color: var(--text-muted); font-style: italic; font-family: var(--font); }

.examples-section { margin-top: 2rem; }

.example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.example-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.example-card h3 { color: var(--primary-dark); }
.example-card ul { padding-left: 1.25rem; margin: 0.5rem 0 0; }
.example-card li { margin-bottom: 0.25rem; font-size: 0.95rem; }

.mistakes-block, .assumptions-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.mistakes-block h3, .assumptions-block h3 { color: var(--primary-dark); }
.mistakes-block ul, .assumptions-block ul { padding-left: 1.25rem; margin: 0; }
.mistakes-block li, .assumptions-block li { margin-bottom: 0.5rem; font-size: 0.95rem; }

.saved-section { margin-top: 2rem; }

.saved-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.saved-empty { color: var(--text-muted); font-style: italic; margin: 0; }

.saved-entry {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: var(--surface-alt);
}

.saved-entry h3 { margin-bottom: 0.5rem; color: var(--primary-dark); }

.saved-entry pre {
  white-space: pre-wrap;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
  max-height: 12rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
}

.saved-entry .saved-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.about-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.last-updated { font-size: 0.85rem; color: var(--text-muted); margin-top: 1rem; }

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer nav { display: flex; gap: 1rem; justify-content: center; margin: 0.5rem 0; flex-wrap: wrap; }
.footer-version { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .builder-grid { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .site-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .site-nav { width: 100%; justify-content: space-between; }
}

@media (max-width: 520px) {
  main { padding: 1rem; }
  .hero { padding: 1.25rem; }
  .hero-text h2 { font-size: 1.5rem; }
  .builder-form { padding: 1rem; }
  fieldset { padding: 0.75rem 1rem; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; }
}

@media print {
  body { background: #fff; }
  .site-header, .site-footer, .form-actions, .preview-controls, .btn, .about-section, .examples-section, .saved-section, .hero-card { display: none; }
  main { max-width: 100%; padding: 0; }
  .builder-grid { grid-template-columns: 1fr; }
  .builder-form { box-shadow: none; border: none; padding: 0; }
  fieldset { break-inside: avoid; }
  .preview-output { max-height: none; border: none; padding: 0; }
  .preview-panel { box-shadow: none; border: none; position: static; }
}



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