/* SoilBalance Garden pH Calculator */
:root {
  --primary: #2e7d32;
  --primary-dark: #1b5e20;
  --secondary: #8d6e63;
  --accent: #ff9800;
  --light: #f5f5f5;
  --dark: #333;
  --success: #4caf50;
  --danger: #f44336;
  --border: #ddd;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background: #fafafa;
  margin: 0;
}

header {
  background: var(--primary);
  color: white;
  padding: 1.5rem 1rem;
  text-align: center;
}

header h1 { margin: 0; font-size: 1.75rem; }
.tagline { margin: 0.25rem 0 0; opacity: 0.9; }

main { max-width: 900px; margin: 0 auto; padding: 1rem; }

section { background: white; margin-bottom: 1.5rem; padding: 1.25rem; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

h2 { margin-top: 0; color: var(--primary-dark); border-bottom: 2px solid var(--primary); padding-bottom: 0.5rem; }

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

.field label { display: block; font-weight: 500; margin-bottom: 0.25rem; }
.field input, .field select { width: 100%; padding: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 1rem; }

.crop-selector { margin: 1rem 0; }
.crop-selector select { width: 100%; padding: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius); }

button { background: var(--primary); color: white; border: none; padding: 0.75rem 1.5rem; border-radius: var(--radius); font-size: 1rem; cursor: pointer; margin: 0.5rem 0.25rem 0 0; }
button:hover { background: var(--primary-dark); }

.results { background: var(--light); padding: 1rem; border-radius: var(--radius); margin-top: 1rem; }
.results h3 { margin-top: 0; color: var(--primary); }
.hidden { display: none; }

.ph-chart { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.ph-chart th, .ph-chart td { padding: 0.5rem; text-align: left; border-bottom: 1px solid var(--border); }
.ph-chart th { background: var(--light); }

.history .empty-state { color: #666; font-style: italic; }

.history-item { background: var(--light); padding: 0.75rem; margin-bottom: 0.5rem; border-radius: var(--radius); border-left: 3px solid var(--primary); }

.guide ul { padding-left: 1.25rem; }
.guide li { margin-bottom: 0.5rem; }

guide h3 { color: var(--secondary); margin-top: 1.5rem; }

footer {
  text-align: center;
  padding: 1.5rem;
  color: #666;
  font-size: 0.9rem;
}
footer a { color: var(--primary); }

@media (max-width: 600px) {
  .input-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
  section { padding: 1rem; }
}

@media print {
  header, footer, .history, .guide { display: none; }
  main { padding: 0; }
  section { box-shadow: none; page-break-inside: avoid; }
}

.field:focus-within label { color: var(--primary); }
button:active { transform: scale(0.98); }
.results p { margin: 0.5rem 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;
}
