:root {
  color-scheme: light;
  --ink: #19251f;
  --muted: #6d776f;
  --forest: #315b49;
  --forest-dark: #234638;
  --sage: #dce8df;
  --cream: #f7f2e8;
  --paper: #fffdf8;
  --orange: #d97842;
  --line: #e6e2d9;
  --shadow: 0 18px 50px rgba(37, 55, 44, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { background: var(--cream); }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 2%, rgba(217, 120, 66, 0.12), transparent 26rem),
    var(--cream);
}

button, input, select { font: inherit; }
button { color: inherit; }
button, .recipe-card { -webkit-tap-highlight-color: transparent; }

.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;
}

.app-shell {
  width: min(100%, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) clamp(16px, 4vw, 40px) calc(48px + env(safe-area-inset-bottom));
}

.hero { padding: 32px 2px 26px; }
.hero__eyebrow, .sheet__eyebrow, .results-heading__label {
  display: block;
  margin-bottom: 7px;
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero__row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.hero__brand { min-width: 0; }
.hero__brand img { display: block; width: min(310px, 72vw); height: auto; }
.hero p { margin: 12px 0 0; color: var(--muted); font-size: clamp(0.95rem, 2.2vw, 1.08rem); }
.install-button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; margin-top: 18px; padding: 8px 13px; border: 1px solid rgba(49, 91, 73, 0.22); border-radius: 12px; color: var(--forest-dark); background: rgba(255, 253, 248, 0.72); font-size: 0.8rem; font-weight: 800; cursor: pointer; }
.install-button[hidden] { display: none; }
.install-button span { font-size: 1.05rem; }

.search-panel { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.search-box, .ingredient-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 16px;
  border: 1px solid rgba(49, 91, 73, 0.12);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 8px 28px rgba(37, 55, 44, 0.06);
}

.search-box svg, .ingredient-search svg, .filter-button svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }
.search-box svg, .ingredient-search svg { flex: 0 0 auto; color: var(--forest); }
.search-box input, .ingredient-search input { width: 100%; height: 54px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-box input::placeholder, .ingredient-search input::placeholder { color: #969e98; }

.filter-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 112px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  color: white;
  background: var(--forest);
  box-shadow: 0 10px 25px rgba(49, 91, 73, 0.2);
  cursor: pointer;
}

.filter-count {
  display: grid;
  min-width: 21px;
  height: 21px;
  place-items: center;
  padding: 0 5px;
  border-radius: 99px;
  color: var(--forest-dark);
  background: #f4d4bd;
  font-size: 0.72rem;
  font-weight: 800;
}

.section-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 26px; padding: 5px; border-radius: 16px; background: rgba(49, 91, 73, 0.08); }
.section-tab { min-height: 44px; padding: 9px 14px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; font-weight: 750; cursor: pointer; }
.section-tab.is-active { color: var(--forest-dark); background: var(--paper); box-shadow: 0 5px 16px rgba(37, 55, 44, 0.08); }

.season-filter, .diet-filter { margin-top: 18px; }
.season-filter__label { display: block; margin: 0 2px 8px; color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.season-filter__options, .diet-filter__options, .meal-filters { display: flex; gap: 8px; margin-inline: -16px; padding: 0 16px 4px; overflow-x: auto; scrollbar-width: none; }
.season-filter__options::-webkit-scrollbar, .diet-filter__options::-webkit-scrollbar, .meal-filters::-webkit-scrollbar { display: none; }
.diet-filter[hidden] { display: none; }
.meal-filters { margin-top: 12px; }
.meal-filters[hidden] { display: none; }
.meal-chip, .season-chip, .diet-chip { flex: 0 0 auto; min-height: 38px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 99px; background: rgba(255, 253, 248, 0.65); color: var(--muted); font-size: 0.86rem; cursor: pointer; }
.diet-chip { max-width: min(520px, 78vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meal-chip.is-active, .season-chip.is-active, .diet-chip.is-active { border-color: var(--forest); color: white; background: var(--forest); }

.quick-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quick-filters[hidden] { display: none; }
.quick-filter { min-height: 38px; padding: 8px 14px; border: 1px solid #cbdace; border-radius: 99px; color: var(--forest-dark); background: var(--sage); font-size: 0.86rem; font-weight: 800; cursor: pointer; }
.quick-filter span { margin-right: 4px; color: #94aa9b; }
.quick-filter.is-active { border-color: var(--forest); color: white; background: var(--forest); }
.quick-filter.is-active span { color: #bfe0ca; }

.active-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.active-filter { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border: 0; border-radius: 99px; background: #e7dfcf; color: #5b5344; font-size: 0.8rem; cursor: pointer; }
.active-filter--exclude { color: #82442f; background: #f4d6c7; }
.active-filter--meatless { color: var(--forest-dark); background: var(--sage); }

.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 30px 2px 16px; }
.results-heading__label { color: var(--forest); }
.results-heading h2 { margin: 0; font: 700 clamp(1.55rem, 4vw, 2rem) Georgia, serif; letter-spacing: -0.02em; }
.results-count { display: grid; min-width: 42px; height: 42px; place-items: center; border-radius: 50%; color: var(--forest); background: var(--sage); font-weight: 800; }

.sync-panel { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px 0 16px; padding: 12px 14px; border: 1px solid #d8e1da; border-radius: 16px; background: rgba(255, 253, 248, 0.75); }
.sync-panel[hidden] { display: none; }
.sync-panel__status { min-width: 0; }
.sync-panel__status strong { display: block; color: var(--forest-dark); font-size: 0.88rem; }
.sync-panel__status span { display: block; margin-top: 3px; color: var(--muted); font-size: 0.76rem; line-height: 1.35; }
.sync-panel--ok { border-color: #c6d9cb; background: #eef6ee; }
.sync-panel--warning { border-color: #e9c1ad; background: #fff1e9; }
.sync-panel--active { border-color: #cbdace; background: var(--sage); }
.sync-panel__actions { display: flex; flex: 0 0 auto; gap: 7px; }
.sync-button { min-height: 36px; padding: 7px 10px; border: 1px solid #cbdace; border-radius: 11px; color: var(--forest-dark); background: var(--paper); font-size: 0.75rem; font-weight: 800; cursor: pointer; }
.sync-button--primary { border-color: var(--forest); color: white; background: var(--forest); }
.sync-button:disabled { color: #8f9992; background: #edf0ec; cursor: default; }

.recipe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.recipe-card { position: relative; display: block; min-width: 0; padding: 0; overflow: hidden; border: 0; border-radius: 22px; text-align: left; background: var(--paper); box-shadow: 0 14px 38px rgba(37, 55, 44, 0.08); transition: transform 180ms ease, box-shadow 180ms ease; }
.recipe-card:hover { transform: translateY(-3px); box-shadow: 0 18px 42px rgba(37, 55, 44, 0.13); }
.recipe-card__open { position: absolute; z-index: 1; inset: 0; border: 0; background: transparent; cursor: pointer; }
.recipe-card__image-wrap { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--sage); }
.recipe-card__image { width: 100%; height: 100%; object-fit: cover; transition: transform 350ms ease; }
.recipe-card:hover .recipe-card__image { transform: scale(1.025); }
.recipe-card__category { position: absolute; top: 12px; left: 12px; padding: 7px 10px; border-radius: 99px; color: var(--forest-dark); background: rgba(255, 253, 248, 0.9); backdrop-filter: blur(8px); font-size: 0.72rem; font-weight: 800; }
.favorite-button { position: absolute; z-index: 2; top: 10px; right: 10px; display: grid; width: 42px; height: 42px; place-items: center; border: 0; border-radius: 50%; color: var(--forest-dark); background: rgba(255, 253, 248, 0.92); box-shadow: 0 5px 16px rgba(37, 55, 44, 0.14); font-size: 1.35rem; cursor: pointer; }
.favorite-button.is-favorite { color: #a94c3b; background: #fff5ef; }
.recipe-card__body { padding: 18px; }
.recipe-card h3 { min-height: 2.5em; margin: 0; font: 700 clamp(1.18rem, 2.8vw, 1.42rem)/1.18 Georgia, serif; }
.recipe-card__meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.meta-pill { padding: 5px 8px; border-radius: 8px; color: var(--forest-dark); background: var(--sage); font-size: 0.73rem; font-weight: 750; }
.meta-pill--diet { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #765037; background: #f3e3d5; }
.meta-pill--taste { color: #6d4266; background: #f1e1ef; }
.recipe-card__ingredients { min-height: 2.8em; margin: 12px 0 0; color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
.recipe-card__cta { display: inline-flex; gap: 7px; margin-top: 15px; color: var(--orange); font-size: 0.83rem; font-weight: 800; }

.loading-state, .empty-state { grid-column: 1 / -1; padding: 60px 20px; border: 1px dashed #cfc8ba; border-radius: 22px; text-align: center; color: var(--muted); background: rgba(255, 253, 248, 0.42); }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); font: 700 1.35rem Georgia, serif; }

dialog { color: var(--ink); }
dialog::backdrop { background: rgba(20, 31, 25, 0.56); backdrop-filter: blur(4px); }
.sheet { width: min(100%, 620px); max-height: min(86vh, 760px); margin: auto auto 0; padding: 0; overflow: hidden; border: 0; border-radius: 26px 26px 0 0; background: var(--paper); }
.sheet__content { display: grid; grid-template-rows: auto auto auto auto minmax(140px, 1fr) auto; max-height: inherit; }
.sheet__handle { width: 44px; height: 5px; margin: 10px auto 0; border-radius: 99px; background: #dad5ca; }
.sheet__header { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 16px 20px 14px; }
.sheet__header h2 { margin: 0; font: 700 1.75rem Georgia, serif; }
.icon-button { display: grid; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 50%; color: var(--muted); background: var(--cream); font-size: 1.7rem; cursor: pointer; }
.filter-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 20px; padding: 4px; border-radius: 13px; background: var(--cream); }
.filter-mode__button { padding: 10px 8px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 0.82rem; font-weight: 750; cursor: pointer; }
.filter-mode__button span { display: inline-grid; min-width: 19px; height: 19px; place-items: center; margin-left: 4px; border-radius: 99px; background: rgba(49, 91, 73, 0.1); font-size: 0.7rem; }
.filter-mode__button.is-active { color: var(--forest-dark); background: var(--paper); box-shadow: 0 3px 12px rgba(37, 55, 44, 0.08); }
.ingredient-search { margin: 14px 20px 10px; background: var(--cream); box-shadow: none; }
.ingredient-search input { height: 46px; }
.ingredient-list { padding: 0 20px 18px; overflow-y: auto; }
.ingredient-category { border-bottom: 1px solid var(--line); }
.ingredient-category summary { position: sticky; z-index: 1; top: 0; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 2px; color: var(--forest); background: var(--paper); font-size: 0.75rem; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; list-style: none; }
.ingredient-category summary::-webkit-details-marker { display: none; }
.ingredient-category summary::after { content: "⌄"; margin-left: 2px; color: var(--muted); font-size: 1.15rem; line-height: 1; transition: transform 160ms ease; }
.ingredient-category[open] summary::after { transform: rotate(180deg); }
.ingredient-category__bulk { padding: 7px 0 5px; }
.ingredient-category__action { width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid #cbdace; border-radius: 10px; color: var(--forest-dark); background: var(--sage); font-size: 0.72rem; font-weight: 850; cursor: pointer; }
.ingredient-category__action.is-selected { border-color: var(--forest); color: white; background: var(--forest); }
.ingredient-category__count { display: grid; min-width: 23px; height: 23px; place-items: center; margin-left: auto; padding: 0 6px; border-radius: 99px; color: var(--muted); background: var(--cream); font-size: 0.66rem; letter-spacing: 0; }
.ingredient-category__items { padding-bottom: 4px; }
.ingredient-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 2px; border: 0; border-bottom: 1px solid var(--line); text-align: left; background: transparent; cursor: pointer; }
.ingredient-option__check { display: grid; flex: 0 0 auto; width: 23px; height: 23px; place-items: center; border: 1.5px solid #bcc4bd; border-radius: 7px; color: white; }
.ingredient-option.is-selected .ingredient-option__check { border-color: var(--forest); background: var(--forest); }
.ingredient-option.is-selected .ingredient-option__check::after { content: "✓"; font-size: 0.75rem; font-weight: 900; }
.sheet__actions { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 10px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); }
.button { min-height: 48px; padding: 11px 16px; border-radius: 14px; font-weight: 800; cursor: pointer; }
.button--quiet { border: 1px solid var(--line); background: transparent; }
.button--primary { border: 0; color: white; background: var(--forest); }

.recipe-dialog { width: min(100%, 760px); max-width: none; height: 100%; max-height: none; margin: 0 0 0 auto; padding: 0; overflow-y: auto; border: 0; background: var(--paper); }
.recipe-detail { min-height: 100%; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
.recipe-detail__hero { position: relative; min-height: 330px; background: var(--sage); }
.recipe-detail__hero img { width: 100%; height: min(52vh, 500px); object-fit: cover; display: block; }
.recipe-detail__close { position: fixed; z-index: 2; top: calc(14px + env(safe-area-inset-top)); right: 14px; display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 50%; color: var(--ink); background: rgba(255, 253, 248, 0.92); box-shadow: 0 8px 24px rgba(20, 31, 25, 0.18); font-size: 1.6rem; cursor: pointer; }
.recipe-detail__content { position: relative; z-index: 1; margin: -28px 12px 0; padding: 26px clamp(18px, 5vw, 38px) 8px; border-radius: 28px 28px 0 0; background: var(--paper); }
.recipe-detail__category { color: var(--orange); font-size: 0.75rem; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.recipe-detail h2 { margin: 8px 0 18px; font: 700 clamp(2rem, 6vw, 3.2rem)/1.02 Georgia, serif; letter-spacing: -0.035em; }
.recipe-detail__diet { margin: -8px 0 20px; color: var(--muted); font-size: 0.85rem; }
.recipe-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: -8px 0 24px; }
.recipe-action { min-height: 42px; padding: 9px 13px; border: 1px solid #cbdace; border-radius: 12px; color: var(--forest-dark); background: var(--sage); font-size: 0.82rem; font-weight: 800; cursor: pointer; }
.recipe-action.is-favorite { border-color: #e9b9a9; color: #96412f; background: #fff0e8; }
.recipe-action--plan { border-color: var(--forest); color: white; background: var(--forest); }
.portion-control { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 22px 0 4px; padding: 14px 16px; border: 1px solid #d5dfd7; border-radius: 16px; background: var(--sage); }
.portion-control > div:first-child > span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.portion-control strong { color: var(--forest-dark); font-size: 1rem; }
.portion-control__buttons { display: flex; gap: 8px; }
.portion-control__buttons button { display: grid; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 12px; color: white; background: var(--forest); font-size: 1.4rem; font-weight: 700; cursor: pointer; }
.portion-control__buttons button:disabled { color: #8f9992; background: #cad6cd; cursor: default; }
.nutrition-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 30px; }
.nutrition-item { padding: 11px 6px; border-radius: 12px; text-align: center; background: var(--cream); }
.nutrition-item strong { display: block; color: var(--forest-dark); font-size: 0.95rem; }
.nutrition-item span { color: var(--muted); font-size: 0.68rem; }
.recipe-section { margin-top: 30px; }
.recipe-section h3 { margin: 0 0 14px; font: 700 1.45rem Georgia, serif; }
.detail-ingredients .ingredient-group-title { display: block; margin: 18px 0 6px; padding: 0; border: 0; color: var(--forest); font-size: 0.75rem; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.detail-ingredients .ingredient-group-title::before { display: none; }
.detail-ingredients { margin: 0; padding: 0; list-style: none; }
.detail-ingredients li { display: flex; align-items: baseline; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); line-height: 1.38; }
.detail-ingredients li::before { content: ""; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.instruction-list { margin: 0; padding: 0; list-style: none; counter-reset: steps; }
.instruction-list li { position: relative; min-height: 42px; padding: 0 0 22px 52px; line-height: 1.55; counter-increment: steps; }
.instruction-list li::before { content: counter(steps); position: absolute; top: -5px; left: 0; display: grid; width: 34px; height: 34px; place-items: center; border-radius: 12px 12px 12px 4px; color: white; background: var(--forest); font-weight: 850; }
.base-links { display: flex; flex-wrap: wrap; gap: 8px; }
.base-link { padding: 9px 12px; border: 1px solid #cbdace; border-radius: 99px; color: var(--forest-dark); background: var(--sage); font-size: 0.8rem; font-weight: 800; cursor: pointer; }
.source-note { margin-top: 28px; color: var(--muted); font-size: 0.75rem; }

.weekly-plan { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.plan-day { overflow: hidden; border-radius: 20px; background: var(--paper); box-shadow: 0 12px 34px rgba(37, 55, 44, 0.07); }
.plan-day h3 { margin: 0; padding: 17px 18px 14px; color: var(--forest-dark); background: var(--sage); font: 700 1.35rem Georgia, serif; }
.plan-day h3 span { display: block; margin-bottom: 3px; color: var(--muted); font: 800 0.66rem Inter, sans-serif; letter-spacing: 0.09em; text-transform: uppercase; }
.plan-day__slots { padding: 5px 16px 12px; }
.plan-slot { position: relative; min-height: 74px; padding: 13px 34px 12px 0; border-bottom: 1px solid var(--line); }
.plan-slot:last-child { border-bottom: 0; }
.plan-slot > span { display: block; margin-bottom: 5px; color: var(--orange); font-size: 0.68rem; font-weight: 850; letter-spacing: 0.06em; text-transform: uppercase; }
.plan-slot em { color: #9aa19c; font-size: 0.83rem; font-style: normal; }
.plan-slot__recipe { padding: 0; border: 0; text-align: left; color: var(--ink); background: transparent; font-weight: 750; line-height: 1.3; cursor: pointer; }
.plan-slot__remove { position: absolute; top: 26px; right: 0; display: grid; width: 29px; height: 29px; place-items: center; border: 0; border-radius: 50%; color: var(--muted); background: var(--cream); font-size: 1.15rem; cursor: pointer; }

.plan-dialog { width: min(calc(100% - 28px), 440px); max-height: min(90vh, 760px); padding: 0; overflow-y: auto; border: 0; border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.plan-dialog__content { padding: 0 20px 20px; }
.plan-dialog .sheet__header { margin-inline: -20px; }
.plan-dialog__recipe { margin: 0 0 18px; padding: 13px 14px; border-radius: 12px; color: var(--forest-dark); background: var(--sage); font-weight: 800; }
.plan-field { display: grid; gap: 7px; margin: 0 0 16px; padding: 0; border: 0; color: var(--muted); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.plan-field legend { margin-bottom: 8px; padding: 0; }
.plan-options { display: grid; gap: 7px; }
.plan-options--days { grid-template-columns: repeat(7, 1fr); }
.plan-options--meals { grid-template-columns: repeat(2, 1fr); }
.plan-options label { position: relative; cursor: pointer; }
.plan-options input { position: absolute; opacity: 0; pointer-events: none; }
.plan-options span { display: grid; min-height: 43px; place-items: center; padding: 7px 5px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: var(--paper); font-size: 0.78rem; font-weight: 800; letter-spacing: 0; text-align: center; text-transform: none; }
.plan-options input:checked + span { border-color: var(--forest); color: white; background: var(--forest); }
.plan-options input:focus-visible + span { outline: 3px solid rgba(49, 91, 73, 0.22); outline-offset: 2px; }
.plan-dialog__hint { margin: -3px 0 12px; color: var(--muted); font-size: 0.73rem; line-height: 1.4; }
.plan-dialog__error { margin: 0 0 12px; color: #9a422f; font-size: 0.78rem; font-weight: 750; }
.plan-dialog .button { width: 100%; margin-top: 4px; }

.sync-dialog { width: min(calc(100% - 28px), 480px); max-height: min(90vh, 760px); padding: 0; overflow-y: auto; border: 0; border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.sync-dialog__content { padding: 0 20px 20px; }
.sync-dialog .sheet__header { margin-inline: -20px; }
.sync-field { display: grid; gap: 7px; margin-bottom: 14px; color: var(--muted); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.sync-field input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--cream); font-size: 0.92rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.sync-dialog__hint { margin: 2px 0 14px; color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.sync-dialog__actions { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 10px; }

@media (max-width: 680px) {
  .app-shell { padding-inline: 14px; }
  .hero { padding-top: 24px; }
  .hero__brand img { width: min(270px, 76vw); }
  .search-panel { grid-template-columns: 1fr 54px; }
  .filter-button { min-width: 54px; width: 54px; padding: 0; font-size: 0; }
  .filter-button svg { width: 23px; }
  .filter-count { position: absolute; top: -6px; right: -5px; font-size: 0.67rem; }
  .section-tabs { display: flex; margin-inline: -14px; padding-inline: 14px; overflow-x: auto; border-radius: 0; scrollbar-width: none; }
  .section-tabs::-webkit-scrollbar { display: none; }
  .section-tab { flex: 0 0 auto; min-width: 105px; }
  .recipe-grid { grid-template-columns: 1fr; gap: 14px; }
  .recipe-card { display: grid; grid-template-columns: 38% 1fr; border-radius: 18px; }
  .recipe-card__image-wrap { height: 100%; min-height: 190px; aspect-ratio: auto; }
  .recipe-card__image { position: absolute; }
  .recipe-card__category { top: 9px; left: 9px; max-width: calc(100% - 18px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .favorite-button { top: 8px; right: 8px; width: 38px; height: 38px; }
  .recipe-card__body { padding: 15px; }
  .recipe-card h3 { min-height: 0; font-size: 1.14rem; }
  .recipe-card__ingredients { min-height: 0; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .recipe-card__cta { margin-top: 12px; }
  .sheet { width: 100%; }
  .recipe-detail__hero img { height: 42vh; min-height: 290px; }
  .recipe-detail__content { margin-inline: 0; }
  .weekly-plan { grid-template-columns: 1fr; }
  .sync-panel { align-items: stretch; flex-direction: column; }
  .sync-panel__actions { width: 100%; }
  .sync-button { flex: 1 1 0; }
}

@media (max-width: 420px) {
  .recipe-card { grid-template-columns: 35% 1fr; }
  .recipe-card__body { padding: 13px; }
  .recipe-card__meta .meta-pill:nth-child(n + 3) { display: none; }
  .recipe-card__ingredients { font-size: 0.77rem; }
  .nutrition-grid { gap: 5px; }
  .nutrition-item strong { font-size: 0.82rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
