.recipe-shell { max-width: 1320px; }
.recipe-header { padding-bottom: 18px; }
.header-home-link {
  flex: 0 0 auto;
  padding: 10px 15px;
  border-radius: 999px;
  background: var(--navy-900);
  color: #fff;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 800;
}
.recipe-main { padding-top: 8px; }
.recipe-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 28px;
  align-items: center;
  padding: 28px;
  background: linear-gradient(145deg, #ffffff 0%, #fff8e7 62%, #edf7fd 100%);
}
.recipe-hero h2 { margin-bottom: 8px; }
.recipe-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(21, 40, 58, 0.06);
}
.recipe-search-wrap span { color: var(--muted); font-size: 1.45rem; line-height: 1; }
.recipe-search-wrap input {
  width: 100%;
  min-width: 0;
  padding: 11px 10px 11px 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}
.recipe-layout {
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-top: 20px;
}
.recipe-sidebar {
  position: sticky;
  top: 18px;
  padding: 20px;
}
.sidebar-heading, .results-heading, .recipe-card-meta, .recipe-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue-600);
  cursor: pointer;
  font-weight: 750;
}
.category-list { display: grid; gap: 5px; }
.category-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #41586b;
  text-align: left;
  cursor: pointer;
  font-weight: 720;
}
.category-button:hover { background: var(--sky-100); }
.category-button.active { color: #fff; background: var(--navy-900); }
.category-count {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(100,119,137,0.12);
  text-align: center;
  font-size: 0.72rem;
}
.category-button.active .category-count { background: rgba(255,255,255,0.16); }
.results-heading { margin: 4px 2px 14px; align-items: end; }
.results-heading h2 { margin-bottom: 0; }
.recipe-count { color: var(--muted); font-size: 0.88rem; font-weight: 750; white-space: nowrap; }
.recipe-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.recipe-card {
  display: flex;
  flex-direction: column;
  min-height: 235px;
  overflow: hidden;
  border: 1px solid rgba(207, 221, 230, 0.85);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.96);
  box-shadow: 0 12px 32px rgba(20, 52, 76, 0.07);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.recipe-card:hover { transform: translateY(-2px); border-color: rgba(40,123,181,0.32); box-shadow: var(--shadow); }
.recipe-card-image {
  display: block;
  width: 100%;
  height: 175px;
  object-fit: cover;
  background: var(--sky-100);
}
.recipe-card-body { display: flex; flex: 1; flex-direction: column; padding: 20px; }
.recipe-card h3 { margin: 10px 0 8px; font-size: 1.25rem; line-height: 1.12; }
.recipe-card p { color: var(--muted); line-height: 1.45; }
.recipe-card-meta { margin-top: auto; padding-top: 16px; color: var(--muted); font-size: 0.76rem; }
.recipe-category-chip, .recipe-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #7a5a15;
  font-size: 0.72rem;
  font-weight: 800;
}
.recipe-tag { background: var(--sky-100); color: var(--navy-800); }
.empty-state { padding: 50px 24px; text-align: center; }
.empty-state div { margin-bottom: 14px; font-size: 3.5rem; }
.empty-state p { margin-bottom: 0; color: var(--muted); }
.recipe-dialog {
  width: min(900px, calc(100% - 24px));
  max-height: min(88vh, 980px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 35px 100px rgba(8,24,39,0.35);
}
.recipe-dialog::backdrop { background: rgba(8,24,39,0.52); backdrop-filter: blur(5px); }
.dialog-actions {
  position: sticky;
  top: 12px;
  z-index: 4;
  display: flex;
  float: right;
  gap: 7px;
  margin: 12px 12px -54px 0;
}
.dialog-icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(15,39,66,0.92);
  color: #fff;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}
#closeRecipe { font-size: 1.7rem; }
.recipe-detail { padding: 34px; }
.recipe-detail-image {
  display: block;
  width: calc(100% + 68px);
  max-height: 420px;
  margin: -34px -34px 30px;
  object-fit: cover;
  border-radius: 24px 24px 0 0;
  background: var(--sky-100);
}
.recipe-detail-head { padding-right: 90px; }
.recipe-detail-head h2 { margin: 8px 0 10px; font-size: clamp(2rem, 5vw, 3.2rem); }
.recipe-detail-head .lead { max-width: 700px; color: #4b6071; font-size: 1.05rem; line-height: 1.6; }
.recipe-stat-row { justify-content: flex-start; flex-wrap: wrap; margin: 18px 0 24px; }
.recipe-stat { padding: 9px 12px; border-radius: 12px; background: var(--sky-50); border: 1px solid var(--line); }
.recipe-stat span { display: block; color: var(--muted); font-size: 0.7rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.06em; }
.recipe-stat strong { display: block; margin-top: 2px; font-size: 0.91rem; }
.recipe-detail-grid { display: grid; grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr); gap: 28px; }
.recipe-detail h3 { margin-bottom: 12px; font-size: 1.25rem; }
.ingredient-list, .step-list { margin: 0; padding-left: 1.25rem; }
.ingredient-list li, .step-list li { margin-bottom: 10px; line-height: 1.52; }
.step-list li { padding-left: 5px; }
.recipe-notes { margin-top: 24px; padding: 18px 20px; border-radius: 16px; background: #fff8e7; border: 1px solid #f2dfad; }
.recipe-notes p:last-child { margin-bottom: 0; }
.recipe-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

@media (max-width: 980px) {
  .recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recipe-hero { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .recipe-layout { grid-template-columns: 1fr; }
  .recipe-sidebar { position: static; padding: 14px; }
  .category-list { display: flex; overflow-x: auto; padding-bottom: 2px; }
  .category-button { flex: 0 0 auto; width: auto; white-space: nowrap; }
  .recipe-grid { grid-template-columns: 1fr; }
  .recipe-detail { padding: 24px 20px; }
  .recipe-detail-image { width: calc(100% + 40px); margin: -24px -20px 24px; }
  .recipe-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .recipe-header { align-items: flex-start; }
  .header-home-link { padding: 8px 11px; font-size: 0.8rem; }
  .recipe-hero { padding: 21px; }
  .results-heading { align-items: flex-start; }
}

@media print {
  @page { margin: 0.55in; }
  body { background: #fff !important; color: #000; }
  body > .site-shell { display: none !important; }
  .recipe-dialog {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }
  .recipe-dialog::backdrop, .dialog-actions { display: none !important; }
  .recipe-detail { padding: 0 !important; }
  .recipe-detail-image {
    width: 100% !important;
    max-height: 3.25in !important;
    margin: 0 0 0.25in !important;
    border-radius: 0 !important;
    object-fit: contain !important;
  }
  .recipe-detail-head { padding-right: 0 !important; }
  .recipe-detail-head h2 { font-size: 26pt !important; }
  .recipe-stat { border-color: #bbb !important; background: #fff !important; }
  .recipe-category-chip, .recipe-tag { border: 1px solid #bbb; background: #fff !important; color: #000 !important; }
  .recipe-detail-grid { grid-template-columns: 0.8fr 1.2fr !important; gap: 0.35in !important; }
  .recipe-notes { background: #fff !important; border-color: #bbb !important; break-inside: avoid; }
}
