:root {
  --ink: #201815;
  --muted: #6f615a;
  --paper: #fff8ef;
  --surface: #ffffff;
  --night: #172015;
  --cream: #fff4df;
  --broth: #f6d188;
  --tomato: #e4573d;
  --leaf: #2d7a55;
  --blue: #2f6cbd;
  --line: rgba(32, 24, 21, .14);
  --shadow: 0 24px 60px rgba(64, 37, 19, .16);
  --soft-shadow: 0 16px 42px rgba(64, 37, 19, .1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Aptos", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    linear-gradient(90deg, rgba(23, 32, 21, .045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 32, 21, .035) 1px, transparent 1px),
    linear-gradient(135deg, #fff8ef 0%, #fffdf8 54%, #edf6e7 100%);
  background-size: 48px 48px, 48px 48px, auto;
  color: var(--ink);
}

button,
textarea,
input {
  font: inherit;
}

.app-shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 28px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(255, 248, 239, .82);
  backdrop-filter: blur(14px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 13px;
  color: var(--cream);
  background: var(--night);
  border: 1px solid rgba(23, 32, 21, .18);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.launch-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 26px;
  padding: 14px 16px;
  color: var(--cream);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .07) 0 1px, transparent 1px 12px),
    var(--night);
  border-radius: 8px;
  box-shadow: 0 22px 48px rgba(23, 32, 21, .18);
}

.launch-strip span,
.voice-card-header span,
.authority-band span {
  color: var(--broth);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.launch-strip strong {
  line-height: 1.2;
}

.launch-strip a {
  color: var(--night);
  background: var(--broth);
  border-radius: 999px;
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.brand-mark img {
  width: 42px;
  height: 42px;
  display: block;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 19px;
  line-height: 1;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.hero {
  min-height: 660px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 480px);
  gap: 42px;
  align-items: center;
  position: relative;
  padding-bottom: 22px;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(620px, 68%);
  height: 8px;
  background: linear-gradient(90deg, var(--tomato), var(--broth), var(--leaf));
  border-radius: 999px;
}

.eyebrow,
.snapshot-label {
  display: block;
  margin: 0 0 12px;
  color: var(--tomato);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 720px;
  font-size: clamp(48px, 7vw, 92px);
  line-height: .88;
  margin: 0 0 22px;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 610px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.4;
  margin: 0;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.hero-proof span,
.sample-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .66);
  color: var(--ink);
  box-shadow: var(--soft-shadow);
}

.hero-proof span {
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 850;
}

.fridge-snapshot {
  width: min(100%, 520px);
  margin-top: 28px;
  padding: 18px;
  border: 1px solid rgba(32, 24, 21, .12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .84), rgba(255, 250, 243, .68)),
    repeating-linear-gradient(90deg, rgba(32, 24, 21, .04) 0 1px, transparent 1px 38px);
  box-shadow: var(--soft-shadow);
}

.fridge-snapshot strong {
  display: block;
  font-size: 22px;
  line-height: 1.05;
}

.fridge-snapshot ol {
  margin: 14px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.45;
}

.voice-card,
.fridge-panel,
.result-stack,
.photo-panel,
.reheat-section {
  background: rgba(255, 255, 255, .86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.voice-card {
  padding: 18px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 250, 243, .86)),
    repeating-linear-gradient(135deg, rgba(32, 24, 21, .04) 0 1px, transparent 1px 14px);
}

.voice-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--tomato), var(--broth), var(--leaf));
}

.voice-card > * {
  position: relative;
}

.voice-card-header {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.voice-card-header strong {
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.mic-button {
  width: 100%;
  min-height: 96px;
  border: 0;
  border-radius: 8px;
  background: var(--tomato);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 850;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}

.mic-button:hover {
  transform: translateY(-1px);
}

.mic-button:active,
.primary-button:active,
.ghost-button:active,
.file-button:active,
.quick-add button:active,
.sample-button:active,
.chip:active {
  transform: translateY(1px) scale(.99);
}

.mic-button.listening {
  background: var(--leaf);
}

.mic-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, .22);
}

textarea {
  width: 100%;
  margin-top: 14px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fffaf3;
  color: var(--ink);
  line-height: 1.45;
}

.input-actions,
.quick-add {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.mode-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
  cursor: pointer;
}

.mode-toggle input {
  width: 22px;
  height: 22px;
  accent-color: var(--leaf);
}

.mode-toggle strong,
.mode-toggle small {
  display: block;
}

.mode-toggle small {
  color: var(--muted);
  margin-top: 2px;
}

.primary-button,
.ghost-button,
.file-button,
.quick-add button {
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  flex: 1;
  background: var(--ink);
  color: white;
}

.ghost-button {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

.file-button {
  background: var(--broth);
  color: var(--ink);
}

#photoInput {
  display: none;
}

.fine-print {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin: 12px 0 0;
}

.ai-status {
  min-height: 20px;
  color: var(--leaf);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  margin: 10px 0 0;
}

.ai-status.error {
  color: var(--tomato);
}

.ai-status.working {
  color: var(--blue);
}

.sample-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.sample-button {
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.scan-meter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.scan-meter span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf3;
  padding: 6px 9px;
}

.scan-meter .pro-pill {
  background: rgba(45, 122, 85, .12);
  border-color: rgba(45, 122, 85, .32);
  color: var(--leaf);
}

.photo-panel {
  display: grid;
  grid-template-columns: minmax(0, .9fr) 220px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
  margin: 8px 0 24px;
}

.photo-panel[hidden] {
  display: none;
}

.photo-panel h2,
.section-heading h2 {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1;
}

.photo-panel p,
.section-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.feature-icon {
  width: 42px;
  height: 42px;
  display: block;
  margin-bottom: 10px;
  border-radius: 10px;
}

#photoPreview {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.photo-chips,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.results-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.fridge-panel,
.result-stack,
.reheat-section {
  padding: 18px;
}

.section-heading {
  margin-bottom: 14px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf3;
  color: var(--ink);
  padding: 9px 11px;
  font-size: 14px;
  font-weight: 760;
  cursor: pointer;
}

.chip.use-first {
  background: rgba(228, 87, 61, .13);
  border-color: rgba(228, 87, 61, .32);
}

.quick-add input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fffaf3;
}

.quick-add button {
  background: var(--leaf);
  color: white;
}

.cards,
.use-first-list,
.reheat-grid,
.glp-grid {
  display: grid;
  gap: 12px;
}

.meal-card,
.use-card,
.reheat-card,
.glp-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 14px;
}

.meal-card h3,
.reheat-card h3,
.glp-card h3 {
  margin: 0 0 7px;
  font-size: 20px;
}

.meal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.meal-meta span {
  border-radius: 999px;
  padding: 6px 8px;
  color: var(--ink);
  background: #f1eadf;
  font-size: 12px;
  font-weight: 800;
}

.meal-card p,
.use-card p,
.reheat-card p,
.glp-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.meal-card ol {
  margin: 10px 0 0;
  padding-left: 21px;
}

.meal-card li {
  margin: 5px 0;
}

.use-card strong {
  display: block;
  margin-bottom: 4px;
}

.safety-note {
  border-color: rgba(47, 108, 189, .28);
  background: #f5f9ff;
}

.reheat-section,
.glp-section,
.addons-section,
.answer-section,
.faq-section {
  margin-top: 18px;
}

.authority-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 24px;
  overflow: hidden;
  border: 1px solid rgba(23, 32, 21, .18);
  border-radius: 8px;
  background: rgba(23, 32, 21, .18);
  box-shadow: var(--shadow);
}

.authority-band article {
  min-height: 218px;
  padding: 18px;
  color: var(--cream);
  background: var(--night);
}

.authority-band strong {
  display: block;
  margin-top: 28px;
  font-size: 23px;
  line-height: 1.05;
}

.authority-band p {
  margin: 12px 0 0;
  color: rgba(255, 244, 223, .72);
  line-height: 1.45;
}

.reheat-grid,
.glp-grid,
.addon-grid,
.answer-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.glp-section,
.addons-section,
.answer-section,
.faq-section {
  padding: 18px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.glp-section[hidden] {
  display: none;
}

.glp-card {
  border-color: rgba(45, 122, 85, .24);
  background: linear-gradient(180deg, #ffffff 0%, #f3fbf6 100%);
}

.glp-card strong {
  color: var(--leaf);
}

.addon-grid {
  display: grid;
  gap: 12px;
}

.addon-card,
.answer-grid article,
.faq-section details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
  padding: 14px;
}

.addon-card h3,
.answer-grid h3 {
  margin: 0 0 7px;
  font-size: 20px;
}

.addon-card p,
.answer-grid p,
.faq-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.answer-grid {
  display: grid;
  gap: 12px;
}

.faq-section details + details {
  margin-top: 10px;
}

.faq-section summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
}

.faq-section details[open] summary {
  margin-bottom: 8px;
}

.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, .55);
}

.empty strong,
.empty p {
  display: block;
  margin: 0;
}

.empty strong {
  color: var(--ink);
  margin-bottom: 5px;
}

.skeleton {
  overflow: hidden;
  position: relative;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
  animation: shimmer 1.15s infinite;
}

.skeleton-line {
  display: block;
  height: 11px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(32, 24, 21, .12);
}

.skeleton-line.short {
  width: 54%;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.legal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 22px 0 8px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.legal-footer strong {
  color: var(--ink);
}

.legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legal-footer a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 960px) {
  .hero,
  .results-layout,
  .authority-band,
  .photo-panel {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding: 20px 0 28px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 14px;
  }

  .topbar {
    padding-bottom: 18px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .status-pill {
    min-height: 38px;
    padding: 0 10px;
    font-size: 12px;
  }

  .launch-strip {
    grid-template-columns: 1fr;
  }

  .launch-strip a {
    width: max-content;
  }

  .input-actions {
    flex-direction: column;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: 52px;
  }
}
