* { box-sizing: border-box; }

body {
  margin: 0;
  background: #f8f9fa;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1f2937;
  line-height: 1.6;
}

.container { max-width: 800px; margin: 0 auto; padding: 1.5rem; }
h1 { font-size: 2rem; font-weight: 700; margin: 0 0 1.5rem; color: #111827; }
h3 { font-size: 1.25rem; font-weight: 700; margin: 0 0 0.5rem; color: #111827; }

.spinner {
  width: 40px; height: 40px;
  border: 4px solid #e2e8f0; border-top-color: #2563eb;
  border-radius: 50%; animation: spin 0.7s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-screen { text-align: center; padding: 4rem 1.5rem; color: #64748b; }

.error-box {
  padding: 1rem 1.25rem; border-radius: 10px;
  background: #fef2f2; color: #991b1b;
  border: 1px solid #fecaca; margin-bottom: 1.5rem;
}
.error-box h3 { color: #991b1b; margin-bottom: 0.5rem; }

.card {
  background: #fff; padding: 1.5rem; border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 1.5rem;
}

.recipe-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem; margin-top: 1.5rem;
}

.recipe-card {
  background: #fff; padding: 1.5rem; border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.15s, box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.recipe-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }

.recipe-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.recipe-card-title { font-size: 1.125rem; font-weight: 700; color: #111827; margin: 0; }
.badge { font-size: 0.75rem; background: #e2e8f0; padding: 0.25rem 0.625rem; border-radius: 999px; color: #475569; white-space: nowrap; }
.recipe-card-desc { color: #64748b; line-height: 1.5; margin-bottom: 1rem; flex-grow: 1; }

.btn { cursor: pointer; border: none; border-radius: 8px; font-weight: 600; font-size: 0.95rem; transition: background 0.2s, opacity 0.2s; padding: 0.75rem 1.25rem; }
.btn-primary { background: #2563eb; color: #fff; width: 100%; }
.btn-primary:hover { background: #1d4ed8; }
.btn-back { background: none; color: #2563eb; font-weight: 600; padding: 0.5rem 0; margin-bottom: 1rem; font-size: 0.95rem; }
.btn-back:hover { color: #1d4ed8; }

.photo-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.photo-preview-box { width: 160px; height: 160px; border-radius: 12px; border: 2px solid #e2e8f0; overflow: hidden; display: none; }
.photo-preview-box img { width: 100%; height: 100%; object-fit: cover; }

.hidden { display: none !important; }
.hidden-file { display: none; }

.prediction-bar { margin-top: 1rem; padding: 0.75rem 1rem; background: #eff6ff; border-radius: 8px; font-size: 0.9rem; color: #475569; display: none; }
.prediction-bar strong { color: #2563eb; }

.label { display: block; font-size: 0.875rem; color: #64748b; margin-bottom: 0.5rem; font-weight: 600; }
input[type="text"] { width: 100%; border: 1px solid #cbd5e1; padding: 0.75rem 1rem; border-radius: 8px; font-size: 1rem; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
input[type="text"]:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
.hint { font-size: 0.75rem; color: #94a3b8; margin-top: 0.5rem; }

.recipe-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
.recipe-emoji { font-size: 3rem; line-height: 1; }
.recipe-title { font-size: 1.75rem; font-weight: 700; margin: 0 0 0.25rem; color: #111827; }
.recipe-meta { font-size: 0.875rem; color: #2563eb; margin: 0; }
.recipe-desc { font-size: 0.95rem; color: #64748b; margin: 0.5rem 0 0; }
.section-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 1rem; color: #111827; }

.ingredient-list { list-style: none; padding: 0; margin: 0; }
.ingredient-list li { padding: 0.5rem 0; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; }
.ingredient-list li:last-child { border-bottom: none; }
.ingredient-list .ing-name { color: #475569; }
.ingredient-list .ing-amount { color: #94a3b8; font-size: 0.875rem; }

.step-card { background: #fff; padding: 1.25rem; border-left: 4px solid #2563eb; border-radius: 0 8px 8px 0; box-shadow: 0 1px 4px rgba(0,0,0,0.05); margin-bottom: 1rem; }
.step-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.step-num { font-weight: 700; color: #2563eb; }
.step-duration { font-size: 0.8rem; color: #94a3b8; }
.step-title { font-weight: 600; color: #1f2937; margin: 0 0 0.5rem; }
.step-desc { color: #64748b; font-size: 0.95rem; margin: 0 0 0.5rem; }
.step-tip { font-size: 0.85rem; color: #64748b; font-style: italic; background: #f8fafc; padding: 0.5rem 0.75rem; border-radius: 6px; margin: 0; }

.no-results { grid-column: 1 / -1; text-align: center; color: #64748b; padding: 2.5rem 1rem; }
