:root {
  --paper: #f3f0e8;
  --ink: #172922;
  --green: #1d3e31;
  --line: #c8cabf;
}

.brand {
  font-style: italic;
  font-size: clamp(1.05rem, 5vw, 2rem);
  letter-spacing: -.035em;
  line-height: 1.1;
  border-bottom: 3px double currentColor;
}

.hero {
  background: #e9e6dd;
  border-radius: 12px;
  display: grid;
  overflow: hidden;
}

.heropic {
  height: clamp(250px, 52svh, 480px);
  background: #211a16;
}

.heropic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 43%;
}

.hero-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 20px 20px 96px;
  background: #1d3e31;
  color: #fff;
  text-align: center;
  font: italic clamp(1.25rem, 3vw, 2.25rem)/1.2 Georgia, serif;
  overflow-wrap: anywhere;
}

.heropic,
.herotxt {
  grid-area: 1 / 1;
}

.herotxt {
  align-self: end;
  min-width: 0;
  padding: clamp(18px, 3vw, 32px);
}

.heropic:not([hidden]) + .herotxt {
  background: linear-gradient(transparent, #211a16);
  color: white;
  padding-top: clamp(32px, 6vw, 64px);
}

.hero h1 {
  margin: 0;
  font: normal clamp(2rem, 5vw, 3.75rem)/1.02 Georgia, serif;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.hero-controls {
  padding: 16px clamp(18px, 3vw, 32px) 20px;
}

.hero-meta {
  color: var(--muted);
  line-height: 1.4;
}

.hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.primary,
.secondary,
.x {
  min-height: 44px;
}

.quick-settings {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}

.quick-settings button {
  width: 100%;
  padding-inline: 6px;
}

.quick-settings .params {
  padding: 6px 4px 0;
  font-size: 0.875rem;
  line-height: 1.4;
}

.line > :first-child:not(input),
.choice.line > span,
.subtotal > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.line > b:last-child,
.subtotal > b {
  flex: none;
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.line:has(> .ingredient-offers) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.ingredient-offers {
  grid-column: 1 / -1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ingredient-offers a {
  display: inline-block;
  align-content: center;
  min-height: 44px;
}

.choice.line {
  min-height: 44px;
}

.choice.line input {
  flex: none;
}

.buy-quantity {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 520px) {
  .heropic {
    height: clamp(220px, 45svh, 380px);
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .hero-actions button {
    padding-inline: 6px;
    font-size: 0.875rem;
  }

  .hero-arrow {
    display: none;
  }

  .quick-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-settings .params {
    display: none;
  }
}

@media (min-width: 781px) {
  .hero {
    max-width: 760px;
    margin-inline: auto;
  }
}


.family-portions summary {
  display: list-item;
  padding-block: 12px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 650;
}
.family-portions[open] > :not(summary) {
  margin-block: 0 12px;
}

/* A modal must keep the page behind it in place while its own content scrolls. */
html:has(dialog:modal) {
  overflow: hidden;
}

dialog:modal {
  max-width: calc(100% - 2 * max(12px, env(safe-area-inset-left), env(safe-area-inset-right)));
  max-height: calc(100dvh - max(12px, env(safe-area-inset-top)) - max(12px, env(safe-area-inset-bottom)));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dialoghead h2,
.content,
.content > *,
.checks > *,
.scanrow > * {
  min-width: 0;
}

.dialoghead h2 {
  overflow-wrap: anywhere;
}

.x {
  min-width: 44px;
  flex: none;
}

@media (max-width: 360px) {
  .scanrow {
    grid-template-columns: auto minmax(0, 1fr) minmax(60px, 80px) auto;
    gap: 4px;
  }
}

/* Keep the dialog header in the same place when its contents change. */
@media (max-width: 780px), (max-height: 500px) and (pointer: coarse) {
  dialog:modal {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    bottom: auto;
    left: max(12px, env(safe-area-inset-left));
    margin: 0 auto;
  }
}

@media (max-width: 780px), (max-height: 500px) and (pointer: coarse) {
  .dialoghead {
    align-items: flex-start;
  }
}

/* Standalone disclosure and action targets remain easy to use on touchscreens. */
summary {
  min-height: 44px;
  padding-block: 12px;
  cursor: pointer;
}

summary:focus-visible {
  outline: 3px solid #426fd8;
  outline-offset: 2px;
}

.textbtn {
  min-width: 44px;
  min-height: 44px;
}

.storecard a {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
}

a.brand { color:var(--ink); text-decoration:none; }
.dinner-more { display:block; text-align:center; text-decoration:none; color:var(--ink); }
