/* Skillet & Coupe — porcelain, bay leaf and saffron. DM Serif Display for titles, Hanken Grotesk for reading. */

/* Every color, font and size comes from the design tokens in /design/tokens.css
   (generated from public/design/tokens.js). Don't hard-code them here. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--size-body) / 1.55 var(--text);
  font-feature-settings: 'kern', 'liga';
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

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

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

svg {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 3px;
}

.sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 50;
  background: var(--bay);
  color: var(--bay-ink);
  padding: 10px 16px;
  border-radius: var(--radius-s);
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

main:focus {
  outline: none;
}

/* ── Type scale ─────────────────────────────────────────── */
.display-xl,
.display-l,
.display-m,
.display-s,
.recipe-title,
.wordmark,
.tile-title {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
.display-xl {
  font-size: clamp(2.6rem, 6.5vw, 5.25rem);
  line-height: 1.02;
  max-width: 14ch;
}
.display-l {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.05;
}
.display-m {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.1;
}
.display-s {
  font-size: 1.6rem;
  line-height: 1.15;
}
.lede {
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--stone);
  max-width: 38em;
  margin: 1rem 0 0;
}
.muted {
  color: var(--stone);
}

/* ── Masthead ───────────────────────────────────────────── */
.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--rule);
  padding-top: env(safe-area-inset-top);
}
.masthead-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark {
  font-size: 2rem;
  font-style: italic;
  font-weight: 600;
  text-decoration: none;
  color: var(--bay);
  line-height: 1;
  padding-bottom: 4px;
}
.mainnav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.mainnav a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
  padding: 10px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--stone);
}
.mainnav a:hover {
  color: var(--ink);
}
.mainnav a[aria-current='page'] {
  color: var(--ink);
}
/* The header's circles are pale until they are the selected thing: the Add page is open,
   the search box is open, or the account menu is open. */
.mainnav .nav-add {
  background: var(--bay-soft);
  color: var(--bay);
  padding-inline: 16px 18px;
}
.mainnav .nav-add[aria-current='page'] {
  background: var(--bay);
  color: var(--bay-ink);
}
.nav-add svg {
  width: 1rem;
  height: 1rem;
  stroke-width: 2.2;
}

/* ── Page shells ────────────────────────────────────────── */
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) var(--gutter) 96px;
}
.page.narrow {
  max-width: 820px;
}
.empty {
  padding-block: 48px;
}
.empty .btn {
  margin-top: 24px;
}

/* ── Buttons ────────────────────────────────────────────── */
/* Controls are for pressing, not for selecting: a long press or a double tap must not highlight their words.
   Text fields and the recipe text itself stay selectable. */
button,
summary,
select,
label,
.btn,
.link-btn,
.chip,
.seg,
[role='button'],
[role='tab'],
[role='radio'],
.masthead a,
.edge-tabs a,
.site-footer a,
.menu a,
.chapter a,
.avatar {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
/* The Send button is a bookmark to drag or copy by its own button: no long-press link menu over it. */
.send-mark {
  -webkit-touch-callout: none;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover {
  border-color: var(--stone);
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}
.btn.primary {
  background: var(--bay);
  border-color: var(--bay);
  color: var(--bay-ink);
}
.btn.primary:hover {
  filter: brightness(1.08);
}
.btn.ghost {
  border-color: transparent;
}
.btn.ghost:hover {
  background: var(--paper-2);
}
.btn.icon-btn {
  width: 46px;
  padding: 0;
}
.btn.danger:hover {
  color: var(--danger);
  border-color: var(--danger);
}
.btn.danger-solid {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--on-danger);
}
.btn.fav.on {
  color: var(--saffron);
  border-color: var(--saffron);
}
.btn.fav.on svg {
  fill: currentColor;
}

/* ── Library ────────────────────────────────────────────── */
.library-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.count {
  margin: 0;
  color: var(--stone);
  font-variant-numeric: tabular-nums;
}
.search {
  position: relative;
  margin-top: 28px;
}
.search svg {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--stone);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 56px;
  padding: 0 20px 0 52px;
  font-size: 1.08rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-2);
  transition: border-color 0.15s, background 0.15s;
}
.search input:focus {
  outline: none;
  border-color: var(--bay);
  background: var(--paper);
}
.search input::placeholder {
  color: var(--stone);
}
.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 36px;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
  margin: -2px;
  mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
}
.chips::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.chip svg {
  width: 1rem;
  height: 1rem;
}
.chip:hover {
  border-color: var(--stone);
}
.chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.chip.on[data-fav] svg {
  fill: var(--saffron);
  stroke: var(--saffron);
}
.sort select {
  appearance: none;
  border: 0;
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a645c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E")
    no-repeat right 4px center / 18px;
  padding: 8px 28px 8px 8px;
  font-size: 0.95rem;
  color: var(--stone);
  cursor: pointer;
  min-height: 44px;
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 48px 28px;
}
.tile-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  height: 100%;
}
.tile-photo {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--bay-soft);
  margin-bottom: 16px;
}
.tile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.tile-link:hover .tile-photo img {
  transform: scale(1.035);
}
.tile-monogram {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-style: italic;
  font-size: 7rem;
  color: var(--bay);
  opacity: 0.55;
}
.tile-fav {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  color: var(--saffron);
}
.tile-fav svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.tile-title {
  font-size: 1.42rem;
  line-height: 1.15;
  font-weight: 500;
}
.tile-link:hover .tile-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.tile-source {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--stone);
}
.tile-meta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.9rem;
  color: var(--stone);
  font-variant-numeric: tabular-nums;
}

/* ── Welcome & add ──────────────────────────────────────── */
.welcome {
  padding-top: clamp(40px, 9vw, 120px);
}
.welcome .add-grid {
  margin-top: clamp(40px, 6vw, 72px);
}
.add-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  grid-template-areas: 'url text' 'json manual';
  gap: 20px;
  margin-top: 36px;
}
.panel {
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  padding: clamp(20px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--paper);
}
.panel-url {
  grid-area: url;
  background: var(--paper-2);
  border-color: transparent;
}
.panel-json {
  grid-area: json;
}
.panel-text {
  grid-area: text;
}
.panel-text textarea {
  min-height: 150px;
}
.optional {
  font-weight: 400;
  color: var(--stone);
  margin-left: 4px;
}
.review-note {
  margin: 24px 0 0;
  padding: 18px 22px;
  border-radius: var(--radius-m);
  background: color-mix(in srgb, var(--saffron) 12%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--saffron) 35%, transparent);
}
.review-note p {
  margin: 0;
}
.review-note p + p {
  margin-top: 6px;
  color: var(--stone);
}
.panel-manual {
  grid-area: manual;
  text-decoration: none;
  transition: border-color 0.15s;
}
.panel-manual:hover {
  border-color: var(--stone);
}
.panel-manual .btn {
  align-self: flex-start;
}
.panel-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.6rem;
  line-height: 1.2;
}
.panel-title svg {
  color: var(--bay);
  width: 1.1em;
  height: 1.1em;
}
.panel-help {
  margin: 0;
  color: var(--stone);
  max-width: 40em;
}
.panel .btn.primary {
  align-self: flex-start;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.label {
  font-weight: 600;
  font-size: 0.92rem;
}
.hint {
  font-size: 0.88rem;
  color: var(--stone);
  margin-top: -2px;
}
.field input,
.field textarea,
.sec-row input {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: var(--radius-s);
  background: var(--paper);
  padding: 12px 14px;
  font-size: 1rem;
  line-height: 1.5;
  min-height: 48px;
  transition: border-color 0.15s;
}
.field textarea {
  resize: vertical;
}
.field input:focus,
.field textarea:focus,
.sec-row input:focus {
  outline: none;
  border-color: var(--bay);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bay) 18%, transparent);
}
.status {
  margin: 0;
  min-height: 1.5em;
  color: var(--stone);
  font-size: 0.95rem;
}
.status.error {
  color: var(--danger);
}

.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  flex: 1;
  min-height: 190px;
  border: 1.5px dashed var(--rule);
  border-radius: var(--radius-m);
  cursor: pointer;
  padding: 24px;
  transition: border-color 0.15s, background 0.15s;
}
.drop svg {
  width: 30px;
  height: 30px;
  color: var(--bay);
  margin-bottom: 4px;
}
.drop:hover,
.drop.over {
  border-color: var(--bay);
  background: var(--bay-soft);
}
.drop:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.drop-main {
  font-weight: 600;
}
.drop-main u {
  text-decoration-color: var(--saffron);
  text-underline-offset: 3px;
}
.drop-sub {
  font-size: 0.88rem;
  color: var(--stone);
}
.results {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.results:empty {
  display: none;
}
.results li {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  background: var(--paper-2);
  font-size: 0.93rem;
}
.r-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.r-state {
  color: var(--stone);
}
.results li.error .r-state {
  color: var(--danger);
}
.results a {
  color: var(--bay);
  font-weight: 600;
}
.export-note {
  margin-top: 40px;
  color: var(--stone);
  font-size: 0.95rem;
}

/* ── Recipe ─────────────────────────────────────────────── */
.recipe {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 40px) var(--gutter) 112px;
}
.recipe-hero {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Title over the photo, on a gradient dark enough for white text. */
.hero-photo {
  position: relative;
  margin: 0;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--photo-base);
  min-height: 280px;
}
.hero-zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  aspect-ratio: 16 / 9;
  max-height: 68vh;
  background: var(--bay-soft);
  cursor: zoom-in;
}
.hero-zoom:disabled {
  cursor: default;
}
.hero-zoom img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-photo .hero-titles {
  position: absolute;
  inset: auto 0 0 0;
  padding: clamp(80px, 14vw, 180px) clamp(20px, 4vw, 48px) clamp(20px, 3.5vw, 40px);
  background: var(--scrim-photo);
  color: var(--on-photo);
  pointer-events: none;
}
.hero-photo .hero-titles a {
  pointer-events: auto;
}
.hero-photo:not(:has(.hero-zoom)) .hero-titles {
  position: static;
  padding-top: clamp(28px, 5vw, 56px);
}
.hero-titles .kicker {
  margin: 0 0 10px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--saffron-ink);
}
.hero-photo .kicker {
  color: var(--on-photo-accent);
}
.recipe-title {
  font-size: clamp(2.4rem, 5.5vw, 4.6rem);
  line-height: 1.02;
  font-weight: 500;
  letter-spacing: -0.02em;
  max-width: 18ch;
}
.hero-photo .recipe-title {
  text-shadow: var(--shadow-text);
}
.byline {
  margin: 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  color: var(--stone);
}
.hero-photo .byline {
  color: var(--on-photo-soft);
}
.byline a {
  color: var(--ink);
  text-underline-offset: 3px;
  text-decoration-color: var(--saffron);
}
.hero-photo .byline a {
  color: var(--on-photo);
  text-decoration-color: var(--on-photo-accent);
}
.byline .sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
}
.hero-titles .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.chip.small {
  height: 30px;
  padding: 0 11px;
  font-size: 0.84rem;
}
.hero-photo .chip.small {
  color: var(--on-photo);
  border-color: var(--on-photo-line);
  background: var(--on-photo-wash);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.hero-photo .chip.small:hover {
  border-color: var(--on-photo);
  background: var(--on-photo-wash-strong);
}

.gallery {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar {
  display: none;
}
.gallery button {
  flex: none;
  width: 76px;
  height: 76px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bay-soft);
  cursor: zoom-in;
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.15s;
}
.gallery button:hover img {
  opacity: 0.85;
}

/* Description, then the buttons that act on the recipe. */
.hero-text {
  margin-top: clamp(24px, 3.5vw, 40px);
  max-width: 46em;
}
.recipe-desc {
  margin: 0 0 22px;
  font-size: 1.15rem;
  line-height: 1.65;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Times and servings, with Start cooking beside them. */
.hero-facts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px 32px;
  margin-top: clamp(24px, 3.5vw, 36px);
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 40px;
  margin: 0;
}
.facts div {
  display: flex;
  flex-direction: column;
}
.facts dt {
  font-size: 0.85rem;
  color: var(--stone);
}
.facts dd {
  margin: 2px 0 0;
  font-family: var(--display);
  font-size: 1.45rem;
  font-variant-numeric: lining-nums;
}

/* The Ingredients | Method bar sticks under the header; the page is the only scroller. */
.recipe-tabs {
  position: sticky;
  top: calc(64px + env(safe-area-inset-top));
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.4fr);
  column-gap: clamp(32px, 6vw, 96px);
  margin: clamp(36px, 5vw, 64px) calc(var(--gutter) * -1) 0;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.recipe-tabs button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 14px 0 12px;
  text-align: left;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  min-height: 52px;
}
.recipe-body {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.4fr);
  gap: clamp(32px, 6vw, 96px);
  padding-top: 24px;
  align-items: start;
}
.recipe-body .display-s {
  display: none;
}
.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.steps-col > .display-s {
  margin-bottom: 20px;
}
.scaler {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 3px;
}
.round {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.round:hover {
  background: var(--paper-2);
}
.serv {
  min-width: 6.5em;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.serv-l {
  font-weight: 400;
  color: var(--stone);
}
.group {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.25rem;
  margin: 28px 0 10px;
  color: var(--bay);
}
.ingredients {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ingredients li + li {
  border-top: 1px solid var(--rule);
}
.ing {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ing input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.box {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  border: 1.5px solid var(--stone);
  border-radius: 5px;
  display: grid;
  place-items: center;
  transition: background 0.15s, border-color 0.15s;
}
.ing input:checked + .box {
  background: var(--bay);
  border-color: var(--bay);
}
.ing input:checked + .box::after {
  content: '';
  width: 10px;
  height: 5px;
  border-left: 2px solid var(--bay-ink);
  border-bottom: 2px solid var(--bay-ink);
  transform: translateY(-1px) rotate(-45deg);
}
.ing input:focus-visible + .box {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
/* Drinks: the kind of liquor behind a brand name ("Smith & Cross" · Dark rum). */
.ing-type {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--stone);
  font-size: 0.78em;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: 0.08em;
}
.ing.done .ing-text {
  color: var(--stone);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--stone) 60%, transparent);
}
.qty {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}
.steps li {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 8px 16px;
  padding: 18px 0;
  cursor: pointer;
  border-radius: var(--radius-s);
  transition: opacity 0.2s;
}
.steps li + li {
  border-top: 1px solid var(--rule);
}
.step-n {
  font-family: var(--display);
  font-size: 2rem;
  line-height: 1;
  color: var(--bay);
  font-variant-numeric: lining-nums;
}
.steps p {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.7;
  max-width: 38em;
}
.steps li.done {
  opacity: 0.4;
}
.step-photo {
  display: block;
  margin-top: 14px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-m);
  overflow: hidden;
  width: min(100%, 520px);
  aspect-ratio: 3 / 2;
  background: var(--bay-soft);
  cursor: zoom-in;
}
.step-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.notes {
  margin-top: 40px;
  padding: 24px 28px;
  border-radius: var(--radius-m);
  background: var(--paper-2);
}
.notes h3 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.35rem;
}
.notes p {
  margin: 0 0 10px;
  max-width: 40em;
}
.notes p:last-child {
  margin-bottom: 0;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}

/* ── Cook mode ──────────────────────────────────────────── */
body.cooking {
  overflow: hidden;
}
.cook {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--paper);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  animation: cook-in 0.35s var(--ease);
}
@keyframes cook-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}
.cook-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px var(--gutter);
}
.cook-name {
  flex: 1;
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--bay);
}
.cook-progress {
  height: 3px;
  background: var(--rule);
}
.cook-progress span {
  display: block;
  height: 100%;
  background: var(--saffron);
  transition: width 0.4s var(--ease);
}
.cook-stage {
  overflow-y: auto;
  padding: clamp(32px, 7vh, 96px) var(--gutter);
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
}
.cook-stage.enter .cook-step {
  animation: step-in 0.4s var(--ease);
}
@keyframes step-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
}
.cook-count {
  margin: 0;
  color: var(--stone);
  font-variant-numeric: tabular-nums;
}
.cook-group {
  margin: 6px 0 0;
  font-family: var(--display);
  font-style: italic;
  color: var(--bay);
  font-size: 1.3rem;
}
.cook-group:empty {
  display: none;
}
.cook-step {
  margin: 20px 0 0;
  font-family: var(--display);
  font-size: clamp(1.7rem, 3.6vw, 2.8rem);
  line-height: 1.3;
  font-weight: 400;
  text-wrap: pretty;
}
.cook-ings {
  position: absolute;
  top: calc(64px + env(safe-area-inset-top));
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  background: var(--paper-2);
  border-left: 1px solid var(--rule);
  padding: 28px var(--gutter) 120px;
  overflow-y: auto;
  z-index: 2;
}
.cook-ings ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.cook-ings li {
  padding: 10px 0;
  border-top: 1px solid var(--rule);
}
.cook-nav {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 16px var(--gutter) 20px;
  border-top: 1px solid var(--rule);
  position: relative;
  z-index: 3;
  background: var(--paper);
}
.btn.big {
  min-height: 60px;
  padding: 0 28px;
  font-size: 1.08rem;
}
.cook-nav .primary {
  flex: 1;
  max-width: 360px;
}

/* ── Editor ─────────────────────────────────────────────── */
.editor {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 32px;
}
.row-2,
.row-4 {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.row-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.photo-field {
  display: flex;
  align-items: center;
  gap: 20px;
}
.photo-preview {
  width: 112px;
  height: 140px;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--bay-soft);
  display: grid;
  place-items: center;
  color: var(--bay);
  flex: none;
}
.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.photo-actions label.btn:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: sticky;
  bottom: 0;
  padding: 16px 0 calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 70%, transparent);
}

/* ── Dialog & toast ─────────────────────────────────────── */
dialog.confirm {
  border: 0;
  border-radius: var(--radius-m);
  padding: 28px;
  max-width: min(440px, calc(100vw - 32px));
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-dialog);
}
dialog.confirm::backdrop {
  background: var(--scrim);
}
dialog.confirm p {
  color: var(--stone);
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.25s var(--ease);
  z-index: 60;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── Accounts ───────────────────────────────────────────── */
body.signed-out .mainnav {
  display: none;
}
.account {
  position: relative;
  margin-left: 6px;
}
.account summary {
  list-style: none;
  cursor: pointer;
  border-radius: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}
.account summary::-webkit-details-marker {
  display: none;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bay-soft);
  color: var(--bay);
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1;
  flex: none;
}
.account[open] .avatar {
  background: var(--bay);
  color: var(--bay-ink);
}
.avatar.big {
  width: 48px;
  height: 48px;
  font-size: 1.45rem;
}
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 230px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-menu);
  padding: 8px;
  display: flex;
  flex-direction: column;
  z-index: 30;
  animation: menu-in 0.16s var(--ease);
}
@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.menu-who {
  margin: 0 0 6px;
  padding: 8px 10px 12px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.menu-who span {
  color: var(--stone);
  font-size: 0.88rem;
}
.menu a,
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  border: 0;
  background: none;
  text-decoration: none;
  font-size: 0.97rem;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
}
.menu a:hover,
.menu button:hover {
  background: var(--paper-2);
}
.menu svg {
  color: var(--stone);
  width: 1.1rem;
  height: 1.1rem;
}

.auth {
  min-height: calc(100dvh - 65px);
  display: grid;
  place-items: center;
  padding: 32px var(--gutter) 64px;
}
.auth-card {
  width: min(100%, 420px);
}
.auth-mark {
  margin: 0 0 28px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: 4.5rem;
  line-height: 0.9;
  color: var(--bay);
}
.auth-lede {
  color: var(--stone);
  margin: 12px 0 28px;
}
.auth-form,
.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.btn.wide {
  width: 100%;
  min-height: 52px;
}
.btn.small {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.9rem;
}
.btn.small.icon-btn {
  width: 40px;
  padding: 0;
}
.page.narrow > .panel {
  margin-top: 28px;
}
.page.narrow > .panel .btn.primary {
  align-self: flex-start;
}
.select,
.role select {
  appearance: none;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-s);
  padding: 0 38px 0 14px;
  background: var(--paper)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a645c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E")
    no-repeat right 10px center / 18px;
  font-size: 1rem;
  cursor: pointer;
}
.role select {
  min-height: 40px;
  font-size: 0.92rem;
}

.people {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.person {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.person-name {
  margin: 0;
  font-weight: 600;
}
.person-meta {
  margin: 2px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  font-size: 0.9rem;
  color: var(--stone);
}
.person-actions {
  display: flex;
  gap: 8px;
}

/* ── Editor: photos and steps ───────────────────────────── */
.ed-section {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ed-section legend {
  padding: 0;
  margin-bottom: 6px;
}
.gallery-edit {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 12px;
}
.ge-item,
.ge-add {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--bay-soft);
}
.ge-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ge-cover {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bay);
  color: var(--bay-ink);
  font-size: 0.78rem;
  font-weight: 600;
}
.ge-tools {
  position: absolute;
  inset: auto 6px 6px;
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
.ge-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-lift);
}
.ge-btn svg {
  width: 18px;
  height: 18px;
}
.ge-btn:hover {
  background: var(--paper);
}
.ge-btn.danger:hover {
  color: var(--danger);
}
.ge-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.ge-add-wrap {
  display: contents;
}
.ge-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 1.5px dashed var(--rule);
  color: var(--bay);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ge-add svg {
  width: 26px;
  height: 26px;
}
.ge-add:hover,
.ge-add:focus-within {
  border-color: var(--bay);
  background: var(--bay-soft);
}
.ge-add:focus-within,
.se-add-photo:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.loading {
  display: grid;
  place-items: center;
}
.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--bay) 25%, transparent);
  border-top-color: var(--bay);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.step-edit {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.se-row {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.se-n {
  font-family: var(--display);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--bay);
  padding-top: 10px;
  text-align: center;
}
.se-n svg {
  width: 20px;
  height: 20px;
}
.se-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.se-body textarea,
.se-head-input {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: var(--radius-s);
  background: var(--paper);
  padding: 10px 12px;
  font-size: 1rem;
  line-height: 1.5;
  resize: none;
  overflow: hidden;
  min-height: 48px;
}
.se-head-input {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.2rem;
}
.se-body textarea:focus,
.se-head-input:focus {
  outline: none;
  border-color: var(--bay);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bay) 18%, transparent);
}
.se-photo {
  position: relative;
  width: 168px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--bay-soft);
}
.se-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.se-photo .ge-btn {
  position: absolute;
  top: 6px;
  right: 6px;
}
.se-photo.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--stone);
}
.se-add-photo {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px dashed var(--rule);
  color: var(--stone);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}
.se-add-photo:hover {
  border-color: var(--bay);
  color: var(--bay);
}
.se-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.se-insert {
  flex: none;
  box-shadow: none;
  border: 1px solid var(--rule);
  color: var(--stone);
}
.se-insert:hover,
.se-insert:focus-visible {
  border-color: var(--bay);
  color: var(--bay);
}
.se-tools {
  display: flex;
  gap: 4px;
  padding-top: 6px;
}
.se-tools .ge-btn {
  box-shadow: none;
  background: transparent;
  color: var(--stone);
}
.se-tools .ge-btn:hover:not(:disabled) {
  background: var(--paper-2);
  color: var(--ink);
}
.step-add {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* ── Photo viewer ───────────────────────────────────────── */
dialog.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--viewer-bg);
  display: grid;
  place-items: center;
}
dialog.lightbox::backdrop {
  background: transparent;
}
.lightbox img {
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 120px);
  object-fit: contain;
  border-radius: 6px;
  animation: lb-in 0.25s var(--ease);
}
@keyframes lb-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
}
.lb-btn {
  position: fixed;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: var(--on-photo-wash);
  color: var(--on-photo);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.lb-btn:hover {
  background: var(--on-photo-wash-strong);
}
.lb-close {
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
}
.lb-prev,
.lb-next {
  top: 50%;
  transform: translateY(-50%);
}
.lb-prev {
  left: 16px;
}
.lb-next {
  right: 16px;
}
.lb-count {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  color: var(--on-photo-soft);
  font-variant-numeric: tabular-nums;
}

.cook-photo {
  margin-top: 28px;
  width: min(100%, 640px);
  max-height: 42vh;
  object-fit: cover;
  border-radius: var(--radius-m);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .add-grid {
    grid-template-columns: 1fr;
    grid-template-areas: 'url' 'text' 'json' 'manual';
  }
  .hero-photo {
    margin-inline: calc(var(--gutter) * -1);
    border-radius: 0;
  }
  .hero-zoom {
    aspect-ratio: 1 / 1;
    max-height: 78vh;
  }
  .hero-photo .hero-titles {
    padding-top: 96px;
  }
  .gallery {
    padding-inline: 0;
  }
  .recipe {
    padding-top: 0;
  }
  .no-photo.recipe {
    padding-top: 8px;
  }
  .recipe-body {
    grid-template-columns: 1fr;
    padding-top: 20px;
  }
  .recipe-tabs {
    display: flex;
  }
  .recipe-tabs button {
    flex: 1;
    text-align: center;
    font-family: var(--text);
    font-size: 1rem;
    font-weight: 600;
    color: var(--stone);
    min-height: 50px;
  }
  .recipe-tabs [aria-selected='true'] {
    color: var(--ink);
    border-bottom-color: var(--saffron);
  }
  .recipe-body[data-show='ing'] .steps-col,
  .recipe-body[data-show='steps'] .ing-col {
    display: none;
  }
  .col-head {
    justify-content: center;
  }
  .col-head:not(:has(.scaler)):not(:has(.shop-btn)) {
    display: none;
  }
  .row-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .masthead-inner {
    height: 58px;
  }
  .recipe-tabs {
    top: calc(58px + env(safe-area-inset-top));
  }
  .hero-facts .btn.primary {
    flex: 1 0 100%;
  }
  .wordmark {
    font-size: 1.75rem;
  }
  .mainnav > a:not(.nav-add) {
    display: none;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 14px;
  }
  .tile-photo {
    margin-bottom: 10px;
    border-radius: 10px;
  }
  .tile-title {
    font-size: 1.15rem;
  }
  .tile-source {
    display: none;
  }
  .tile-meta {
    font-size: 0.82rem;
  }
  .tile-monogram {
    font-size: 4.5rem;
  }
  .filters {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 28px;
  }
  .sort {
    align-self: flex-end;
  }
  .facts {
    gap: 12px 28px;
  }
  .steps li {
    grid-template-columns: 2rem 1fr;
    gap: 6px 12px;
  }
  .step-n {
    font-size: 1.6rem;
  }
  .steps p {
    font-size: 1.06rem;
  }
  .row-2 {
    grid-template-columns: 1fr;
  }
  .person {
    grid-template-columns: auto 1fr;
    gap: 10px 14px;
  }
  .person .role,
  .person-actions {
    grid-column: 2;
  }
  .person-actions {
    margin-top: -2px;
  }
  .se-row {
    grid-template-columns: 1.6rem 1fr;
    gap: 8px 10px;
  }
  .se-n {
    font-size: 1.3rem;
  }
  .se-tools {
    grid-column: 2;
    padding-top: 0;
    margin-top: -4px;
  }
  .se-photo {
    width: 100%;
    max-width: 320px;
  }
  .gallery-edit {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .ge-btn {
    width: 32px;
    height: 32px;
  }
  .auth-mark {
    font-size: 3.6rem;
  }
  .lb-prev,
  .lb-next {
    top: auto;
    bottom: calc(8px + env(safe-area-inset-bottom));
    transform: none;
  }
  .cook-nav .btn:not(.primary) span {
    display: none;
  }
  .cook-nav .btn:not(.primary) {
    width: 60px;
    padding: 0;
  }
  .cook-nav .primary {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Print page: toolbar over the recipe card ──────────── */
/* The card itself is drawn by public/share-styles (base.css plus the chosen style). */
body.card-mode {
  background: var(--paper-2);
}
body.card-mode .masthead {
  display: none;
}
.card-tools {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.card-opts,
.card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.95rem;
}
.card-opts [hidden] {
  display: none;
}
.card-style .select,
.card-layout .select,
.card-size .select {
  min-height: 40px;
  width: auto;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  cursor: pointer;
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--bay);
}
.card-frame {
  display: block;
  width: min(100%, 1120px);
  min-height: 80vh;
  margin: clamp(12px, 3vw, 32px) auto 48px;
  border: 0;
  border-radius: var(--radius-m);
  background: var(--paper);
  box-shadow: var(--shadow-paper);
}
/* Note cards show front beside back at true size: two 6-inch cards need more room. */
.card-frame.card-frame-wide {
  width: min(100%, 1280px);
}
@media (max-width: 760px) {
  .card-frame {
    margin: 0;
    border-radius: 0;
  }
}
@media print {
  .card-tools {
    display: none;
  }
}

/* ── Header: search and add ─────────────────────────────── */
body {
  overflow-x: clip;
}
/* The magnifying glass stays where it is; the box grows out to its left, around the glass,
   and pushes the add button along. The form is the box; the field inside has no edge of its own. */
.hsearch {
  position: relative;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  box-sizing: border-box;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s;
}
/* Closed, the glass sits in a circle the size of the add button and the account circle. */
.hsearch:not(.open) {
  background: var(--bay-soft);
}
.hsearch .hs-toggle {
  color: var(--bay);
}
.hsearch .hs-toggle:hover {
  background: transparent;
}
.hsearch.open .hs-toggle,
.hsearch.open .hs-toggle:hover {
  background: var(--bay);
  color: var(--bay-ink);
}
/* A pointer over a circle darkens it a little. Not on touch screens, where the last thing tapped would stay dark. */
@media (hover: hover) {
  .mainnav .nav-add:not([aria-current='page']):hover,
  .hsearch:not(.open):hover,
  .account:not([open]) summary:hover .avatar {
    background: color-mix(in srgb, var(--bay) 22%, var(--bay-soft));
  }
}
.jobs-slot:empty,
.account-slot:empty {
  display: none;
}
.mainnav .account {
  margin-left: 0;
}
.account summary .avatar {
  width: 44px;
  height: 44px;
  font-size: 1.35rem;
}
.hsearch.open {
  background: var(--paper-2);
  border-color: var(--rule);
}
.hsearch.open:focus-within {
  background: var(--paper);
  border-color: var(--bay);
}
.hsearch .hs-toggle {
  width: 42px;
  height: 42px;
  flex: none;
}
.hs-toggle,
.hs-close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  color: var(--ink);
  cursor: pointer;
}
.hs-toggle:hover,
.hs-close:hover {
  background: var(--paper-2);
}
.hsearch input {
  width: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  height: 42px;
  border-radius: 999px;
  background: transparent;
  font-size: 1rem;
  transition: width 0.25s var(--ease), opacity 0.2s, padding 0.25s var(--ease);
}
.hs-close {
  display: none;
}
.hsearch.open input {
  width: min(320px, 34vw);
  padding: 0 34px 0 16px;
  opacity: 1;
}
.hsearch input:focus,
.hsearch input:focus-visible {
  outline: none;
  box-shadow: none;
}
.hsearch.open .hs-close {
  display: grid;
  position: absolute;
  right: 42px;
  top: 50%;
  width: 32px;
  height: 32px;
  transform: translateY(-50%);
}
.hs-close svg {
  width: 16px;
  height: 16px;
}
.hsearch input::-webkit-search-cancel-button {
  display: none;
}
.mainnav .nav-add {
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}
.mainnav .nav-add svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}
.account {
  margin-left: 2px;
}

@media (max-width: 640px) {
  /* On phones the open box needs the whole header: the name fades out of the way, the add
     button slides to the left edge, and the box grows to fill the space (app.js measures it
     and sets --hs-w, so the width can animate). */
  .wordmark {
    transition: opacity 0.2s;
  }
  body.searching .wordmark {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }
  body.searching .nav-recipes {
    display: none;
  }
  .hsearch.open input {
    width: var(--hs-w, 150px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hsearch,
  .hsearch input,
  .wordmark {
    transition: none;
  }
}

/* ── Library list view ──────────────────────────────────── */
.search-note {
  margin: 8px 0 0;
  min-height: 0;
  color: var(--stone);
}
.search-note:empty {
  display: none;
}
.link-btn {
  border: 0;
  background: none;
  padding: 6px 4px;
  color: var(--bay);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.filters {
  margin-top: 24px;
}
.view-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.seg button {
  width: 38px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--stone);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.seg button svg {
  width: 18px;
  height: 18px;
}
.seg button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
}
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.row-link {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: background 0.15s;
}
.row-link:hover {
  background: var(--paper-2);
}
.row-photo {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bay-soft);
}
.row-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.row-monogram {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-style: italic;
  font-size: 2rem;
  color: var(--bay);
  opacity: 0.6;
}
.row-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.row-title {
  font-family: var(--display);
  font-size: 1.22rem;
  line-height: 1.2;
  /* Up to two lines, then trimmed. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-wrap: balance;
}
.row-source {
  font-size: 0.88rem;
  color: var(--stone);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-meta {
  display: flex;
  gap: 4px 16px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--stone);
  font-variant-numeric: tabular-nums;
}
.row-fav {
  color: var(--saffron);
}
.row-fav svg {
  fill: currentColor;
  width: 18px;
  height: 18px;
}
@media (max-width: 560px) {
  .row-link {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px;
    padding-inline: 0;
  }
  .row-meta {
    font-size: 0.82rem;
  }
  .row-photo {
    width: 56px;
    height: 56px;
  }

  .view-tools {
    justify-content: space-between;
  }
}

/* ── Add page ───────────────────────────────────────────── */
.ai-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 0;
  color: var(--stone);
  font-size: 0.95rem;
  max-width: 52em;
}
.ai-line svg {
  flex: none;
  margin-top: 2px;
  color: var(--stone);
}
.ai-line.on svg {
  color: var(--saffron);
}
.ai-line a {
  color: var(--bay);
  font-weight: 600;
}
.add-grid {
  grid-template-areas: 'url text' 'files text' 'files manual';
}
.panel-files {
  grid-area: files;
}
.spinner.small {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-width: 2px;
  vertical-align: -2px;
  margin-right: 4px;
}
@media (max-width: 900px) {
  .add-grid {
    grid-template-areas: 'url' 'text' 'files' 'manual';
  }
}

/* ── Settings ───────────────────────────────────────────── */
.ai-state {
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  background: var(--paper-2);
  color: var(--stone);
}
.ai-state.on {
  background: var(--bay-soft);
  color: var(--ink);
}
.model-row {
  display: flex;
  gap: 8px;
}
.model-row .select {
  flex: 1;
  min-width: 0;
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Share menu ─────────────────────────────────────────── */
.share-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.share-options .btn {
  justify-content: flex-start;
  border-radius: var(--radius-m);
  min-height: 52px;
}

/* ── Import review ──────────────────────────────────────── */
.review .lede {
  max-width: 46em;
}
.review-warn {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  background: color-mix(in srgb, var(--saffron) 12%, var(--paper));
  color: var(--ink);
  max-width: 46em;
}
.previews {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 32px;
}
.preview {
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  padding: clamp(18px, 3vw, 32px);
  background: var(--paper);
  transition: opacity 0.2s;
}
.preview.unpicked {
  opacity: 0.5;
}
.preview-pick {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin: -6px 0 12px;
  font-weight: 600;
  cursor: pointer;
}
.preview-pick input {
  width: 20px;
  height: 20px;
  accent-color: var(--bay);
}
.preview-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}
.preview-head:has(.preview-photo) {
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
}
.preview-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-s);
  background: var(--bay-soft);
}
.preview-titles .kicker {
  margin: 0 0 6px;
  color: var(--saffron-ink);
  font-weight: 600;
  font-size: 0.9rem;
}
.preview-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  line-height: 1.08;
  text-wrap: balance;
}
.preview-titles .byline {
  margin-top: 8px;
  font-size: 0.95rem;
}
.preview-desc {
  margin: 12px 0 0;
  color: var(--stone);
  max-width: 40em;
}
.facts.small {
  margin-top: 14px;
  gap: 8px 28px;
}
.facts.small dd {
  font-size: 1.15rem;
}
.preview-titles .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.chip.static {
  cursor: default;
}
.preview-flags {
  margin: 18px 0 0;
  padding: 12px 16px 12px 34px;
  border-radius: var(--radius-s);
  background: color-mix(in srgb, var(--danger) 9%, var(--paper));
  color: var(--ink);
}
.preview-flag.dupe {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  background: var(--bay-soft);
}
.preview-flag.dupe svg {
  color: var(--bay);
}
.preview-flag a {
  color: var(--bay);
  font-weight: 600;
}
.preview-body {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.3fr);
  gap: clamp(20px, 4vw, 48px);
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.preview-body h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.3rem;
}
.preview-body h3 .muted {
  font-family: var(--text);
  font-size: 0.85rem;
  margin-left: 6px;
}
.preview-body h4 {
  margin: 14px 0 6px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--bay);
}
.preview-body ul,
.preview-body ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.preview-body ul li {
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.97rem;
}
.preview-body ol li {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 8px;
  padding: 0 0 12px;
}
.pv-n {
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--bay);
}
.preview-body ol p {
  margin: 0;
  font-size: 0.97rem;
}
.preview-body ol img {
  display: block;
  margin-top: 8px;
  width: min(100%, 280px);
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-s);
}
.preview-notes {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-s);
  background: var(--paper-2);
  font-size: 0.95rem;
}
.preview-notes h4 {
  margin-top: 0;
}
.preview-notes p {
  margin: 0 0 6px;
}
.preview-actions {
  margin-top: 8px;
}
.review-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 75%, transparent);
}
.review-status {
  text-align: right;
}
.saved-list {
  margin: 20px 0 28px;
  padding-left: 20px;
  font-size: 1.1rem;
  line-height: 1.9;
}
.saved-list a {
  color: var(--bay);
}
@media (max-width: 700px) {
  .preview-head:has(.preview-photo),
  .preview-body {
    grid-template-columns: 1fr;
  }
  .review-bar .btn {
    flex: 1;
  }
  .review-bar .btn.primary {
    flex-basis: 100%;
    order: -1;
  }
}

/* "S&C Skillet & Coupe": "S&C" is the title; the full name is part of the header's background.
   It takes no room in the layout, and the header's controls may sit over it. */
.wordmark {
  position: relative;
  z-index: 1;
  white-space: nowrap;
}
.auth-mark span {
  display: block;
  margin-top: 10px;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--stone);
}
.wm-rest {
  position: absolute;
  left: 100%;
  bottom: 4px;
  z-index: -1;
  margin-left: 0.22em;
  font-weight: 400;
  color: color-mix(in srgb, var(--stone) 20%, var(--paper));
  pointer-events: none;
  user-select: none;
}
.masthead-inner {
  position: relative;
}
.mainnav {
  position: relative;
  z-index: 2;
}

/* ── Web search ─────────────────────────────────────────── */
.add-grid {
  grid-template-areas: 'url text' 'web text' 'files manual';
}
.panel-web {
  grid-area: web;
}
@media (max-width: 900px) {
  .add-grid {
    grid-template-areas: 'url' 'web' 'text' 'files' 'manual';
  }
}
.web-inline {
  display: flex;
  gap: 8px;
}
.web-inline input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-s);
  padding: 0 14px;
  background: var(--paper);
  font-size: 1rem;
}
.web-inline input:focus {
  outline: none;
  border-color: var(--bay);
}
.web-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 14px;
  color: var(--bay);
  font-weight: 600;
  text-underline-offset: 3px;
}
.web-link svg {
  width: 1rem;
  height: 1rem;
}
.web-search {
  position: relative;
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.web-search > svg {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--stone);
  pointer-events: none;
}
.web-search input {
  flex: 1;
  min-width: 0;
  height: 54px;
  padding: 0 18px 0 50px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 1.05rem;
}
.web-search input:focus {
  outline: none;
  border-color: var(--bay);
  background: var(--paper);
}
.web-search .btn {
  min-height: 54px;
}
.web-hint {
  margin: 18px 0 0;
}
.web-results {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.web-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--rule);
}
.web-open {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px 6px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  color: inherit;
  border-radius: var(--radius-s);
}
.web-open:hover {
  background: var(--paper-2);
}
.web-thumb {
  width: 96px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bay-soft);
}
.web-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.web-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.web-title {
  font-family: var(--display);
  font-size: 1.2rem;
  line-height: 1.25;
}
.web-site {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--bay);
}
.web-site .muted {
  font-weight: 400;
}
.web-needs {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--saffron) 18%, var(--paper));
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}
.wp-needs {
  max-width: 34rem;
  margin: 0 auto;
  text-align: center;
}
/* Your Account: the Send button (a bookmark to drag) and how to add it. */
.send-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0;
}
.send-mark {
  cursor: grab;
}
.send-steps {
  margin: 0;
  padding-left: 1.3em;
  display: grid;
  gap: 6px;
}
.send-phone summary {
  cursor: pointer;
  font-weight: 600;
}
.send-phone .send-steps {
  margin: 10px 0 12px;
}
.send-note {
  margin: 0;
  font-size: var(--size-small);
}
.web-desc {
  font-size: 0.92rem;
  color: var(--stone);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.web-result.have .web-title::after {
  content: '';
}
.web-act .btn.small svg {
  width: 1rem;
  height: 1rem;
}
.web-result.have .web-act .btn {
  color: var(--bay);
  border-color: var(--bay-soft);
  background: var(--bay-soft);
}

dialog.web-preview {
  width: min(980px, calc(100vw - 32px));
  height: min(92dvh, 1100px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: var(--radius-m);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-dialog);
}
dialog.web-preview[open] {
  display: grid;
  grid-template-rows: auto 1fr auto;
}
dialog.web-preview::backdrop {
  background: var(--scrim);
}
.wp-top {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule);
}
.wp-count {
  margin: 0 6px;
  font-size: 0.92rem;
  color: var(--stone);
  font-variant-numeric: tabular-nums;
}
.wp-spacer {
  flex: 1;
}
.wp-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(14px, 3vw, 28px);
}
.wp-body:focus {
  outline: none;
}
.wp-body .preview {
  border: 0;
  padding: 0;
}
.wp-via {
  margin: 0 0 14px;
  font-size: 0.92rem;
}
.wp-body .review-warn {
  margin: 0 0 12px;
}
.wp-loading {
  min-height: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--stone);
  text-align: center;
}
.wp-bar {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
}
.wp-bar .btn.ghost {
  margin-right: auto;
}
@media (max-width: 640px) {
  dialog.web-preview {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
  .web-open {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
  }
  .web-thumb {
    width: 72px;
    height: 72px;
  }
  .web-result {
    grid-template-columns: 1fr;
    gap: 0;
    padding-bottom: 12px;
  }
  .web-act {
    padding-left: 90px;
  }
  .web-search .btn {
    display: none;
  }
  .web-link {
    display: flex;
    margin: 6px 0 0;
  }
  .wp-bar .btn {
    flex: 1;
  }
  .wp-bar .btn.ghost {
    flex-basis: 100%;
    order: 3;
  }
}

/* ── Share window ───────────────────────────────────────── */
dialog.share-sheet {
  width: min(560px, calc(100vw - 32px));
}
.share-loading {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 24px;
  color: var(--stone);
}
.share-loading p {
  margin: 0;
}
.share-link {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.share-link input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-s);
  background: var(--paper-2);
  font-size: 0.92rem;
  color: var(--ink);
}
.share-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.share-options .btn {
  flex-direction: column;
  gap: 6px;
  min-height: 74px;
  padding: 10px 6px;
  border-radius: var(--radius-m);
  font-size: 0.88rem;
  text-align: center;
}
.share-options .btn svg {
  width: 22px;
  height: 22px;
  color: var(--bay);
}
.share-email {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-m);
  background: var(--paper-2);
}
.share-email[hidden] {
  display: none;
}
.share-email .btn {
  align-self: flex-start;
}
.share-style {
  margin: 16px 0 0;
  font-size: 0.92rem;
}
.share-style a {
  color: var(--bay);
  font-weight: 600;
}
.share-sheet .dialog-actions {
  justify-content: space-between;
}
.danger-text {
  color: var(--danger);
}
@media (max-width: 480px) {
  .share-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Account: card style and shared links ───────────────── */
.style-choices {
  display: grid;
  gap: 10px;
}
.style-choice {
  display: grid;
  grid-template-columns: auto 72px 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  cursor: pointer;
}
.style-choice:has(input:checked) {
  border-color: var(--bay);
  background: var(--bay-soft);
}
.style-choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--bay);
}
.style-swatch {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: 8px;
  background: var(--sw-paper);
  border: 1px solid var(--rule);
}
.sw-photo {
  height: 30px;
  border-radius: 4px;
  background: var(--sw-photo);
}
.sw-title {
  height: 6px;
  width: 70%;
  border-radius: 2px;
  background: var(--sw-ink);
}
.sw-line {
  height: 6px;
  width: 45%;
  border-radius: 2px;
  background: var(--sw-muted);
}
/* Stacked styles put the title above the photo; overlay styles put it on the photo. */
.sw-stacked .sw-photo {
  order: 3;
  height: 22px;
}
.sw-stacked .sw-title {
  background: var(--sw-accent);
}
.sw-overlay {
  position: relative;
}
.sw-overlay .sw-title {
  position: absolute;
  left: 11px;
  top: 22px;
  width: 50%;
  background: var(--sw-paper);
}
.style-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.93rem;
}
.style-text span {
  color: var(--stone);
}
.shared-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.shared-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}
.shared-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.shared-main a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shared-main .muted {
  font-size: 0.88rem;
}
.row-2.tight {
  gap: 10px;
}
@media (max-width: 560px) {
  .shared-list li {
    grid-template-columns: 1fr auto;
  }
  .shared-main {
    grid-column: 1 / -1;
  }
}

.reconnecting {
  text-align: center;
}
.reconnecting .spinner {
  display: inline-block;
  margin-bottom: 18px;
}
.reconnecting .lede {
  margin-inline: auto;
}

/* ── Photo tiles: click or drop ─────────────────────────── */
button.ge-add {
  width: 100%;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
}
.ge-add-hint {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--stone);
}
.drop-tile.over {
  border-color: var(--bay) !important;
  border-style: solid !important;
  background: var(--bay-soft) !important;
  transform: scale(1.03);
}
.se-photos {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.se-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bay-soft);
}
.se-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.se-thumb .ge-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
}
.se-thumb .ge-btn svg {
  width: 14px;
  height: 14px;
}
.se-add {
  width: 72px;
  height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 1.5px dashed var(--rule);
  border-radius: 10px;
  background: transparent;
  color: var(--stone);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
}
.se-add svg:first-child {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
  margin-right: 1px;
}
.se-add svg:last-child {
  width: 24px;
  height: 24px;
}
.se-add:hover,
.se-add:focus-visible {
  border-color: var(--bay);
  color: var(--bay);
}

/* Several photos on a step: a row on the recipe page and in cook mode. */
.step-photos {
  margin-top: 14px;
}
.step-photos .step-photo {
  margin-top: 0;
}
.step-photos.several {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  max-width: 520px;
}
.step-photos.several .step-photo {
  width: 100%;
  aspect-ratio: 1;
}
.cook-photos {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  overflow-x: auto;
}
.cook-photos img {
  width: min(100%, 640px);
  max-height: 42vh;
  object-fit: cover;
  border-radius: var(--radius-m);
}
.cook-photos.several img {
  width: min(44%, 320px);
  flex: none;
  aspect-ratio: 1;
}

/* ── Background imports: header indicator, list and alert ─ */
/* The circle is the first one in the header and matches the others: pale at rest, dark while its list is open.
   The list hangs from the whole nav (not from the circle), so it stays on the screen on a phone. */
.jobs summary {
  position: relative;
  list-style: none;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: var(--bay-soft);
  color: var(--bay);
  transition: background 0.2s, color 0.2s;
}
.jobs summary::-webkit-details-marker {
  display: none;
}
.jobs summary > svg {
  width: 20px;
  height: 20px;
}
.jobs[open] summary {
  background: var(--bay);
  color: var(--bay-ink);
}
@media (hover: hover) {
  .jobs:not([open]) summary:hover {
    background: color-mix(in srgb, var(--bay) 22%, var(--bay-soft));
  }
}
.jobs summary .spinner.small {
  margin: 0;
  width: 18px;
  height: 18px;
}
.jobs[open] summary .spinner {
  border-color: color-mix(in srgb, var(--bay-ink) 30%, transparent);
  border-top-color: var(--bay-ink);
}
.jobs-badge {
  position: absolute;
  top: -4px;
  right: -5px;
  box-shadow: 0 0 0 2px var(--paper);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--saffron);
  color: var(--on-accent);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.jobs-menu {
  width: min(340px, calc(100vw - 32px));
}
.jobs-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}
.job {
  display: flex;
  align-items: center;
  gap: 4px;
}
.job > .job-state,
.job-open .job-state {
  flex: none;
  width: 32px;
  display: grid;
  place-items: center;
}
.job-state.ok {
  color: var(--saffron);
}
.job-state.bad {
  color: var(--danger);
}
.job > .job-main,
.job-open {
  flex: 1;
  min-width: 0;
}
.job-open {
  display: flex;
  align-items: center;
  border: 0;
  background: none;
  padding: 8px 4px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
}
.job-open:hover {
  background: var(--paper-2);
}
.job.running {
  padding: 8px 4px;
}
.job-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}
.job-main strong {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job-main span {
  font-size: 0.85rem;
  color: var(--stone);
}
.job.failed .job-main span {
  white-space: normal;
}
.job .ge-btn {
  box-shadow: none;
  background: transparent;
  color: var(--stone);
}

.job-alert {
  position: fixed;
  top: calc(72px + env(safe-area-inset-top));
  right: max(16px, calc((100vw - var(--max)) / 2 + var(--gutter)));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(440px, calc(100vw - 32px));
  padding: 10px 10px 10px 14px;
  border-radius: var(--radius-m);
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-menu);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s, transform 0.25s var(--ease);
}
.job-alert.show {
  opacity: 1;
  transform: none;
}
.ja-icon {
  flex: none;
  color: var(--saffron);
}
.job-alert.bad .ja-icon {
  color: var(--danger);
}
.ja-text {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.35;
}
.job-alert .ge-btn {
  flex: none;
  box-shadow: none;
  background: transparent;
  color: var(--stone);
}
@media (max-width: 560px) {
  .job-alert {
    top: calc(64px + env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    max-width: none;
  }
}

/* DM Serif Display comes in one weight; stop browsers faking a bold version of it. */
body {
  font-synthesis-weight: none;
}

/* ── Sections: contents, chapters and edge tabs ─────────── */
/* Each section brings its color as --c (one of the --section-N tokens). */
.contents-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--rule);
}
.contents-head h1 {
  margin: 0;
}
.contents-all,
.contents-link {
  color: var(--bay);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.contents-all:hover,
.contents-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.library-head .count {
  margin-right: auto;
}
.chapters {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 36px 28px;
}
.chapter a {
  display: block;
  color: inherit;
  text-decoration: none;
}
.ch-photo {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-l);
  overflow: hidden;
  background: color-mix(in srgb, var(--c) 16%, var(--paper-2));
}
.ch-photo::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 6px;
  background: var(--c);
}
/* The chapter number: big, bold and pale, in the bottom left corner of the picture.
   It runs past the left and bottom edges, so the picture's own edge cuts it off. */
.ch-photo {
  container-type: inline-size;
}
.ch-num {
  position: absolute;
  left: -0.07em;
  bottom: -0.12em;
  font: 800 46cqw/1 var(--font-text);
  letter-spacing: -0.05em;
  font-variant-numeric: lining-nums tabular-nums;
  color: rgb(255 255 255 / 0.5);
  text-shadow: 0 2px 18px rgb(0 0 0 / 0.18);
  pointer-events: none;
  user-select: none;
}
/* A section with no picture has a pale card, so its number takes the section's color. */
.ch-photo:not(:has(img)) .ch-num {
  color: color-mix(in srgb, var(--c) 20%, transparent);
  text-shadow: none;
}
.ch-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.chapter a:hover .ch-photo img {
  transform: scale(1.04);
}
.ch-initial {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
/* A disc in the section's color with the icon cut out of it in the card's own color. */
.ch-initial svg {
  box-sizing: border-box;
  width: 42%;
  height: auto;
  aspect-ratio: 1;
  padding: 9%;
  border-radius: 50%;
  background: var(--c);
  color: color-mix(in srgb, var(--c) 16%, var(--paper-2));
  stroke-width: 1.5;
}
.ch-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 14px;
}
.ch-name {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.65rem;
  line-height: 1.1;
}
.chapter a:hover .ch-name {
  color: var(--bay);
}
.ch-count {
  color: var(--stone);
  font-size: var(--size-small);
  white-space: nowrap;
}
.chapter.is-empty .ch-name {
  color: var(--stone);
}

.chapter-block {
  scroll-margin-top: calc(var(--header) + 8px);
}
.chapter-block + .chapter-block {
  margin-top: 56px;
}
.chapter-all {
  padding-top: 28px;
}
.chapter-title {
  position: sticky;
  top: var(--header);
  z-index: 5;
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 24px;
  padding: 18px 0 12px;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--c);
}
.chapter-title h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  line-height: 1;
}
.chapter-title .ch-count {
  margin-left: auto;
}

/* The edge tabs: a gutter down the whole right side shaded like the fore-edge of a book,
   with a tab per section, flat on the page side. When the window is too short for names
   to run down the tabs, body gets .tabs-icons (icons with small names under them), and
   .tabs-tight (icons alone) when it's shorter still. */
body {
  --tab-gutter: 0px;
}
body.has-tabs {
  --tab-gutter: 46px;
  padding-right: var(--tab-gutter);
}
body.has-tabs.tabs-icons {
  --tab-gutter: 62px;
}
.edge-tabs {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  width: var(--tab-gutter);
  padding: calc(env(safe-area-inset-top) + 10px) 0 calc(env(safe-area-inset-bottom) + 10px);
  background: linear-gradient(90deg, var(--paper) 0%, var(--paper-2) 45%, color-mix(in srgb, var(--rule) 75%, var(--paper-2)) 100%);
  box-shadow: inset 7px 0 9px -7px rgb(0 0 0 / 0.2);
}
.edge-tabs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.edge-tabs li {
  flex: 1;
  display: flex;
  min-height: 0;
  max-height: 150px;
}
.edge-tabs a {
  --tab-bg: color-mix(in srgb, var(--c) 74%, var(--paper-2));
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 11px;
  writing-mode: vertical-rl;
  /* Darker where the tab meets the page, fading out over a few pixels. */
  background: linear-gradient(90deg, rgb(0 0 0 / 0.26), rgb(0 0 0 / 0) 7px), var(--tab-bg);
  color: var(--on-section);
  text-decoration: none;
  font: 600 0.74rem/1 var(--font-text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  border-radius: 0 9px 9px 0;
  box-shadow: 2px 2px 7px -1px rgb(0 0 0 / 0.22), 1px 0 1px rgb(0 0 0 / 0.08);
  transition: margin var(--dur-base) var(--ease), box-shadow var(--dur-base);
}
.edge-tabs a svg {
  display: none;
  width: 20px;
  height: 20px;
  flex: none;
}
.edge-tabs .t-label {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.edge-tabs a:hover {
  --tab-bg: var(--c);
  margin-right: 5px;
}
.edge-tabs a[aria-current] {
  --tab-bg: var(--c);
  margin-right: 0;
  box-shadow: 3px 2px 10px -1px rgb(0 0 0 / 0.3), 1px 0 1px rgb(0 0 0 / 0.1);
}
.edge-tabs a.is-empty {
  --tab-bg: color-mix(in srgb, var(--c) 14%, var(--paper-2));
  background: linear-gradient(90deg, rgb(0 0 0 / 0.08), rgb(0 0 0 / 0) 7px), var(--tab-bg);
  color: color-mix(in srgb, var(--c) 65%, var(--ink));
  box-shadow: 1px 1px 4px -1px rgb(0 0 0 / 0.14);
  cursor: default;
  margin-right: 11px;
}
.edge-tabs a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -4px;
}
/* The All tab sits a little apart from the sections. */
.edge-tabs li:first-child {
  margin-bottom: 6px;
}

/* Short windows: an icon with a small name under it. */
.tabs-icons .edge-tabs a {
  writing-mode: horizontal-tb;
  flex-direction: column;
  gap: 3px;
  padding: 0 3px;
  margin-right: 8px;
  font-size: 0.5rem;
  letter-spacing: 0.04em;
}
.tabs-icons .edge-tabs a svg {
  display: block;
}
.tabs-icons .edge-tabs .t-label {
  max-width: 100%;
}
.tabs-icons .edge-tabs a:hover {
  margin-right: 4px;
}
.tabs-icons .edge-tabs a[aria-current] {
  margin-right: 0;
}
.tabs-tight .edge-tabs .t-label {
  display: none;
}
.tabs-tight .edge-tabs a svg {
  width: 17px;
  height: 17px;
}
.tabs-tight .edge-tabs ol {
  gap: 3px;
}

@media (max-width: 560px) {
  body.has-tabs {
    --tab-gutter: 30px;
  }
  body.has-tabs.tabs-icons {
    --tab-gutter: 48px;
  }
  .edge-tabs {
    padding-top: calc(env(safe-area-inset-top) + 6px);
    padding-bottom: calc(env(safe-area-inset-bottom) + 6px);
  }
  .edge-tabs ol {
    gap: 3px;
  }
  .edge-tabs a,
  .edge-tabs a.is-empty {
    margin-right: 7px;
    font-size: 0.58rem;
    letter-spacing: 0.05em;
    border-radius: 0 7px 7px 0;
  }
  .tabs-icons .edge-tabs a,
  .tabs-icons .edge-tabs a.is-empty {
    margin-right: 5px;
    padding: 0 2px;
    font-size: 0.44rem;
    letter-spacing: 0.02em;
  }
  .tabs-icons .edge-tabs a svg {
    width: 18px;
    height: 18px;
  }
  .edge-tabs a[aria-current] {
    margin-right: 0;
  }
  .chapter-title {
    top: var(--header-phone);
  }
  .chapter-block {
    scroll-margin-top: calc(var(--header-phone) + 8px);
  }
  .chapters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 14px;
  }
  .ch-photo {
    border-radius: var(--radius-m);
  }
  .ch-line {
    flex-wrap: wrap;
    gap: 2px 8px;
    margin-top: 10px;
  }
  .ch-name {
    font-size: 1.2rem;
  }
  .ch-count {
    width: 100%;
    font-size: 0.8rem;
  }
}
@media print {
  .edge-tabs {
    display: none;
  }
  body.has-tabs {
    padding-right: 0;
  }
}
.sec-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}
.sec-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sec-mark {
  width: 6px;
  height: 14px;
  border-radius: 0 3px 3px 0;
  background: var(--c);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.5);
}
.kicker .sep {
  margin: 0 8px;
  opacity: 0.6;
}
.preview-section {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-weight: 600;
  font-size: var(--size-small);
  color: var(--stone);
}
.sec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.sec-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1.6fr) minmax(0, 1fr) 2.5ch auto;
  align-items: center;
  gap: 10px;
}
.sec-row input {
  padding: 8px 12px;
  min-height: 40px;
}
.sec-count {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.sec-moves {
  display: flex;
  gap: 2px;
}
.sec-color {
  position: relative;
}
.sec-color summary {
  list-style: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-s);
}
.sec-color summary::-webkit-details-marker {
  display: none;
}
.sec-chip {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, rgb(0 0 0 / 0.26), rgb(0 0 0 / 0) 6px), var(--c);
  color: var(--on-section);
  box-shadow: 2px 2px 6px -1px rgb(0 0 0 / 0.22);
}
.sec-chip svg {
  width: 20px;
  height: 20px;
}
.sec-pop {
  position: absolute;
  z-index: 10;
  top: 100%;
  left: 0;
  width: max-content;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-menu);
}
.sec-pop-label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
}
.sec-pop-label + div {
  margin-bottom: 12px;
}
.sec-pop-label + div:last-child {
  margin-bottom: 0;
}
.sec-swatches,
.sec-icons {
  display: grid;
  grid-template-columns: repeat(6, 32px);
  gap: 6px;
}
.ic {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-s);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.ic svg {
  width: 20px;
  height: 20px;
}
.ic.on {
  background: var(--c);
  border-color: var(--c);
  color: var(--on-section);
}
.sw {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--c);
  cursor: pointer;
}
.sw.on {
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink);
}
@media (max-width: 560px) {
  .sec-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .sec-short,
  .sec-count {
    display: none;
  }
}

/* ── Nutrition (bottom of a recipe) ─────────────────────── */
.nutrition {
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.nut-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.nut-head h2 {
  margin: 0;
}
.nut-grid {
  display: grid;
  grid-template-columns: minmax(200px, 0.8fr) minmax(0, 2fr);
  gap: 24px clamp(24px, 5vw, 72px);
  align-items: start;
}
.nut-cal {
  display: grid;
  gap: 2px;
}
.nut-big {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 7vw, 4.6rem);
  line-height: 0.95;
  color: var(--bay);
  font-variant-numeric: tabular-nums;
}
.nut-cal-l {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
}
.nut-sub {
  color: var(--stone);
  font-size: var(--size-small);
  margin-top: 6px;
}
.nut-main {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}
.nut-item {
  padding: 16px 18px;
  border-radius: var(--radius-m);
  background: var(--paper-2);
}
.nut-item dt {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
}
.nut-item dd {
  margin: 6px 0 0;
  display: grid;
  gap: 8px;
}
.nut-val {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.nut-val small {
  font-family: var(--font-text);
  font-size: 0.9rem;
  color: var(--stone);
}
.nut-bar {
  display: block;
  height: 5px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--bay) 14%, transparent);
  overflow: hidden;
}
.nut-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--bay);
}
.nut-pct {
  font-size: 0.8rem;
  color: var(--stone);
}
.nut-more {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 20px 0 0;
  color: var(--stone);
}
.nut-more strong {
  color: var(--ink);
  font-weight: 600;
  margin-left: 4px;
}
.nut-source {
  margin: 18px 0 0;
  font-size: var(--size-small);
  color: var(--stone);
}
.nut-source .link-btn,
.nut-stale .link-btn {
  margin-left: 6px;
}
.nut-stale {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 20px;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  background: color-mix(in srgb, var(--saffron) 14%, var(--paper));
  color: var(--saffron-ink);
  font-size: var(--size-small);
}
.nut-stale svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.nut-empty {
  display: flex;
  align-items: center;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin: 0;
  color: var(--stone);
}
.nut-empty p {
  margin: 0;
}
.nut-how {
  margin-top: 18px;
}
.nut-how summary {
  cursor: pointer;
  color: var(--bay);
  font-weight: 600;
  font-size: var(--size-small);
}
.nut-how > p {
  font-size: var(--size-small);
}
.nut-table-wrap {
  overflow-x: auto;
}
.nut-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--size-small);
  font-variant-numeric: tabular-nums;
}
.nut-table th,
.nut-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
  text-align: right;
  white-space: nowrap;
}
.nut-table th[scope='row'],
.nut-table thead th:first-child {
  text-align: left;
  white-space: normal;
  font-weight: 400;
}
.nut-table thead th {
  font-weight: 600;
  color: var(--stone);
}
@media (max-width: 700px) {
  .nut-grid {
    grid-template-columns: 1fr;
  }
  .nut-main {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .nut-item {
    padding: 12px;
  }
  .nut-val {
    font-size: 1.4rem;
  }
  .nut-pct {
    font-size: 0.7rem;
  }
}
@media print {
  .nut-how,
  .nut-source .link-btn,
  .nut-stale {
    display: none;
  }
}
.nut-fields {
  border: 0;
  padding: 0;
  margin: 0;
}
.nut-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px 12px;
  margin-top: 8px;
}
.nut-inputs label {
  display: grid;
  gap: 4px;
  font-size: var(--size-small);
  font-weight: 600;
}
.nut-inputs small {
  font-weight: 400;
  color: var(--stone);
}
.nut-inputs input {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-s);
  background: var(--paper);
  font: inherit;
  font-weight: 400;
}
.nut-inputs input:focus {
  outline: none;
  border-color: var(--bay);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bay) 18%, transparent);
}

/* ── Ratings: yours (five stars you tap) and everyone's (one star and a number) ── */
.ratings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 32px;
  margin: 18px 0 4px;
}
.rate-mine,
.rate-all {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rate-label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
}
.stars {
  display: inline-flex;
}
.stars button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: transparent;
  cursor: pointer;
}
.stars button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  stroke: var(--stone);
  stroke-width: 1.4;
  stroke-linejoin: round;
  transition: transform var(--dur-fast) var(--ease), color var(--dur-fast);
}
.stars button.on {
  color: var(--saffron);
}
.stars button.on svg {
  stroke: var(--saffron);
}
/* Hovering previews the rating: stars up to the pointer light up. */
@media (hover: hover) {
  .stars:hover button {
    color: color-mix(in srgb, var(--saffron) 70%, var(--paper));
  }
  .stars:hover button svg {
    stroke: var(--saffron);
  }
  .stars button:hover ~ button {
    color: transparent;
  }
  .stars button:hover ~ button svg {
    stroke: var(--stone);
  }
  .stars button:hover svg {
    transform: scale(1.15);
  }
}
.stars button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.rate-hint {
  font-size: var(--size-small);
}
.rate-avg {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.rate-avg strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1;
}
.avg-star svg {
  width: 17px;
  height: 17px;
  fill: var(--ink);
  transform: translateY(2px);
}
.rate-avg .muted {
  font-size: var(--size-small);
}
@media print {
  .ratings {
    display: none;
  }
}

/* ── Place (where a recipe was found) ───────────────────── */
.place-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.place-link svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.place-field {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.place-find {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.place-find input {
  flex: 1 1 220px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-s);
  background: var(--paper);
  font: inherit;
}
.place-find input:focus {
  outline: none;
  border-color: var(--bay);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bay) 18%, transparent);
}
.place-find .btn svg,
.place-pin svg,
.place-results svg {
  width: 17px;
  height: 17px;
  flex: none;
}
.place-status:empty {
  display: none;
}
.place-results {
  list-style: none;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  background: var(--paper);
  box-shadow: var(--shadow-menu);
  max-height: 320px;
  overflow: auto;
}
.place-results button {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.place-results button:hover,
.place-results button:focus-visible {
  background: var(--paper-2);
}
.place-results svg {
  margin-top: 2px;
  color: var(--bay);
}
.place-results strong,
.place-results small {
  display: block;
}
.place-results small {
  color: var(--stone);
  font-size: 0.82rem;
}
.place-pin {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0;
  font-size: var(--size-small);
}
.place-pin svg {
  color: var(--bay);
}

/* ── Site footer: the same on every page (public/footer.js) ── */
body {
  display: flex;
  flex-direction: column;
}
body > main {
  flex: 1 0 auto;
}
.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
  padding-bottom: env(safe-area-inset-bottom);
}
.site-footer:empty {
  display: none;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px var(--gutter) 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 14px 40px;
}
.footer-mark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ink);
  text-decoration: none;
}
.footer-mark span {
  color: color-mix(in srgb, var(--ink) 30%, transparent);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  flex: 1;
}
.footer-links a {
  color: var(--stone);
  text-decoration: none;
  font-size: var(--size-small);
  font-weight: 500;
}
.footer-links a:hover {
  color: var(--bay);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-copy {
  width: 100%;
  margin: 0;
  color: var(--stone);
  font-size: 0.82rem;
}
/* On a phone the links get the full width under the name, instead of a narrow column beside it. */
@media (max-width: 640px) {
  .footer-inner {
    padding-top: 26px;
    padding-bottom: 28px;
  }
  .footer-links {
    flex: 1 0 100%;
  }
}
@media print {
  .site-footer {
    display: none;
  }
}

/* A failed link import: open the page to copy it, then paste it into Skillet & Coupe. */
.job-main .job-fallback,
.ja-text .job-fallback {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.job-fallback .btn svg {
  width: 15px;
  height: 15px;
}
.job-main .job-hint,
.ja-text .job-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--stone);
}
.panel.spotlight {
  box-shadow: 0 0 0 2px var(--saffron), var(--shadow-paper);
}
.job-main .job-fallback span {
  color: inherit;
  font-size: inherit;
}

/* ── Section tools: a toolbar on a chapter heading ──────── */
.sec-tools {
  display: flex;
  gap: 6px;
  align-self: center;
}
.chapter-title .ch-count + .sec-tools {
  margin-left: 4px;
}
.sec-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 12px 4px 9px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, var(--rule));
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--c) 10%, var(--paper));
  color: var(--ink);
  font: 600 0.8rem/1 var(--font-text);
  cursor: pointer;
  transition: background-color var(--dur-fast), border-color var(--dur-fast);
}
.sec-tool svg {
  width: 17px;
  height: 17px;
  color: var(--c);
}
.sec-tool:hover {
  background: color-mix(in srgb, var(--c) 20%, var(--paper));
  border-color: var(--c);
}
.sec-tool[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
}
.chapter-empty {
  margin: 0 0 8px;
}
@media (max-width: 560px) {
  .sec-tool span {
    display: none;
  }
  .sec-tool {
    padding: 6px;
  }
}

.tool-dialog {
  width: min(560px, calc(100vw - 32px));
}
.tool-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.tool-head h2 {
  margin: 0 0 4px;
}
.tool-head p {
  margin: 0;
}
.tool-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--c);
  color: var(--on-section);
}
.tool-badge svg {
  width: 28px;
  height: 28px;
}
.tool-dialog textarea,
.tool-dialog input:not([type='radio']):not([type='checkbox']) {
  width: 100%;
}
.tool-count {
  border: 0;
  padding: 0;
  margin: 0;
}
.tool-count .seg {
  display: inline-flex;
  margin-top: 6px;
}
.tool-count .seg label {
  position: relative;
}
.tool-count .seg input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.tool-count .seg span {
  display: grid;
  place-items: center;
  min-width: 48px;
  height: 38px;
  font-weight: 600;
}
.tool-count .seg input:checked + span {
  background: var(--bay);
  color: var(--bay-ink);
  border-radius: var(--radius-pill);
}
.tool-count .seg input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-pill);
}
.menu-drop {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 32px 20px;
  border: 2px dashed var(--rule);
  border-radius: var(--radius-l);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.menu-drop:hover,
.menu-drop.over {
  border-color: var(--bay);
  background: var(--bay-soft);
}
.menu-drop svg {
  width: 36px;
  height: 36px;
  color: var(--bay);
}
.menu-reading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 0;
  margin: 0;
}
.menu-found {
  margin: 0;
}
.menu-items {
  max-height: min(46vh, 420px);
  overflow: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  padding: 6px 12px;
}
.menu-items ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.menu-heading {
  margin: 12px 0 4px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
}
.menu-items label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}
.menu-items li:last-child label {
  border-bottom: 0;
}
.menu-items input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: var(--bay);
  flex: none;
}
.menu-items strong,
.menu-items small {
  display: block;
}
.menu-items small {
  color: var(--stone);
  font-size: 0.85rem;
  line-height: 1.4;
}
.menu-drop.busy {
  opacity: 0.6;
  pointer-events: none;
}

/* ── Admin settings → Drink colors ──────────────────────────────────────────────── */
.dc-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.dc-search {
  flex: 1 1 220px;
}
.dc-search input {
  width: 100%;
}
.dc-new {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.dc-new[hidden] {
  display: none;
}
.dc-new input[name='name'] {
  flex: 1 1 200px;
}
.dc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 560px;
  overflow: auto;
  border-top: 1px solid var(--rule);
}
.dc-row {
  border-bottom: 1px solid var(--rule);
}
.dc-row summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  cursor: pointer;
  list-style: none;
}
.dc-row summary::-webkit-details-marker {
  display: none;
}
.dc-sw {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 25%, transparent);
}
.dc-name {
  font-weight: 600;
}
.dc-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--bay-soft);
  color: var(--bay);
}
.dc-meta {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--stone);
  white-space: nowrap;
}
.dc-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  padding: 6px 4px 18px;
}
.dc-preview .dg-art {
  min-width: 300px;
}
.dc-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dc-fields input[type='color'],
.dc-new input[type='color'] {
  width: 56px;
  height: 38px;
  padding: 2px;
  border-radius: var(--radius-s);
}
.dc-aliases {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dc-aliases li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dc-aliases li > span {
  flex: 1 1 140px;
}
.dc-aliases .select,
.dc-fields [data-merge] {
  max-width: 220px;
}
@media (max-width: 560px) {
  .dc-body {
    grid-template-columns: 1fr;
  }
  .dc-meta {
    display: none;
  }
}

/* ── Drink glass on the recipe page (the glass itself: drink-glass.css) ────── */
.drink-ref {
  margin: 0 0 26px;
}
.drink-ref[hidden] {
  display: none;
}

/* Phones with the edge tabs: the header loses the tab gutter, so the wordmark keeps
   just "S&C" and the search button never runs into it. */
@media (max-width: 560px) {
  body.has-tabs .wm-rest {
    display: none;
  }
}

/* ── Drinks: a search box under the chapter heading ─────────────────────── */
.drink-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  padding: 0 16px;
  min-height: 48px;
  max-width: 560px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--stone);
}
.drink-search:focus-within {
  border-color: var(--bay);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bay) 18%, transparent);
}
.drink-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
}
.drink-none {
  margin: 0 0 8px;
}
.drink-more {
  margin: 28px 0 8px;
}

/* ── Shopping: a link from each ingredient, and the Shop panel ──────────── */
.ingredients li:has(.ing-buy) {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.ingredients li:has(.ing-buy) .ing {
  flex: 1;
  min-width: 0;
}
.ing-buy {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-top: 2px;
  border-radius: 50%;
  color: var(--stone);
  opacity: 0.55;
}
.ing-buy:hover,
.ing-buy:focus-visible {
  opacity: 1;
  color: var(--bay);
  background: var(--bay-soft);
}
.ing-buy svg {
  width: 18px;
  height: 18px;
}
.shop-btn {
  margin-left: auto;
}
.shop-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: min(86vh, 900px);
  padding: clamp(20px, 3vw, 32px);
  border: 0;
  border-radius: var(--radius-l);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-dialog);
}
.shop-dialog::backdrop {
  background: var(--scrim);
}
.shop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.shop-head h2 {
  margin: 0;
}
.shop-store {
  margin-top: 22px;
}
.shop-store h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.3rem;
}
.shop-store ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.shop-store li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}
.shop-store label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.shop-store input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--bay);
}
.shop-line {
  grid-column: 1;
  padding-left: 28px;
  font-size: 0.85rem;
  color: var(--stone);
}
.shop-find {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--bay);
  font-weight: 600;
}
.shop-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.kroger-row[hidden] {
  display: none;
}
.copyable {
  user-select: all;
  word-break: break-all;
}

/* The account menu in sections: you, admin (People, Admin settings), sign out. */
.menu-group {
  display: flex;
  flex-direction: column;
}
.menu-group + .menu-group {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--rule);
}

/* ── The page turn between the edge tabs (public/page-turn.js) ──
   --f is where the fold is, from the left of the box; --w the box's width; --slant how far
   the fold's top is ahead of its middle; --lean the same as an angle; --curl how much of
   the turned part shows, curled over the fold. */
.pt-box {
  position: fixed;
  z-index: 19; /* under the masthead and the edge tabs */
  overflow: hidden;
  background: var(--paper);
  --f: 100vw;
  --w: 100vw;
  --slant: 0px;
  --lean: 0deg;
  --curl: 0px;
}
.pt-leaf {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--paper);
}
.pt-over {
  clip-path: polygon(0 0, calc(var(--f) + var(--slant)) 0, calc(var(--f) - var(--slant)) 100%, 0 100%);
}
/* The back of the turned part, curling over the fold: a strip along the fold line, lit like
   a cylinder, with its shadow on the page it's leaving. --curl is how wide the strip is. */
.pt-flap {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: calc(var(--f) - var(--curl));
  width: var(--curl);
  transform-origin: 100% 50%;
  transform: rotate(var(--lean));
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--paper-2) 90%, #000) 0%,
    var(--paper-2) 18%,
    color-mix(in srgb, var(--paper) 60%, #fff) 58%,
    var(--paper-2) 84%,
    color-mix(in srgb, var(--paper-2) 84%, #000) 100%
  );
  box-shadow: -16px 0 36px rgb(0 0 0 / 0.26), -2px 0 5px rgb(0 0 0 / 0.16);
}
/* Its shadow on the page underneath, just right of the fold. */
.pt-cast {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: var(--f);
  width: 120px;
  transform-origin: 0 50%;
  transform: rotate(var(--lean));
  background: linear-gradient(90deg, rgb(0 0 0 / 0.3), rgb(0 0 0 / 0.09) 45%, rgb(0 0 0 / 0));
}

.pt-turned .pt-flap,
.pt-turned .pt-cast {
  display: none;
}
/* The page that hasn't arrived: blank paper with the loading mark. The mark holds back a
   moment, so a page that arrives quickly never shows it. */
.pt-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--bay);
  opacity: 0;
  animation: pt-show 0.3s ease 0.28s forwards;
}
.pt-loading svg {
  width: 96px;
  height: 96px;
  margin-top: -6vh;
}
.pt-steam {
  opacity: 0;
  animation: pt-steam 1.5s ease-in-out infinite;
}
.pt-steam.s2 {
  animation-delay: 0.25s;
}
.pt-steam.s3 {
  animation-delay: 0.5s;
}
@keyframes pt-steam {
  0% {
    opacity: 0;
    transform: translateY(5px);
  }
  40% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateY(-7px);
  }
}
@keyframes pt-show {
  to {
    opacity: 1;
  }
}
/* The page arriving on the paper mid-turn. */
.pt-arrive > * {
  animation: pt-show 0.2s ease both;
  opacity: 0;
}

/* A section's own page: its heading carries the chapter number and the section's color. */
.section-head {
  align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--c);
}
.section-head h1 {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

/* ── My Bar (public/bar.js): what a person has, and the drinks they can make ── */
.drink-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 28px;
}
.drink-tools .drink-search {
  flex: 1 1 280px;
  margin: 0;
}
.bar-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  margin-top: 28px;
  align-items: start;
}
.bar-h {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.1;
}
.bar-drinks .bar-h:not(:first-child) {
  margin-top: 36px;
}
.bar-shelf .drink-search {
  margin-bottom: 8px;
}
.bar-group .group {
  margin: 22px 0 10px;
}
.bar-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bar-chip {
  height: 34px;
  padding: 0 12px 0 10px;
  font-size: 0.88rem;
}
.bar-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 25%, transparent);
}
.bar-chip.on .bar-dot {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--paper) 55%, transparent);
}
.bar-drinks {
  position: sticky;
  top: calc(var(--header) + 20px);
  max-height: calc(100vh - var(--header) - 40px);
  overflow-y: auto;
}
.bar-rest {
  margin-top: 20px;
}
.bar-near .row {
  border-bottom: 1px solid var(--rule);
}
.bar-near .row-link {
  border-bottom: 0;
  padding-bottom: 2px;
}
.bar-need {
  margin: -14px 0 12px;
  padding-left: 86px; /* under the title, past the photo */
  color: var(--stone);
  font-size: 0.9rem;
}
.bar-need span {
  display: block;
}
.bar-need .link-btn {
  padding: 0 2px;
  font-size: inherit;
}
@media (max-width: 860px) {
  .bar-cols {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Phones: the drinks first, since the list of what there is to have is long. */
  .bar-drinks {
    order: -1;
    position: static;
    max-height: none;
  }
}

/* ── Magic Recipe ───────────────────────────────────────── */
.add-grid.has-magic {
  grid-template-areas: 'magic magic' 'url text' 'web text' 'files manual';
}
.panel-magic {
  grid-area: magic;
  border-color: var(--bay);
}
.panel-magic .panel-title svg {
  color: var(--bay);
}
@media (max-width: 900px) {
  .add-grid.has-magic {
    grid-template-areas: 'magic' 'url' 'web' 'text' 'files' 'manual';
  }
}
.wp-riff {
  display: grid;
  gap: 6px;
  padding: 12px 16px;
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
}
.wp-riff label {
  font-size: 0.85rem;
  font-weight: 600;
}
.wp-riff .btn {
  flex: none;
}
@media (max-width: 560px) {
  .panel-magic .web-inline,
  .wp-riff .web-inline {
    flex-wrap: wrap;
  }
  .panel-magic .web-inline input,
  .wp-riff .web-inline input {
    flex-basis: 100%;
  }
}
