/* HabitForge Styles */
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; color: #333; background: #f8f9fa min-height: 100vh; }
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
.site-header, .site-footer { background: #fff; border-bottom: 1px solid #e5e5e5; }
.site-footer { border-top: 1px solid #e5e5e5; border-bottom: none; }
.header-flex { display: flex; justify-content: space-between; align-items: center; }
.site-header h1 { font-size: 1.75rem; margin: 0; }
nav a { margin-left: 1.5rem; text-decoration: none; color: #666; font-size: 0.9rem; }
nav a:hover { color: #333; }
.hero-section { text-align: center; margin-bottom: 2rem; }
.hero-section h2 { font-size: 2rem; margin: 0 0 0.5rem; }
.hero-section p { color: #666; margin: 0 0 1.5rem; }
.controls-top { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.primary-btn, .secondary-btn, .submit-btn, .cancel-btn, .danger-btn { padding: 0.75rem 1.5rem; border: none; border-radius: 6px; cursor: pointer; font-size: 1rem; }
.primary-btn { background: #4a90e2; color: white; }
.primary-btn:hover { background: #357abd; }
.secondary-btn { background: #f0f0f0; color: #333; }
.secondary-btn:hover { background: #e0e0e0; }
.danger-btn { background: #d32f2f; color: white; }
.danger-btn:hover { background: #b71c1c; }
.habit-form { display: grid; gap: 1rem; max-width: 400px; margin: 1rem auto; padding: 1.5rem; background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.form-group { display: flex; flex-direction: column; }
.form-group label { margin-bottom: 0.5rem; font-weight: 500; }
.form-group input { padding: 0.75rem; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; }
.submit-btn { width: 100%; }
.cancel-btn { width: 100%; background: #f0f0f0; }
.presets-section { margin: 2rem 0; }
.presets-section h3 { font-size: 1.25rem; margin-bottom: 1rem; }
.preset-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.preset-card { background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; padding: 1rem; cursor: pointer; transition: all 0.2s; text-align: left; }
.preset-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.preset-icon { width: 40px; height: 40px; margin-bottom: 0.5rem; }
.preset-card span { font-weight: 500; display: block; margin-bottom: 0.25rem; }
.preset-card small { color: #666; }
.habits-section { margin: 2rem 0; }
.habits-section h3 { font-size: 1.25rem; margin-bottom: 1rem; }
.habits-list { background: #fff; border-radius: 8px; padding: 1rem; margin-bottom: 1rem; min-height: 150px; }
.habit-item { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border-bottom: 1px solid #f0f0f0; }
.habit-item:last-child { border-bottom: none; }
.habit-info { flex: 1; }
.habit-name { font-weight: 500; margin: 0 0 0.25rem; }
.streak-counter { display: inline-block; background: #ffeb3b; color: #333; padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.85rem; cursor: pointer; }
.streak-counter:hover { background: #fdd835; }
.habit-checkbox { width: 18px; height: 18px; cursor: pointer; }
.empty-state { text-align: center; padding: 2rem; color: #666; }
.empty-icon { width: 48px; height: 48px; margin-bottom: 1rem; opacity: 0.5; }
.habits-controls { display: flex; gap: 1rem; justify-content: flex-end; }
.stats-section { margin: 2rem 0; }
.stats-section h3 { font-size: 1.25rem; margin-bottom: 1rem; }
.stats-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 2rem; }
.stat-card { background: #fff; padding: 1.5rem; border-radius: 8px; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.stat-value { font-size: 2rem; font-weight: bold; color: #4a90e2; }
.stat-label { font-size: 0.85rem; color: #666; margin-top: 0.25rem; }
.progress-chart { background: #fff; padding: 1.5rem; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.chart-title { font-size: 1rem; margin-bottom: 1rem; color: #666; }
.chart-bars { display: flex; justify-content: space-between; align-items: flex-end; height: 120px; gap: 0.5rem; }
.bar-group { display: flex; flex-direction: column; align-items: center; }
.bar-label { font-size: 0.75rem; color: #999; margin-bottom: 0.25rem; }
.bar-value { width: 20px; background: #4a90e2; border-radius: 3px 3px 0 0; transition: height 0.3s; }
.how-it-works { margin: 2rem 0; }
.how-it-works h2 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.work-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.work-step { background: #fff; padding: 1.5rem; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); text-align: center; }
.step-number { width: 30px; height: 30px; background: #4a90e2; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; margin: 0 auto 0.75rem; }
.tips-section { margin: 2rem 0; }
.tips-section h2 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.tips-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.tip-card { background: #fff; padding: 1.5rem; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.tip-card h3 { margin-top: 0; font-size: 1.1rem; }
.faq-section { margin: 2rem 0; padding-top: 1.5rem; border-top: 1px solid #e5e5e5; }
.faq-section h2 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.faq-item { margin-bottom: 1.5rem; }
.faq-item h3 { font-size: 1rem; margin: 0 0 0.5rem; }
.footer-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); padding: 2rem 0; }
.footer-brand h3 { margin: 0 0 0.5rem; }
.footer-nav a { display: block; margin-bottom: 0.5rem; }
.footer-note p { font-size: 0.85rem; color: #999; margin: 0; }
.hidden { display: none !important; }
@media (max-width: 768px) { .container { padding: 1rem; } .header-flex { flex-direction: column; gap: 1rem; text-align: center; } nav a { margin-left: 0; } .controls-top { flex-direction: column; } .habit-form { padding: 1rem; } .stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr; } .header-flex { flex-direction: column; } }



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