/* ==========================================================================
   Cozy Recipe Box — stylesheet
   Warm cream paper, cocoa browns, muted sage, a handwritten header font,
   soft shadows and gentle motion. Fonts are bundled so it works offline.
   ========================================================================== */

@font-face {
  font-family: "Caveat";
  src: url("../fonts/Caveat.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/Nunito.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --cream: #fbf6ec;
  --paper: #fffdf8;
  --linen: #f3e9d7;
  --line: #e7d9c4;
  --ink: #3e2c22;
  --muted: #8b7563;
  --brown: #6b4a35;
  --brown-dark: #4a3226;
  --cocoa: #946a4e;
  --sage: #8fa683;
  --sage-dark: #627a58;
  --sage-light: #e2ebd9;
  --terracotta: #cf8a66;
  --honey: #e8b96a;
  --honey-light: #f8ebcf;
  --rose: #e2a59b;
  --rose-light: #f8e1dc;
  --danger: #b5583f;
  --shadow: 0 2px 6px rgba(74, 50, 38, 0.08), 0 8px 24px rgba(74, 50, 38, 0.07);
  --shadow-lift: 0 4px 10px rgba(74, 50, 38, 0.12), 0 16px 36px rgba(74, 50, 38, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  --body: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

/* A warm "evening kitchen" theme when the computer is in dark mode. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #2a201b; --paper: #33271f; --linen: #3d2f26; --line: #4d3c30;
    --ink: #f3e7d6; --muted: #c2ab95; --brown: #e9c9a6; --brown-dark: #f6dfc3; --cocoa: #d9a77f;
    --sage: #9fb893; --sage-dark: #b9d0ad; --sage-light: #3a4434; --honey-light: #4a3b22;
    --rose-light: #4c3029; --shadow: 0 2px 8px rgba(0,0,0,.3); --shadow-lift: 0 8px 24px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --cream: #2a201b; --paper: #33271f; --linen: #3d2f26; --line: #4d3c30;
  --ink: #f3e7d6; --muted: #c2ab95; --brown: #e9c9a6; --brown-dark: #f6dfc3; --cocoa: #d9a77f;
  --sage: #9fb893; --sage-dark: #b9d0ad; --sage-light: #3a4434; --honey-light: #4a3b22;
  --rose-light: #4c3029; --shadow: 0 2px 8px rgba(0,0,0,.3); --shadow-lift: 0 8px 24px rgba(0,0,0,.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--cream);
  /* faint linen texture */
  background-image:
    radial-gradient(circle at 20% 10%, rgba(232, 185, 106, 0.08), transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(143, 166, 131, 0.08), transparent 45%);
  background-attachment: fixed;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--sage-dark); }
h1, h2, h3, .hand {
  font-family: var(--hand);
  font-weight: 700;
  color: var(--brown);
  line-height: 1.1;
  margin: 0 0 0.4em;
}
h1 { font-size: 2.7rem; }
h2 { font-size: 2.1rem; }
h3 { font-size: 1.7rem; }
h4 { font-family: var(--body); font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--cocoa); margin: 1em 0 .4em; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Header & navigation ----------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px dashed var(--line);
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.logo {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: var(--hand); font-size: 2.1rem; font-weight: 700; color: var(--brown);
  white-space: nowrap;
}
.logo svg { width: 44px; height: 44px; }
.logo .steam path { animation: steam 3.2s ease-in-out infinite; transform-origin: bottom; opacity: .0; }
.logo .steam path:nth-child(2) { animation-delay: 1s; }
.logo .steam path:nth-child(3) { animation-delay: 2s; }
@keyframes steam {
  0% { opacity: 0; transform: translateY(4px) scaleY(.8); }
  40% { opacity: .7; }
  100% { opacity: 0; transform: translateY(-6px) scaleY(1.1); }
}
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex-basis: 100%; justify-content: center; border-top: 1px dashed var(--line); padding-top: 8px; }
.search-box { margin-left: auto; }
.nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px; text-decoration: none;
  color: var(--brown); font-weight: 700; font-size: .95rem;
  transition: background .2s, transform .2s;
}
.nav a svg { width: 19px; height: 19px; }
.nav a:hover { background: var(--linen); transform: translateY(-1px); }
.nav a.active { background: var(--sage); color: #fff; }
.search-box { position: relative; }
.search-box input { padding-left: 38px; width: 220px; border-radius: 999px; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--muted); }

@media (max-width: 900px) {
  .nav { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .nav a span { display: none; }
  .nav a { padding: 8px 12px; }
  .search-box { flex: 1; min-width: 160px; }
  .search-box input { width: 100%; }
  h1 { font-size: 2.2rem; }
}

/* ---- Layout -------------------------------------------------------------- */
main { max-width: 1200px; margin: 0 auto; padding: 24px 20px 80px; }
.view { animation: fadeUp .35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.spread { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 18px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.home { grid-template-columns: 2fr 1fr; align-items: start; }
@media (max-width: 800px) { .grid.two, .grid.home { grid-template-columns: 1fr; } }

.panel {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px; border: 1px solid var(--line);
}
.panel.soft { background: var(--linen); box-shadow: none; }
.panel h2 { font-size: 1.9rem; }
.panel-title { display: flex; align-items: center; gap: 8px; }
.panel-title svg { width: 26px; height: 26px; color: var(--sage-dark); }

/* ---- Buttons & inputs --------------------------------------------------- */
button, .btn {
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  padding: 9px 18px; border-radius: 999px; border: 2px solid transparent;
  background: var(--sage); color: #fff; text-decoration: none;
  transition: transform .15s, box-shadow .2s, background .2s;
  box-shadow: 0 2px 0 var(--sage-dark);
}
button:hover, .btn:hover { transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(1px); box-shadow: none; }
button svg, .btn svg { width: 18px; height: 18px; }
button.secondary, .btn.secondary { background: var(--paper); color: var(--brown); border-color: var(--line); box-shadow: 0 2px 0 var(--line); }
button.warm, .btn.warm { background: var(--terracotta); box-shadow: 0 2px 0 #a86749; }
button.ghost, .btn.ghost { background: transparent; color: var(--brown); box-shadow: none; padding: 7px 10px; }
button.ghost:hover { background: var(--linen); }
button.danger { background: var(--paper); color: var(--danger); border-color: var(--rose); box-shadow: none; }
button.small, .btn.small { padding: 5px 12px; font-size: .85rem; }
button.icon { padding: 7px; border-radius: 50%; }
button:disabled { opacity: .55; cursor: default; transform: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--honey); outline-offset: 2px;
}

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 12px; width: 100%; transition: border-color .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--sage); outline: none; }
textarea { min-height: 110px; resize: vertical; }
label { display: block; font-weight: 700; color: var(--brown); font-size: .92rem; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 3px; }
input[type="checkbox"] { width: auto; accent-color: var(--sage); transform: scale(1.25); margin-right: 6px; }
.check { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; cursor: pointer; }

/* ---- Chips, badges -------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: 999px; font-size: .82rem; font-weight: 700;
  background: var(--sage-light); color: var(--sage-dark); text-decoration: none; border: 0;
  box-shadow: none; cursor: pointer;
}
.chip.cat { background: var(--honey-light); color: var(--cocoa); }
.chip.on { background: var(--sage); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.badge.ok { background: var(--sage-light); color: var(--sage-dark); }
.badge.low { background: var(--honey-light); color: #9a6a12; }
.badge.out { background: var(--rose-light); color: var(--danger); }
.badge.expiring { background: #fbe3c8; color: #a4561f; }
.badge.expired { background: var(--rose-light); color: var(--danger); }

/* ---- Recipe cards -------------------------------------------------------- */
.recipe-card {
  background: var(--paper); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  text-decoration: none; color: inherit; display: flex; flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
  animation: fadeUp .4s ease both;
}
.recipe-card:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: var(--shadow-lift); }
.recipe-card .photo { aspect-ratio: 4 / 3; background: var(--linen); position: relative; overflow: hidden; }
.recipe-card .photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.recipe-card:hover .photo img { transform: scale(1.04); }
.recipe-card .body { padding: 12px 15px 15px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.recipe-card .title { font-family: var(--hand); font-size: 1.65rem; font-weight: 700; color: var(--brown); line-height: 1.05; }
.recipe-card .meta { font-size: .82rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.recipe-card .heart { position: absolute; top: 10px; right: 10px; }
.placeholder-art { width: 100%; height: 100%; display: grid; place-items: center; color: var(--cocoa); }
.placeholder-art svg { width: 38%; height: 38%; opacity: .55; }
.ribbon {
  position: absolute; left: 10px; top: 10px; background: var(--honey); color: var(--brown-dark);
  font-size: .72rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; text-transform: uppercase;
}

.heart-btn {
  background: var(--paper); color: var(--rose); border: 0; box-shadow: var(--shadow);
  border-radius: 50%; width: 38px; height: 38px; padding: 0;
}
.heart-btn svg { width: 22px; height: 22px; }
.heart-btn.on { color: #d0574a; }
.heart-btn.on svg { fill: currentColor; animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.35); } }

.hearts { display: inline-flex; gap: 2px; }
.hearts button { background: none; box-shadow: none; padding: 2px; color: var(--rose); }
.hearts button.on { color: #d0574a; }
.hearts button.on svg { fill: currentColor; }
.hearts svg { width: 22px; height: 22px; }

/* ---- Recipe detail: the printable recipe card ----------------------------- */
.recipe-sheet {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line); overflow: hidden;
}
.recipe-hero { display: grid; grid-template-columns: 1.1fr 1fr; }
.recipe-hero .photo { min-height: 300px; background: var(--linen); position: relative; }
.recipe-hero .photo img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.recipe-hero .info { padding: 26px 28px; display: flex; flex-direction: column; gap: 10px; }
.recipe-hero h1 { font-size: 3rem; }
@media (max-width: 800px) { .recipe-hero { grid-template-columns: 1fr; } .recipe-hero .photo { min-height: 220px; } }
.facts { display: flex; gap: 10px; flex-wrap: wrap; }
.fact { background: var(--linen); border-radius: var(--radius-sm); padding: 6px 12px; font-size: .88rem; }
.fact b { display: block; font-family: var(--hand); font-size: 1.35rem; color: var(--brown); line-height: 1; }
.recipe-body { display: grid; grid-template-columns: 1fr 1.5fr; gap: 0; border-top: 1px dashed var(--line); }
.recipe-body > section { padding: 22px 28px; }
.recipe-body > section + section { border-left: 1px dashed var(--line); }
@media (max-width: 800px) { .recipe-body { grid-template-columns: 1fr; } .recipe-body > section + section { border-left: 0; border-top: 1px dashed var(--line); } }
.ing-list { list-style: none; padding: 0; margin: 0; }
.ing-list li { padding: 7px 0; border-bottom: 1px dotted var(--line); display: flex; gap: 10px; align-items: baseline; cursor: pointer; }
.ing-list li.heading { font-weight: 800; color: var(--cocoa); border: 0; padding-top: 14px; cursor: default; }
.ing-list li .amt { font-weight: 800; color: var(--brown); min-width: 92px; }
.ing-list li.checked { text-decoration: line-through; opacity: .5; }
.ing-list li .have { margin-left: auto; font-size: .75rem; }
.instructions ol { padding-left: 0; counter-reset: step; list-style: none; }
.instructions ol li { counter-increment: step; position: relative; padding: 4px 0 12px 46px; }
.instructions ol li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%; background: var(--sage-light); color: var(--sage-dark);
  display: grid; place-items: center; font-family: var(--hand); font-size: 1.3rem; font-weight: 700;
}
.instructions h4:first-child { margin-top: 0; }
.notes-card {
  background: var(--honey-light); border-radius: var(--radius-sm); padding: 14px 18px;
  font-family: var(--hand); font-size: 1.4rem; color: var(--brown-dark); line-height: 1.25;
  transform: rotate(-.6deg); white-space: pre-wrap;
}
.servings-stepper { display: inline-flex; align-items: center; gap: 6px; background: var(--linen); border-radius: 999px; padding: 3px; }
.servings-stepper button { width: 30px; height: 30px; padding: 0; border-radius: 50%; font-size: 1.15rem; line-height: 1; }
.servings-stepper b { min-width: 34px; text-align: center; }

/* ---- Editor ---------------------------------------------------------------- */
.editor-toolbar { display: flex; gap: 2px; flex-wrap: wrap; padding: 6px; background: var(--linen); border-radius: var(--radius-sm) var(--radius-sm) 0 0; border: 2px solid var(--line); border-bottom: 0; }
.editor-toolbar button { background: transparent; color: var(--brown); box-shadow: none; padding: 5px 9px; border-radius: 8px; font-size: .9rem; }
.editor-toolbar button:hover { background: var(--paper); }
.editor-toolbar .sep { width: 1px; background: var(--line); margin: 4px 4px; }
.rich-editor {
  min-height: 220px; padding: 14px 16px; background: var(--paper); border: 2px solid var(--line);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); outline: none; overflow-wrap: anywhere;
}
.rich-editor:focus { border-color: var(--sage); }
.rich-editor:empty::before { content: attr(data-placeholder); color: var(--muted); }
.ing-editor .ing-row { display: grid; grid-template-columns: 26px 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 6px; animation: fadeUp .2s ease; }
.ing-editor .ing-row .grip { color: var(--muted); cursor: grab; text-align: center; }
.ing-editor .preview { font-size: .78rem; color: var(--muted); grid-column: 2 / 3; margin-top: -4px; }
.photo-drop {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 18px; text-align: center;
  color: var(--muted); cursor: pointer; transition: background .2s, border-color .2s; position: relative; overflow: hidden;
}
.photo-drop:hover, .photo-drop.drag { background: var(--linen); border-color: var(--sage); }
.photo-drop img { max-height: 220px; margin: 0 auto 8px; border-radius: var(--radius-sm); }

/* ---- Pantry ------------------------------------------------------------------ */
.pantry-groups { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.shelf h3 { display: flex; gap: 8px; align-items: center; }
.pantry-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 9px 0; border-bottom: 1px dotted var(--line); align-items: center; }
.pantry-item .name { font-weight: 700; }
.pantry-item .controls { display: flex; gap: 4px; align-items: center; }
.pantry-item .controls button { width: 30px; height: 30px; padding: 0; border-radius: 50%; }
.pantry-item.out .name { color: var(--muted); text-decoration: line-through; }
.pantry-item .sub { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.meter { height: 6px; background: var(--linen); border-radius: 99px; overflow: hidden; width: 90px; }
.meter i { display: block; height: 100%; background: var(--sage); border-radius: 99px; transition: width .4s ease; }
.meter.low i { background: var(--honey); }
.meter.out i { background: var(--rose); }

/* ---- Grocery lists ----------------------------------------------------------- */
.list-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.list-tabs a { text-decoration: none; }
.grocery-item { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px dotted var(--line); transition: opacity .3s; }
.grocery-item .tick {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--sage); background: var(--paper);
  padding: 0; box-shadow: none; color: #fff; flex-shrink: 0;
}
.grocery-item .tick svg { width: 16px; height: 16px; opacity: 0; transform: scale(.4); transition: all .25s; }
.grocery-item.done .tick { background: var(--sage); }
.grocery-item.done .tick svg { opacity: 1; transform: scale(1); }
.grocery-item.done .label { text-decoration: line-through; color: var(--muted); }
.grocery-item .label { flex: 1; }
.grocery-item .amt { font-weight: 800; color: var(--brown); margin-right: 4px; }
.grocery-item .from { font-size: .75rem; color: var(--muted); }
.aisle-title { font-family: var(--hand); font-size: 1.5rem; color: var(--cocoa); margin: 14px 0 2px; }

/* ---- Meal planner -------------------------------------------------------------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); gap: 10px; overflow-x: auto; }
.day { background: var(--paper); border-radius: var(--radius-sm); border: 1px solid var(--line); padding: 10px; min-height: 220px; }
.day.today { border: 2px solid var(--sage); }
.day h3 { font-size: 1.5rem; margin: 0; }
.day .date { font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.meal { background: var(--linen); border-radius: 10px; padding: 6px 8px; margin-bottom: 6px; font-size: .86rem; display: flex; justify-content: space-between; gap: 6px; }
.meal .slot { font-size: .68rem; text-transform: uppercase; font-weight: 800; color: var(--cocoa); display: block; }
.meal a { color: var(--ink); font-weight: 700; text-decoration: none; }
.meal button { padding: 0 4px; background: none; color: var(--muted); box-shadow: none; }
@media (max-width: 900px) { .week { grid-template-columns: 1fr; } .day { min-height: 0; } }

/* ---- Cozy tip widget ----------------------------------------------------------- */
.tip-card {
  position: relative; background: var(--honey-light); border-radius: var(--radius); padding: 20px 22px 20px 82px;
  box-shadow: var(--shadow); overflow: hidden;
}
.tip-card::after {
  content: ""; position: absolute; right: -30px; bottom: -30px; width: 120px; height: 120px; border-radius: 50%;
  background: rgba(232, 185, 106, .25);
}
.tip-card .tip-icon { position: absolute; left: 20px; top: 20px; width: 46px; height: 46px; color: var(--cocoa); animation: sway 4s ease-in-out infinite; }
@keyframes sway { 50% { transform: rotate(-8deg); } }
.tip-card .label { font-family: var(--hand); font-size: 1.6rem; color: var(--cocoa); font-weight: 700; }
.tip-card p { font-size: 1.05rem; margin: 2px 0 0; position: relative; z-index: 1; }

.welcome { display: flex; align-items: center; gap: 14px; }
.welcome h1 { margin: 0; }
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 14px; }
.stat b { font-family: var(--hand); font-size: 1.8rem; color: var(--sage-dark); margin-right: 6px; }
.suggestion { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dotted var(--line); text-decoration: none; color: inherit; }
.suggestion .thumb { width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: var(--linen); flex-shrink: 0; display: grid; place-items: center; }
.suggestion .thumb img { width: 100%; height: 100%; object-fit: cover; }
.suggestion .thumb svg { width: 30px; color: var(--cocoa); opacity: .6; }
.suggestion b { font-family: var(--hand); font-size: 1.45rem; color: var(--brown); display: block; line-height: 1.05; }
.coverage { height: 8px; border-radius: 99px; background: var(--linen); overflow: hidden; margin-top: 6px; }
.coverage i { display: block; height: 100%; background: linear-gradient(90deg, var(--sage), var(--sage-dark)); }

/* ---- Empty states, toasts, modal ------------------------------------------------ */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 90px; height: 90px; color: var(--cocoa); opacity: .5; margin: 0 auto 10px; animation: sway 5s ease-in-out infinite; }
.empty .hand { font-size: 2rem; color: var(--cocoa); }

#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--brown-dark); color: var(--cream); padding: 11px 20px; border-radius: 999px;
  box-shadow: var(--shadow-lift); font-weight: 700; animation: toastIn .35s ease both; pointer-events: auto;
  display: flex; gap: 12px; align-items: center; max-width: 90vw;
}
.toast.error { background: var(--danger); }
.toast button { background: transparent; border: 1px solid currentColor; color: inherit; box-shadow: none; padding: 3px 10px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.95); } }

.modal-backdrop { position: fixed; inset: 0; background: rgba(62, 44, 34, .4); z-index: 50; display: grid; place-items: center; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-lift); padding: 24px;
  width: min(560px, 100%); max-height: 90vh; overflow: auto; animation: fadeUp .25s ease;
}
.modal h2 { margin-bottom: 12px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

.lock-screen { min-height: 70vh; display: grid; place-items: center; }
.lock-screen .panel { width: min(380px, 100%); text-align: center; }

.offline-banner { background: var(--honey-light); color: var(--brown-dark); text-align: center; padding: 6px; font-weight: 700; font-size: .9rem; }

.spinner { width: 34px; height: 34px; border: 4px solid var(--linen); border-top-color: var(--sage); border-radius: 50%; animation: spin 1s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.warn { background: var(--honey-light); border-radius: var(--radius-sm); padding: 10px 14px; color: var(--brown-dark); }
.error-box { background: var(--rose-light); border-radius: var(--radius-sm); padding: 14px 16px; color: var(--brown-dark); }

.tabs { display: flex; gap: 6px; border-bottom: 2px dashed var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { background: none; box-shadow: none; color: var(--muted); border-radius: 12px 12px 0 0; }
.tabs button.on { color: var(--brown); background: var(--linen); }

.note-card { background: var(--paper); border-radius: var(--radius-sm); padding: 14px 16px; border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; }
.note-card.pinned { background: var(--honey-light); }
.note-card h3 { font-size: 1.6rem; margin-bottom: 4px; }
.note-card .body { white-space: pre-wrap; max-height: 180px; overflow: hidden; font-size: .95rem; }

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

/* ---- Print: recipe cards & grocery lists ---------------------------------------- */
.print-only { display: none; }
@media print {
  :root { --paper: #fff; --cream: #fff; --ink: #222; }
  body { background: #fff; font-size: 12pt; }
  .site-header, .no-print, #toasts, .offline-banner { display: none !important; }
  .print-only { display: block; }
  main { padding: 0; max-width: none; }
  .recipe-sheet, .panel { box-shadow: none; border: 1px solid #ccc; }
  .recipe-card:hover { transform: none; }
  a { color: inherit; text-decoration: none; }
}
/* 4x6 index card print layout */
.index-card {
  width: 6in; min-height: 4in; margin: 0 auto 20px; background: #fffdf6; border: 1px solid #d8c7ad;
  padding: .3in .35in; position: relative; color: #3e2c22;
  background-image: repeating-linear-gradient(#fffdf6 0 23px, #cfe0ea 23px 24px);
  background-position: 0 .7in; break-inside: avoid; page-break-inside: avoid;
}
.index-card::before { content: ""; position: absolute; left: 0; right: 0; top: .62in; border-top: 2px solid #e5a5a0; }
.index-card h2 { font-size: 26pt; margin: 0 0 .25in; color: #6b4a35; }
.index-card .cols { display: grid; grid-template-columns: 1fr 1.5fr; gap: .2in; font-size: 9.5pt; line-height: 24px; }
.index-card ul, .index-card ol { margin: 0; padding-left: 1.1em; }
.index-card .from { position: absolute; right: .35in; top: .2in; font-family: var(--hand); font-size: 13pt; color: #946a4e; }
.print-list { max-width: 640px; margin: 0 auto; }
.print-list .grocery-item .tick { border-color: #555; }

/* small inline icons inside text */
svg.inline { width: 1em; height: 1em; vertical-align: -0.15em; display: inline-block; }

/* ---- Accounts: sign-in screens, settings tabs, admin ---------------------- */
body[data-auth="out"] .search-box, body[data-auth="out"] .nav { display: none; }
.auth-panel { text-align: left !important; width: min(420px, 100%) !important; }
.auth-panel > svg { width: 48px; height: 48px; color: var(--cocoa); margin: 0 auto 8px; display: block; }
.auth-panel h2 { text-align: center; }
.auth-panel > p.muted { text-align: center; }
.auth-panel form button { width: 100%; margin-top: 4px; }
.auth-error { color: var(--danger); min-height: 1.2em; margin: 10px 0 0; }
.auth-foot { text-align: center; margin-top: 6px; }
.auth-foot p { margin: 6px 0 0; }

.people { width: 100%; border-collapse: collapse; }
.people th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 8px; }
.people td { padding: 10px 8px; border-top: 1px dashed var(--line); vertical-align: middle; }
.people td .row { gap: 6px; }
.people .who b { display: block; }
.badge.admin { background: var(--honey-light); color: #9a6a12; }
.badge.pending { background: #fbe3c8; color: #a4561f; }
.badge.disabled { background: var(--rose-light); color: var(--danger); }
.badge.member { background: var(--sage-light); color: var(--sage-dark); }
.link-box { display: flex; gap: 8px; align-items: center; background: var(--linen); border-radius: var(--radius-sm); padding: 8px 10px; }
.link-box code { flex: 1; word-break: break-all; font-size: .85rem; }
.shared-banner { background: var(--sage-light); color: var(--sage-dark); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-weight: 700; }
.recipe-card .by { font-size: .82rem; color: var(--muted); }
@media (max-width: 700px) {
  .people thead { display: none; }
  .people tr { display: block; border-top: 1px dashed var(--line); padding: 8px 0; }
  .people td { display: block; border: 0; padding: 4px 0; }
  .people td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
}
