/* Kitchen — "the good table" Design System
   Fonts: Playfair Display (headings), DM Sans (body/UI), DM Mono (eyebrows/meta)
   Colors: canvas #f7f6f2, forest green #253a34, terracotta #b55d44, soft tan #e9e6db
*/

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;1,500;1,600&display=swap');

:root {
  font-family: 'DM Sans', sans-serif;
  color: #20201d;
  background: #f7f6f2;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { display: block; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2 { font-family: 'Playfair Display', serif; font-weight: 500; letter-spacing: -.045em; }
em { font-style: italic; color: #b55d44; font-weight: 500; }

/* Ensure [hidden] is respected even when display is set by class */
.recipe-grid[hidden],
#loading-skeletons[hidden],
#featured-row[hidden],
#empty-state[hidden],
#search-empty-state[hidden] {
  display: none !important;
}

.app-shell { min-height: 100vh; background: #f7f6f2; }

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Header ─── */
.site-header {
  height: 76px; max-width: 1320px; margin: auto;
  padding: 0 40px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #deded7;
}
.logo-button { border: 0; background: transparent; padding: 0; color: #252522; }
.logo { 
  font-family: 'Playfair Display', serif; 
  font-size: 26px; 
  letter-spacing: -.05em; 
  color: #273c36; 
  white-space: nowrap; 
  text-decoration: none;
  display: flex;
  align-items: center;
}
.logo span { color: #b55d44; font-style: italic; }
nav { display: flex; gap: 32px; margin-left: 7%; }
nav button, .header-actions button { 
  border: 0; background: none; color: #4e504a; font-size: 11px; font-weight: 700; 
  letter-spacing: .1em; text-transform: uppercase; transition: color .2s; 
}
nav button:hover, .header-actions button:hover { color: #b55d44; }
.header-actions { display: flex; align-items: center; gap: 22px; }
.icon-button { padding: 8px; display: grid; place-items: center; }
.auth-btn { border-bottom: 1px solid #252522; padding: 0 0 5px; }

/* Language Toggle (compact in header) */
.lang-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  color: #4e504a;
  background: transparent;
  border: 1px solid #c9c9c0;
  border-radius: 4px;
  transition: all .2s;
}
.lang-toggle:hover { border-color: #253a34; color: #253a34; }
.lang-toggle.active { background: #253a34; color: #fff; border-color: #253a34; }
.lang-toggle .lang-te { display: none; }
.lang-toggle.active .lang-en { display: none; }
.lang-toggle.active .lang-te { display: inline; }

/* ─── Shared elements ─── */
.eyebrow { 
  font-family: 'DM Mono', monospace; font-size: 10px; text-transform: uppercase; 
  letter-spacing: .18em; color: #a45e49; margin: 0 0 18px; 
}
.eyebrow.center { text-align: center; }
.eyebrow small { color: #8a8c83; text-transform: none; letter-spacing: 0; margin-left: 6px; font-family: 'DM Sans', sans-serif; }

.primary-button, .outline-button {
  border: 0; padding: 13px 20px; display: inline-flex; align-items: center; gap: 14px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  transition: transform .2s, background .2s, border-color .2s;
}
.primary-button { background: #253a34; color: #fff; }
.primary-button:hover { transform: translateY(-2px); background: #b55d44; }
.outline-button { color: #253a34; border: 1px solid #c9c9c0; background: transparent; }
.outline-button:hover { border-color: #253a34; }
.outline-button.saved { background: #e8e5d9; border-color: #e8e5d9; color: #b55d44; }

/* ─── Discover bar ─── */
.discover-bar {
  background: #e9e6db; padding: 60px 40px 50px; border-bottom: 1px solid #deded7;
}
.discover-content { max-width: 720px; margin: 0 auto 40px; text-align: center; }
.discover-title { font-size: clamp(40px, 5vw, 60px); line-height: 1; color: #253a34; margin: 0; }
.discover-subtitle { font-size: 18px; color: #5a5d54; margin: 14px 0 0; font-weight: 400; }
@media (min-width: 768px) {
  .discover-subtitle { font-size: 20px; }
}
.filter-row { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; align-items: center; }

.search-wrap {
  width: 100%; max-width: 480px; display: flex; align-items: center; gap: 10px;
  background: #f7f6f2; border: 1px solid #d4d4ca; padding: 12px 16px; transition: border-color .2s;
}
.search-wrap:focus-within { border-color: #253a34; }
.search-wrap svg { color: #8a8c83; flex-shrink: 0; }
.search-wrap input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 14px; color: #253a34; }
.search-wrap input::placeholder { color: #a2a499; }
.clear-search { padding: 2px; color: #8a8c83; display: grid; place-items: center; }

.pill-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pill {
  padding: 10px 18px; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  border: 1px solid #c9c9c0; border-radius: 999px; color: #5e6058;
  transition: all .2s; min-height: 44px; min-width: 44px;
}
.pill:hover { border-color: #253a34; color: #253a34; }
.pill.active { background: #b55d44; color: #fff; border-color: #b55d44; }

/* ─── Recipe section ─── */
.recipe-section { max-width: 1320px; margin: auto; padding: 70px 40px 90px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 36px; }
.section-heading.secondary { margin-top: 70px; }
.result-count { font-family: 'DM Mono', monospace; font-size: 11px; color: #7d7e75; margin: 0; letter-spacing: .05em; }
.sub-head { font-size: clamp(28px, 3.5vw, 40px); color: #253a34; margin: 0; }

.empty-state { text-align: center; padding: 80px 20px; color: #8a8c83; }
.empty-state svg { color: #c9c9c0; margin-bottom: 16px; }
.empty-state svg[hidden] { display: none; }
.empty-state h3 { font-family: 'Playfair Display', serif; font-size: 26px; color: #253a34; margin-bottom: 8px; font-weight: 500; }
.empty-state h3[hidden] { display: none; }
.empty-state p { margin: 0; font-size: 14px; }
.empty-state p[hidden] { display: none; }
.empty-reset-btn {
  display: inline-block; padding: 14px 28px; font-size: 14px; font-weight: 500;
  color: #b55d44; min-height: 44px;
  border: 1px solid #b55d44; border-radius: 999px; background: transparent;
  transition: all .2s; cursor: pointer;
}
.empty-reset-btn:hover { background: #b55d44; color: #fff; }
.empty-reset-btn[hidden] { display: none; }

/* ─── Featured row ─── */
.featured-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; margin-bottom: 70px; }
.featured-card { cursor: pointer; }
.featured-image { height: 520px; position: relative; overflow: hidden; background: #ddd; }
.featured-image img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.8); transition: transform .5s; }
.featured-card:hover .featured-image img { transform: scale(1.04); }
.featured-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(37,58,52,.92) 0%, rgba(37,58,52,.6) 60%, transparent 100%);
  padding: 40px 34px 30px; color: #fff;
}
.featured-tag {
  display: inline-block; font-family: 'DM Mono', monospace; font-size: 9px; text-transform: uppercase;
  letter-spacing: .14em; background: #b55d44; padding: 5px 10px; margin-bottom: 14px;
}
.featured-overlay .card-category.light { color: #d4c9b8; }
.featured-overlay h2 { font-size: 34px; line-height: 1.05; color: #fff; margin-bottom: 10px; text-decoration: none; }
@media (hover: hover) {
  .featured-card:hover .featured-overlay h2,
  .featured-card:focus .featured-overlay h2 { text-decoration: underline; text-decoration-color: #fff; text-underline-offset: 4px; }
}
.featured-desc { font-size: 13px; color: #d4d8d2; margin: 0 0 16px; max-width: 420px; line-height: 1.6; }
.featured-meta { display: flex; gap: 20px; font-size: 11px; color: #d4d8d2; }
.featured-meta span { display: flex; align-items: center; gap: 6px; }

.featured-side { display: flex; flex-direction: column; gap: 16px; }
.side-title { font-size: 28px; color: #253a34; margin: 0 0 4px; }
.side-card {
  display: flex; gap: 16px; cursor: pointer; padding: 8px 0;
  border-bottom: 1px solid #e3e1d9;
}
.side-card h4 { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 500; color: #253a34; margin: 4px 0 8px; letter-spacing: -.02em; text-decoration: none; }
@media (hover: hover) {
  .side-card:hover h4 { text-decoration: underline; text-decoration-color: #253a34; text-underline-offset: 3px; }
}
.side-card-image { width: 88px; height: 88px; object-fit: cover; filter: saturate(.8); flex-shrink: 0; background: #e3e1d9; }
.side-meta { font-size: 11px; color: #8a8c83; display: flex; align-items: center; gap: 6px; }
.side-meta svg { color: #b55d44; }

/* ─── Recipe grid ─── */
.recipe-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.recipe-card {
  cursor: pointer; background: transparent; padding: 0; text-align: left;
  transition: transform .3s;
}
.recipe-card:hover { transform: translateY(-4px); }
.card-image-wrap { height: 250px; position: relative; overflow: hidden; background: #e3e1d9; }
.card-image-wrap img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.8); transition: transform .4s; }
.recipe-card:hover .card-image-wrap img { transform: scale(1.05); }

.save-chip {
  position: absolute; top: 14px; right: 14px; background: rgba(247,246,242,.92);
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #253a34;
  backdrop-filter: blur(4px); pointer-events: none;
}
.save-chip.large { width: 40px; height: 40px; }

.card-content { padding: 18px 0 0; }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-category { font-family: 'DM Mono', monospace; color: #a45e49; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; margin: 0; }
.card-time { color: #8a8c83; font-size: 11px; display: flex; gap: 5px; align-items: center; }
.card-content h3 { font-family: 'Playfair Display', serif; font-size: 22px; letter-spacing: -.025em; font-weight: 500; margin: 0 0 10px; color: #253a34; line-height: 1.2; text-decoration: none; }
@media (hover: hover) {
  .recipe-card:hover .card-content h3,
  .recipe-card:focus .card-content h3 { text-decoration: underline; text-decoration-color: #253a34; text-underline-offset: 3px; }
}
.card-desc { font-size: 13px; color: #6d7067; line-height: 1.6; margin: 0 0 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid #e3e1d9; }
.card-author { font-size: 11px; color: #8a8c83; }
.read-link { font-size: 11px; font-weight: 600; color: #253a34; display: flex; align-items: center; gap: 6px; transition: gap .2s; }
.recipe-card:hover .read-link { gap: 10px; color: #b55d44; }

/* Placeholder for images — cuisine-colored gradient monograms */
.placeholder-image {
  width: 100%; height: 100%;
  background: linear-gradient(160deg, #3a4a3f 0%, #2a3a30 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 140px;
  font-style: italic;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.12);
  letter-spacing: -0.03em;
}
.placeholder-image.small { font-size: 32px; }
.placeholder-image.card { font-size: 80px; }
.placeholder-image.featured { font-size: 180px; }
.placeholder-image.detail { font-size: 200px; }

/* Cuisine gradient variants */
.placeholder-image.cuisine-mexican {
  background: linear-gradient(160deg, #722f37 0%, #4a1f24 100%);
}
.placeholder-image.cuisine-american {
  background: linear-gradient(160deg, #5c4033 0%, #3a2920 100%);
}
.placeholder-image.cuisine-indian {
  background: linear-gradient(160deg, #b5651d 0%, #8b4513 100%);
}
.placeholder-image.cuisine-street {
  background: linear-gradient(160deg, #3a5a40 0%, #2a4030 100%);
}
.placeholder-image.cuisine-comfort {
  background: linear-gradient(160deg, #5a5a40 0%, #3a3a28 100%);
}
.placeholder-image.cuisine-italian {
  background: linear-gradient(160deg, #7b4b3a 0%, #5a3528 100%);
}
.placeholder-image.cuisine-japanese {
  background: linear-gradient(160deg, #4a4a5a 0%, #2a2a3a 100%);
}
.placeholder-image.cuisine-thai {
  background: linear-gradient(160deg, #8b6914 0%, #6b4910 100%);
}
.placeholder-image.cuisine-french {
  background: linear-gradient(160deg, #5a4a6a 0%, #3a2a4a 100%);
}
.placeholder-image.cuisine-greek {
  background: linear-gradient(160deg, #2a5a7a 0%, #1a3a5a 100%);
}
.placeholder-image.cuisine-korean {
  background: linear-gradient(160deg, #8b3a3a 0%, #5a2828 100%);
}
.placeholder-image.cuisine-middle-eastern {
  background: linear-gradient(160deg, #a0784a 0%, #7a5830 100%);
}
.placeholder-image.cuisine-turkish {
  background: linear-gradient(160deg, #6a4a4a 0%, #4a3030 100%);
}
.placeholder-image.cuisine-chinese {
  background: linear-gradient(160deg, #8b2323 0%, #5a1818 100%);
}
.placeholder-image.cuisine-vietnamese {
  background: linear-gradient(160deg, #4a6a4a 0%, #2a4a2a 100%);
}
.placeholder-image.cuisine-spanish {
  background: linear-gradient(160deg, #9a4a1a 0%, #6a3010 100%);
}
.placeholder-image.cuisine-mediterranean {
  background: linear-gradient(160deg, #4a6a8a 0%, #2a4a6a 100%);
}

/* ─── Detail page ─── */
.detail-page { max-width: 1320px; margin: auto; padding: 30px 40px 90px; }
.detail-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.back-button { border: 0; background: transparent; display: flex; align-items: center; gap: 10px; color: #65675f; padding: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; transition: color .2s; }
.back-button:hover { color: #b55d44; }
.detail-share { display: flex; gap: 8px; }
.detail-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(40px, 7vw, 90px); align-items: center; padding: 30px 0 80px; }
.detail-image { height: 560px; position: relative; overflow: hidden; background: #e9e6db; }
.detail-image img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.8); }
.detail-copy .eyebrow { margin-bottom: 12px; }
.detail-copy h1 { font-size: clamp(48px, 5.5vw, 80px); color: #253a34; line-height: .95; margin-bottom: 26px; }
.detail-intro { max-width: 420px; font-size: 16px; line-height: 1.7; color: #6d7067; margin: 0 0 26px; }
.detail-meta { display: flex; gap: 28px; margin: 0 0 32px; flex-wrap: wrap; }
.detail-meta > span { display: grid; grid-template-columns: 26px auto; column-gap: 8px; }
.detail-meta svg { grid-row: span 2; color: #b55d44; }
.detail-meta b { font-family: 'Playfair Display', serif; font-size: 17px; font-weight: 500; color: #253a34; }
.detail-meta small { color: #85867e; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ─── Recipe body (ingredients + method) ─── */
.recipe-body { border-top: 1px solid #d9d8cf; padding-top: 70px; display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(50px, 8vw, 100px); }
.ingredients-panel { position: relative; }
.ingredients-sticky { position: sticky; top: 30px; }
.ingredients-sticky h2, .method h2 { font-size: clamp(28px, 3.5vw, 38px); color: #253a34; margin: 0 0 24px; }
.servings { border-bottom: 1px solid #d9d8cf; padding: 16px 0; display: flex; align-items: center; gap: 12px; color: #787a72; font-size: 12px; margin-bottom: 10px; }
.servings svg { color: #b55d44; }
.servings button { border: 1px solid #d4d4ca; border-radius: 50%; background: transparent; width: 28px; height: 28px; display: grid; place-items: center; color: #253a34; transition: background .2s; }
.servings button:hover { background: #e8e5d9; }
.servings b { color: #253a34; font-size: 14px; }
.ingredients ul { list-style: none; padding: 0; margin: 0; }
.ingredients li {
  display: grid; grid-template-columns: 22px 70px 1fr; gap: 8px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid #e3e1d9; color: #5f6259; font-size: 14px;
  cursor: pointer; transition: color .2s;
}
.ingredients li.checked { color: #b5b8ae; }
.ingredients li.checked .ing-name { text-decoration: line-through; text-decoration-color: #b5b8ae; }
.ing-name { transition: color 120ms ease-out, text-decoration-color 120ms ease-out; }
@media (prefers-reduced-motion: reduce) {
  .ing-name { transition: none; }
}
.check-box {
  position: relative;
  width: 18px; height: 18px; border: 1.5px solid #c9c9c0; border-radius: 4px;
  display: grid; place-items: center; color: #b55d44;
}
.check-box::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  min-width: 44px; min-height: 44px;
}
.check-box svg {
  opacity: 0;
  transform: scale(0.5);
}
.ingredients li.checked .check-box { background: #b55d44; border-color: #b55d44; color: #fff; }
.ingredients li.checked .check-box svg {
  opacity: 1;
  transform: scale(1);
  animation: check-draw 120ms ease-out;
}
@keyframes check-draw {
  0% { opacity: 0; transform: scale(0.5); }
  50% { transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .ingredients li.checked .check-box svg {
    animation: none;
    opacity: 1;
    transform: scale(1);
  }
}
.ing-qty { font-family: 'DM Mono', monospace; font-size: 11px; color: #253a34; }
.ingredients li.checked .ing-qty { color: #b5b8ae; }
.ing-name { line-height: 1.4; }

/* ─── Method ─── */
.step-progress { margin-bottom: 28px; }
.step-progress > span { font-family: 'DM Mono', monospace; font-size: 11px; color: #7d7e75; display: block; margin-bottom: 8px; }
.progress-track { height: 3px; background: #e3e1d9; overflow: hidden; }
.progress-fill { height: 100%; background: #b55d44; transition: width .3s; }

/* Checked progress counter under step jump bar */
.checked-progress {
  display: flex;
  gap: 16px;
  font-family: 'DM Mono', monospace;
  font-size: 15px;
  color: #7d7e75;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e3e1d9;
}
.checked-progress span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.checked-progress .check-icon {
  width: 16px;
  height: 16px;
  color: #b55d44;
}

/* Plate's ready message */
.plates-ready {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 15px;
  color: #253a34;
  margin-left: auto;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 200ms ease-out, transform 200ms ease-out;
}
.plates-ready.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .plates-ready { transition: none; }
}
.method-step { display: grid; grid-template-columns: 44px 1fr; gap: 18px; padding: 24px 0; border-top: 1px solid #d9d8cf; align-items: start; }
.method-step:last-of-type { border-bottom: 1px solid #d9d8cf; }
.step-num {
  width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  border: 1.5px solid #c9c9c0; border-radius: 50%;
  display: grid; place-items: center; color: #253a34; font-family: 'DM Mono', monospace; font-size: 12px;
  transition: all .25s; cursor: pointer;
}
.step-num:hover { border-color: #b55d44; color: #b55d44; }
.method-step.done .step-num { background: #b55d44; border-color: #b55d44; color: #fff; }
.method-step.done h3 { color: #a2a499; }
.method-step.done p { color: #b5b8ae; }
.method-step h3 { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 500; margin: 0 0 8px; color: #253a34; transition: color .25s; }
.method-step p { color: #73756c; line-height: 1.6; font-size: 18px; max-width: 520px; margin: 0; transition: color .25s; }
@media (min-width: 768px) {
  .method-step p { font-size: 20px; }
}

.cook-note {
  margin-top: 36px; padding: 32px; background: #e9e6db;
  display: grid; grid-template-columns: 40px 1fr; gap: 16px; align-items: start;
}
.cook-note > svg { color: #b55d44; }
.cook-note h3 { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 500; margin: 0 0 8px; color: #253a34; }
.cook-note p { color: #73756c; line-height: 1.6; font-size: 13px; margin: 0; }

/* ─── Related ─── */
.related-section { max-width: 1320px; margin: auto; padding: 0 40px 90px; }
.related-section .section-heading h2 { font-size: clamp(28px, 3.5vw, 40px); color: #253a34; margin: 0; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

/* ─── Footer ─── */
footer {
  border-top: 1px solid #deded7; background: #f2f0e9;
  padding: 56px 40px 36px; max-width: 1320px; margin: auto;
  display: grid; grid-template-columns: 1fr 2fr; gap: 50px;
}
.footer-brand .logo { font-size: 24px; margin-bottom: 12px; }
.footer-brand p { color: #898a82; font-size: 13px; margin: 0; }
.footer-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.footer-links h4 { font-family: 'DM Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: #253a34; margin: 0 0 16px; }
.footer-links button { display: block; color: #6d7067; font-size: 13px; padding: 6px 0; text-align: left; }
.footer-links button:hover { color: #b55d44; }
.footer-bottom { grid-column: 1 / -1; padding-top: 28px; border-top: 1px solid #deded7; }
.footer-bottom span { color: #898a82; font-size: 11px; }

/* ─── Toast Notifications ─── */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 400px;
}
@media (max-width: 800px) {
  #toast-container { bottom: 88px; }
}

.toast {
  background: #253a34;
  color: #f7f6f2;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  pointer-events: auto;
  animation: toast-enter .25s ease-out;
}

.toast.toast-success { background: #253a34; }
.toast.toast-error { background: #b55d44; }
.toast.toast-exit { animation: toast-exit .15s ease-in forwards; }

@keyframes toast-enter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* ─── Sheets (Modals) ─── */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet[hidden] { display: none; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(37, 58, 52, 0.5);
  animation: fade-in .25s ease-out;
}

.sheet-content {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  background: #f7f6f2;
  display: flex;
  flex-direction: column;
  animation: sheet-enter .25s ease-out;
  overflow-y: auto;
}

/* Full-screen detail sheet */
#detail-sheet .sheet-content {
  max-width: 100%;
  max-height: 100%;
  height: 100%;
  overflow-y: auto;
}

.sheet-content-sm { max-width: 420px; }

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheet-enter {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #deded7;
  flex-shrink: 0;
}

.sheet-close {
  padding: 8px;
  margin: -8px;
  color: #65675f;
  transition: color .2s;
}
.sheet-close:hover { color: #b55d44; }

.sheet-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 500;
  color: #253a34;
  margin: 0;
}

.sheet-actions { display: flex; gap: 8px; margin-left: auto; }

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  overscroll-behavior: contain;
}

/* ─── Paste Recipe ─── */
.paste-section { margin-bottom: 16px; }
.paste-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 14px 18px; font-size: 16px; font-weight: 500; color: #253a34;
  background: rgba(37, 58, 52, 0.06); border: 1px dashed #253a34; border-radius: 8px;
  transition: all 0.2s; min-height: 52px; cursor: pointer;
}
.paste-toggle:hover { background: rgba(37, 58, 52, 0.1); border-style: solid; }
.paste-toggle.active { border-style: solid; border-radius: 8px 8px 0 0; border-bottom: none; }
.paste-toggle-arrow { margin-left: auto; transition: transform 0.2s; }
.paste-toggle.active .paste-toggle-arrow { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
  .paste-toggle, .paste-toggle-arrow { transition: none; }
}
.paste-panel {
  padding: 18px; background: #f7f6f2; border: 1px solid #253a34;
  border-top: none; border-radius: 0 0 8px 8px;
}
.paste-panel .form-label { display: block; margin-bottom: 8px; font-size: 16px; }
.paste-textarea { min-height: 120px; font-size: 18px; line-height: 1.5; }
.paste-helper { font-size: 15px; color: #5a5d54; margin: 10px 0 0; }
.paste-actions { display: flex; gap: 10px; margin-top: 14px; }
.paste-actions .btn { min-height: 48px; min-width: 48px; font-size: 16px; padding: 12px 20px; }
.paste-divider {
  display: flex; align-items: center; gap: 16px; margin-top: 20px;
  color: #5a5d54; font-size: 15px;
}
.paste-divider::before, .paste-divider::after { content: ''; flex: 1; height: 1px; background: #d4d4ca; }
@media (min-width: 768px) {
  .paste-textarea { font-size: 20px; }
}

/* ─── Forms ─── */
.recipe-form, .auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: #253a34;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.form-hint {
  font-size: 11px;
  color: #8a8c83;
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 8px;
}

.form-input,
.form-select,
.form-textarea {
  padding: 12px 14px;
  font-size: 14px;
  background: #fff;
  border: 1px solid #d4d4ca;
  transition: border-color .2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #253a34;
}

.form-input::placeholder,
.form-textarea::placeholder { color: #a2a499; }

.form-textarea { resize: vertical; min-height: 100px; }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23253a34' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

.form-error {
  font-size: 12px;
  color: #b55d44;
  min-height: 18px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { grid-template-columns: repeat(3, 1fr); }

.form-actions { padding-top: 16px; }

.password-wrapper { position: relative; }
.password-wrapper .form-input { padding-right: 48px; }
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px;
  color: #8a8c83;
  transition: color .2s;
}
.password-toggle:hover { color: #253a34; }

.auth-header { text-align: center; margin-bottom: 24px; }
.auth-title { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 500; margin-bottom: 8px; color: #253a34; }
.auth-subtitle { font-size: 14px; color: #6d7067; margin: 0; }

/* Button variants for forms */
.btn { 
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; font-size: 12px; font-weight: 600; 
  letter-spacing: .05em; text-transform: uppercase;
  transition: all .2s;
}
.btn-primary { background: #253a34; color: #fff; border: none; }
.btn-primary:hover { background: #b55d44; }
.btn-ghost { background: transparent; color: #253a34; border: 1px solid #d4d4ca; }
.btn-ghost:hover { border-color: #253a34; }
.btn-danger { color: #b55d44; }
.btn-danger:hover { background: rgba(181, 93, 68, 0.1); }
.btn-lg { padding: 16px 24px; font-size: 13px; }
.btn-sm { padding: 8px 14px; font-size: 10px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.loading { position: relative; color: transparent; pointer-events: none; }
.btn.loading::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.btn-primary.loading::after { border-color: rgba(255,255,255,.3); border-top-color: #fff; }

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

/* ─── Confirm Dialog ─── */
.dialog {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.dialog[hidden] { display: none; }

.dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(37, 58, 52, 0.5);
  animation: fade-in .15s ease-out;
}

.dialog-content {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: #f7f6f2;
  padding: 32px;
  animation: dialog-enter .15s ease-out;
}

@keyframes dialog-enter {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.dialog-title { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 500; margin-bottom: 8px; color: #253a34; }
.dialog-message { font-size: 14px; color: #6d7067; margin-bottom: 24px; }
.dialog-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* ─── Video Section ─── */
.video-section {
  padding: 0 var(--content-padding, 44px) 60px;
  max-width: 900px;
  margin: 0 auto;
}

.video-frame {
  background: #e9e6db;
  border-radius: 8px;
  overflow: hidden;
}

.video-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 60px 24px;
  gap: 12px;
  text-decoration: none;
  color: #253a34;
  transition: background .2s;
}

.video-cta:hover {
  background: #e3e1d9;
}

.video-cta:focus-visible {
  outline: 3px solid rgba(37, 58, 52, 0.3);
  outline-offset: 2px;
}

.video-placeholder {
  width: 100px;
  height: 100px;
  background: #f7f6f2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b55d44;
  transition: background .2s, color .2s, transform .2s;
}

.video-cta:hover .video-placeholder {
  background: #253a34;
  color: #fff;
  transform: scale(1.05);
}

.video-link-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.video-helper {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #6d7067;
  letter-spacing: 0.01em;
}

@media (prefers-reduced-motion: reduce) {
  .video-cta,
  .video-placeholder {
    transition: none;
  }
  .video-cta:hover .video-placeholder {
    transform: none;
  }
}

/* Video Embed Container */
.video-embed-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  background: #e9e6db;
  border-radius: 8px;
  overflow: hidden;
}

.video-embed-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-open-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: #6d7067;
  text-decoration: none;
  transition: color .2s;
}

.video-open-link:hover {
  color: #b55d44;
}


/* Detail Image with actual images */
.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.85);
}

/* Card images */
.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.8);
  transition: transform .4s;
}

.recipe-card:hover .card-image-wrap img {
  transform: scale(1.05);
}

/* Featured image with actual images */
.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.8);
  transition: transform .5s;
}

.featured-card:hover .featured-image img {
  transform: scale(1.04);
}

/* Side card images */
.side-card-image {
  width: 88px;
  height: 88px;
  object-fit: cover;
  filter: saturate(.8);
  flex-shrink: 0;
  background: #e3e1d9;
}

/* ─── FAB ─── */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  width: 56px;
  height: 56px;
  background: #253a34;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 58, 52, 0.3);
  transition: all .2s;
}
.fab:hover { background: #b55d44; transform: scale(1.05); }
.fab[hidden] { display: none !important; }

.guest-nudge {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  padding: 14px 22px;
  background: #f7f6f2;
  color: #4a4d44;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid #c4c4ba;
  border-radius: 28px;
  box-shadow: 0 2px 8px rgba(37, 58, 52, 0.12);
  transition: all .2s;
  cursor: pointer;
  min-height: 48px;
  min-width: 48px;
}
.guest-nudge:hover, .guest-nudge:focus { background: #fff; color: #253a34; border-color: #253a34; outline: none; }
.guest-nudge:focus-visible { box-shadow: 0 0 0 3px rgba(37, 58, 52, 0.3); }
@media (prefers-reduced-motion: reduce) {
  .guest-nudge { transition: none; }
}
.guest-nudge[hidden] { display: none !important; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .featured-row { grid-template-columns: 1fr; }
  .featured-image { height: 440px; }
  .recipe-grid, .related-grid { grid-template-columns: 1fr 1fr; }
  .recipe-body { grid-template-columns: 1fr; gap: 50px; }
  .ingredients-sticky { position: static; }
  .detail-hero { grid-template-columns: 1fr; gap: 40px; }
  .detail-image { height: 400px; }
}

@media (min-width: 640px) {
  .sheet { align-items: center; }
}

@media (max-width: 800px) {
  .site-header { height: 66px; padding: 0 22px; }
  .site-header nav { display: none; }
  .header-actions { gap: 12px; }
  .logo { font-size: 22px; }
  .discover-bar { padding: 45px 22px 40px; }
  .recipe-section { padding: 55px 22px 75px; }
  .recipe-grid, .related-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .featured-overlay { padding: 30px 22px 24px; }
  .featured-overlay h2 { font-size: 28px; }
  .featured-image { height: 380px; }
  .detail-page { padding: 22px 22px 75px; }
  .detail-hero { grid-template-columns: 1fr; gap: 40px; padding: 20px 0 60px; }
  .detail-image { height: 400px; }
  .detail-copy h1 { font-size: 52px; }
  .detail-meta { gap: 20px; }
  .related-section { padding: 0 22px 70px; }
  footer { grid-template-columns: 1fr; gap: 30px; padding: 40px 22px 30px; }
  .footer-links { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .footer-bottom { flex-direction: column; gap: 16px; }
}

@media (max-width: 520px) {
  .recipe-grid, .related-grid { grid-template-columns: 1fr; }
  .card-image-wrap { height: 280px; }
  .discover-title { font-size: 38px; }
  .detail-copy h1 { font-size: 46px; }
  .detail-actions .primary-button, .detail-actions .outline-button { flex: 1; justify-content: center; }
  .footer-links { grid-template-columns: 1fr 1fr; }
  .cook-note { padding: 24px 20px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
