/* Dinner In — the original artifact's theme (warm paper, deep green,
   paprika, mustard), carried over from client/src/theme.css. */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=DM+Serif+Display&display=swap');
:root {
  color-scheme: light dark;
  --bg: #faf7f0; --surface: #ffffff; --surface-alt: #f1ebdd;
  --text: #1c2420; --dim: #647065; --border: #e3ddcd;
  --accent: #1e4634; --accent-text: #ffffff;
  --paprika: #c8501f; --mustard: #d9a441;
  --radius: 14px; --shadow: 0 2px 10px rgba(30, 70, 52, .12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131713; --surface: #1d231d; --surface-alt: #262d26;
    --text: #eceadf; --dim: #9aa695; --border: #333b33;
    --accent: #7fc79b; --accent-text: #10231a;
    --paprika: #e87a4a; --mustard: #e3b95c;
    --shadow: 0 2px 10px rgba(0, 0, 0, .4);
  }
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
.font-display { font-family: "DM Serif Display", Georgia, serif; }
.boot { padding: 3rem 1rem; text-align: center; color: var(--dim); }
a { color: var(--accent); }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; }

/* top bar + menu drawer */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: .6rem;
  background: var(--bg); border-bottom: 1px solid var(--border); padding: .55rem .9rem; }
.topbar .menu-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-weight: 700; font-size: .9rem; border-radius: 999px; padding: .5rem .9rem; }
.topbar .title { font-family: "DM Serif Display", Georgia, serif; font-size: 1.25rem; }
.topbar .who { margin-left: auto; font-size: .85rem; color: var(--dim); text-align: right; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 50; }
.drawer { position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 85vw); background: var(--surface); z-index: 51;
  box-shadow: var(--shadow); padding: 1rem; overflow-y: auto; }
.drawer h2 { margin: .2rem 0 1rem; font-family: "DM Serif Display", Georgia, serif; font-size: 1.3rem; }
.drawer .head { margin: 1.1rem 0 .3rem; padding: 0 .6rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.drawer button.item { display: block; width: 100%; background: none; border: 0; color: var(--text);
  font-size: .98rem; font-weight: 600; padding: .6rem; border-radius: .6rem; text-align: left; }
.drawer button.item:hover { background: var(--surface-alt); }
.drawer .note { margin-top: 1.2rem; padding: 0 .6rem; font-size: .78rem; line-height: 1.5; color: var(--dim); }
.drawer .close-btn { float: right; background: var(--surface-alt); border: 0; border-radius: 999px; padding: .35rem .7rem; font-weight: 700; color: var(--text); }

main { max-width: 880px; margin: 0 auto; padding: 0 .9rem 3rem; }
section.view { padding-top: 1.2rem; }
h1.big { font-family: "DM Serif Display", Georgia, serif; font-size: 2rem; line-height: 1.15; margin: .4rem 0 .3rem; }
h2.viewtitle { font-family: "DM Serif Display", Georgia, serif; font-size: 1.5rem; margin: .2rem 0 .3rem; }
h3.sect { font-family: "DM Serif Display", Georgia, serif; font-size: 1.2rem; margin: 1.6rem 0 .2rem; }
.muted { color: var(--dim); } .small { font-size: .88rem; } .xs { font-size: .78rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; }
.error { background: #fdecea; color: #8c241c; border-radius: .6rem; padding: .6rem .8rem; margin: .8rem 0; }
@media (prefers-color-scheme: dark) { .error { background: #472622; color: #ffb4ab; } }
.notice { background: var(--surface-alt); border-radius: .6rem; padding: .6rem .8rem; margin: .8rem 0; }

/* buttons, chips, forms */
.btn { display: inline-block; border: 0; border-radius: 999px; cursor: pointer; font-weight: 700;
  background: var(--accent); color: var(--accent-text); padding: .6rem 1.1rem; font-size: .92rem; }
.btn.alt { background: var(--surface-alt); color: var(--text); font-weight: 600; }
.btn.paprika { background: var(--paprika); color: #fff; }
.btn:disabled { opacity: .6; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px;
  padding: .45rem .8rem; font-size: .88rem; font-weight: 600; }
.chip.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.chip.static { background: var(--surface-alt); border-color: transparent; font-size: .78rem; padding: .3rem .6rem; }
.chiprow { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .5rem; }
label { display: block; font-size: .9rem; color: var(--dim); margin: .7rem 0 .25rem; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface);
  border: 1.5px solid var(--border); border-radius: .6rem; padding: .6rem .7rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--mustard); }
input.pill, select.pill { border-radius: 999px; padding: .65rem 1rem; }
.grow-input { flex: 1; min-width: 10rem; }
form.inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
form.inline input { width: auto; }

/* recipe cards */
.grid { display: grid; grid-template-columns: 1fr; gap: .9rem; margin-top: .9rem; }
@media (min-width: 620px) { .grid { grid-template-columns: 1fr 1fr; } }
.rcard { display: flex; flex-direction: column; overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); text-align: left; }
.rcard .open { display: block; width: 100%; background: none; border: 0; padding: 0; text-align: left; color: var(--text); }
.rcard .body { padding: .8rem .9rem .2rem; }
.rcard h3 { font-family: "DM Serif Display", Georgia, serif; font-size: 1.08rem; line-height: 1.25; margin: 0; }
.rcard .foot { margin-top: auto; padding: .5rem .9rem .9rem; }
.rimg { position: relative; display: block; overflow: hidden; background: var(--surface-alt); }
.rimg img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rimg.tile { display: flex; align-items: center; justify-content: center; }
.rimg.tile span { font-family: "DM Serif Display", Georgia, serif; font-size: 2.4rem; color: var(--accent); }
.rimg .ai-badge { position: absolute; bottom: .5rem; left: .5rem; background: rgba(0,0,0,.65); color: #fff;
  border-radius: 999px; padding: .15rem .55rem; font-size: .7rem; font-weight: 600; }
.h36 { height: 9rem; width: 100%; } .h44 { height: 11rem; width: 100%; } .h56 { height: 14rem; width: 100%; }
@media (min-width: 620px) { .h44 { height: 14rem; } }
.match { color: var(--accent); font-weight: 600; }
.save-line { color: var(--accent); font-weight: 600; }
.stars { position: relative; display: inline-block; line-height: 1; font-size: 1.1rem; }
.stars .base { color: var(--border); white-space: nowrap; }
.stars .fill { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: var(--mustard); }
.stars .hits { position: absolute; inset: 0; display: flex; }
.stars .hits button { flex: 1; background: none; border: 0; padding: 0; }
.star-wrap { display: flex; align-items: center; gap: .5rem; }
.star-val { font-size: .78rem; font-weight: 600; }
.mini-btns { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.mini { border: 0; border-radius: 999px; padding: .4rem .7rem; font-size: .8rem; font-weight: 600; background: var(--surface-alt); color: var(--text); }
.mini.on-fav { background: var(--paprika); color: #fff; }
.mini.on-like { background: var(--accent); color: var(--accent-text); }

/* detail overlay */
.overlay { position: fixed; inset: 0; z-index: 60; overflow-y: auto; background: var(--bg); }
.overlay .inner { max-width: 720px; margin: 0 auto; padding: 0 .9rem 3rem; }
.overlay h2.title { font-family: "DM Serif Display", Georgia, serif; font-size: 1.9rem; line-height: 1.15; margin: 1rem 0 .3rem; }
.back-btn { margin-top: .8rem; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: .5rem .9rem; font-size: .9rem; font-weight: 600; }
.nutri { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .6rem; }
@media (min-width: 620px) { .nutri { grid-template-columns: repeat(6, 1fr); } }
.nutri div { background: var(--surface-alt); border-radius: .6rem; padding: .5rem .2rem; text-align: center; }
.nutri b { display: block; font-size: 1rem; }
.nutri span { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); }
ol.steps { list-style: none; padding: 0; margin: .6rem 0; }
ol.steps li { display: flex; gap: .8rem; margin-bottom: .8rem; line-height: 1.55; font-size: .96rem; }
ol.steps .n { font-family: "DM Serif Display", Georgia, serif; font-size: 1.15rem; line-height: 1; color: var(--paprika); }
ul.ings { list-style: none; padding: 0; margin: .6rem 0; }
ul.ings li { margin-bottom: .55rem; font-size: .96rem; }
ul.ings .dot { color: var(--paprika); margin-right: .45rem; }
.gallery { display: flex; gap: .5rem; margin-top: .5rem; }
.gallery button { height: 4rem; width: 5rem; overflow: hidden; border-radius: .5rem; border: 2px solid var(--border); padding: 0; background: none; }
.gallery button.on { border-color: var(--accent); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* login */
.loginwrap { max-width: 420px; margin: 8vh auto; padding: 0 1rem; }
.loginwrap .card { padding: 1.4rem; }
.loginwrap h1 { margin: 0 0 .2rem; font-size: 1.7rem; font-family: "DM Serif Display", Georgia, serif; color: var(--accent); text-align: center; }
.loginwrap .sub { text-align: center; color: var(--dim); margin: 0 0 .6rem; }
.loginwrap .btn { width: 100%; margin-top: .9rem; }
.loginwrap input { width: 100%; }
.linkrow { text-align: center; margin-top: 1rem; font-size: .92rem; }
.linklike { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 0; }
details.howto { background: var(--surface-alt); border-radius: .6rem; padding: .55rem .8rem; margin-bottom: .5rem; }
details.howto summary { cursor: pointer; font-weight: 700; font-size: .92rem; }
table.members { width: 100%; border-collapse: collapse; }
table.members td, table.members th { padding: .45rem .3rem; border-bottom: 1px solid var(--border); text-align: left; font-size: .92rem; }
