:root {
  --wine: #741d38;
  --paper: #f8f3ef;
  --line: #e7d9d4;
}
header {padding-block: 20px}
.hero {
  position: relative;
  min-height: 235px;
  isolation: isolate;
  overflow: hidden;
  border-radius: 22px;
  display: flex;
  align-items: center;
  background: #65162e;
  color: white;
  padding: clamp(24px, 6vw, 58px);
}
.hero img {position:absolute;inset:0 0 0 auto;width:58%;height:100%;object-fit:cover;z-index:-2}
.hero::before {content:"";position:absolute;inset:0;background:linear-gradient(90deg,#65162e 34%,#65162ee8 49%,transparent 82%);z-index:-1}
.hero h1 {font-family:Georgia,serif;font-weight:400;letter-spacing:-.055em;font-size:clamp(2.8rem,8vw,5.6rem)}
.hero p {color:#fff4f7;max-width:280px;margin:12px 0 0}
.panel {box-shadow:0 6px 24px #4f172008}
.products {max-height:430px;display:grid;gap:8px;padding:4px 3px 4px 0}
.product {border:1px solid var(--line);border-radius:11px;padding:9px;transition:background .22s,border-color .22s}
.product-main {display:flex;align-items:center;gap:12px}
.product-main h3 {font-size:1rem;margin:0}
.product-photo {object-fit:cover;border-radius:8px;background:#eee3dc;flex:none;transition:filter .25s,opacity .25s}
.product[data-preference=love] {border-color:#b45173;background:#fff2f7}
.product[data-preference=exclude] {background:#f6f3f2}
.product[data-preference=exclude] .product-photo {filter:grayscale(.85);opacity:.64}
.preferences {display:flex;flex-wrap:wrap;gap:5px;margin:8px 0}
.preferences button {font-size:.875rem;flex:1;padding:6px;border-color:#cdbac0;transition:background .2s,color .2s,transform .15s}
.preferences button:active {transform:scale(.94)}
.preferences button[aria-pressed=true] {background:var(--wine);color:white;border-color:var(--wine)}
.preferences button[data-choice=exclude][aria-pressed=true] {background:#54474a;border-color:#54474a}
button:focus-visible,summary:focus-visible {outline:3px solid #b45173;outline-offset:3px}
.product details {margin:0}
.preference-help,.selection {font-size:.875rem}
.selection {margin:8px 0 0;color:var(--wine);font-weight:650}
.preference-changed {animation:selection-pulse .33s ease-out}
@keyframes selection-pulse {50%{transform:scale(.985)}}
.meal {overflow:hidden;border:1px solid var(--line);padding:0;border-radius:13px;background:#fff;display:grid;grid-template-columns: minmax(100px,36%) 1fr}
.meal-photo {display:block;width:100%;height:100%;min-height:145px;object-fit:cover;background:#eee3dc}
.meal-content {padding:12px 14px}
.stat {padding:8px 5px}
@media(max-width:420px) {
  .hero {min-height:188px}
  .hero img {width:75%}
  .hero::before {background:linear-gradient(90deg,#65162e 15%,#65162edc 47%,#65162e38)}
  .meal {grid-template-columns:1fr}
  .meal-photo {height:140px}
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {animation:none!important;transition:none!important}
}
@media print {.hero {display:none}.meal {break-inside:avoid}.meal-photo {height:145px}}
dialog {width:min(520px,calc(100% - 24px));max-height:calc(100% - 32px);border:1px solid var(--line);border-radius:16px;padding:20px;color:var(--ink);background:white}
dialog::backdrop {background:#221b1d92}
dialog input[type=text],dialog select {width:100%;padding:8px;border:1px solid #c9b9be;border-radius:7px;background:white;color:var(--ink);font:inherit}
dialog label {margin:8px 0}
#lookup-section {border:1px solid var(--line);border-radius:8px;padding:10px;margin-bottom:12px}
#lookup-results {display:grid;gap:6px;max-height:145px;overflow:auto}
#lookup-results button {text-align:left}
#lookup-status {margin-top:8px}
.food-placeholder {width:68px;height:68px;display:grid;place-items:center;color:var(--wine);font-size:1.6rem}
.history {margin-top:20px}
.week-nav {display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
#week-days {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin:12px 0}
#week-days button {padding:6px 0;min-height:68px;font-size:.875rem}
#week-days button[aria-pressed=true] {color:white;background:var(--wine)}
#week-days strong,#week-days small {display:block}
#week-days small {font-size:.7rem;line-height:1.15;color:inherit}
.purchase-history,.profile-settings,#owner-stats {margin-top:16px}
.purchase {border:1px solid var(--line);border-radius:8px;padding:8px;margin:6px 0}
.receipt-items {max-height:180px;overflow:auto}
dialog input[type=date] {width:100%;font:inherit;padding:8px}
@media print {.history {display:none}}
