:root {
  --ink: #24362e;
  --paper: #f7f3ea;
  --cream: #eee8db;
  --orange: #e9683d;
  --orange-dark: #c84b27;
  --sage: #a9b8a3;
  --line: rgba(36, 54, 46, 0.16);
  --white: #fffdf8;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", sans-serif;
  min-height: 100vh;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .12;
  z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

main { overflow: hidden; }

.eyebrow { text-transform: uppercase; letter-spacing: .17em; font-size: 12px; font-weight: 700; margin: 0 0 18px; display: flex; align-items: center; gap: 9px; }
.eyebrow > span { width: 25px; height: 2px; background: var(--orange); }
.eyebrow.muted { opacity: .62; margin-bottom: 12px; }

h2 { font-family: "Fraunces", Georgia, serif; letter-spacing: -.045em; }

.menu-section { background: var(--ink); color: var(--white); padding: 72px max(32px, calc((100vw - 1120px)/2)) 58px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
h2 { font-size: clamp(38px, 5vw, 59px); text-transform: capitalize; margin: 0; font-weight: 600; }
.actions { display: flex; gap: 10px; }
.icon-button, .download-button { height: 46px; border: 1px solid rgba(255,255,255,.28); color: var(--white); background: transparent; border-radius: 100px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: .2s ease; }
.icon-button { width: 46px; }
.icon-button svg, .download-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.download-button { padding: 0 20px; gap: 9px; text-decoration: none; font-size: 14px; font-weight: 600; }
.icon-button:hover, .download-button:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.6); }
.icon-button.is-spinning svg { animation: spin .8s linear infinite; }
.is-disabled { opacity: .45; pointer-events: none; }

.transcription { margin-bottom: 42px; }
.table-shell { overflow-x: auto; border: 1px solid rgba(255,255,255,.18); border-radius: 18px; background: rgba(255,255,255,.055); }
table { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: fixed; }
th { height: 52px; padding: 0 16px; color: rgba(255,255,255,.58); text-align: left; text-transform: uppercase; letter-spacing: .11em; font-size: 11px; font-weight: 700; border-right: 1px solid rgba(255,255,255,.12); }
th:last-child { border-right: 0; }
td { height: 270px; vertical-align: top; padding: 16px; border-top: 1px solid rgba(255,255,255,.12); border-right: 1px solid rgba(255,255,255,.12); }
td:last-child { border-right: 0; }
.day-content { min-height: 236px; display: flex; flex-direction: column; }
.day-number { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: var(--orange); color: white; font-weight: 700; font-size: 13px; margin-bottom: 14px; }
.meal-lines { color: rgba(255,255,255,.9); font-size: 12px; line-height: 1.5; }
.meal-lines p { margin: 0 0 6px; }
.meal-lines strong { color: #c4d3bc; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.meal-lines.no-menu { color: rgba(255,255,255,.36); font-style: italic; }
.recommendation { margin-top: auto; padding-top: 11px; border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.58); font-size: 10px; line-height: 1.4; }
.recommendation strong { display: block; margin-bottom: 3px; color: var(--orange); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.recommendation p { margin: 0 0 3px; }
.recommendation b { color: rgba(255,255,255,.74); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.empty-day { background: rgba(0,0,0,.08); }
.transcription-note { margin: 11px 3px 0; color: rgba(255,255,255,.45); font-size: 11px; }
.transcription-warning { margin: 0 0 30px; padding: 14px 17px; border: 1px solid rgba(233,104,61,.5); border-radius: 10px; color: #f4c1af; font-size: 13px; }
.transcription { position: relative; }
.original-overlay { position: absolute; inset: 0; z-index: 3; border-radius: 18px; overflow: hidden; background: #e6e4df; box-shadow: 0 24px 70px rgba(0,0,0,.4); }
.original-overlay iframe { border: 0; width: 100%; height: 100%; background: #e6e4df; }
.download-button.is-active { background: var(--white); border-color: var(--white); color: var(--ink); }

.menu-state { position: relative; min-height: 0; }
.menu-state:has(.is-visible) { min-height: 330px; margin-bottom: 42px; background: #e6e4df; border-radius: 18px; }
.loader, .error { position: absolute; inset: 0; display: none; place-content: center; justify-items: center; text-align: center; color: var(--ink); z-index: 2; }
.loader.is-visible, .error.is-visible { display: grid; }
.loader-mark { width: 46px; height: 46px; border: 3px solid rgba(36,54,46,.15); border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; }
.loader p { font-size: 14px; margin-top: 18px; color: rgba(36,54,46,.62); }
.error > span { display: grid; place-items: center; width: 42px; height: 42px; background: #f6d8cc; color: var(--orange-dark); border-radius: 50%; font: 700 20px "Fraunces"; }
.error h3 { font: 600 25px "Fraunces"; margin: 16px 0 4px; }
.error p { color: rgba(36,54,46,.65); margin: 0; max-width: 380px; }
.error button { margin-top: 20px; border: 0; border-radius: 100px; padding: 12px 19px; background: var(--ink); color: white; font: 600 13px "DM Sans"; cursor: pointer; }

.source-note { display: flex; align-items: center; gap: 9px; font-size: 12px; color: rgba(255,255,255,.58); margin-top: 20px; }
.source-note a { color: var(--white); margin-left: auto; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.3); padding-bottom: 2px; }
.live-dot { width: 7px; height: 7px; background: #9fc488; border-radius: 50%; box-shadow: 0 0 0 4px rgba(159,196,136,.13); }

.dinner-section { max-width: 1180px; margin: 0 auto; padding: 90px 32px 80px; }
.dinner-intro { max-width: 880px; margin-bottom: 38px; }
.dinner-intro h2 { text-transform: none; color: var(--ink); line-height: 1.02; }
.dinner-intro h2 em { color: var(--orange); font-weight: 600; }
.dinner-intro > p:last-child { max-width: none; color: rgba(36,54,46,.67); line-height: 1.7; }
.dinner-setup, .feedback-box { padding: 25px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
.dinner-setup label, .feedback-box label { display: block; margin-bottom: 10px; font-weight: 700; font-size: 14px; }
textarea { width: 100%; resize: vertical; border: 1px solid rgba(36,54,46,.2); border-radius: 11px; padding: 14px 15px; color: var(--ink); background: var(--paper); font: 14px/1.55 "DM Sans", sans-serif; outline: none; }
textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(233,104,61,.12); }
.setup-footer, .feedback-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 15px; }
.setup-footer p, .feedback-footer span { margin: 0; color: rgba(36,54,46,.55); font-size: 12px; }
.primary-button { border-radius: 100px; min-height: 44px; padding: 0 20px; font: 700 13px "DM Sans", sans-serif; cursor: pointer; transition: .2s ease; }
.primary-button { border: 0; background: var(--orange); color: white; }
.primary-button:hover { background: var(--orange-dark); }
.primary-button:disabled { opacity: .45; cursor: wait; }
.dinner-loading { min-height: 140px; margin-top: 20px; border-radius: 16px; background: var(--cream); display: flex; align-items: center; justify-content: center; gap: 18px; }
.dinner-loading .loader-mark { flex: 0 0 auto; }
.dinner-loading strong { font-family: "Fraunces", serif; font-size: 20px; }
.dinner-loading p { margin: 4px 0 0; color: rgba(36,54,46,.58); font-size: 12px; }
.dinner-error { margin-top: 18px; padding: 15px 18px; border: 1px solid rgba(200,75,39,.3); border-radius: 11px; color: var(--orange-dark); background: #fff2eb; font-size: 13px; }
.dinner-plan { margin-top: 38px; }
.plan-actions { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.ghost-button { border: 1px solid var(--line); border-radius: 100px; min-height: 36px; padding: 0 16px; background: transparent; color: rgba(36,54,46,.7); font: 600 12px "DM Sans", sans-serif; cursor: pointer; transition: .2s ease; }
.ghost-button:hover { border-color: var(--ink); color: var(--ink); }
.ghost-button { display: inline-flex; align-items: center; gap: 7px; }
.ghost-button svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ghost-button.is-active { border-color: var(--ink); background: var(--ink); color: var(--white); }

.shopping-panel { margin-top: 25px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
.shopping-title { margin: 0 0 8px; font: 600 24px "Fraunces", Georgia, serif; letter-spacing: -.03em; color: var(--ink); }
.shopping-note { margin: 0 0 18px; color: rgba(36,54,46,.6); font-size: 12px; line-height: 1.55; }
.shopping-weeks { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.shopping-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.shopping-week h4 { margin: 0; font: 600 15px "Fraunces", Georgia, serif; }
.copy-button { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 100px; padding: 4px 11px; background: transparent; color: rgba(36,54,46,.6); font: 600 10px "DM Sans", sans-serif; cursor: pointer; transition: .2s ease; }
.copy-button:hover { border-color: var(--ink); color: var(--ink); }
.shopping-category { margin-bottom: 13px; }
.shopping-category h5 { margin: 0 0 4px; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--orange-dark); }
.shopping-category ul { margin: 0; padding-left: 16px; font-size: 12px; line-height: 1.55; color: rgba(36,54,46,.78); }
.shopping-category b, .is-pantry b { font-weight: 600; color: rgba(36,54,46,.55); }
.is-pantry { padding: 16px 18px; border-radius: 14px; background: var(--cream); }
.is-pantry ul { margin: 0; padding-left: 16px; font-size: 12px; line-height: 1.55; color: rgba(36,54,46,.78); }
.pantry-hint { margin: -6px 0 9px; font-size: 11px; color: rgba(36,54,46,.55); }
.dinner-calendar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--white); }
.dinner-weekday { padding: 16px; color: rgba(36,54,46,.56); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; border-right: 1px solid var(--line); }
.dinner-day { min-height: 310px; padding: 15px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
.dinner-day:nth-child(5n), .dinner-weekday:nth-child(5) { border-right: 0; }
.dinner-day.empty { background: rgba(36,54,46,.025); }
.dinner-day .day-number { margin-bottom: 12px; }
.dinner-course { margin: 0 0 9px; font-size: 12px; line-height: 1.4; }
.dinner-course strong { color: var(--orange-dark); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.recipe-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 11px; }
.recipe-details summary { cursor: pointer; color: var(--ink); font-size: 11px; font-weight: 700; }
.recipe-details h4 { margin: 13px 0 5px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.recipe-details ul, .recipe-details ol { margin: 0; padding-left: 17px; color: rgba(36,54,46,.67); font-size: 10px; line-height: 1.45; }
.rules-details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 13px; }
.rules-details summary { cursor: pointer; font-size: 13px; font-weight: 700; }
.rules-note { margin: 11px 0 0; color: rgba(36,54,46,.55); font-size: 12px; }
.rules-details ol { margin: 9px 0 0; padding-left: 19px; color: rgba(36,54,46,.67); font-size: 12px; line-height: 1.5; }
.rules-details li { margin-bottom: 5px; }
.recipe-meta { margin-top: 12px; color: rgba(36,54,46,.5); font-size: 10px; }
.feedback-box { margin-top: 25px; }

footer { max-width: 1180px; margin: 0 auto; padding: 32px; display: flex; justify-content: space-between; color: rgba(36,54,46,.58); font-size: 12px; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .menu-section { padding: 52px 18px 40px; }
  .dinner-section { padding: 64px 18px 50px; }
  .section-head { align-items: center; }
  .actions { align-self: flex-end; }
  .download-button { width: 46px; padding: 0; font-size: 0; }
  .original-overlay { border-radius: 12px; }
  .table-shell { margin-right: -18px; border-radius: 12px 0 0 12px; }
  table { min-width: 820px; }
  td { height: 260px; padding: 13px; }
  .day-content { min-height: 232px; }
  .source-note > span:nth-child(2) { max-width: 190px; }
  .setup-footer, .feedback-footer { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .dinner-plan { overflow: hidden; }
  .dinner-calendar { grid-template-columns: repeat(5, 190px); overflow-x: auto; border-radius: 12px; }
  .dinner-day { min-height: 320px; }
  footer { padding: 26px 20px; display: block; }
  footer p:last-child { margin-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; }
}
