:root {
  color-scheme: light;
  --cream: #f9f4e8;
  --paper: #fffcf4;
  --ink: #32261d;
  --muted: #625446;
  --sage: #dce5d2;
  --forest: #354c38;
  --line: #d6cab7;
  --red: #833529;
  --serif: Georgia, "Times New Roman", serif;
  font: 16px/1.55 system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
h1, h2, .brand, .card-copy strong { font-family: var(--serif); line-height: 1.12; }
h1 { font-size: clamp(2.35rem, 6vw, 4.65rem); margin: 0 0 .45em; font-weight: normal; }
h2 { font-size: 1.75rem; margin: 0 0 .7em; font-weight: normal; }
p { margin: .4em 0 1em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid transparent; border-radius: .45rem; font-weight: 650; padding: .5rem .85rem; }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 3px solid #9a5c23; outline-offset: 3px; }
.primary { background: var(--forest); color: #fff; }
.secondary { background: var(--paper); color: var(--forest); border-color: var(--line); }
.danger { background: var(--paper); color: var(--red); border-color: var(--red); }
.masthead { color: #fff9eb; background: #403127; border-bottom: 4px solid #ad8b63; }
.masthead-inner { max-width: 76rem; margin: auto; padding: .8rem clamp(1rem, 4vw, 2rem); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.brand { font-size: 1.3rem; }
nav { display: flex; flex-wrap: wrap; gap: .4rem; }
nav button.secondary { background: transparent; color: inherit; border-color: #8e7968; }
#status, main { width: min(100% - 2rem, 72rem); margin-inline: auto; }
#status:not(:empty) { margin-top: 1rem; padding: .6rem 1rem; border: 1px solid var(--line); border-radius: .45rem; background: var(--sage); overflow-wrap: anywhere; }
#status.error { background: #f4ded7; color: #64291d; }
main { margin-block: 1.5rem 4rem; }
.hero { background: radial-gradient(ellipse at 87% 20%, #edf0df 0%, transparent 58%), var(--sage); border: 1px solid #b9c9ad; border-radius: .8rem; padding: clamp(1.4rem, 6vw, 4rem); margin-bottom: 1.4rem; }
.hero h1 { margin-bottom: .12em; color: #2f4531; }
.hero p { font: italic 1.23rem/1.5 var(--serif); color: var(--muted); }
.filters { background: var(--paper); border: 1px solid var(--line); border-radius: .7rem; display: grid; grid-template-columns: 2fr 1fr auto; align-items: end; gap: 1rem; padding: .9rem 1rem; margin-bottom: 1.3rem; }
.field { display: flex; flex-direction: column; gap: .28rem; min-width: 0; font-weight: 600; }
.field:has(input[type="checkbox"]) { flex-direction: row; align-items: center; gap: .55rem; min-height: 2.65rem; }
input:not([type="checkbox"]), select, textarea { color: var(--ink); background: #fffefa; border: 1px solid #ada090; border-radius: .35rem; padding: .48rem .6rem; width: 100%; }
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--forest); }
textarea { resize: vertical; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 1rem; }
.card { position: relative; border-radius: .65rem; border: 1px solid var(--line); background: var(--paper); }
.recipe-card { display: block; width: 100%; height: 100%; background: none; padding: 0; text-align: left; color: inherit; border: 0; overflow: hidden; border-radius: inherit; }
.recipe-card img, .photo-placeholder { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: repeating-linear-gradient(45deg, transparent 0 8px, #ede1ce 8px 9px), #f3ead8; }
.card-copy { display: block; padding: .85rem; overflow-wrap: anywhere; }
.card-copy strong { display: block; font-size: 1.35rem; }
.card-copy small { color: var(--muted); }
.star { position: absolute; top: .55rem; right: .55rem; font-size: 1.3rem; padding: .1rem .5rem; }
.panel { background: var(--paper); border: 1px solid var(--line); padding: clamp(.9rem, 3vw, 1.6rem); border-radius: .6rem; margin-bottom: 1rem; min-width: 0; overflow-wrap: anywhere; }
.panel form, .editor-rows { display: grid; gap: .8rem; }
.panel form > button, .editor-rows + button { justify-self: start; }
.editor-rows + button { margin-top: .8rem; }
.narrow { max-width: 31rem; }
.actions { display: flex; align-items: end; flex-wrap: wrap; gap: .55rem; margin-bottom: .85rem; }
.actions .field { flex: 1 1 10rem; }
.muted { color: var(--muted); }
.recipe-meta { margin-bottom: .9rem; }
.recipe-heading { overflow-wrap: anywhere; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .9rem; margin-bottom: 1rem; }
.gallery:empty { display: none; }
.gallery figure { margin: 0; }
.gallery img { display: block; width: 100%; height: 16rem; object-fit: contain; background: #efe7d9; border-radius: .5rem; }
.gallery button { margin-top: .4rem; }
.recipe-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1rem; }
.ingredients, .steps { padding-left: 1.3rem; }
.ingredients li, .steps li { padding: .3rem 0; }
.multiline, .steps li { white-space: pre-wrap; }
.ingredient-row, .step-row { display: grid; grid-template-columns: minmax(4.5rem, .7fr) minmax(4.5rem, .8fr) minmax(8rem, 2fr) auto; gap: .55rem; align-items: end; }
.step-row { grid-template-columns: minmax(0, 1fr) auto; }
.account { border-top: 1px solid var(--line); padding: .75rem 0; }
.account summary { cursor: pointer; }
.account form { margin-top: .65rem; }
.print-only { display: none; }
@media (max-width: 650px) {
  .filters, .recipe-body { grid-template-columns: 1fr; gap: .55rem; }
  .ingredient-row { grid-template-columns: 1fr 1fr; align-items: end; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
  .ingredient-row .field:nth-child(3) { grid-column: 1 / -1; }
}
@media print {
  @page { margin: 15mm; }
  :root { background: white; color: black; font-size: 11pt; }
  .masthead, #status, button, .screen-only, .ingredients-panel label,
  main.recipe .actions, .gallery figure:not(:first-child) { display: none !important; }
  .print-only { display: block; }
  main.recipe { width: auto; margin: 0; }
  .recipe-body, .gallery { display: block; }
  .gallery img { max-width: 95mm; height: auto; max-height: 55mm; background: none; object-fit: contain; }
  .panel { padding: 0; border: 0; background: none; }
  h1 { font-size: 28pt; }
  h2 { font-size: 16pt; break-after: avoid; }
  li, figure { break-inside: avoid; }
}
.invite-dialog { width: min(36rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: .65rem; padding: 1.2rem; }
.invite-dialog::backdrop { background: rgb(50 38 29 / 55%); }
.invite-dialog .field, .account > button { margin-top: .65rem; }
.invite-dialog .actions { margin-top: .85rem; }
.invite-feedback { margin-bottom: 0; min-height: 1.55em; }
.mail-link { display: inline-block; border: 1px solid var(--line); border-radius: .45rem; padding: .5rem .85rem; font-weight: 650; text-decoration: none; }
.mail-link:not([href]) { opacity: .6; }
.invite-dialog [hidden] { display: none; }
.shopping-list { list-style: none; padding: 0; margin: .85rem 0; }
.shopping-list li { display: flex; justify-content: space-between; align-items: center; gap: .55rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.shopping-list li .field { font-weight: normal; overflow-wrap: anywhere; }
.shopping-list li .checked, .shopping-list li.checked .field > span { text-decoration: line-through; color: var(--muted); }
.shopping-list input { flex: 0 0 auto; }
.account-expired { display: inline-block; margin-inline-start: .45rem; color: #7b2c21; background: #fae7dd; padding: .05rem .4rem; border-radius: .25rem; }
.mail-link[hidden] { display: none; }
