* { box-sizing: border-box; }

body {
  margin: 0;
  background: #1B1A16;
  background-image:
    radial-gradient(circle at 15% 10%, rgba(232,185,74,0.06), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(107,143,78,0.06), transparent 40%);
  font-family: 'Inter', sans-serif;
  color: #EFE6CC;
}

.app-root {
  min-height: 100vh;
  padding: 32px 16px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero {
  width: 100%;
  max-width: 480px;
  text-align: center;
  margin-bottom: 28px;
}

.hero-eyebrow {
  font-family: 'Courier Prime', monospace;
  letter-spacing: 0.25em;
  font-size: 11px;
  color: #B23A2E;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hero h1 {
  font-family: 'Courier Prime', monospace;
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: #F5EFDF;
}

.hero p {
  font-size: 14.5px;
  color: #A79E88;
  line-height: 1.5;
  margin: 0 0 14px;
  max-width: 380px;
  margin-inline: auto;
}

.edit-profile-link {
  background: none;
  border: 1px dashed #4A4535;
  color: #E8B94A;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
}
.edit-profile-link:hover { border-color: #E8B94A; }
.edit-profile-link span { color: #F5EFDF; }

.upload-desk {
  width: 100%;
  max-width: 480px;
  background: #221F19;
  border: 1px solid #3A362B;
  border-radius: 14px;
  padding: 28px;
}

.desk-frame {
  border: 1.5px dashed #4A4535;
  border-radius: 10px;
  padding: 36px 20px;
  text-align: center;
}

.preview-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}

.preview-wrap img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
  filter: sepia(0.08) contrast(1.02);
}

.scan-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(27,26,22,0.85) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 16px;
}

.scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #E8B94A, transparent);
  animation: sweep 1.8s ease-in-out infinite;
  box-shadow: 0 0 12px 1px rgba(232,185,74,0.7);
}

@keyframes sweep {
  0% { top: 4%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 94%; opacity: 0; }
}

.loading-tag {
  font-family: 'Courier Prime', monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: #F5EFDF;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(27,26,22,0.7);
  padding: 6px 12px;
  border-radius: 20px;
}

.icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #2C2820;
  border: 1px solid #4A4535;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #E8B94A;
}

.desk-frame h3 {
  font-family: 'Courier Prime', monospace;
  font-size: 15px;
  margin: 0 0 6px;
  color: #F5EFDF;
  font-weight: 700;
}

.desk-frame p.hint {
  font-size: 13px;
  color: #8A8270;
  margin: 0 0 20px;
}

.btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: transform 0.12s ease, background 0.15s ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary { background: #E8B94A; color: #1B1A16; }
.btn-primary:hover { background: #F0C766; }

.btn-ghost { background: transparent; color: #EFE6CC; border: 1px solid #4A4535; }
.btn-ghost:hover { border-color: #6B8F4E; color: #6B8F4E; }

.error-banner {
  margin-top: 14px;
  background: rgba(178,58,46,0.12);
  border: 1px solid rgba(178,58,46,0.4);
  color: #E39B8F;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  text-align: left;
}

.unidentified-banner {
  margin-top: 14px;
  background: rgba(232,185,74,0.08);
  border: 1px solid rgba(232,185,74,0.3);
  color: #E8B94A;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  text-align: left;
}

.footnote {
  max-width: 480px;
  text-align: center;
  font-size: 11px;
  color: #6B6350;
  margin-top: 24px;
  line-height: 1.5;
}

input[type="file"] { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* Profile modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,14,11,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  background: #F5EFDF;
  color: #2A2620;
  border-radius: 14px;
  padding: 24px;
  animation: cardIn 0.35s cubic-bezier(0.16,1,0.3,1);
}

.modal-card h2 {
  font-family: 'Courier Prime', monospace;
  font-size: 19px;
  margin: 0 0 8px;
}

.modal-sub {
  font-size: 12.5px;
  color: #6B6350;
  line-height: 1.5;
  margin: 0 0 18px;
}

.modal-label {
  display: block;
  font-family: 'Courier Prime', monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #B23A2E;
  margin-bottom: 6px;
}

.modal-select {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #D8CFB4;
  background: #fff;
  color: #2A2620;
  margin-bottom: 16px;
}

.modal-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.modal-btn-row .btn { flex: 1; justify-content: center; }
.modal-btn-row .btn-ghost { border-color: #D8CFB4; color: #6B6350; }
.modal-btn-row .btn-ghost:hover { border-color: #B23A2E; color: #B23A2E; }

/* Passport card */
.passport-card {
  width: 100%;
  max-width: 480px;
  background: #F5EFDF;
  color: #2A2620;
  border-radius: 14px;
  overflow: hidden;
  margin-top: 24px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.6);
  animation: cardIn 0.5s cubic-bezier(0.16,1,0.3,1);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.passport-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #2A2620;
  color: #E8B94A;
  font-family: 'Courier Prime', monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  padding: 8px 18px;
}

.serial { color: #8A8270; letter-spacing: 0.08em; }

.passport-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 20px 20px 14px;
  position: relative;
}

.thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.header-text { flex: 1; min-width: 0; }

.header-text h2 {
  font-family: 'Courier Prime', monospace;
  font-size: 20px;
  margin: 0 0 4px;
  line-height: 1.2;
}

.description { font-size: 12.5px; color: #6B6350; margin: 0; line-height: 1.4; }

.stamp-badge {
  position: absolute;
  top: 14px;
  right: 18px;
  border: 2px solid #B23A2E;
  color: #B23A2E;
  font-family: 'Courier Prime', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 7px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.85;
}

/* Verdict banner — the traffic-light health call */
.verdict-banner {
  margin: 0 20px 16px;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid;
}

.verdict-banner.tone-good { background: rgba(107,143,78,0.12); border-color: rgba(107,143,78,0.45); }
.verdict-banner.tone-moderate { background: rgba(232,185,74,0.14); border-color: rgba(232,185,74,0.5); }
.verdict-banner.tone-occasional { background: rgba(178,58,46,0.1); border-color: rgba(178,58,46,0.4); }

.verdict-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-top: 3px;
  flex-shrink: 0;
}
.tone-good .verdict-dot { background: #6B8F4E; }
.tone-moderate .verdict-dot { background: #E8B94A; }
.tone-occasional .verdict-dot { background: #B23A2E; }

.verdict-text { flex: 1; }
.verdict-label {
  font-family: 'Courier Prime', monospace;
  font-weight: 700;
  font-size: 13.5px;
  margin: 0 0 3px;
}
.tone-good .verdict-label { color: #4E6B36; }
.tone-moderate .verdict-label { color: #8C6A1E; }
.tone-occasional .verdict-label { color: #8C2E22; }

.verdict-reason { font-size: 12px; color: #4A4535; line-height: 1.5; margin: 0; }

.perforation {
  height: 1px;
  margin: 0 20px;
  background-image: repeating-linear-gradient(90deg, #D8CFB4 0 6px, transparent 6px 12px);
}

.passport-section { padding: 18px 20px; }

.section-head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6B8F4E;
  margin-bottom: 2px;
}

.eyebrow {
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.passport-section h3 {
  font-family: 'Courier Prime', monospace;
  font-size: 16px;
  margin: 2px 0 12px;
}

.serving-line {
  font-size: 11.5px;
  color: #8A8270;
  margin-bottom: 8px;
  font-style: italic;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dotted #D8CFB4;
}
.price-amount {
  font-family: 'Courier Prime', monospace;
  font-weight: 700;
  font-size: 17px;
  color: #4E6B36;
}
.price-note { font-size: 11px; color: #8A8270; }

.nutrition-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.nutrition-table tr { border-bottom: 1px dotted #D8CFB4; }
.nutrition-table tr:last-child { border-bottom: none; }
.nutrition-table td { padding: 6px 0; vertical-align: top; }
.n-label { color: #4A4535; width: 46%; font-family: 'Courier Prime', monospace; }
.n-plain { display: block; font-family: 'Inter', sans-serif; font-size: 10.5px; color: #A79E88; font-weight: 400; }
.n-val { text-align: right; font-weight: 700; white-space: nowrap; font-family: 'Courier Prime', monospace; }

.notable-list {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: #4A4535;
  line-height: 1.6;
}

.estimate-note {
  margin-top: 10px;
  font-size: 10.5px;
  color: #A79E88;
  font-style: italic;
}

.recipe-meta {
  font-family: 'Courier Prime', monospace;
  font-size: 12px;
  color: #6B8F4E;
  margin-bottom: 12px;
}
.meta-sep { margin: 0 6px; color: #D8CFB4; }

.recipe-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 420px) {
  .recipe-cols { grid-template-columns: 1fr 1.3fr; }
}

.mini-label {
  font-family: 'Courier Prime', monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #B23A2E;
  margin-bottom: 8px;
}

.ingredient-list {
  margin: 0;
  padding-left: 16px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #4A4535;
}

.steps-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #2A2620;
}
.steps-list li { margin-bottom: 6px; }

.sourcing-block { display: flex; flex-direction: column; gap: 12px; }
.sourcing-row p { margin: 0; font-size: 12.5px; color: #4A4535; line-height: 1.55; }

.sourcing-tip {
  background: rgba(107,143,78,0.1);
  border: 1px solid rgba(107,143,78,0.3);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.tip-mark {
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #6B8F4E;
  background: #F5EFDF;
  border: 1px solid #6B8F4E;
  border-radius: 4px;
  padding: 2px 6px;
  flex-shrink: 0;
}

.sourcing-tip p { margin: 0; font-size: 12.5px; color: #3E3A2E; line-height: 1.5; }

.card-actions {
  display: flex;
}

.scan-again, .share-whatsapp {
  flex: 1;
  font-family: 'Courier Prime', monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 13px 8px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
}

.scan-again { background: #2A2620; color: #E8B94A; }
.scan-again:hover { background: #383226; }

.share-whatsapp { background: #25D366; color: #0B3B22; text-decoration: none; }
.share-whatsapp:hover { background: #2EE679; }

@media (prefers-reduced-motion: reduce) {
  .scan-line, .passport-card, .modal-card { animation: none !important; }
}
