/* FermentFire Styles */
:root {
  --bg: #1a1210;
  --bg-card: #231a16;
  --bg-sidebar: #1e1512;
  --bg-input: #2c2018;
  --border: #3d2e24;
  --border-light: #4a382c;
  --text: #f0e6dc;
  --text-muted: #a89080;
  --text-dim: #7a6558;
  --accent: #e74c3c;
  --accent-hover: #c0392b;
  --accent-light: #ff6b5a;
  --success: #27ae60;
  --success-light: #2ecc71;
  --warning: #f39c12;
  --danger: #e74c3c;
  --info: #3498db;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  --transition: 0.2s ease;
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 16px; }

a { color: var(--accent-light); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
}
.logo:hover, .logo:focus { text-decoration: none; }
.logo-icon { flex-shrink: 0; }
.site-nav { display: flex; gap: 20px; }
.site-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.site-nav a:hover, .site-nav a:focus {
  color: var(--text);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

/* App Shell */
.app-shell {
  display: flex;
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Sidebar */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
  overflow-y: auto;
}
.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-header h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.batch-list { flex: 1; overflow-y: auto; padding: 8px; }
.batch-item {
  padding: 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 4px;
  border: 1px solid transparent;
}
.batch-item:hover { background: var(--bg-input); }
.batch-item.active {
  background: var(--bg-input);
  border-color: var(--accent);
}
.batch-item-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.batch-item-meta { font-size: 0.75rem; color: var(--text-dim); }
.batch-item-progress { font-size: 0.75rem; color: var(--success); margin-top: 4px; }
.empty-state { padding: 24px 16px; text-align: center; color: var(--text-dim); font-size: 0.85rem; }
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  min-width: 0;
}

/* Hero */
.hero-section { margin-bottom: 24px; }
.hero-content h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent-light), var(--warning));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub { color: var(--text-muted); font-size: 1rem; max-width: 600px; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}
.card h2 { font-size: 1.2rem; margin-bottom: 16px; }

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.form-group input,
.form-group select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: var(--font);
  transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(231,76,60,0.15);
}
.form-group input::placeholder { color: var(--text-dim); }
.field-hint { font-size: 0.75rem; color: var(--text-dim); }
.form-actions { display: flex; gap: 12px; align-items: center; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover, .btn:focus { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover, .btn-primary:focus { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover, .btn-ghost:focus { background: var(--bg-input); color: var(--text); border-color: var(--border-light); }
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover, .btn-danger:focus { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Timeline */
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.timeline-header h2 { font-size: 1.3rem; margin-bottom: 4px; }
.timeline-meta { color: var(--text-muted); font-size: 0.85rem; }
.timeline-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.progress-bar {
  background: var(--bg-input);
  border-radius: var(--radius);
  height: 32px;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.progress-fill {
  background: linear-gradient(90deg, var(--accent), var(--warning));
  height: 100%;
  transition: width 0.5s ease;
  border-radius: var(--radius) 0 0 var(--radius);
}
.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.timeline-card:hover { border-color: var(--border-light); transform: translateY(-1px); }
.timeline-card.completed { border-color: var(--success); }
.timeline-card.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.timeline-card.future { opacity: 0.6; }
.timeline-card-day {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.timeline-card.current .timeline-card-day { color: var(--accent-light); }
.timeline-card.completed .timeline-card-day { color: var(--success); }
.timeline-card-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.timeline-card-desc { font-size: 0.8rem; color: var(--text-muted); }
.timeline-card-logged {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--success);
}
.timeline-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
}
.badge-check { background: rgba(39,174,96,0.2); color: var(--success); }
.badge-alert { background: rgba(243,156,18,0.2); color: var(--warning); }
.badge-info { background: rgba(52,152,219,0.2); color: var(--info); }

/* Compare */
.section-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }
.compare-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.compare-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.9rem;
  min-width: 200px;
}
.compare-select:focus { outline: none; border-color: var(--accent); }
.compare-results { overflow-x: auto; }
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.compare-table th, .compare-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.compare-table th { color: var(--text-muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; }
.compare-table tr:hover td { background: var(--bg-input); }

/* Guide */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.guide-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.guide-card h3 { font-size: 1rem; margin-bottom: 8px; color: var(--accent-light); }
.guide-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.7; }

/* FAQ */
.faq-list dt {
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 16px;
  margin-bottom: 4px;
}
.faq-list dd {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-left: 0;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.1rem; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
  max-width: 320px;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--info); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.footer-nav { display: flex; gap: 16px; }
.footer-nav a { color: var(--text-dim); }
.footer-nav a:hover { color: var(--text-muted); }

/* Print */
@media print {
  .site-header, .sidebar, .site-footer, .timeline-actions, .btn, .modal-overlay, .toast-container { display: none !important; }
  .app-shell { display: block; }
  .main-content { padding: 0; }
  body { background: #fff; color: #000; }
  .card { border: 1px solid #ccc; background: #fff; }
  .timeline-card { break-inside: avoid; }
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -280px;
    top: 56px;
    height: calc(100vh - 56px);
    z-index: 150;
    transition: left 0.3s ease;
    width: 260px;
  }
  .sidebar.open { left: 0; }
  .main-content { padding: 16px; }
  .hero-content h1 { font-size: 1.4rem; }
  .form-grid { grid-template-columns: 1fr; }
  .timeline-header { flex-direction: column; }
  .compare-controls { flex-direction: column; }
  .compare-select { width: 100%; }
  .header-inner { padding: 0 12px; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar { width: 220px; min-width: 220px; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--accent);
  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;
}
