:root {
  --paper: #fafaf9; --ink: #292524; --muted: #78716c; --line: #e7e5e4;
  --herb: #047857; --herb-dark: #065f46; --herb-soft: #d1fae5;
  --amber: #fef3c7; --amber-ink: #78350f; --sky: #e0f2fe; --sky-ink: #075985;
  --red: #dc2626;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.serif { font-family: Georgia, "Times New Roman", serif; }
a { color: var(--herb); }

/* layout */
header.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  background: var(--herb-dark); color: #fff; padding: 12px 16px;
}
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 18px; }
.topbar .brand .logo { width: 26px; height: 26px; border-radius: 6px; background: rgba(255,255,255,.2);
  display: grid; place-items: center; font-size: 15px; }
.iconbtn { background: none; border: 0; color: inherit; cursor: pointer; padding: 6px; border-radius: 6px; }
.iconbtn:hover { background: rgba(255,255,255,.12); }
main { max-width: 720px; margin: 0 auto; padding: 24px 16px 80px; }

/* drawer */
.drawer-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 30; }
.drawer { position: fixed; left: 0; top: 0; height: 100%; width: 256px; background: #fff; padding: 16px;
  box-shadow: 2px 0 16px rgba(0,0,0,.15); z-index: 31; }
.drawer h4 { margin: 0 0 2px; }
.drawer .tag { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.drawer nav button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: 0; padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: #44403c; cursor: pointer; }
.drawer nav button:hover { background: #f5f5f4; }
.drawer nav button.active { background: var(--herb-soft); color: var(--herb-dark); }

/* generic */
h1.page { font-family: Georgia, serif; font-size: 30px; margin: 0 0 4px; }
p.sub { color: var(--muted); margin: 0 0 16px; font-size: 14px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
label.fld { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #a8a29e; margin-bottom: 4px; }
input, textarea, select { font: inherit; color: var(--ink); }
.input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
.input:focus { outline: none; border-color: var(--herb); }
.underline { border: 0; border-bottom: 1px solid var(--line); padding: 4px 0; width: 100%; background: none; }
.underline:focus { outline: none; border-color: var(--herb); }

button.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--herb); color: #fff; border: 0;
  border-radius: 8px; padding: 8px 14px; font-weight: 600; font-size: 14px; cursor: pointer; }
button.btn:hover { background: var(--herb-dark); }
button.btn.ghost { background: #fff; color: #44403c; border: 1px solid var(--line); }
button.btn.ghost:hover { border-color: var(--herb); color: var(--herb-dark); }
button.btn.danger { background: var(--red); }
button.link { background: none; border: 0; color: var(--herb); cursor: pointer; font-weight: 600; font-size: 14px; }

.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--herb-soft); color: var(--herb-dark);
  border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; font-weight: 600; }
.chip button { background: none; border: 0; color: var(--herb); cursor: pointer; }
.pill { border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 600; border: 1px solid var(--line);
  background: #fff; color: #57534e; cursor: pointer; }
.pill.active { background: var(--herb); color: #fff; border-color: var(--herb); }

.tag-qty { background: var(--amber); color: var(--amber-ink); border-radius: 4px; padding: 1px 6px; font-size: 12px; font-weight: 600; }
.tag-unit { background: var(--sky); color: var(--sky-ink); border-radius: 4px; padding: 1px 6px; font-size: 12px; font-weight: 600; }
.tag-food { background: var(--herb-soft); color: var(--herb-dark); border-radius: 4px; padding: 1px 6px; font-size: 12px; font-weight: 600; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .grid4 { grid-template-columns: repeat(4, 1fr); } }

.recipe-card { text-align: left; cursor: pointer; }
.recipe-card:hover { border-color: var(--herb); }

ul.clean { list-style: none; margin: 0; padding: 0; }
.ing { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 4px; }

.unit-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.unit-row .grp { width: 56px; text-align: right; font-size: 11px; font-weight: 700; text-transform: uppercase; color: #d6d3d1; }
.unit-chip { background: #f5f5f4; color: #57534e; border: 0; border-radius: 6px; padding: 4px 8px; font-size: 12px; font-weight: 600; cursor: pointer; }
.unit-chip:hover { background: var(--sky); color: var(--sky-ink); }
.unit-chip.on { background: #0284c7; color: #fff; }

.addbox { border: 2px solid var(--herb); border-radius: 12px; padding: 12px; background: #fff; }

.banner { border: 1px solid #a7f3d0; background: #ecfdf5; border-radius: 12px; padding: 12px; margin-bottom: 16px; }

/* cook mode */
.cook-overlay { position: fixed; inset: 0; background: #1c1917; color: #fafaf9; z-index: 50; padding: 24px; display: flex; flex-direction: column; }
.cook-step { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 720px; margin: 0 auto; }
.cook-step .n { color: #34d399; font-weight: 700; font-size: 18px; }
.cook-step p { font-size: 28px; line-height: 1.4; }
.cook-nav { display: flex; justify-content: space-between; max-width: 720px; margin: 0 auto; width: 100%; }

.center { text-align: center; }
.notice-ok { color: var(--herb-dark); font-size: 14px; }
.notice-bad { color: var(--red); font-size: 14px; }
.login-wrap { max-width: 360px; margin: 80px auto; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
