/* ===== Recipe Keeper — fun neo-brutalist theme ===== */
:root {
  --paper:   #FBF7EC;
  --bg-2:    #F2EAD7;
  --card:    #FFFFFF;
  --ink:     #161616;
  --muted:   #6B6357;
  --accent:  #FF5A1F;
  --green:   #2BA84A;
  --lilac:   #C7B3F5;
  --yellow:  #FFE08A;
  --sky:     #8FD3FF;
  --pink:    #FF9DBB;
  --gold:    #E8A33D;
  --danger:  #FF6B5E;
  --line:    rgba(22, 22, 22, .12);
  --shadow:    4px 4px 0 var(--ink);
  --shadow-lg: 7px 7px 0 var(--ink);
  --r:       12px;
  --r-sm:    9px;
  --display: 'Space Grotesk', system-ui, sans-serif;
  --mono:    'Space Mono', ui-monospace, monospace;
  --sans:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-h3:   28px;   /* recipe / modal / deck titles (collapses old 32/30/26) */
  --fs-h4:   18px;   /* card subheads */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  background-color: var(--paper);
  /* bg.png shows through a translucent cream wash so it stays readable */
  background-image: linear-gradient(rgba(251,247,236,.88), rgba(251,247,236,.88)), url('/bg.png');
  background-repeat: repeat, repeat;
  background-size: auto, 300px;
  background-attachment: fixed, fixed;
}
em { font-style: normal; color: var(--accent); }

.eyebrow { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--accent); margin: 0 0 14px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--paper); border-bottom: 2.5px solid var(--ink); }
.header-inner { max-width: 1080px; margin: 0 auto; padding: 13px 24px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand-logo { display: none; height: 34px; width: auto; }
.brand-mark { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--paper); background: var(--accent); width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); border: 2.5px solid var(--ink); }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.4px; }

.tabs { margin-left: auto; display: flex; gap: 8px; }
.tab { font-family: var(--sans); font-weight: 600; font-size: 14px; cursor: pointer; color: var(--ink); background: var(--card); border: 2px solid var(--ink); border-radius: 999px; padding: 7px 16px; display: flex; align-items: center; gap: 6px; transition: transform .12s, box-shadow .12s; }
.tab:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); }
.tab.active { background: var(--accent); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.tab .count { font-family: var(--mono); font-size: 11px; background: var(--ink); color: var(--paper); padding: 1px 7px; border-radius: 999px; }

/* ---------- layout ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 40px 24px 90px; }
.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 34px; align-items: center; margin: 6px 0 46px; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(38px, 6vw, 66px); line-height: 1.0; letter-spacing: -1.5px; margin: 0 0 18px; }
.hero-sub { font-size: 18px; color: var(--muted); max-width: 46ch; margin: 0; }
.hero-art { justify-self: center; width: 100%; max-width: 300px; }
.hero-art svg { display: block; width: 100%; height: auto; }
.hero-photo { display: none; width: 100%; height: auto; border: 2.5px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow-lg); background: var(--card); }
.hero-art.has-photo svg { display: none; }
.hero-art.has-photo .hero-photo { display: block; }

.section-head { margin: 6px 0 28px; }
.section-head h2, .lib-head h2.title { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 4.5vw, 46px); letter-spacing: -1px; margin: 0; }
.section-sub { font-size: 16px; color: var(--muted); margin: 10px 0 0; }

.banner { max-width: 720px; margin: 0 0 20px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--yellow); color: var(--ink); border: 2.5px solid var(--ink); box-shadow: var(--shadow); font-family: var(--sans); font-size: 14px; display: none; }
.banner.show { display: block; }

/* ---------- card / form ---------- */
.card { background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 26px; }
.form-card { max-width: 640px; }
label { display: block; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink); margin: 0 0 8px; }
input[type=text], input[type=url], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 12px 14px; font-size: 15px; font-family: var(--sans); color: var(--ink);
  border: 2.5px solid var(--ink); border-radius: var(--r-sm); background: #fff; outline: none; transition: box-shadow .12s;
}
input::placeholder { color: #B7AD9D; }
input:focus, select:focus, textarea:focus { box-shadow: var(--shadow); }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.field-row > div { flex: 1 1 180px; }
.check { display: flex; align-items: baseline; gap: 9px; margin-top: 16px; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); position: relative; top: 2px; }
.check-note { color: var(--muted); }

/* ---------- buttons ---------- */
.btn { font-family: var(--sans); font-weight: 700; font-size: 14px; cursor: pointer; border-radius: var(--r-sm); border: 2.5px solid var(--ink); background: var(--card); color: var(--ink); padding: 11px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px,2px); box-shadow: 0 0 0 var(--ink); }
.btn-primary { background: var(--accent); }
.btn-primary:disabled { opacity: .55; cursor: progress; }
.btn-block { width: 100%; padding: 14px; font-size: 15px; margin-top: 22px; }
.btn-ghost { border-color: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); transform: none; box-shadow: none; }
.btn-danger { background: var(--danger); }
.btn-lg { padding: 14px 20px; }
.hint { font-family: var(--mono); font-size: 11px; color: var(--muted); margin: 12px 0 0; }

/* ---------- status / spinner ---------- */
.status { margin: 24px 0 0; max-width: 640px; color: var(--muted); display: none; font-family: var(--sans); font-size: 13px; }
.status.show { display: block; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--bg-2); border-top-color: var(--accent); border-radius: 50%; margin: 0 0 12px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { max-width: 640px; margin: 20px 0 0; padding: 13px 16px; border-radius: var(--r-sm); background: #FFD9D4; border: 2.5px solid var(--ink); box-shadow: var(--shadow); color: var(--ink); font-family: var(--sans); font-size: 13px; display: none; }
.error.show { display: block; }

/* ---------- recipe (shared) ---------- */
.recipe-result { max-width: 680px; margin: 30px 0 0; display: none; }
.recipe-result.show { display: block; }
.recipe h2 { font-family: var(--display); font-weight: 700; font-size: var(--fs-h3); letter-spacing: -.5px; margin: 0 0 6px; color: var(--accent); }
.recipe .desc { color: var(--muted); margin: 0 0 14px; }
.src { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 16px; }
.src a { color: var(--ink); font-weight: 600; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; border: 2px solid var(--ink); border-radius: 999px; padding: 4px 11px; color: var(--ink); background: var(--lilac); }
.chip span { opacity: .65; }
.chips .chip:nth-child(4n+2) { background: var(--yellow); }
.chips .chip:nth-child(4n+3) { background: var(--sky); }
.chips .chip:nth-child(4n+4) { background: var(--pink); }
.chip.cuisine { background: var(--accent); }
.meta-chips { margin-bottom: 4px; }
.sec { margin-top: 24px; }
.sec h3 { font-family: var(--display); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); margin: 0 0 13px; font-weight: 700; display: inline-block; background: var(--accent); padding: 3px 11px; border: 2px solid var(--ink); border-radius: 6px; box-shadow: 2px 2px 0 var(--ink); }
ul.ingredients { list-style: none; padding: 0; margin: 0; }
ul.ingredients li { display: flex; gap: 11px; padding: 9px 0; border-bottom: 2px dashed var(--ink); align-items: baseline; }
ul.ingredients li:last-child { border-bottom: 0; }
ul.ingredients input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
ul.ingredients .qty { font-family: var(--mono); font-size: 13px; white-space: nowrap; color: var(--accent); }
ul.ingredients .note { color: var(--muted); font-style: italic; }
ul.ingredients .conv { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
ol.steps { padding: 0; margin: 0; list-style: none; counter-reset: step; }
ol.steps li { position: relative; padding: 5px 0 16px 48px; counter-increment: step; }
ol.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 8px; background: var(--green); color: var(--ink); border: 2.5px solid var(--ink); font-family: var(--display); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.notes-box { background: var(--yellow); border: 2.5px solid var(--ink); padding: 12px 15px; border-radius: var(--r-sm); color: var(--ink); box-shadow: var(--shadow); }
.card-actions { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.card-actions .btn { flex: 1; min-width: 130px; }

/* ---------- cuisine bar ---------- */
.cuisine-bar { display: flex; gap: 9px; flex-wrap: wrap; margin: 0 0 28px; }
.cuisine-pill { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; cursor: pointer; color: var(--ink); background: var(--card); border: 2.5px solid var(--ink); border-radius: 999px; padding: 8px 16px; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.cuisine-pill:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.cuisine-pill.active { background: var(--accent); }
.cuisine-pill .n { opacity: .55; margin-left: 4px; }

/* ---------- library ---------- */
.lib-head { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 24px; }
.lib-head .substat { font-family: var(--mono); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin: 10px 0 0; }
.lib-tools { margin-left: auto; display: flex; gap: 11px; flex-wrap: wrap; align-items: center; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap .search-ic { position: absolute; left: 13px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search-wrap input { padding-left: 38px; min-width: 230px; }
.tag-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.tag-pill { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; border: 2px solid var(--ink); background: #fff; color: var(--ink); border-radius: 999px; padding: 5px 12px; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.tag-pill:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); }
.tag-pill.active { background: var(--accent); box-shadow: 3px 3px 0 var(--ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 18px; }
.rcard { background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; cursor: pointer; transition: transform .14s, box-shadow .14s; position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 150px; }
.rcard:hover { transform: translate(-3px,-3px); box-shadow: var(--shadow-lg); }
.rcard .rtitle { font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 1.12; margin: 0 82px 10px 0; letter-spacing: -.4px; color: var(--accent); }
.rbadges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: auto; padding-top: 12px; }
.health-badge { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .03em; border: 2px solid var(--ink); border-radius: 999px; padding: 2px 8px; background: var(--bg-2); }
.stamp { position: absolute; top: 12px; right: 12px; transform: rotate(-6deg); font-family: var(--display); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--green); border: 2.5px solid var(--green); border-radius: 6px; padding: 2px 8px; opacity: .92; pointer-events: none; }
.rcard .rmeta { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 13px; }
.rcard .rtags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.rcard .rtags .chip { font-size: 10px; padding: 2px 8px; border-width: 1.5px; }
.badge { position: absolute; top: 0; right: 0; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; padding: 4px 10px; border-left: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); border-radius: 0 var(--r) 0 9px; }
.badge.never { background: var(--yellow); }
.badge.cooked { background: var(--green); }
.stars-mini { color: var(--gold); font-size: 13px; letter-spacing: 1px; margin-bottom: 11px; }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); grid-column: 1/-1; }
.empty img { width: 110px; height: 110px; object-fit: contain; margin-bottom: 12px; }
.empty h3 { font-family: var(--display); color: var(--ink); font-size: 24px; font-weight: 700; margin: 0 0 6px; }
.empty p { max-width: 40ch; margin: 0 auto; }

/* ---------- discover deck ---------- */
.deck-wrap { max-width: 560px; }
.deck-counter { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 13px; }
.deck-card { background: var(--card); border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 26px; min-height: 300px; animation: dealIn .26s cubic-bezier(.2,.8,.3,1.1); }
@keyframes dealIn { from { opacity: 0; transform: translateY(12px) rotate(-1deg); } to { opacity: 1; transform: none; } }
.deck-card h2 { font-family: var(--display); font-weight: 700; font-size: var(--fs-h3); line-height: 1.05; letter-spacing: -.5px; margin: 0 0 9px; color: var(--accent); }
.deck-card .deck-meta { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 16px; }
.deck-card .deck-ing { margin: 16px 0 0; }
.deck-card .deck-ing .lbl { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.deck-card .deck-ing ul { margin: 9px 0 0; padding-left: 18px; }
.deck-card .deck-ing li { padding: 3px 0; }
.deck-card .deck-more { color: var(--muted); font-style: italic; font-size: 14px; }
.deck-nav { display: flex; gap: 10px; margin-top: 18px; }
.deck-nav .btn { flex: 1; }
.deck-cook { margin-top: 18px; }
.deck-cook .btn { margin-top: 0; }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(22,18,12,.5); display: none; align-items: flex-start; justify-content: center; padding: 44px 16px; overflow-y: auto; }
.overlay.show { display: flex; animation: fade .2s ease; }
.modal { background: var(--card); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 10px 10px 0 var(--ink); max-width: 660px; width: 100%; padding: 30px; position: relative; animation: pop .22s cubic-bezier(.2,.8,.3,1.15); }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-close { position: absolute; top: 16px; right: 16px; border: 2.5px solid var(--ink); background: var(--card); width: 36px; height: 36px; border-radius: 9px; font-size: 18px; cursor: pointer; color: var(--ink); box-shadow: 2px 2px 0 var(--ink); transition: transform .1s, box-shadow .1s; }
.modal-close:hover { background: var(--accent); transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); }
.modal-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 70px 20px; color: var(--muted); font-family: var(--sans); font-size: 13px; }
.modal-loading .spinner { margin: 0; }
.usage-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 18px 0 4px; padding: 12px 14px; background: var(--bg-2); border: 2.5px solid var(--ink); border-radius: var(--r-sm); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); }
.stars { display: inline-flex; gap: 3px; }
.stars .star { cursor: pointer; font-size: 20px; color: #CDBFA6; transition: transform .1s; }
.stars .star:hover { transform: scale(1.2); }
.stars .star.on { color: var(--gold); }
textarea.notes-input { margin-top: 11px; min-height: 64px; resize: vertical; font-size: 14px; }

/* ---------- cook mode ---------- */
.cook { position: fixed; inset: 0; z-index: 80; background: var(--paper); display: none; flex-direction: column; }
.cook.show { display: flex; animation: fade .2s ease; }
.cook-top { display: flex; align-items: center; gap: 14px; padding: 16px 24px; border-bottom: 3px solid var(--ink); background: var(--card); }
.cook-top .ctitle { font-family: var(--display); font-weight: 700; font-size: 22px; flex: 1; letter-spacing: -.4px; color: var(--accent); }
.cook-body { flex: 1; overflow-y: auto; padding: 30px 24px 50px; }
.cook-inner { max-width: 720px; margin: 0 auto; }
.cook-inner h3 { font-family: var(--display); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); margin: 28px 0 15px; font-weight: 700; display: inline-block; background: var(--accent); padding: 3px 11px; border: 2px solid var(--ink); border-radius: 6px; box-shadow: 2px 2px 0 var(--ink); }
.cook-ing { list-style: none; padding: 0; margin: 0; }
.cook-ing li { display: flex; align-items: center; gap: 15px; padding: 14px 16px; border: 2.5px solid var(--ink); border-radius: var(--r-sm); margin-bottom: 11px; background: var(--card); font-size: 17px; cursor: pointer; box-shadow: var(--shadow); transition: transform .1s, box-shadow .1s; }
.cook-ing li:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.cook-ing li.done { background: var(--bg-2); box-shadow: none; transform: none; opacity: .6; text-decoration: line-through; }
.cook-ing input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.cook-step { display: flex; gap: 18px; padding: 18px 0; border-bottom: 2px dashed var(--ink); font-size: 19px; line-height: 1.5; }
.cook-step .num { flex: none; width: 42px; height: 42px; border-radius: 9px; background: var(--accent); color: var(--ink); border: 2.5px solid var(--ink); font-family: var(--display); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.cook-step.done .num { background: var(--green); }
.cook-step.done .txt { opacity: .5; text-decoration: line-through; }
.cook-step .txt { cursor: pointer; padding-top: 8px; }

/* ---------- toast ---------- */
.toasts { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast { background: var(--ink); color: var(--paper); padding: 14px 26px; border: 2.5px solid var(--ink); border-radius: 999px; font-family: var(--mono); font-size: 14px; text-transform: uppercase; letter-spacing: .04em; box-shadow: var(--shadow-lg); animation: toastIn .25s ease; max-width: 92vw; text-align: center; }
.toast.good { background: var(--green); color: var(--ink); }
.toast.bad { background: var(--danger); color: var(--ink); }
.chef-tip { display: inline-block; font-family: var(--mono); font-size: 12px; color: var(--ink); background: var(--yellow); border: 2px solid var(--ink); border-radius: 999px; padding: 7px 15px; margin: 18px 0 0; box-shadow: 2px 2px 0 var(--ink); transition: opacity .25s; }
.chef-tip:empty { display: none; }
.reused-note { background: var(--gold); border: 2.5px solid var(--ink); border-radius: var(--r-sm); padding: 11px 14px; font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 18px; box-shadow: 3px 3px 0 var(--ink); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- scaler / shopping / edit ---------- */
.scaler { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.scaler-lbl { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.scale-btn { font-family: var(--mono); font-size: 12px; cursor: pointer; border: 2px solid var(--ink); background: #fff; color: var(--ink); border-radius: 999px; padding: 4px 12px; transition: transform .1s, box-shadow .1s; }
.scale-btn:hover { transform: translate(-1px,-1px); box-shadow: 2px 2px 0 var(--ink); }
.scale-btn.active { background: var(--accent); }
.modal-h { font-family: var(--display); font-weight: 700; font-size: var(--fs-h3); letter-spacing: -.5px; margin: 0 0 6px; color: var(--accent); }
.modal-sub { color: var(--muted); margin: 0 0 16px; font-size: 15px; }
.shop-pick { display: grid; gap: 2px; max-height: 240px; overflow-y: auto; border: 2px solid var(--ink); border-radius: var(--r-sm); padding: 8px; }
.shop-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; cursor: pointer; border-radius: 6px; font-size: 15px; }
.shop-item:hover { background: var(--bg-2); }
.shop-item input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.shop-listh { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 22px 0 12px; }
.shop-list { list-style: none; padding: 0; margin: 0; }
.shop-list li { display: flex; gap: 11px; align-items: baseline; padding: 9px 0; border-bottom: 2px dashed var(--ink); }
.shop-list input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.shop-qty { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.diet-filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 24px; }
.diet-btn { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; border: 2px solid var(--ink); background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 13px; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.diet-btn:hover:not(:disabled) { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); }
.diet-btn.active { background: var(--green); box-shadow: 3px 3px 0 var(--ink); }
.diet-btn:disabled { opacity: .35; cursor: not-allowed; border-style: dashed; }
.diet-btn .dn { opacity: .55; margin-left: 3px; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-row + .filter-row { margin-top: 8px; }
.diet-btn.health.active { background: var(--gold); }
[hidden] { display: none !important; }
.view-toggle { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.vt { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; border: 0; background: var(--card); color: var(--ink); padding: 9px 14px; cursor: pointer; }
.vt.active { background: var(--accent); }
.vt + .vt { border-left: 2px solid var(--ink); }
.sort-select { width: auto; flex: 0 0 auto; padding: 10px 30px 10px 13px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; box-shadow: var(--shadow); cursor: pointer; }
.more-wrap { position: relative; }
.more-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--r-sm); box-shadow: var(--shadow); padding: 6px; z-index: 30; display: flex; flex-direction: column; gap: 2px; min-width: 172px; }
.more-menu button { font-family: var(--sans); font-size: 14px; text-align: left; border: 0; background: none; color: var(--ink); padding: 9px 12px; border-radius: 6px; cursor: pointer; }
.more-menu button:hover { background: var(--bg-2); }
.cook-progress { margin-top: 12px; max-width: 440px; }
.cp-bar { height: 10px; background: var(--bg-2); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.cp-fill { height: 100%; background: var(--accent); transition: width .6s cubic-bezier(.2,.8,.3,1); }
.cp-label { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cp-badge { display: inline-block; font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--ink); background: var(--gold); border: 2.5px solid var(--ink); border-radius: 999px; padding: 8px 16px; box-shadow: var(--shadow); animation: pop .35s cubic-bezier(.2,.8,.3,1.3); }
.confetti { position: fixed; top: -14px; width: 9px; height: 14px; z-index: 200; pointer-events: none; border-radius: 2px; animation: confetti-fall linear forwards; }
@keyframes confetti-fall { to { transform: translateY(108vh) rotate(700deg); } }

/* ---------- auth ---------- */
.auth-screen { position: fixed; inset: 0; z-index: 120; background: var(--paper); display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; background: var(--card); border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 30px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.auth-h { font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: -.5px; margin: 0 0 6px; }
.auth-sub { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.auth-error { background: #FFD9D4; border: 2.5px solid var(--ink); border-radius: var(--r-sm); padding: 10px 13px; font-family: var(--mono); font-size: 12px; color: var(--ink); margin-bottom: 14px; }
.auth-card input { margin-bottom: 12px; }
.auth-toggle { font-size: 14px; color: var(--muted); margin: 16px 0 0; text-align: center; }
.auth-toggle a { color: var(--accent); font-weight: 700; }
.user-area { display: flex; align-items: center; gap: 10px; margin-left: 14px; }
.user-name { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: var(--r-sm); transition: color .12s, background .12s; }
.user-name::before { content: "👤 "; font-size: 1.3em; vertical-align: middle; }
/* enlarge emoji "text icons" everywhere — app.js wraps each emoji in <span class="ic"> */
.ic { display: inline-block; font-size: 1.25em; line-height: 1; vertical-align: middle; }
.hero h1 .ic, .section-head h2 .ic, .lib-head h2 .ic, .recipe h2 .ic, .deck-card h2 .ic, .modal-h .ic, .modal-title .ic { font-size: 1em; }
.user-name:hover { color: var(--ink); background: var(--bg-2); }
.admin-h { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.3px; margin: 26px 0 12px; }
.admin-hint { font-family: var(--mono); font-size: 11px; text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 400; }
.admin-stats { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0 4px; }
.stat-card { background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--r); box-shadow: 4px 4px 0 var(--ink); padding: 16px 22px; min-width: 110px; flex: 1; }
.stat-num { font-family: var(--display); font-weight: 700; font-size: 32px; line-height: 1; color: var(--accent); }
.stat-lbl { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 6px; }
.admin-row { cursor: pointer; transition: background .1s; }
.admin-row:hover { background: var(--bg-2); }
.admin-table td.link { color: var(--accent); font-weight: 700; }
.modal-narrow { max-width: 420px; }
.modal-title { font-family: var(--display); font-weight: 700; font-size: var(--fs-h3); letter-spacing: -.4px; margin: 0 0 8px; }
.account-note { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.admin-table th { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; text-align: left; padding: 11px 14px; background: var(--bg-2); border-bottom: 2.5px solid var(--ink); }
.admin-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-tag { font-family: var(--mono); font-size: 10px; text-transform: uppercase; background: var(--accent); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 999px; padding: 1px 7px; }
.admin-del { padding: 6px 12px; font-size: 12px; box-shadow: 2px 2px 0 var(--ink); }

/* ---------- admin dashboard (usage / health / insights / security) ---------- */
.btn-sm { padding: 6px 12px; font-size: 12px; box-shadow: 2px 2px 0 var(--ink); }
.admin-h .btn-sm { margin-left: 10px; vertical-align: middle; }
.usage-foot { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 14px 0 4px; }
.usage-foot b { color: var(--ink); }

/* proportional bar lists */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { font-size: 13px; }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3px; }
.bar-head b { font-family: var(--display); }
.bar-track { height: 12px; background: var(--bg-2); border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--green); }
.bar-fill.paid { background: var(--gold); }
.bar-tag { font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; border: 1.5px solid var(--ink); border-radius: 999px; padding: 0 6px; vertical-align: middle; }
.bar-tag.free { background: var(--green); color: #fff; }
.bar-tag.paid { background: var(--gold); color: var(--ink); }

/* multi-column grid for usage/insights breakdowns */
.insight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 14px 0 4px; }
.insight-col { background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; }
.insight-col h4 { font-family: var(--display); font-size: var(--fs-h4); margin: 0 0 12px; letter-spacing: -.2px; }

/* health card */
.health-card { background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px 18px; max-width: 560px; }
.health-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.health-row:last-child { border-bottom: 0; }
.health-lbl { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.health-row b { font-family: var(--display); font-size: 16px; }
.hchips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.hchip { font-family: var(--mono); font-size: 11px; border: 1.5px solid var(--ink); border-radius: 999px; padding: 2px 9px; }
.hchip.on { background: var(--green); color: #fff; }
.hchip.off { background: var(--bg-2); color: var(--muted); }

/* security cards */
.sec-card { background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 14px; max-width: 560px; }
.sec-lbl { display: block; font-family: var(--mono); font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.sec-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sec-row input { flex: 1; min-width: 140px; padding: 9px 12px; border: 2px solid var(--ink); border-radius: var(--r-sm); font-family: var(--mono); font-size: 13px; background: var(--paper); }
.sec-check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; font-family: var(--mono); }
.sec-check input { width: 16px; height: 16px; }
.ok-pill { font-family: var(--mono); font-size: 10px; text-transform: uppercase; background: var(--green); color: #fff; border: 1.5px solid var(--ink); border-radius: 999px; padding: 1px 8px; }
.warn-pill { font-family: var(--mono); font-size: 10px; text-transform: uppercase; background: var(--danger); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 999px; padding: 1px 8px; }

/* ---------- PWA install pill ---------- */
.install-pill { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 80; display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: var(--shadow); padding: 8px 10px 8px 18px; font-family: var(--mono); font-size: 13px; max-width: calc(100vw - 24px); }
.install-pill b { color: var(--yellow); }
.pill-go { background: var(--accent); color: #fff; border: 2px solid var(--paper); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.pill-x { background: transparent; border: none; color: var(--paper); font-size: 20px; line-height: 1; padding: 0 4px; cursor: pointer; }

/* multi-select filter "Clear" + cost cards */
.filter-clear { border-style: dashed !important; color: var(--muted); }
.cost-row .stat-card { background: var(--bg-2); }
.cost-row .stat-num { font-size: 26px; }
.roller { position: fixed; inset: 0; z-index: 90; background: rgba(22,18,12,.55); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s ease; }
.roller-card { background: var(--card); border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 26px 32px; min-width: 280px; max-width: 90vw; text-align: center; }
.roller-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin-bottom: 8px; }
.roller-title { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -.4px; min-height: 30px; }

/* centered per-tab GIF — hidden (onerror) until you add gif1/gif2/gif3.gif */
.tab-gif { display: block; margin: 2px auto 20px; width: 100%; max-width: 200px; border: 2.5px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); }

/* ---------- Chef, Help! chatbot ---------- */
.chat-bar { display: flex; gap: 10px; margin: 4px 0 14px; }
.chat-bar input { flex: 1; min-width: 0; }
.chat-bar .btn { flex: 0 0 auto; }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.suggest-chip { font-family: var(--mono); font-size: 12px; background: var(--card); border: 2px solid var(--ink); border-radius: 999px; padding: 6px 13px; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); transition: transform .1s, box-shadow .1s; color: var(--ink); }
.suggest-chip:hover { background: var(--lilac); transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); }
.chat-reply { margin: 2px 0 18px; }
.chat-reply:empty { display: none; }
.chat-bubble { display: inline-block; background: var(--green); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 14px; border-bottom-left-radius: 4px; padding: 11px 16px; font-size: 15px; font-weight: 600; box-shadow: 3px 3px 0 var(--ink); max-width: 90%; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  main { padding: 32px 18px 80px; }
  .hero { grid-template-columns: 1fr; gap: 14px; margin-bottom: 36px; }
  .hero-art { max-width: 210px; }
  .hero h1 { font-size: clamp(28px, 8vw, 48px); letter-spacing: -1px; }
}
@media (max-width: 620px) {
  .header-inner { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .brand-name { font-size: 20px; }
  .tabs { margin-left: 0; width: 100%; gap: 6px; }
  .tab { flex: 1; justify-content: center; padding: 9px 6px; font-size: 12px; }
  main { padding: 26px 16px 72px; }
  .card { padding: 20px; }
  .lib-head { gap: 12px; }
  .lib-tools { margin-left: 0; width: 100%; }
  .search-wrap { flex: 1; }
  .search-wrap input { min-width: 0; width: 100%; }
  .lib-tools .btn { white-space: nowrap; }
  .grid { grid-template-columns: 1fr; }
  .deck-card { padding: 22px; }
  .deck-nav { flex-wrap: wrap; }
  .deck-nav .btn { flex: 1 1 30%; }
  .modal { padding: 22px 16px; }
  .card-actions { flex-direction: column; }
  .card-actions .btn { width: 100%; min-width: 0; flex: none; }
  .cook-top { padding: 14px 16px; }
  .cook-top .ctitle { font-size: 18px; }
  .cook-body { padding: 24px 16px 50px; }
  .cook-step { font-size: 17px; gap: 14px; }
  .cook-step .num { width: 36px; height: 36px; font-size: 14px; }
  .recipe h2 { font-size: 24px; }
  /* full-screen scrollable sheet on phones, close button pinned to the corner */
  .overlay { padding: 0; }
  .modal { padding: 24px 16px 40px; min-height: 100vh; min-height: 100dvh; border-radius: 0; border-left: 0; border-right: 0; }
  .modal-close { position: fixed; top: 10px; right: 10px; z-index: 70; }
}

/* ---------- print ---------- */
@media print {
  body { background: #fff; }
  .site-header, .card-actions, .usage-row, .btn, .hint, .deck-nav { display: none !important; }
  .overlay { position: static; background: #fff; padding: 0; }
  .modal { box-shadow: none; border: 0; max-width: 100%; }
}
