:root {
  --paper: #FCFBF8;
  --ink: #1E2A32;
  --blue: #33658A;
  --butter: #F2C14E;
  --line: #E4E0D6;
  --muted: #6b7680;
  --faint: #9aa4ac;
  --card: #ffffff;
  --oven: #C4452D;
  --stovetop: #33658A;
  --grill: #2F6B4F;
  --smoker: #6B4A2F;
  --slowcooker: #8A5A83;
  --airfryer: #B07D2B;
  --nocook: #5B7065;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
.pad-top { padding-top: 28px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-tight { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 26px; } .mt-4 { margin-top: 36px; }

/* header */
.site-header { border-bottom: 2px solid var(--ink); background: var(--paper); }
.header-inner { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; }
.brand { text-decoration: none; display: block; }
.brand-script { display: block; font-family: 'Caveat', cursive; font-size: 22px; color: var(--blue); line-height: 1; }
.brand-title { display: block; font-family: 'Zilla Slab', serif; font-weight: 700; font-size: 34px; line-height: 1.05; color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.greeting { font-family: 'Caveat', cursive; font-size: 21px; }

.site-footer { border-top: 1.5px solid var(--line); margin-top: 60px; padding: 22px 0 40px; color: var(--faint); font-family: 'Caveat', cursive; font-size: 19px; }

/* buttons */
button { font: inherit; }
.btn {
  font-family: 'Zilla Slab', serif; font-weight: 600; border-radius: 6px; cursor: pointer;
  padding: 9px 18px; font-size: 16px; border: 1.5px solid var(--blue);
  background: var(--blue); color: #fff; text-decoration: none; display: inline-block;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 5px 12px; font-size: 14px; }
.btn.outline { background: transparent; color: var(--blue); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--oven); border-color: var(--oven); color: #fff; }
.btn.surprise {
  font-family: 'Caveat', cursive; font-size: 21px; font-weight: 600; white-space: nowrap;
  border: 2px dashed var(--blue); background: transparent; color: var(--blue);
}
.linkish { background: none; border: none; padding: 0; color: var(--blue); font-weight: 600; text-decoration: underline; cursor: pointer; }

/* chips */
.chip {
  font-size: 13.5px; font-weight: 600; padding: 5px 13px; border-radius: 999px;
  cursor: pointer; border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
}
.chip.on { background: var(--ink); color: #fff; }
.chip.static { cursor: default; }
.chip.small { font-size: 12px; padding: 3px 9px; }
.chip.tag { border: none; background: #EFEDE5; color: #4a565f; cursor: default; font-weight: 500; }
.chip.fav { border-color: var(--butter); color: #8a6d1c; }
.chip.fav.on { background: var(--butter); color: var(--ink); }
.filter-label { font-family: 'Caveat', cursive; font-size: 20px; color: var(--muted); min-width: 84px; }

/* star */
.star {
  display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--line);
  background: #fff; color: var(--faint); border-radius: 999px; cursor: pointer;
  padding: 3px 10px; font-size: 13px; font-weight: 700;
}
.star.has { border-color: var(--butter); color: #8a6d1c; }
.star.mine { background: var(--butter); color: var(--ink); border-color: var(--butter); }
.star.big { padding: 6px 14px; font-size: 16px; }

/* inputs */
input[type=text], input[type=password], input[type=url], textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 6px; padding: 9px 12px;
  font-size: 15px; background: #fff; color: var(--ink); font-family: inherit;
}
input:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px;
}
textarea { min-height: 110px; line-height: 1.6; resize: vertical; }
.search { font-size: 17px; padding: 12px 16px; border-color: var(--ink); border-width: 2px; flex: 1; min-width: 200px; }
.field { display: block; margin-bottom: 16px; }
.field > span.label { font-family: 'Zilla Slab', serif; font-weight: 600; font-size: 15px; }
.field > span.hint { font-size: 12px; color: var(--muted); margin-left: 8px; }
.field .control { margin-top: 4px; }
.grid-fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.error { color: var(--oven); font-weight: 600; margin: 8px 0 12px; }

/* recipe grid */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card {
  background: var(--card); border: 1.5px solid var(--line); border-top: 6px solid var(--blue);
  border-radius: 8px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
  box-shadow: 0 1px 3px rgba(30,42,50,.07); position: relative; text-align: left; padding: 0;
  color: inherit; text-decoration: none;
}
.card:hover { box-shadow: 0 3px 10px rgba(30,42,50,.12); }
.card .card-star { position: absolute; top: 8px; right: 8px; z-index: 2; }
.card img { width: 100%; height: 150px; object-fit: cover; display: block; }
.card .noimg { height: 60px; background: #F4F2EC; display: flex; align-items: center; justify-content: center; font-family: 'Caveat', cursive; font-size: 22px; color: var(--faint); }
.card .body { padding: 12px 14px 14px; }
.card h3 { font-family: 'Zilla Slab', serif; font-weight: 700; font-size: 19px; line-height: 1.2; margin: 0; }
.card .from { font-family: 'Caveat', cursive; font-size: 19px; color: var(--blue); margin-top: 2px; }
.card .meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* recipe page */
.recipe { max-width: 760px; }
.recipe h2 { font-family: 'Zilla Slab', serif; font-weight: 700; font-size: 34px; line-height: 1.1; margin: 0; }
.recipe .from { font-family: 'Caveat', cursive; font-size: 24px; color: var(--blue); margin-top: 4px; }
.recipe h3 { font-family: 'Zilla Slab', serif; font-weight: 700; font-size: 22px; border-bottom: 2px solid var(--butter); display: inline-block; padding-bottom: 2px; margin: 0; }
.facts { display: flex; flex-wrap: wrap; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.fact { padding: 10px 22px; }
.fact + .fact { border-left: 1.5px solid var(--line); }
.fact .k { font-family: 'Caveat', cursive; font-size: 19px; color: var(--muted); line-height: 1; }
.fact .v { font-family: 'Zilla Slab', serif; font-weight: 700; font-size: 18px; }
.photos { display: flex; gap: 12px; flex-wrap: wrap; }
.photos img { width: 230px; height: 172px; object-fit: cover; border-radius: 8px; border: 1.5px solid var(--line); }
.ing-list { list-style: none; padding: 0; margin: 10px 0 0; }
.ing-list li { border-bottom: 1px dashed var(--line); }
.ing-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none; cursor: pointer; padding: 7px 0; font-size: 15.5px; color: var(--ink); }
.ing-btn .box { width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0; border: 1.5px solid var(--blue); background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); }
.ing-btn.done { color: var(--faint); text-decoration: line-through; }
.ing-btn.done .box { border-color: var(--faint); background: #EFEDE5; }
.steps { margin: 10px 0 0; padding-left: 24px; }
.steps li { padding: 6px 0; font-size: 15.5px; line-height: 1.55; }
.notecard { background: #FBF4DE; border: 1.5px solid var(--butter); border-radius: 8px; padding: 14px 18px; }
.notecard .who { font-family: 'Caveat', cursive; font-size: 22px; color: #8a6d1c; }
.notecard p { margin: 4px 0 0; font-size: 15.5px; line-height: 1.55; white-space: pre-wrap; }
.comment { background: #fff; border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.comment .who { font-family: 'Caveat', cursive; font-size: 20px; color: var(--blue); }
.comment p { margin: 2px 0 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; }

/* members admin */
.member { background: #fff; border: 1.5px solid var(--line); border-radius: 8px; padding: 12px 16px; }
.member .name { font-family: 'Zilla Slab', serif; font-weight: 700; font-size: 17px; }
.badge { font-size: 12px; font-weight: 700; color: #8a6d1c; background: #FBF4DE; border: 1px solid var(--butter); border-radius: 999px; padding: 2px 9px; }
.panel { background: #fff; border: 1.5px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.panel h3 { font-family: 'Zilla Slab', serif; font-weight: 700; font-size: 18px; margin: 0 0 10px; border: none; }

/* photo editor */
.thumbs { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.thumb-wrap { position: relative; }
.thumb-wrap img { width: 110px; height: 84px; object-fit: cover; border-radius: 6px; border: 1.5px solid var(--line); display: block; }
.thumb-x { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; border: none; cursor: pointer; font-size: 12px; line-height: 1; }

.empty { text-align: center; padding: 70px 20px; }
.empty .big { font-family: 'Caveat', cursive; font-size: 30px; color: var(--blue); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 22px; border-radius: 8px;
  font-family: 'Zilla Slab', serif; font-weight: 600; font-size: 15px; z-index: 50;
}

.form-narrow { max-width: 420px; }
.form-medium { max-width: 680px; }

@media (max-width: 560px) {
  .brand-title { font-size: 27px; }
  .recipe h2 { font-size: 27px; }
  .fact { padding: 8px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .wrap { max-width: none; padding: 0; }
  .card, .panel, .facts, .comment { box-shadow: none; }
  a[href]:after { content: ""; }
}
