/* ============================================================
   Recipe app
   Young Serif headings · Outfit UI · warm stone/cream ·
   rose accent · light/dark/auto theming.
   ============================================================ */

:root {
  --bg:        hsl(30 50% 90%);
  --bg-2:      hsl(30 45% 87%);
  --surface:   hsl(40 40% 99%);
  --surface-2: hsl(33 44% 96%);
  --surface-3: hsl(30 30% 92%);

  --text:   hsl(24 6% 16%);
  --text-2: hsl(28 9% 36%);
  --text-3: hsl(28 8% 55%);

  --border:   hsl(30 22% 84%);
  --border-2: hsl(30 18% 78%);

  --accent:        hsl(332 51% 33%);
  --accent-press:  hsl(332 55% 27%);
  --accent-soft:   hsl(335 60% 95%);
  --accent-on:     #fff;
  --brown:         hsl(14 46% 36%);

  --danger: hsl(2 62% 44%);

  --shadow-sm: 0 1px 2px hsl(24 20% 20% / 0.06), 0 1px 3px hsl(24 20% 20% / 0.05);
  --shadow-md: 0 4px 10px hsl(24 20% 20% / 0.07), 0 2px 4px hsl(24 20% 20% / 0.05);
  --shadow-lg: 0 14px 34px hsl(24 22% 18% / 0.14), 0 4px 10px hsl(24 22% 18% / 0.07);
  --img-filter: none;
  --img-veil: 0;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  --serif: "Young Serif", Georgia, serif;
  --ui: "Outfit", system-ui, -apple-system, sans-serif;

  --gap: 24px;
  --col-min: 244px;
  --maxw: 1320px;

  /* dark palette raw values — defined once, referenced by both dark selectors below */
  --_d-bg:           hsl(24 14% 9%);
  --_d-bg-2:         hsl(24 14% 7%);
  --_d-surface:      hsl(24 13% 13%);
  --_d-surface-2:    hsl(24 12% 17%);
  --_d-surface-3:    hsl(24 11% 22%);
  --_d-text:         hsl(34 32% 92%);
  --_d-text-2:       hsl(32 14% 72%);
  --_d-text-3:       hsl(30 9% 52%);
  --_d-border:       hsl(34 22% 86% / 0.13);
  --_d-border-2:     hsl(34 22% 86% / 0.20);
  --_d-accent:       hsl(338 62% 66%);
  --_d-accent-press: hsl(338 62% 72%);
  --_d-accent-soft:  hsl(336 32% 20%);
  --_d-accent-on:    hsl(24 14% 9%);
  --_d-brown:        hsl(22 58% 66%);
  --_d-shadow-sm:    0 1px 2px hsl(0 0% 0% / 0.4);
  --_d-shadow-md:    0 4px 12px hsl(0 0% 0% / 0.45);
  --_d-shadow-lg:    0 16px 40px hsl(0 0% 0% / 0.55);
  --_d-img-filter:   brightness(0.82) saturate(0.95);
  --_d-img-veil:     0.18;
}

/* ---- dark palette (warm) — explicit ---- */
[data-theme="dark"] {
  --bg:           var(--_d-bg);
  --bg-2:         var(--_d-bg-2);
  --surface:      var(--_d-surface);
  --surface-2:    var(--_d-surface-2);
  --surface-3:    var(--_d-surface-3);
  --text:         var(--_d-text);
  --text-2:       var(--_d-text-2);
  --text-3:       var(--_d-text-3);
  --border:       var(--_d-border);
  --border-2:     var(--_d-border-2);
  --accent:       var(--_d-accent);
  --accent-press: var(--_d-accent-press);
  --accent-soft:  var(--_d-accent-soft);
  --accent-on:    var(--_d-accent-on);
  --brown:        var(--_d-brown);
  --shadow-sm:    var(--_d-shadow-sm);
  --shadow-md:    var(--_d-shadow-md);
  --shadow-lg:    var(--_d-shadow-lg);
  --img-filter:   var(--_d-img-filter);
  --img-veil:     var(--_d-img-veil);
}

/* ---- dark palette (warm) — auto follows system ---- */
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg:           var(--_d-bg);
    --bg-2:         var(--_d-bg-2);
    --surface:      var(--_d-surface);
    --surface-2:    var(--_d-surface-2);
    --surface-3:    var(--_d-surface-3);
    --text:         var(--_d-text);
    --text-2:       var(--_d-text-2);
    --text-3:       var(--_d-text-3);
    --border:       var(--_d-border);
    --border-2:     var(--_d-border-2);
    --accent:       var(--_d-accent);
    --accent-press: var(--_d-accent-press);
    --accent-soft:  var(--_d-accent-soft);
    --accent-on:    var(--_d-accent-on);
    --brown:        var(--_d-brown);
    --shadow-sm:    var(--_d-shadow-sm);
    --shadow-md:    var(--_d-shadow-md);
    --shadow-lg:    var(--_d-shadow-lg);
    --img-filter:   var(--_d-img-filter);
    --img-veil:     var(--_d-img-veil);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 400; }
a { color: var(--accent); }
::selection { background: var(--accent); color: var(--accent-on); }

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
  height: 74px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: baseline;
  font-family: var(--serif);
  font-size: 25px;
  color: var(--text);
  text-decoration: none;
}
.brand .dot { color: var(--accent); }

.site-header .search {
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  margin: 0;
  padding: 0 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-3);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.site-header .search:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}
.site-header .search svg { flex: 0 0 auto; color: var(--text-3); }
.site-header .search input {
  flex: 1;
  width: auto;
  margin: 0;
  border: 0;
  padding: 0;
  background: none;
  outline: none;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
}
.site-header .search input::placeholder { color: var(--text-3); }

.header-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.navlink {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 8px 4px;
}
.navlink:hover { color: var(--text); }
.navlink.active { color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, background .15s, box-shadow .15s, border-color .15s;
  white-space: nowrap;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-on); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-press); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--surface-2); }

.avatar {
  width: 42px; height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #d98));
  color: #fff;
  display: grid; place-items: center;
  font-weight: 600; font-size: 15px;
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-sm);
}
.logout-form { margin: 0; }
button.avatar { cursor: pointer; padding: 0; text-transform: uppercase; }

/* ============ LOGIN ============ */
.login-page { max-width: 420px; }
.login-card { margin-top: 8vh; }
.login-card h1 { margin-bottom: 1rem; }
.login-error {
  color: var(--accent-on, #fff);
  background: var(--accent);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
}

/* ============ LIBRARY LAYOUT ============ */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 34px 32px 80px;
  display: grid;
  grid-template-columns: 272px 1fr;
  gap: 36px;
  align-items: start;
}

/* ============ SIDEBAR / FACETS ============ */
.sidebar {
  position: sticky;
  top: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
#filters { margin: 0; }
.sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-head h2 { font-family: var(--serif); font-size: 19px; }
.clear-link {
  margin-left: auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  padding: 4px 2px;
}
.clear-link:hover { text-decoration: underline; }

.fgroup { border-bottom: 1px solid var(--border); }
.fgroup:last-child { border-bottom: 0; }
.fgroup > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 15px 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-2);
}
.fgroup > summary::-webkit-details-marker { display: none; }
.fgroup > summary:hover { color: var(--text); }
.fgroup > summary::after {
  content: "";
  width: 8px; height: 8px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.fgroup[open] > summary::after { transform: rotate(-135deg); }
.fgroup-body { padding: 0 12px 16px; max-height: 220px; overflow-y: auto; scrollbar-width: thin; }

.facet-item {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
  padding: 9px 8px;
  border-radius: var(--r-sm);
  font-size: 14.5px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.facet-item:hover { background: var(--surface-2); }
.facet-item input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.facet-item .count { margin-left: auto; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.range-group { padding: 14px 12px 4px; }
.range-group > label { font-size: 13px; color: var(--text-2); display: block; margin: 0 0 4px; }
.range-group input[type="range"] { width: 100%; margin: 0; padding: 0; accent-color: var(--accent); background: none; border: 0; }
.range-vals { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-3); margin-top: 4px; }
.range-hint { font-size: 12px; color: var(--text-3); }

/* ============ MAIN ============ */
.main { min-width: 0; }
.main-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.main-head .title-wrap { display: flex; flex-direction: column; gap: 4px; }
.main-head h1 { font-family: var(--serif); font-size: 34px; line-height: 1; }
.main-head .count { font-size: 14px; color: var(--text-2); }
.main-head .count b { color: var(--text); font-weight: 600; }

.sort { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.sort .label { color: var(--text-3); font-size: 13px; }
.sort select {
  height: 42px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

/* ============ GRID + CARDS ============ */
.results-header { margin-bottom: 4px; }
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--col-min), 1fr));
  gap: var(--gap);
}
.empty-state { color: var(--text-2); font-style: italic; padding: 40px 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-2); }

.card-img {
  position: relative;
  aspect-ratio: 4 / 3;
  filter: var(--img-filter);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-img .glyph { width: 38px; height: 38px; color: #fff; opacity: .58; }
.card-img .time {
  position: absolute;
  left: 12px; bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  background: hsl(24 14% 9% / 0.62);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
}
.fav-form { position: absolute; top: 12px; right: 12px; margin: 0; }
.fav {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 0;
  background: hsl(40 40% 99% / 0.9);
  backdrop-filter: blur(4px);
  color: var(--text-2);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .12s, color .15s;
}
.fav:hover { transform: scale(1.08); }
.fav svg { width: 17px; height: 17px; }
.fav.on { color: var(--accent); }
.fav.on svg { fill: currentColor; }

.card-body { padding: 15px 16px 17px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card-body h3 { font-family: var(--serif); font-size: 19px; line-height: 1.18; text-wrap: pretty; }
.card-body h3 a { color: var(--text); text-decoration: none; }
.card:hover .card-body h3 a { color: var(--accent); }
.card-body .summary { font-size: 13.5px; color: var(--text-2); line-height: 1.5; margin: 0; }
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent);
}
.card-foot { margin-top: auto; }

/* ============ CHIPS ============ */
.chips, .tags, .tag-row, .card-foot { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.chip {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 4px 10px;
}
.chip-cuisine { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }

/* ============ ACTIVE FILTER TAGS ============ */
.active-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.active-filters:empty { display: none; }
.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}
[data-theme="dark"] .filter-tag { color: var(--text); }
.filter-tag .x { font-size: 12px; opacity: .8; }
.filter-tag:hover .x { opacity: 1; }

/* ============ PAGINATION ============ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 32px;
}
.pagination a,
.pagination .disabled {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}
.pagination a:hover { background: var(--accent-soft); color: var(--accent); }
.pagination .disabled { opacity: .4; cursor: default; }
.pagination .page-info { font-size: 14px; color: var(--text-2); }

/* ============ DETAIL PAGE ============ */
.detail { max-width: 800px; margin: 0 auto; padding: 30px 24px 96px; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  margin-bottom: 22px;
}
.back:hover { color: var(--text); }

.recipe-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.hero {
  position: relative;
  aspect-ratio: 16 / 9;
  filter: var(--img-filter);
  display: grid;
  place-items: center;
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .glyph { width: 54px; height: 54px; color: #fff; opacity: .5; }

.recipe-body { padding: 40px clamp(24px, 6vw, 52px) 48px; }
.recipe-head { display: flex; flex-direction: column; gap: 14px; }
.recipe-head h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.05;
  text-wrap: balance;
}
.archived-badge { color: var(--danger); margin: 0; }

.recipe-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  margin-top: 2px;
}
.stat { display: inline-flex; align-items: center; gap: 7px; font-size: 14.5px; color: var(--text-2); }
.stat svg { width: 17px; height: 17px; color: var(--accent); }
.stat b { color: var(--text); font-weight: 600; }
.save-btn {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.save-btn svg { width: 17px; height: 17px; }
.save-btn:hover { background: var(--surface-2); }
.save-btn.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.save-btn.on svg { fill: currentColor; }
.save-form { margin: 0 0 0 auto; }

.lead { font-size: 16.5px; line-height: 1.62; color: var(--text-2); margin: 8px 0 0; text-wrap: pretty; }

.prep {
  background: var(--accent-soft);
  border-radius: var(--r-lg);
  padding: 22px 26px;
  margin: 26px 0 4px;
}
[data-theme="dark"] .prep { background: var(--surface-2); }
.prep h2 { font-family: var(--ui); font-size: 18px; font-weight: 600; color: var(--accent); margin-bottom: 12px; }
[data-theme="dark"] .prep h2 { color: var(--text); }
.prep dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; }
.prep dt { color: var(--text); font-weight: 600; font-size: 14px; }
.prep dd { margin: 0; color: var(--text-2); font-size: 14px; }

.section { padding-top: 26px; margin-top: 26px; border-top: 1px solid var(--border); }
.section h2 { font-family: var(--serif); font-size: 26px; color: var(--brown); margin-bottom: 16px; }

.ingredients-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.ingredients-list li {
  display: flex; align-items: baseline; gap: 14px;
  font-size: 15.5px; line-height: 1.5; color: var(--text-2);
}
.ingredients-list li::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex: 0 0 auto; transform: translateY(-3px);
}
.equipment-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; gap: 7px; flex-wrap: wrap; }
.equipment-list li { font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 4px 10px; }

/* prose body rendered via the | md filter */
.body-prose { font-size: 15.5px; line-height: 1.62; color: var(--text-2); }
.body-prose h2 { font-family: var(--serif); font-size: 26px; color: var(--brown); margin: 26px 0 14px; }
.body-prose h3 { font-family: var(--serif); font-size: 20px; color: var(--text); margin: 20px 0 10px; }
.body-prose ol, .body-prose ul { padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.body-prose li { padding-left: 4px; }
.body-prose li::marker { color: var(--accent); font-weight: 600; }
.body-prose p { margin: 0 0 14px; }
.body-prose b, .body-prose strong { color: var(--text); }

.nutrition { margin-top: 26px; }
.nutrition summary { font-weight: 600; cursor: pointer; color: var(--text); }
.nutrition dl { display: grid; grid-template-columns: 1fr auto; margin: 14px 0 0; }
.nutrition dt, .nutrition dd { padding: 11px 4px; border-bottom: 1px solid var(--border); margin: 0; font-size: 15px; }
.nutrition dt { color: var(--text-2); }
.nutrition dd { color: var(--accent); font-weight: 700; text-align: right; }
[data-theme="dark"] .nutrition dd { color: var(--text); }

.source { font-size: 14px; color: var(--text-2); }
.recipe-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.recipe-actions form { margin: 0; }

/* ============ FORMS (edit / new) — replaces Pico basics ============ */
.container { max-width: 820px; margin: 0 auto; padding: 30px 24px 80px; }
.container h1 { font-family: var(--serif); font-size: 32px; margin-bottom: 20px; }

.container form fieldset {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin: 0 0 20px;
  background: var(--surface);
}
.container form legend { font-weight: 600; padding: 0 8px; color: var(--text); }
.container form label { display: block; margin-bottom: 12px; font-size: 14px; color: var(--text-2); }
.container form input, .container form textarea, .container form select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.container form input:focus, .container form textarea:focus, .container form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.container form input[type="checkbox"] { width: auto; display: inline-block; margin: 0 8px 0 0; accent-color: var(--accent); }
.container form textarea.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 16px; }
.checkbox-grid label { display: flex; align-items: center; margin: 0; padding: 6px 0; }
.time-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0 16px; }
.fav-field { display: flex; align-items: center; margin: 0; }

.container form button[type="submit"], .form-actions .btn-link {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 20px;
  border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600;
  border: 1px solid transparent;
  background: var(--accent); color: var(--accent-on);
  cursor: pointer; text-decoration: none;
  font-family: inherit;
}
.container form button[type="submit"]:hover { background: var(--accent-press); }
.form-actions { display: flex; gap: 12px; align-items: center; }
.form-actions .secondary { background: transparent; color: var(--text); border-color: var(--border-2); }

.error-summary {
  border: 1px solid var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  color: var(--text);
}
.error-msg { color: var(--danger); display: block; margin-top: 4px; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }

/* ============ RESPONSIVE ============ */
@media (max-width: 940px) {
  .page { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .site-header .search { max-width: none; }
}
@media (max-width: 560px) {
  .site-header { padding: 0 16px; gap: 12px; }
  .navlink, .btn-primary .txt { display: none; }
  .page { padding: 22px 16px 60px; }
}

/* ============ PRINT ============ */
@media print {
  .no-print, .site-header, .sidebar, .fav-form, .save-form, .recipe-actions, .back { display: none !important; }
  body { background: #fff; }
  .recipe-detail { border: 0; box-shadow: none; }
  .hero { display: none; }
  .page, .detail { padding: 0; }
}
