/* ValveMap Styles */
:root {
  --green-900: #0d3b2e;
  --green-800: #135240;
  --green-700: #1a6b52;
  --green-600: #228b68;
  --green-500: #3ba87e;
  --green-400: #7fd4b8;
  --green-300: #b2e8d4;
  --green-200: #d4f5ea;
  --green-100: #edfbf6;
  --amber-500: #e8a838;
  --amber-100: #fef7e6;
  --red-500: #c0392b;
  --red-100: #fdedec;
  --gray-900: #1a1a2e;
  --gray-700: #3d3d56;
  --gray-500: #6b6b80;
  --gray-300: #c4c4d0;
  --gray-200: #e8e8ee;
  --gray-100: #f5f5f8;
  --white: #ffffff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  --max-width: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--gray-100);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green-700); text-decoration: none; }
a:hover, a:focus { color: var(--green-900); text-decoration: underline; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--green-900);
}
.logo:hover, .logo:focus { text-decoration: none; color: var(--green-700); }
.main-nav { display: flex; gap: 24px; }
.main-nav a { font-size: 0.9rem; font-weight: 500; color: var(--gray-700); }
.main-nav a:hover { color: var(--green-700); }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--green-100) 0%, var(--white) 100%);
  padding: 60px 0 50px;
}
.hero .container { display: flex; align-items: center; gap: 40px; }
.hero-content { flex: 1; }
.hero h1 { font-size: 2.4rem; line-height: 1.2; color: var(--green-900); margin-bottom: 16px; }
.hero-sub { font-size: 1.1rem; color: var(--gray-700); margin-bottom: 24px; max-width: 520px; }
.hero-meta { font-size: 0.85rem; color: var(--gray-500); margin-top: 12px; }
.hero-visual { flex-shrink: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font);
  gap: 6px;
}
.btn-primary { background: var(--green-700); color: var(--white); border-color: var(--green-700); }
.btn-primary:hover { background: var(--green-800); border-color: var(--green-800); color: var(--white); text-decoration: none; }
.btn-secondary { background: var(--white); color: var(--green-700); border-color: var(--green-700); }
.btn-secondary:hover { background: var(--green-100); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--gray-700); border-color: var(--gray-300); }
.btn-ghost:hover { background: var(--gray-200); text-decoration: none; }
.btn-danger { background: transparent; color: var(--red-500); border-color: var(--red-500); }
.btn-danger:hover { background: var(--red-100); text-decoration: none; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }

/* Planner */
.planner-section { padding: 50px 0; }
.planner-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.planner-panel { background: var(--white); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.planner-panel h2 { font-size: 1.4rem; color: var(--green-900); margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font);
  background: var(--white);
  transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(34,139,104,0.15);
}
.field-hint { font-size: 0.8rem; color: var(--gray-500); margin-top: 4px; }

/* Room Picker */
.room-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.room-chip {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
}
.room-chip:hover { border-color: var(--green-600); background: var(--green-100); }
.room-chip.active { background: var(--green-700); color: var(--white); border-color: var(--green-700); }
.room-chip.has-valves { border-color: var(--green-500); }
.room-chip.has-valves.active { background: var(--green-800); }

/* Valve Form */
.valve-form {
  background: var(--green-100);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-top: 16px;
}
.valve-form h3 { font-size: 1rem; color: var(--green-900); margin-bottom: 14px; }

/* Planner Actions */
.planner-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--gray-200); }

/* Preview Panel */
.preview-panel h2 { font-size: 1.4rem; color: var(--green-900); margin-bottom: 16px; }
.map-preview {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 400px;
  padding: 24px;
  overflow-y: auto;
  max-height: 600px;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  color: var(--gray-500);
  text-align: center;
  gap: 12px;
}
.empty-state p { max-width: 260px; }

/* Room in preview */
.preview-room {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}
.preview-room-header {
  background: var(--green-100);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--green-900);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.preview-valve {
  padding: 10px 16px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.preview-valve-info { flex: 1; }
.preview-valve-type { font-weight: 600; font-size: 0.9rem; }
.preview-valve-loc { font-size: 0.8rem; color: var(--gray-500); }
.preview-valve-notes { font-size: 0.8rem; color: var(--gray-700); margin-top: 2px; }
.valve-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-good { background: #d4edda; color: #155724; }
.badge-stiff { background: var(--amber-100); color: #856404; }
.badge-painted { background: var(--red-100); color: var(--red-500); }
.badge-corroded { background: var(--red-100); color: var(--red-500); }
.badge-unknown { background: var(--gray-200); color: var(--gray-700); }

/* Stats */
.stats-bar {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  padding: 10px 16px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
}

/* Layouts Section */
.layouts-section { padding: 50px 0; background: var(--white); }
.layouts-section h2 { font-size: 1.6rem; color: var(--green-900); margin-bottom: 8px; }
.section-intro { color: var(--gray-500); margin-bottom: 28px; }
.layout-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.layout-card {
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--gray-200);
}
.layout-card h3 { font-size: 1.1rem; color: var(--green-900); margin-bottom: 12px; }
.layout-card ul { list-style: none; }
.layout-card li { font-size: 0.9rem; padding: 4px 0; color: var(--gray-700); padding-left: 16px; position: relative; }
.layout-card li::before { content: ""; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--green-500); }

/* Guide Section */
.guide-section { padding: 50px 0; }
.guide-section h2 { font-size: 1.6rem; color: var(--green-900); margin-bottom: 28px; text-align: center; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.guide-step {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  position: relative;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green-700);
  color: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.guide-step h3 { font-size: 1rem; color: var(--green-900); margin-bottom: 8px; }
.guide-step p { font-size: 0.9rem; color: var(--gray-700); }

/* Mistakes Section */
.mistakes-section { padding: 50px 0; background: var(--white); }
.mistakes-section h2 { font-size: 1.6rem; color: var(--green-900); margin-bottom: 28px; text-align: center; }
.mistakes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.mistake-card {
  background: var(--red-100);
  border-radius: var(--radius);
  padding: 24px;
  border-left: 4px solid var(--red-500);
}
.mistake-card h3 { font-size: 1rem; color: var(--red-500); margin-bottom: 8px; }
.mistake-card p { font-size: 0.9rem; color: var(--gray-700); }

/* Maintenance Section */
.maintenance-section { padding: 50px 0; }
.maintenance-section h2 { font-size: 1.6rem; color: var(--green-900); margin-bottom: 12px; }
.maintenance-section > .container > p { color: var(--gray-700); margin-bottom: 20px; max-width: 700px; }
.maintenance-checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.maintenance-checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--gray-700);
  cursor: pointer;
}
.maintenance-checklist input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green-700);
}

/* FAQ Section */
.faq-section { padding: 50px 0; background: var(--white); }
.faq-section h2 { font-size: 1.6rem; color: var(--green-900); margin-bottom: 24px; text-align: center; }
.faq-section details {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}
.faq-section summary {
  padding: 14px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--gray-900);
  background: var(--gray-100);
}
.faq-section summary:hover { background: var(--green-100); }
.faq-section details[open] summary { background: var(--green-100); color: var(--green-900); }
.faq-section details p { padding: 14px 20px; font-size: 0.9rem; color: var(--gray-700); }

/* Footer */
.site-footer {
  background: var(--green-900);
  color: var(--green-300);
  padding: 40px 0 20px;
}
.footer-inner { display: flex; flex-direction: column; gap: 16px; }
.footer-brand .logo-text { color: var(--white); font-weight: 700; font-size: 1.1rem; }
.footer-brand p { font-size: 0.85rem; margin-top: 4px; }
.footer-brand a { color: var(--green-400); }
.footer-nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-nav a { color: var(--green-300); font-size: 0.85rem; }
.footer-nav a:hover { color: var(--white); }
.footer-copy { font-size: 0.8rem; opacity: 0.7; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--green-900);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Print styles */
@media print {
  .site-header, .site-footer, .planner-section, .guide-section, .mistakes-section, .maintenance-section, .faq-section, .hero { display: none !important; }
  .layouts-section { display: none !important; }
  .preview-panel { display: block !important; }
  .map-preview { box-shadow: none; border: 1px solid #ccc; max-height: none; overflow: visible; }
  body { background: white; }
}

/* Responsive */
@media (max-width: 900px) {
  .planner-grid { grid-template-columns: 1fr; }
  .layout-cards { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr 1fr; }
  .mistakes-grid { grid-template-columns: 1fr; }
  .hero .container { flex-direction: column; text-align: center; }
  .hero h1 { font-size: 1.8rem; }
  .hero-sub { margin: 0 auto 24px; }
  .main-nav { display: none; }
}
@media (max-width: 600px) {
  .guide-grid { grid-template-columns: 1fr; }
  .maintenance-checklist { grid-template-columns: 1fr; }
  .planner-actions { flex-direction: column; }
  .stats-bar { flex-direction: column; gap: 4px; }
}

/* Focus styles for accessibility */
*:focus-visible {
  outline: 2px solid var(--green-600);
  outline-offset: 2px;
}



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