@font-face {
  font-family: "Caballeros Crayon";
  src: url("./assets/CaballerosCrayon-Regular.woff") format("woff");
  font-display: swap;
}

:root {
  --paper: #f3ecdf;
  --paper-deep: #e8ddcb;
  --paper-light: #fbf7ef;
  --ink: #201f1c;
  --muted: #777166;
  --faint: #a69d90;
  --line: rgba(44, 40, 34, 0.14);
  --red: #c83f2a;
  --red-dark: #9e2d1d;
  --green: #3d6c53;
  --shadow: 0 18px 55px rgba(45, 37, 27, 0.09);
  --sans: Futura, "Avenir Next", Avenir, "Century Gothic", sans-serif;
  --mono: "SFMono-Regular", "Roboto Mono", Consolas, monospace;
  --crayon: "Caballeros Crayon", "Comic Sans MS", cursive;
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 12%, rgba(200, 63, 42, 0.035), transparent 26rem),
    var(--paper);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("./assets/paper-tile.png");
  background-size: 360px 360px;
  mix-blend-mode: multiply;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  gap: 28px;
  min-height: 84px;
  padding: 13px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(243, 236, 223, 0.91);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  width: max-content;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.brand__logo {
  display: block;
  width: clamp(108px, 10vw, 122px);
  height: auto;
  max-height: 58px;
  mix-blend-mode: multiply;
}

.brand__sub {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.topnav {
  display: flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.27);
}

.nav-button {
  position: relative;
  min-width: 105px;
  padding: 10px 17px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.nav-button.is-active {
  background: var(--ink);
  color: var(--paper-light);
}

.nav-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  font-family: var(--mono);
  font-size: 9px;
}

.selection-button {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 260px;
  padding: 10px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  cursor: pointer;
}

#app {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 64px) 80px;
}

.loading-screen,
.error-screen {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  min-height: calc(100vh - 84px);
  color: var(--muted);
  font-size: 13px;
}

.crayon-loader {
  display: block;
  width: 56px;
  height: 56px;
  border: 4px solid rgba(200, 63, 42, 0.15);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 36px;
  padding: clamp(48px, 7vw, 92px) 0 30px;
}

.page-kicker,
.eyebrow {
  display: block;
  margin-bottom: 13px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.page-head h1,
.shopping-head h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(38px, 6vw, 78px);
  font-weight: 450;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.page-intro {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.library-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 28px;
}

.collection-tabs {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 30px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.collection-tab {
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.collection-tab.is-active {
  background: var(--ink);
  color: var(--paper-light);
}

.collection-page {
  animation: collection-in 180ms ease-out;
}

@keyframes collection-in {
  from { opacity: 0; transform: translateY(4px); }
}

.search-field {
  position: relative;
  flex: 1;
  max-width: 520px;
}

.search-field input,
.custom-item-form input {
  width: 100%;
  height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.35);
  color: var(--ink);
}

.filter-chip,
.quiet-button,
.primary-button,
.select-recipe,
.stepper button,
.tab-button,
.remove-selection,
.shopping-action {
  border: 0;
  cursor: pointer;
}

.filter-chip {
  height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.filter-chip.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-light);
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.marinade-section {
  margin-top: 0;
  padding: clamp(30px, 5vw, 54px);
  border: 1px solid rgba(200, 63, 42, 0.24);
  border-radius: calc(var(--radius) + 8px);
  background: rgba(200, 63, 42, 0.055);
}

.marinade-section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.marinade-section__head h2 {
  margin-bottom: 10px;
  font-size: clamp(32px, 4.6vw, 58px);
  font-weight: 450;
  letter-spacing: -0.05em;
}

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

.marinade-badge {
  color: var(--red);
  font-weight: 700;
}

.recipe-card {
  position: relative;
  min-height: 328px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 247, 239, 0.54);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.recipe-card:hover {
  transform: translateY(-3px);
  border-color: rgba(200, 63, 42, 0.35);
  box-shadow: var(--shadow);
}

.recipe-card__open {
  display: grid;
  grid-template-rows: 180px 1fr;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.recipe-card__art {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 22px 28px 4px;
}

.recipe-card__art img {
  width: auto;
  height: auto;
  max-width: min(88%, 255px);
  max-height: 150px;
  object-fit: contain;
  filter: saturate(0.95) contrast(1.02);
}

.artwork-stack {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.artwork-stack--pair {
  gap: 2px;
}

.recipe-card__art .artwork-stack--pair img {
  max-width: 49%;
  max-height: 125px;
}

.recipe-card__copy {
  display: flex;
  flex-direction: column;
  padding: 20px 22px 22px;
}

.recipe-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recipe-card h2 {
  margin-bottom: 9px;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.recipe-card__day {
  margin-top: auto;
  color: var(--muted);
  font-size: 11px;
}

.dish-badge {
  color: var(--red);
}

.card-select {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(251, 247, 239, 0.9);
  font-size: 18px;
  cursor: pointer;
}

.card-select.is-selected {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.empty-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 136px;
  height: 136px;
  color: var(--red);
}

.empty-art__ring {
  position: absolute;
  inset: 12px;
  border: 5px solid currentColor;
  border-radius: 47% 53% 48% 52%;
  opacity: 0.36;
  transform: rotate(-8deg);
}

.empty-art__dash {
  position: absolute;
  width: 70px;
  border-top: 4px solid currentColor;
  opacity: 0.22;
  transform: rotate(14deg);
}

.empty-art__copy {
  font-family: var(--crayon);
  font-size: 22px;
  transform: rotate(-4deg);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 80px 20px;
  color: var(--muted);
  text-align: center;
}

/* Recipe detail */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 28px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.recipe-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: clamp(32px, 6vw, 92px);
  align-items: center;
  padding: 28px 0 48px;
  border-bottom: 1px solid var(--line);
}

.recipe-hero h1 {
  max-width: 820px;
  margin-bottom: 25px;
  font-size: clamp(42px, 6.4vw, 88px);
  font-weight: 430;
  letter-spacing: -0.062em;
  line-height: 0.95;
}

.recipe-hero__art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
}

.recipe-hero__art::after {
  content: "";
  position: absolute;
  width: 75%;
  height: 52%;
  border: 5px solid rgba(200, 63, 42, 0.13);
  border-radius: 50%;
  transform: rotate(-7deg);
}

.recipe-hero__art img {
  position: relative;
  z-index: 1;
  width: min(72%, 310px);
  max-height: 300px;
  object-fit: contain;
}

.recipe-hero__art .artwork-stack--pair img {
  width: 49%;
  max-height: 255px;
}

.recipe-summary {
  max-width: 740px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.recipe-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 32px;
}

.select-recipe,
.primary-button {
  min-height: 48px;
  padding: 0 21px;
  border-radius: 14px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.select-recipe.is-selected {
  background: var(--ink);
}

.serves-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chicken-weight-control {
  display: grid;
  gap: 8px;
  min-width: 245px;
}

.weight-input {
  display: grid;
  grid-template-columns: 38px minmax(72px, 1fr) 24px 38px;
  align-items: center;
  height: 48px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.35);
}

.weight-input button {
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 18px;
}

.weight-input input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  text-align: right;
}

.weight-input span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.serves-control__label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.stepper {
  display: grid;
  grid-template-columns: 34px 42px 34px;
  align-items: center;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.25);
}

.stepper button {
  height: 100%;
  background: transparent;
  font-size: 18px;
}

.stepper output {
  font-family: var(--mono);
  font-size: 14px;
  text-align: center;
}

.detail-tabs {
  position: sticky;
  top: 84px;
  z-index: 12;
  display: flex;
  gap: 8px;
  padding: 18px 0;
  background: linear-gradient(var(--paper) 78%, rgba(243, 236, 223, 0));
}

.tab-button {
  padding: 11px 18px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.tab-button.is-active {
  background: var(--ink);
  color: var(--paper-light);
}

.recipe-body {
  display: grid;
  grid-template-columns: minmax(290px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(34px, 6vw, 100px);
  padding: 24px 0 80px;
}

.section-title {
  margin-bottom: 24px;
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.ingredient-group + .ingredient-group,
.method-group + .method-group {
  margin-top: 38px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.subrecipe-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.subrecipe-heading h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.subrecipe-heading span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.ingredient-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ingredient-subgroup + .ingredient-subgroup {
  margin-top: 1rem;
}

.ingredient-subgroup h4 {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.ingredient-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, auto);
  gap: 24px;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid rgba(44, 40, 34, 0.09);
  font-size: 13px;
  line-height: 1.5;
}

.ingredient-row__amount {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-align: left;
}

.method-list,
.assembly-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: method;
}

.method-step,
.assembly-step {
  position: relative;
  min-height: 58px;
  padding: 0 0 25px 54px;
  color: #393631;
  font-size: 14px;
  line-height: 1.75;
  counter-increment: method;
}

.method-step::before,
.assembly-step::before {
  content: counter(method, decimal-leading-zero);
  position: absolute;
  top: 1px;
  left: 0;
  color: var(--red);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.method-step:not(:last-child)::after,
.assembly-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 25px;
  bottom: 5px;
  left: 11px;
  width: 1px;
  background: rgba(200, 63, 42, 0.18);
}

.info-card {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.25);
}

.info-card__label {
  display: block;
  margin-bottom: 10px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.info-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.component-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.component-pill {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
}

/* Assembly */
.assembly-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: clamp(38px, 6vw, 90px);
  padding: 24px 0 80px;
}

.plating-board {
  position: sticky;
  top: 164px;
  align-self: start;
}

.plating-board__frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper-light);
  box-shadow: var(--shadow);
}

.plating-board img {
  display: block;
  width: 100%;
  height: auto;
}

.plating-placeholder {
  display: grid;
  place-items: center;
  min-height: 430px;
  padding: 55px;
  text-align: center;
}

.plating-placeholder p {
  max-width: 280px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.assembly-count {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding: 9px 13px;
  border: 1px solid rgba(200, 63, 42, 0.24);
  border-radius: 999px;
  color: var(--red-dark);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.assembly-ingredients {
  margin-bottom: 40px;
}

/* Shopping */
.shopping-page {
  padding-top: clamp(48px, 7vw, 86px);
}

.shopping-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: end;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.shopping-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.shopping-action,
.quiet-button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  color: var(--muted);
  font-size: 11px;
}

.shopping-summary {
  display: grid;
  grid-template-columns: minmax(250px, 0.62fr) minmax(0, 1.38fr);
  gap: clamp(40px, 7vw, 110px);
  padding: 34px 0 80px;
}

.selected-recipes {
  align-self: start;
}

.party-size-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  padding: 20px;
  border: 1px solid rgba(200, 63, 42, 0.23);
  border-radius: 18px;
  background: rgba(251, 247, 239, 0.62);
}

.party-size-control .eyebrow {
  margin-bottom: 7px;
}

.party-size-control strong {
  font-size: 13px;
  font-weight: 500;
}

.stepper--global {
  flex: 0 0 auto;
  width: 126px;
  height: 46px;
  grid-template-columns: 38px 48px 38px;
  border-color: rgba(200, 63, 42, 0.3);
}

.stepper--global output {
  color: var(--red-dark);
  font-size: 15px;
}

.selected-recipe {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.selected-recipe strong {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 550;
}

.selected-recipe small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.selected-recipe__tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.selected-recipe__covers {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  white-space: nowrap;
}

.selected-recipe .stepper {
  grid-template-columns: 27px 32px 27px;
  height: 34px;
}

.selected-recipe .stepper button {
  font-size: 15px;
}

.selected-recipe .stepper output {
  font-size: 11px;
}

.remove-selection {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

.progress-card {
  margin-bottom: 28px;
  padding: 20px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--paper-light);
}

.progress-card__copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 13px;
  font-family: var(--mono);
  font-size: 10px;
}

.progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--red);
  transition: width 220ms ease;
}

.shopping-group + .shopping-group {
  margin-top: 34px;
}

.shopping-group h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 11px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.shopping-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) minmax(120px, auto);
  gap: 13px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.shopping-item input {
  appearance: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  border: 1px solid rgba(44, 40, 34, 0.38);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
}

.shopping-item input:checked {
  border-color: var(--green);
  background: var(--green);
}

.shopping-item input:checked::after {
  content: "✓";
  color: #fff;
  font-size: 12px;
}

.shopping-item.is-checked .shopping-item__name,
.shopping-item.is-checked .shopping-item__amount {
  color: var(--faint);
  text-decoration: line-through;
}

.shopping-item__name {
  font-size: 13px;
  line-height: 1.45;
}

.shopping-item__source {
  display: block;
  margin-top: 5px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.4;
}

.shopping-item__amount {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.45;
  text-align: left;
}

.custom-item-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 28px;
}

.custom-item-form .primary-button {
  min-height: 48px;
}

.schema-warning {
  margin: 24px 0 0;
  padding: 16px 18px;
  border: 1px solid rgba(200, 63, 42, 0.24);
  border-radius: 14px;
  color: var(--red-dark);
  font-size: 11px;
  line-height: 1.6;
}

.toast-region {
  position: fixed;
  z-index: 99;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 8px;
}

.toast {
  max-width: 330px;
  padding: 13px 17px;
  border-radius: 13px;
  background: var(--ink);
  color: var(--paper-light);
  box-shadow: var(--shadow);
  font-size: 11px;
  animation: toast-in 180ms ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

@media (max-width: 1120px) {
  .recipe-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topbar { grid-template-columns: 1fr auto; }
  .topnav { order: 3; grid-column: 1 / -1; justify-self: center; }
  .selection-button { grid-column: 2; grid-row: 1; }
  .detail-tabs { top: 130px; }
  .plating-board { top: 208px; }
}

@media (max-width: 820px) {
  .topbar {
    min-height: 70px;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px 18px;
    backdrop-filter: none;
  }
  .brand__sub,
  .selection-button { display: none; }
  .topnav {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 50;
    order: initial;
    grid-column: auto;
    justify-content: stretch;
    padding: 6px;
    background: rgba(32, 31, 28, 0.94);
    border-color: rgba(255,255,255,.15);
    box-shadow: 0 12px 40px rgba(0,0,0,.24);
    backdrop-filter: blur(18px);
  }
  .nav-button { flex: 1; color: rgba(255,255,255,.68); }
  .nav-button.is-active { background: var(--paper-light); color: var(--ink); }
  #app { padding: 0 18px 100px; }
  .page-head { align-items: start; flex-direction: column; }
  .library-tools { align-items: stretch; flex-wrap: wrap; }
  .marinade-section__head { align-items: stretch; flex-direction: column; }
  .search-field { flex-basis: 100%; max-width: none; }
  .recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recipe-card { min-height: 285px; }
  .recipe-card__open { grid-template-rows: 145px 1fr; }
  .recipe-hero { grid-template-columns: 1fr; padding-top: 18px; }
  .recipe-hero__art { order: -1; min-height: 220px; }
  .recipe-hero__art img { width: min(60%, 220px); max-height: 220px; }
  .recipe-hero h1 { font-size: clamp(41px, 12vw, 70px); }
  .detail-tabs { top: 69px; }
  .recipe-body,
  .assembly-layout,
  .shopping-summary { grid-template-columns: 1fr; }
  .plating-board { position: static; }
  .assembly-copy { order: 2; }
  .shopping-head { grid-template-columns: 1fr; align-items: start; }
  .shopping-controls { justify-content: start; }
}

@media (max-width: 520px) {
  .brand__logo { width: 104px; }
  .page-head h1,
  .shopping-head h1 { font-size: 45px; }
  .recipe-grid { grid-template-columns: 1fr; }
  .recipe-grid--marinades { grid-template-columns: 1fr; }
  .marinade-section { padding: 24px 18px; }
  .recipe-card { min-height: 250px; }
  .recipe-card__open { grid-template-columns: 132px 1fr; grid-template-rows: 1fr; }
  .recipe-card__art { padding: 20px 8px 20px 16px; }
  .recipe-card__art img { max-width: 118px; max-height: 105px; }
  .recipe-card__art .artwork-stack--pair img { max-width: 58px; max-height: 88px; }
  .recipe-card__copy { padding: 24px 18px 22px; }
  .recipe-card h2 { font-size: 18px; }
  .recipe-card__meta span:last-child { display: none; }
  .card-select { top: 10px; right: 10px; }
  .ingredient-row { grid-template-columns: minmax(0, 1fr) 105px; gap: 12px; }
  .shopping-item { grid-template-columns: 24px minmax(0, 1fr); }
  .shopping-item__amount { grid-column: 2; }
  .custom-item-form { grid-template-columns: 1fr; }
}

@media print {
  .topbar,
  .library-tools,
  .shopping-controls,
  .selected-recipes,
  .custom-item-form,
  .paper-grain { display: none !important; }
  body { background: #fff; }
  #app { width: 100%; padding: 0; }
  .shopping-page { padding: 0; }
  .shopping-summary { display: block; padding: 20px 0; }
  .shopping-item { break-inside: avoid; }
}
