/* App chrome: header, library cards, forms. Recipe pages use recipe.css. */
body.app {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body-font);
  font-size: 17px;
  line-height: 1.5;
}
a { color: #8a4b2a; }
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding: 14px 20px;
  border-bottom: 1px dashed var(--rule);
}
.site-name {
  font-family: var(--title-font);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.site-nav { display: flex; gap: 18px; flex: 1; }
.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }
.site-user { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); }
.site-user form { margin: 0; }
.site-main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
.flash {
  max-width: 1100px;
  margin: 12px auto 0;
  padding: 10px 16px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.page-title {
  font-family: var(--title-font);
  font-weight: 300;
  font-size: 34px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 16px;
}
.card { background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 24px; }
.narrow { max-width: 460px; margin: 48px auto; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.button {
  display: inline-block;
  font: inherit;
  padding: 8px 18px;
  border-radius: 6px;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}
.button.primary { background: var(--ink); color: #fff; }
.button.small { padding: 4px 10px; font-size: 15px; }
.link-button { font: inherit; background: none; border: none; color: #8a4b2a; cursor: pointer; padding: 0; text-decoration: underline; }
.badge { font-size: 13px; padding: 1px 8px; border-radius: 10px; background: #efe3c8; color: #6b4e16; }
.error-text { color: #a33a2a; font-size: 15px; }
.errors { border: 1px solid #d9a79f; background: #fbeeec; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }

/* library */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filters input[type=search] { flex: 1 1 240px; }
.filters input, .filters select { font: inherit; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.recipe-card { display: flex; flex-direction: column; gap: 2px; }
.recipe-card a { color: var(--ink); text-decoration: none; display: flex; flex-direction: column; gap: 8px; }
.recipe-card img, .recipe-card .no-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--panel); border: 1px solid var(--rule); }
.card-title { font-family: var(--title-font); font-size: 22px; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.15; }
.recipe-card a:hover .card-title { text-decoration: underline; }
.card-subtitle { font-style: italic; color: var(--ink-soft); }
.card-meta { font-size: 15px; color: var(--ink-soft); }

/* recipe page */
.recipe-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px; }
.recipe-actions .spacer { flex: 1; }
.version-banner { background: #efe3c8; border-radius: 6px; padding: 8px 14px; margin-bottom: 16px; }

/* history and diff */
.history { width: 100%; border-collapse: collapse; }
.history th, .history td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.history-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.history-actions form { margin: 0; }
.diff { background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: 12px; overflow-x: auto; font-size: 14px; line-height: 1.45; }
.diff .add { background: #e6f4e3; display: block; }
.diff .del { background: #fbe6e3; display: block; }
.diff .hunk { color: #6b625a; display: block; }
.diff .meta { color: #6b625a; font-weight: 500; display: block; }

/* Members admin */
table.members { border-collapse: collapse; width: 100%; margin-bottom: 24px; }
table.members th, table.members td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--rule); }
.member-form { display: grid; gap: 10px; max-width: 420px; }
.member-form label { display: grid; gap: 4px; }
.member-form input { font: inherit; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 6px; }
.member-form button { justify-self: start; }
.hint { color: #6b6158; font-size: 15px; }

/* Editor: the original on the left, the form on the right */
.editor { display: grid; gap: 24px; }
.editor.with-original { grid-template-columns: minmax(260px, 2fr) 3fr; align-items: start; }
.editor-original { position: sticky; top: 16px; }
.editor-original img { width: 100%; border: 1px solid var(--rule); border-radius: 6px; background: #fff; }
.editor-form { min-width: 0; }
.editor-section { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 14px; margin-bottom: 22px; }
.editor-section.wide { display: block; }
.editor-section h2 { margin: 0 0 6px; }
.field { display: grid; gap: 4px; font-size: 15px; }
.field.wide { grid-column: 1 / -1; }
.field.check { display: flex; align-items: center; gap: 8px; }
.editor-form input[type=text], .editor-form select, .editor-form textarea {
  font: inherit; font-size: 16px; padding: 6px 8px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; min-width: 0;
}
.editor-form textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.editor-form [aria-invalid=true] { border-color: #a33a2a; }
.group { border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; }
.group-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.group-name { flex: 1; font-weight: 600; }
.item-row { display: grid; grid-template-columns: 4em 5.5em 3.8em 6.6em minmax(9em, 2fr) minmax(5em, 1fr) auto; gap: 6px; margin-bottom: 6px; align-items: center; }
.item-row .free { grid-column: 1 / 7; }
.item-row .source-hint, .item-row .field-error { grid-column: 1 / -1; margin: 0; }
.steps { counter-reset: step; }
.step-row { display: grid; grid-template-columns: 2em 1fr auto; gap: 6px; margin-bottom: 8px; align-items: start; }
.step-row .step-num::before { counter-increment: step; content: counter(step) "."; font-weight: 600; }
.step-row .field-error { grid-column: 2 / -1; }
.remove { color: #a33a2a; }
.editor-actions { display: flex; gap: 10px; position: sticky; bottom: 0; background: var(--paper, #faf7f2); padding: 10px 0; border-top: 1px solid var(--rule); }
@media (max-width: 860px) {
  .editor.with-original { grid-template-columns: 1fr; }
  .editor-original { position: static; max-width: 420px; }
  .item-row { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .item-row .item, .item-row .note, .item-row .free { grid-column: 1 / -1; }
}

/* Library card without any photo: the title's initial on a soft panel */
.recipe-card .no-photo { display: grid; place-items: center; }
.recipe-card .no-photo span { font-family: var(--title-font); font-size: 64px; color: var(--rule); line-height: 1; }
