:root {
  --bg: var(--bg-light, #f6f2e9);
  --surface: var(--surface-light, #fefdfb);
  --ink: var(--ink-light, #322920);
  --muted: var(--muted-light, #72685a);
  --line: var(--line-light, #dfd9cd);
  --accent: var(--accent-light, #2d803e);
  --accent-deep: var(--accent-deep-light, #1c5e29);
  --fill: var(--fill-light, #2d803e);
  --olive: var(--olive-light, #355a3c);
  --olive-fill: var(--olive-fill-light, #355a3c);
  --gold: var(--gold-light, #ab873f);
  --wash-a: var(--wash-a-light, #e0ebe2);
  --wash-b: var(--wash-b-light, #ece4d5);
  --photo: var(--photo-light, #efece6);
  --note: var(--note-light, #f5f2eb);
  --note-ink: var(--note-ink-light, #5b5248);
  --on-fill: var(--on-fill-light, #f9fbf9);
  --danger: var(--danger-light, #a3262c);
  --rating-public: #c47f00;
  --rating-own: #0072b2;
  --shadow: var(--shadow-light, 0 16px 40px hsl(40 18% 22% / 0.08));
  --header-shadow: var(--header-shadow-light, 0 8px 22px hsl(40 18% 22% / 0.1));
  --bar-shadow: 0 -8px 22px hsl(40 18% 22% / 0.1);
  --footer-bg: var(--footer-bg-light, #1c2b22);
  --footer-ink: var(--footer-ink-light, #f6f2e9);
  --footer-link: var(--footer-link-light, #cfe3c4);
  --banner-edge: #fff;
  --hero-stroke: var(--bg);
  --terra: var(--accent);
  --terra-deep: var(--accent-deep);
  --font-sans: system-ui, "Segoe UI", sans-serif;
  --font-serif: Georgia, "Iowan Old Style", Palatino, serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: var(--bg-dark, #171c19);
    --surface: var(--surface-dark, #222a25);
    --ink: var(--ink-dark, #f2f0ed);
    --muted: var(--muted-dark, #b7c2ba);
    --line: var(--line-dark, #3d4841);
    --accent: var(--accent-dark, #86d596);
    --accent-deep: var(--accent-deep-dark, #c7e6cd);
    --fill: var(--fill-dark, #2d803e);
    --olive: var(--olive-dark, #b2c7b6);
    --olive-fill: var(--olive-fill-dark, #3c5d42);
    --gold: var(--gold-dark, #c9b792);
    --wash-a: var(--wash-a-dark, #222f25);
    --wash-b: var(--wash-b-dark, #272421);
    --photo: var(--photo-dark, #2a322d);
    --note: var(--note-dark, #262c28);
    --note-ink: var(--note-ink-dark, #e4e1dd);
    --on-fill: var(--on-fill-dark, #f6f9f6);
    --danger: var(--danger-dark, #ff8d8d);
    --rating-public: #f0c14a;
    --rating-own: #6cb6ff;
    --shadow: var(--shadow-dark, 0 16px 40px rgba(0, 0, 0, 0.4));
    --header-shadow: var(--header-shadow-dark, 0 8px 22px rgba(0, 0, 0, 0.45));
    --bar-shadow: 0 -8px 22px rgba(0, 0, 0, 0.45);
    --footer-bg: var(--footer-bg-dark, #101612);
    --footer-ink: var(--footer-ink-dark, #f2f0ed);
    --footer-link: var(--footer-link-dark, #cfe3c4);
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.5s;
  animation-timing-function: ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0s;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at -10% -10%, var(--wash-a) 0%, transparent 60%),
    radial-gradient(800px 380px at 110% 0%, var(--wash-b) 0%, transparent 55%),
    var(--bg);
  font-family: var(--font-sans), "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }

a { color: var(--terra-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--terra); }

h1, h2, .card-title, .brand-name {
  font-family: var(--font-serif), Georgia, serif;
  font-weight: 560;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 12px;
  top: 12px;
  transform: translateY(calc(-100% - 24px));
  background: var(--fill);
  color: var(--on-fill);
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus { transform: translateY(0); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-header {
  --mark: 42px;
  --name: 1.15rem;
  --header-min: 88px;
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: transparent;
  box-shadow: 0 8px 22px transparent;
  translate: 0 0;
  transition:
    translate 0.35s ease,
    box-shadow 0.35s ease,
    background-color 0.35s ease;
}

.site-header.is-top {
  --mark: 50px;
  --name: 1.32rem;
}

.site-header.is-stuck {
  background-color: var(--bg);
  box-shadow: var(--header-shadow);
}

.site-header.is-hidden {
  translate: 0 -100%;
  pointer-events: none;
}

body:has(main.home) {
  padding-top: 22px;
}

main.home > :first-child {
  margin-top: 16px;
}

.header-inner, .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-inner {
  min-height: var(--header-min, 88px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: var(--mark, 42px);
  height: var(--mark, 42px);
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 12px;
  background: var(--fill);
  color: #fff;
  transition: width 0.35s ease, height 0.35s ease;
}

.brand-hat {
  width: 74%;
  height: auto;
  display: block;
  color: #fff;
}

.brand-hat path {
  fill: #fff;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex: none;
}

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.header-link .nav-icon {
  width: 20px;
  height: 20px;
  flex: none;
}

.header-link[aria-current="page"] {
  background: color-mix(in srgb, var(--fill) 14%, transparent);
}

.header-link:focus-visible,
.tab-item:focus-visible,
.category-tile:focus-visible,
.letter-nav a:focus-visible,
.chef-list a:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 2px;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: none;
}

.header-tools .account {
  position: relative;
  width: 44px;
  height: 44px;
  flex: none;
  justify-content: center;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account .avatar { width: 36px; height: 36px; }

.avatar-fallback {
  display: grid;
  place-items: center;
  background: var(--fill);
  color: var(--on-fill);
  font-weight: 650;
}

.account-menu { position: relative; }

.account-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 650;
  padding: 4px;
  border-radius: 999px;
  cursor: pointer;
}

.account-trigger:focus-visible,
.bookmark:focus-visible,
.bookmark-remove:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 2px;
}

.account-menu-name {
  margin: 2px 4px 4px;
  padding: 6px 8px 8px;
  font-weight: 650;
  line-height: 1.3;
  border-bottom: 1px solid var(--line);
}

.account-popover {
  z-index: 50;
  min-width: 200px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.account-menu-list {
  display: grid;
  margin: 0;
  padding: 0;
  outline: none;
}

.account-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.account-menu-item svg { flex: none; }

.account-menu-item[data-hovered],
.account-menu-item[data-focused] {
  background: color-mix(in srgb, var(--line) 55%, transparent);
  outline: none;
}

.account-menu-item[data-focus-visible] {
  outline: 2px solid var(--olive);
  outline-offset: -2px;
}

.account-login {
  border: 1px solid var(--fill);
  background: var(--fill);
  color: var(--on-fill);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.header-tools .account-login,
.header-tools .account-trigger {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  box-sizing: border-box;
}

.header-tools .account-login .nav-icon {
  width: 22px;
  height: 22px;
}

.header-tools .account .avatar {
  width: 44px;
  height: 44px;
}

.account-face {
  opacity: 0;
  pointer-events: none;
}

.header-tools .account-face {
  position: absolute;
  inset: 0;
  display: grid;
}

.account.is-signed-in .account-login {
  opacity: 0;
  pointer-events: none;
}

.account.is-signed-in .account-face {
  opacity: 1;
  pointer-events: auto;
}

.account-login,
.account-face {
  transition: opacity 160ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .account-login,
  .account-face {
    transition: none;
  }
}

.auth-note {
  margin: 0;
  padding: 0 0 12px;
  color: var(--terra-deep);
  font-size: 0.92rem;
}

.auth-note[hidden] { display: none; }

.manage-page form {
  display: grid;
  gap: 14px;
}

.manage-page form[hidden] {
  display: none;
}

.manage-page label {
  display: grid;
  gap: 6px;
  font-weight: 650;
}

.manage-page input,
.manage-page select,
.manage-page textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-weight: 400;
}

.manage-page a.button {
  display: inline-block;
  text-decoration: none;
}

.manage-page .button,
.manage-page button {
  justify-self: start;
  border: 0;
  border-radius: 999px;
  background: var(--fill);
  color: var(--on-fill);
  padding: 12px 18px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.field-hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.92rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.publish-note {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
}

.preview-banner {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--note);
  color: var(--note-ink);
}

#article-preview[hidden] { display: none; }

.manage-page button.button-quiet,
.manage-page label.image-change {
  background: transparent;
  color: var(--terra-deep);
  border: 1px solid var(--line);
}

.manage-page button.button-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 55%, var(--line));
}

.edit-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 14px;
}

.edit-pair > label {
  flex: 1 1 20rem;
  max-width: 24rem;
}

.editor-actions {
  display: grid;
  gap: 14px;
  margin-top: 4px;
}

.editor-actions-main,
.editor-actions-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.editor-actions-main > #publish-recipe {
  margin-left: auto;
}

.editor-danger {
  display: flex;
  justify-content: center;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.editor-danger:has(button[hidden]) {
  display: none;
}

.manage-groups, #manage-groups {
  display: grid;
  gap: 28px;
}

.manage-group {
  display: grid;
  gap: 10px;
}

.manage-group h2 {
  margin: 0;
  font-size: 1.35rem;
}

.manage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.manage-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.manage-view {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.manage-thumb {
  width: 96px;
  height: 72px;
  flex: none;
  overflow: hidden;
  border-radius: 10px;
  background: var(--photo);
}

.manage-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.manage-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.manage-copy strong {
  font-size: 1.05rem;
}

.manage-badge {
  color: var(--muted);
  font-size: 0.86rem;
}

.manage-edit {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--terra-deep);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.manage-edit:hover {
  color: var(--terra);
}

.image-field {
  display: flex;
  align-items: center;
  gap: 16px;
}

.image-frame {
  flex: 1 1 240px;
  min-width: 0;
  max-width: min(420px, calc(100% - 8.5rem));
}

.image-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  flex: none;
}

.image-actions button,
.manage-page .image-actions label.image-change {
  width: auto;
  justify-content: center;
  white-space: nowrap;
  text-align: center;
}

.manage-page label.image-change {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.manage-page label.image-change input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.manage-page label.image-change:focus-within {
  outline: 2px solid var(--olive);
  outline-offset: 2px;
}

#image-preview,
.image-stand-in {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  background: var(--photo);
}

#image-preview {
  object-fit: cover;
}

.image-stand-in { margin: 0; }

#image-preview[hidden],
.image-stand-in[hidden] { display: none !important; }

.button-quiet {
  background: transparent;
  color: var(--terra-deep);
  border: 1px solid var(--line);
}

.brand-text { min-width: 0; }
.brand-name { display: block; font-size: var(--name, 1.15rem); line-height: 1.1; transition: font-size 0.35s ease; }
.brand-sub { color: var(--muted); font-size: 0.82rem; }
.brand-sub { display: block; margin-top: 2px; }

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 36px;
  align-items: end;
  padding: 48px 0 12px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--terra);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1, .missing h1, .recipe h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 0.95;
  font-weight: 560;
}

.hero em { font-style: italic; font-weight: 520; color: var(--terra-deep); }

.lede {
  max-width: 46rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.chef-card {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.chef-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 50%;
}

.chef-card figcaption { display: grid; }
.chef-card span { color: var(--muted); font-size: 0.9rem; }

.authors h2 { margin: 8px 0 14px; font-size: 1.6rem; }

.author-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 12px;
  padding: 0;
}

.author-list a, .byline, .card-author {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.author-list a {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 16px 10px 10px;
  box-shadow: var(--shadow);
}

.author-list a span, .byline span, .card-author span { display: grid; }
.author-list a strong { font-size: 1.05rem; }
.author-list a span span, .card-meta { color: var(--muted); font-size: 0.9rem; }

.avatar {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
  background: var(--photo);
}

.avatar-large { width: 84px; height: 84px; }

.author-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 0 28px;
}

.about-heading { padding: 8px 0 0; }
.about-heading h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 3.4rem); }
.about-body {
  display: grid;
  gap: 28px;
  max-width: 40rem;
  margin-top: 28px;
}
.about-body section { display: grid; gap: 8px; }
.about-body h2 { margin: 0; font-size: 1.35rem; }
.about-body p,
.about-body ul { margin: 0; }
.about-body ul { padding-left: 1.2rem; display: grid; gap: 6px; }

.account-page .account-panel {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
}
.account-page .account-panel h2 { margin: 0; font-size: 1.35rem; }
.account-page .account-panel p { margin: 0; max-width: 42rem; }
.account-page .account-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 42rem;
  font-size: 1rem;
}
.account-page .account-check input { margin-top: 0.25rem; }
.account-page #delete-account-form { display: grid; gap: 12px; justify-items: start; }
.account-page .account-danger { padding-bottom: 8px; }

.byline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 16px;
}

.byline { margin: 0; font-weight: 650; }

.byline .official-mark {
  display: inline-flex;
  align-items: center;
  color: var(--terra);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bookmark-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 0 auto;
}

.bookmark-note { margin: 0; color: var(--accent); font-size: 0.92rem; }

.bookmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.bookmark svg { flex: none; }

.bookmark[aria-pressed="true"] {
  border-color: transparent;
  background: var(--fill);
  color: var(--on-fill);
}

.bookmark-item { display: grid; gap: 8px; align-content: start; }
.bookmark-remove-slot { justify-self: start; }
.bookmark-remove {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.bookmark-remove svg { flex: none; }
.card-author { margin-top: 2px; }
.card-author .avatar { width: 28px; height: 28px; }

.filters { display: grid; gap: 14px; margin-top: 28px; }

.search { display: grid; gap: 6px; }

.search > span,
.filter-select > span,
.chef-sort-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.search input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  box-shadow: var(--shadow);
}

.search input:focus, .filter-select select:focus {
  outline: 2px solid var(--olive);
  outline-offset: 2px;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.search-filters .filter-row {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.filter-select {
  position: relative;
  display: grid;
  gap: 6px;
}

.filter-select::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: 24px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}

.filter-select select {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 14px 48px 14px 18px;
  font: inherit;
  box-shadow: var(--shadow);
}

.card:focus-visible, .pager-link:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 3px;
}

.result-count { color: var(--muted); font-size: 0.92rem; }

.grid {
  list-style: none;
  padding: 0;
  margin: 0 0 64px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.card-photo, .card-photo-missing {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--photo);
}

.photo-fallback {
  display: grid;
  place-items: center;
  background:
    radial-gradient(90% 80% at 12% 0%, var(--wash-a), transparent 58%),
    radial-gradient(80% 70% at 100% 100%, var(--wash-b), transparent 52%),
    var(--photo);
}

.photo-fallback-1 {
  background:
    radial-gradient(70% 60% at 82% 0%, color-mix(in srgb, var(--gold) 55%, var(--photo)), transparent 60%),
    radial-gradient(80% 70% at 0% 100%, var(--wash-b), transparent 55%),
    var(--photo);
}

.photo-fallback-2 {
  background:
    radial-gradient(75% 65% at 0% 82%, color-mix(in srgb, var(--olive) 32%, var(--photo)), transparent 62%),
    radial-gradient(80% 70% at 100% 8%, var(--wash-a), transparent 55%),
    var(--photo);
}

.photo-fallback-3 {
  background:
    radial-gradient(70% 60% at 72% 100%, color-mix(in srgb, var(--accent) 24%, var(--photo)), transparent 60%),
    radial-gradient(90% 70% at 8% 0%, var(--wash-a), transparent 58%),
    var(--photo);
}

.photo-fallback::before {
  content: "";
  width: min(28%, 132px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--ink) 16%, transparent);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  box-shadow: inset 0 0 0 9px color-mix(in srgb, var(--surface) 45%, transparent);
}

.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-photo-missing {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.search-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 1.5rem;
  margin: 8px 0 0;
  color: var(--muted);
}

.search-status[hidden] {
  display: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--olive);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.card-body { display: grid; gap: 6px; padding: 14px 16px 16px; }
.card-title { font-size: 1.35rem; line-height: 1.15; }
.card-meta { color: var(--muted); font-size: 0.9rem; }

.empty, .missing { padding-bottom: 80px; }

.recipe { padding-bottom: 48px; }

.book-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
  box-shadow: var(--bar-shadow);
}

body:has(.book-nav) .site-footer { padding-bottom: 72px; }

.book-link {
  display: grid;
  gap: 1px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.book-link span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.book-link strong {
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-link.is-next { text-align: right; }

.book-link.is-disabled { visibility: hidden; }

.book-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.book-link:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 2px;
}

.back { margin: 22px 0 14px; }
.back a { text-decoration: none; font-weight: 650; }

.hero-photo {
  margin: 0;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--photo);
}

.hero-photo.photo-fallback {
  aspect-ratio: 4 / 3;
  max-height: 640px;
}

.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  max-height: 640px;
}

.recipe-heading { padding: 28px 0 8px; }
.recipe h1 { font-size: clamp(2.2rem, 5vw, 4.2rem); }

.facts {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 10px;
  padding: 0;
  margin: 22px 0 0;
}

.facts li {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}

.facts span { display: block; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.facts strong { display: block; margin-top: 4px; font-size: 1.05rem; overflow-wrap: break-word; }

.rating-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

.rating-summary {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  color: var(--muted);
  font-size: 0.92rem;
}

.facts .rating-summary {
  display: inline-flex;
}

.rating-star {
  font-size: 1.05rem;
  line-height: 1;
}

.rating-scale { font-size: 0.8em; }

.rating-star-public { color: var(--rating-public); }
.rating-star-own { color: var(--rating-own); }

.fact-rating .rating-summary {
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.05rem;
}

.fact-rating .rating-score,
.fact-rating .rating-value,
.fact-rating .rating-scale,
.fact-rating .rating-star {
  display: inline;
  font-size: 1.05rem;
  letter-spacing: 0;
  text-transform: none;
}

.facts .rating-summary .rating-score,
.facts .rating-summary .rating-value,
.facts .rating-summary .rating-scale,
.facts .rating-summary .rating-star {
  display: inline-flex;
}

.fact-rating .rating-scale { font-size: 0.8em; }

.fact-rating .rating-score { color: var(--ink); }

.rating-panel { margin-top: 42px; }
.rating-panel h2 { margin: 0 0 14px; font-size: 1.6rem; }
.rating-list-action {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}
.rating-list-action .bookmark { white-space: nowrap; }
.rating-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.rating-list li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.rating-who {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-height: 34px;
  margin: 0;
  padding-right: 5.5rem;
}
.rating-who strong { font-weight: 650; }
.rating-who time { color: var(--muted); font-size: 0.92rem; }
.rating-comment { margin: 8px 0 0; white-space: pre-wrap; }
.rating-edit {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  visibility: hidden;
  pointer-events: none;
}
.rating-list li.is-own .rating-edit {
  visibility: visible;
  pointer-events: auto;
}
#rating-empty[hidden] { display: none; }
.fact-rating .rating-star-public { color: var(--rating-public); }

.rating-dialog {
  width: min(28rem, calc(100% - 32px));
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.rating-dialog::backdrop { background: hsl(40 18% 10% / 0.45); }

.rating-form {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 22px;
}

.rating-dialog h2 { margin: 0; font-size: 1.5rem; }

.rating-dialog .rating-comment-field { font-weight: 650; }

.rating-dialog textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-weight: 400;
}

.rating-dialog .button {
  border: 0;
  border-radius: 999px;
  background: var(--fill);
  color: var(--on-fill);
  padding: 12px 18px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.rating-dialog .button:disabled,
.rating-dialog .button-danger:disabled { opacity: 0.7; }

.rating-dialog .button-danger {
  border-radius: 999px;
  background: transparent;
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 55%, var(--line));
  padding: 12px 18px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.rate svg { flex: none; }

.rating-dialog .rating-close {
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.rating-dialog .star-choice.is-on { color: var(--rating-own); }

.star-picker {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
}

.star-picker legend {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.star-choice {
  position: relative;
  color: color-mix(in srgb, var(--muted) 35%, transparent);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.star-choice.is-on { color: var(--rating-own); }

.star-choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.star-choice:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rating-comment-field {
  display: grid;
  gap: 6px;
}

.rating-item { display: grid; gap: 8px; }

.rating-comment {
  margin: 6px 0 0;
  white-space: pre-wrap;
}

.card-body .rating-pair { margin-top: 8px; }

.banner-rating .rating-summary { color: inherit; }
.banner-rating .rating-star-public { color: #f0c14a; }
.banner-rating .rating-star-own { color: #8ec8ff; }

.recipe-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 42px;
  align-items: start;
  margin-top: 36px;
}

.ingredients {
  position: sticky;
  top: 92px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 18px 8px;
}

.ingredients h2, .recipe-layout h2 {
  margin: 0 0 12px;
  font-size: 1.8rem;
}

.ingredients ul { list-style: none; margin: 0; padding: 0; }
.ingredients li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.ingredients li.ingredient-heading {
  margin-top: 16px;
  border-top: none;
  padding-top: 0;
  padding-bottom: 0;
  font-family: var(--font-serif), Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--olive);
}

.ingredients li.ingredient-heading + li { border-top: none; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step { display: grid; grid-template-columns: 36px 1fr; gap: 12px; margin: 0 0 16px; }
.step::before {
  counter-increment: step;
  content: counter(step);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--olive-fill);
  color: var(--on-fill);
  font-size: 0.9rem;
  font-weight: 700;
}
.step p { margin: 0; }

.notes {
  margin-top: 28px;
  background: var(--note);
  border-left: 3px solid var(--gold);
  border-radius: 0 16px 16px 0;
  padding: 8px 18px 4px;
}

.notes h2 { font-size: 1.5rem; }
.notes p { margin: 0 0 12px; color: var(--note-ink); }

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.pager-link {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 14px;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  color: inherit;
}
.pager-link span { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; }
.pager-link.is-next { text-align: right; }

.site-footer {
  margin-top: 48px;
  background: var(--footer-bg);
  color: var(--footer-ink);
  font-size: 0.92rem;
}

.site-footer a { color: var(--footer-link); }
.site-footer a:hover { color: #fff; }
.footer-inner {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  min-height: 0;
  padding: 40px 0 44px;
}
.footer-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-self: center;
  width: min(100%, 32rem);
  text-align: left;
}
.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: stretch;
  align-items: start;
  gap: 22px 32px;
  width: 100%;
  margin: 0;
  text-align: left;
}
.footer-col {
  display: grid;
  gap: 10px;
  justify-items: start;
}
.footer-col[hidden] { display: none; }
.footer-title {
  margin: 0;
  color: var(--footer-ink);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.footer-nav a { text-decoration: none; font-weight: 650; }
.footer-nav a:hover,
.footer-nav a[aria-current="page"] { color: #fff; }
.footer-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }
.footer-nav a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.footer-note {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid color-mix(in srgb, var(--footer-ink) 24%, transparent);
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: center;
}
.footer-note p { margin: 0; }
.nowrap { white-space: nowrap; }

@media (max-width: 640px) {
  .footer-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 28px;
  }
}

@media (max-width: 800px) {
  .hero, .recipe-layout, .pager, .footer-inner, .author-heading { grid-template-columns: 1fr; display: grid; }
  .facts { gap: 8px; margin-top: 16px; }
  .facts li { padding: 10px 8px; }
  .facts span { font-size: 0.68rem; letter-spacing: 0.04em; }
  .facts strong { font-size: 0.95rem; }
  .site-header { --header-min: 76px; }
  .site-header.is-top { --mark: 48px; --name: 1.24rem; }
  .header-tools { gap: 10px; }
  .header-link { padding: 8px; gap: 0; }
  .header-link > span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }
  .hero { padding-top: 28px; }
  .ingredients { position: static; }
  .pager-link.is-next { text-align: left; }
}

.home-stage {
  position: relative;
  --banner-height: 440px;
  --banner-width: 587px;
  --banner-lift: calc(var(--banner-height) * 0.07 + 8px);
}

.hero-on-banner {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  display: block;
  padding: calc(var(--banner-lift) + 28px) 0 0;
  pointer-events: none;
}

.hero-on-banner h1,
.hero-on-banner .kicker,
.hero-on-banner .lede {
  paint-order: stroke fill;
  -webkit-text-stroke: max(0.16em, 6px) var(--hero-stroke);
}

.banner {
  --banner-height: 440px;
  --banner-width: 587px;
  --banner-lift: calc(var(--banner-height) * 0.07 + 8px);
  margin: 0;
}

.banner-viewport {
  overflow: hidden;
  padding-top: var(--banner-lift);
  padding-bottom: var(--banner-lift);
}

.banner-viewport.banner-manual {
  overflow-x: auto;
  overflow-y: hidden;
  overflow-anchor: none;
  overscroll-behavior-x: contain;
  scroll-behavior: auto;
}

.banner-viewport.banner-live {
  scrollbar-width: none;
  cursor: grab;
}

.banner-viewport.banner-live::-webkit-scrollbar {
  display: none;
}

.banner-viewport.banner-live.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.banner-track {
  display: flex;
  width: max-content;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--banner-edge);
  border-block: 10px solid var(--banner-edge);
  animation: banner-drift 56s linear infinite;
}

.banner-viewport.banner-manual .banner-track {
  animation: none;
}

.banner:has(.banner-tile:hover) .banner-track,
.banner:focus-within .banner-track {
  animation-play-state: paused;
}

.banner-track > li {
  display: flex;
  flex: none;
}

.banner-track > li:hover,
.banner-track > li:focus-within {
  position: relative;
  z-index: 2;
}

.banner-tile {
  position: relative;
  display: block;
  width: var(--banner-width);
  height: var(--banner-height);
  margin-right: 10px;
  overflow: hidden;
  color: #fffaf3;
  text-decoration: none;
  background: #efece6;
  transform: scale(1);
  transform-origin: center;
  transition:
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.banner-tile:hover,
.banner-tile:focus-visible {
  z-index: 2;
  color: #fffaf3;
  transform: scale(1.14);
  box-shadow:
    0 0 0 10px var(--banner-edge),
    0 18px 40px hsl(40 18% 22% / 0.22);
}

.banner-tile:focus {
  outline: none;
}

.banner-tile:focus-visible {
  outline: 3px solid #fffaf3;
  outline-offset: -8px;
}

.banner-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.banner-caption {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 7px;
  padding: 36px 16px 14px;
  pointer-events: none;
}

.banner-caption::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(28, 16, 10, 0.86) 0%, rgba(28, 16, 10, 0.42) 46%, rgba(28, 16, 10, 0) 78%);
  opacity: 0;
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.banner-title,
.banner-by,
.banner-rating {
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.95s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.95s cubic-bezier(0.22, 1, 0.36, 1);
}

.banner-tile:hover .banner-caption::before,
.banner-tile:focus-visible .banner-caption::before {
  opacity: 1;
}

.banner-tile:hover .banner-title,
.banner-tile:focus-visible .banner-title {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.05s;
}

.banner-tile:hover .banner-by,
.banner-tile:focus-visible .banner-by,
.banner-tile:hover .banner-rating,
.banner-tile:focus-visible .banner-rating {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.16s;
}

.banner-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-family: var(--font-serif), Georgia, serif;
  font-size: 1.22rem;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.banner-by {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.84rem;
  font-weight: 650;
}

.banner-by span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.banner-avatar {
  width: 22px;
  height: 22px;
  flex: none;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 250, 243, 0.75);
}

@keyframes banner-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

@media (max-width: 800px) {
  .home-stage,
  .banner {
    --banner-height: 440px;
    --banner-width: 587px;
  }

  .banner-title {
    font-size: 1.05rem;
  }
}

.search-page { padding-bottom: 48px; }

.search-heading { margin-bottom: 8px; }

.search-filters {
  --search-control: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-rows: auto auto;
  align-items: end;
  column-gap: 12px;
  margin-top: 12px;
}

.search-bar {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / 3;
  grid-row: 1;
  align-items: end;
  column-gap: 12px;
}

.search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--fill);
  color: var(--on-fill);
  font: inherit;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.search-submit:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 2px;
}

.search-advanced {
  display: grid;
  grid-template-columns: subgrid;
  grid-template-rows: subgrid;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  align-items: end;
  pointer-events: none;
  interpolate-size: allow-keywords;
}

.search-advanced summary {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: var(--search-control);
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.search-advanced summary::-webkit-details-marker {
  display: none;
}

.search-advanced summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.22s ease;
}

.search-advanced[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.search-advanced summary:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 2px;
}

.search-advanced .filter-row {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 0;
}

.search-advanced::details-content {
  grid-column: 1 / -1;
  grid-row: 2;
  box-sizing: border-box;
  height: 0;
  padding-top: 0;
  overflow: clip;
  pointer-events: auto;
  transition:
    height 0.22s ease,
    padding-top 0.22s ease,
    content-visibility 0.22s allow-discrete;
}

.search-advanced[open]::details-content {
  height: auto;
  padding-top: 14px;
}

@media (max-width: 700px) {
  .search-filters {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
  }

  .search-bar { grid-column: 1 / -1; }

  .search-advanced summary {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    margin-top: 12px;
  }

  .search-advanced .filter-row,
  .search-advanced::details-content { grid-row: 3; }
}

.home-search .filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.home-search .search {
  display: block;
  flex: 1;
  min-width: 0;
}

.home-search .search input,
.search-filters .search input {
  height: 52px;
}

.tab-bar {
  display: none;
  translate: 0 0;
  transition: translate 0.35s ease;
}

.tab-bar.is-hidden {
  translate: 0 100%;
  pointer-events: none;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 64px;
  padding: 6px 2px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
}

.tab-item .nav-icon {
  width: 24px;
  height: 24px;
  flex: none;
}

.tab-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--fill);
  color: #fff;
}

.tab-mark .brand-hat {
  width: 74%;
  height: auto;
  display: block;
}

.tab-mark .brand-hat path { fill: #fff; }

.tab-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-item[aria-current="page"],
.tab-item[aria-expanded="true"] {
  color: var(--ink);
}

.tab-account {
  position: relative;
  display: flex;
  min-width: 0;
}

.tab-account .account-face {
  position: absolute;
  inset: 0;
  display: flex;
}

.tab-account .account-face .account-trigger {
  height: 100%;
}

.tab-account .account-login,
.tab-account .account-trigger {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 2px 8px;
  font-size: 0.68rem;
  font-weight: 650;
  justify-content: center;
}

.tab-account .avatar {
  width: 24px;
  height: 24px;
}

.categories-page { padding-bottom: 28px; }

.trends-page { padding-bottom: 48px; }

.trend-block > h2 {
  margin: 32px 0 18px;
  font-size: 1.7rem;
}

.trend-list + .trend-list { margin-top: 28px; }

.trend-list h3 {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 560;
  letter-spacing: -0.02em;
}

.trend-note,
.trend-empty {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.trend-empty { margin-bottom: 0; }

.trend-grid {
  margin-bottom: 0;
  counter-reset: trend;
}

@media (min-width: 1100px) {
  .trend-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.trend-grid > li {
  position: relative;
  counter-increment: trend;
}

.trend-grid > li::before {
  content: counter(trend);
  position: absolute;
  z-index: 1;
  top: 10px;
  left: 10px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}

.card-saves {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.card-saves-icon { flex: none; }

.trend-chefs { counter-reset: trend; }

.trend-chefs > li { counter-increment: trend; }

.trend-chefs > li > a {
  flex-wrap: wrap;
}

.trend-chefs > li > a::before {
  content: counter(trend);
  width: 1.6rem;
  flex: none;
  text-align: center;
  font-weight: 700;
  color: var(--muted);
}

.trend-chefs .chef-copy { flex: 1; }

.trend-chefs .chef-rating { margin-left: auto; display: flex; align-items: center; }

.category-group { margin-top: 28px; }

.category-group h2 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 560;
  letter-spacing: -0.02em;
}

.category-tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}

.category-tile {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 168px;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: #fffaf3;
  background: hsl(var(--tab-hue, 132) calc(var(--tab-sat, 0.48) * 100%) calc(var(--tab-lit, 0.34) * 100%));
  box-shadow: var(--shadow);
}

.category-tile-photo,
.category-tile-photo img,
.category-tile-fill {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 168px;
  object-fit: cover;
}

.category-tile-fill {
  background: radial-gradient(circle at 30% 24%, hsl(var(--tab-hue, 132) calc(var(--tab-sat, 0.48) * 100%) 62%), hsl(var(--tab-hue, 132) calc(var(--tab-sat, 0.48) * 100%) calc(var(--tab-lit, 0.34) * 100%)));
}

.category-tile-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 2px;
  padding: 40px 12px 12px;
  background: linear-gradient(transparent, rgb(20 12 8 / 0.74));
}

.category-tile-name {
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.2;
}

.category-tile-count {
  font-size: 0.78rem;
  opacity: 0.9;
}

.chefs-page { padding-bottom: 28px; }

.chef-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.chef-sort-field { display: grid; gap: 6px; justify-items: start; }

.chef-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.chef-sort button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 650;
  padding: 8px 14px;
  white-space: nowrap;
  cursor: pointer;
}

.chef-sort button[aria-pressed="true"] {
  background: var(--fill);
  color: var(--on-fill);
}

.chef-sort button:focus-visible,
.chef-tools .search input:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .chef-tools { grid-template-columns: 1fr; }
}

body:has(.chefs-page .letter-nav:not([hidden])) .chefs-page.wrap,
body:has(.chefs-page .letter-nav:not([hidden])) .site-footer .wrap {
  --side: max(16px, calc((100% - 1120px) / 2));
  --rail-clear: 52px;
  width: min(1120px, calc(100% - var(--side) - max(var(--side), var(--rail-clear))));
  margin-left: var(--side);
  margin-right: auto;
}

.letter-nav {
  position: fixed;
  top: 100px;
  bottom: 100px;
  right: max(8px, env(safe-area-inset-right));
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  width: 40px;
  margin: 0;
  padding: 6px 2px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  box-shadow: var(--header-shadow);
  overflow-x: hidden;
  overflow-y: auto;
}

.letter-nav[hidden],
.letter-nav a[hidden],
.chef-group[hidden],
.chef-list[hidden],
.chef-list li[hidden] { display: none; }

.letter-nav a,
.letter-nav span {
  flex: 1 1 0;
  display: grid;
  place-items: center;
  min-height: 0;
  min-width: 0;
  padding: 0;
  border-radius: 8px;
  color: var(--ink);
  font-size: clamp(0.62rem, 2vh, 0.78rem);
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-decoration: none;
}

.letter-nav a:hover { background: color-mix(in srgb, var(--fill) 12%, transparent); }

.letter-nav a.is-current {
  background: var(--fill);
  color: var(--on-fill);
}

.letter-nav a.is-current:hover { background: var(--fill); }

.letter-nav span.is-muted {
  color: color-mix(in srgb, var(--muted) 42%, transparent);
}

.chef-index { margin-top: 22px; }

.chef-group { margin-top: 22px; scroll-margin-top: 80px; }

.chef-group h2 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 560;
  letter-spacing: -0.02em;
}

.chef-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.chef-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
}

.chef-list a > span { display: grid; min-width: 0; }
.chef-list strong { font-size: 1.05rem; }
.chef-list a > span > span { color: var(--muted); font-size: 0.9rem; }

.search-pager {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pager-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.pager-link.is-disabled {
  visibility: hidden;
}

@media (orientation: portrait) and (max-width: 900px) {
  .site-header { display: none; }
  body:has(main.home) { padding-top: 0; }
  main.home > :first-child { margin-top: 0; }
  .hero-on-banner { padding-top: calc(var(--banner-lift) + max(18px, env(safe-area-inset-top))); }
  .hero-on-banner .kicker { font-size: 0.936rem; }
  .hero-on-banner h1 { font-size: clamp(3.12rem, 7.2vw, 6rem); }
  .hero-on-banner .lede { font-size: 1.296rem; }
  .chef-group { scroll-margin-top: 56px; }

  .tab-bar {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: var(--bg);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -8px 22px hsl(40 18% 22% / 0.08);
  }

  .site-footer { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  .book-nav {
    bottom: calc(64px + env(safe-area-inset-bottom));
    padding-bottom: 8px;
    transition: bottom 0.35s ease;
  }

  body:has(.tab-bar.is-hidden) .book-nav { bottom: env(safe-area-inset-bottom); }

  body:has(.book-nav) .site-footer { padding-bottom: calc(64px + 68px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .tab-bar,
  .book-nav,
  .header-inner,
  .brand-mark,
  .brand-name,
  .search-advanced summary::after,
  .search-advanced::details-content { transition: none; }
  .banner-viewport { overflow-x: auto; scroll-behavior: auto; }
  .banner-viewport.banner-live { scrollbar-width: auto; cursor: auto; }
  .banner-viewport.banner-live::-webkit-scrollbar { display: block; }
  .banner-track { animation: none; }
  .banner-copy { display: none; }
  .banner-tile,
  .banner-caption::before,
  .banner-title,
  .banner-by,
  .banner-rating { transition: none; }
}

@media print {
  .banner { display: none; }
  .hero-on-banner { position: static; }
  .hero-on-banner h1,
  .hero-on-banner .kicker,
  .hero-on-banner .lede { -webkit-text-stroke: 0; }
  :root {
    color-scheme: light;
    --bg: var(--bg-light, #f6f2e9);
    --surface: var(--surface-light, #fefdfb);
    --ink: var(--ink-light, #322920);
    --muted: var(--muted-light, #72685a);
    --accent: var(--accent-light, #2d803e);
    --accent-deep: var(--accent-deep-light, #1c5e29);
  }
  .site-header, .site-footer, .tab-bar, .book-nav, .letter-nav, .pager, .back, .skip { display: none; }
  body { background: white; color: var(--ink); }
  .hero-photo, .card { box-shadow: none; }
}
