@font-face {
  font-family: 'Bricolage'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/fonts/bricolage-grotesque-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
  color-scheme: light dark;
  --bg: #f2f1f8;
  --card: #ffffff;
  --ink: #15131f;
  --muted: #6a6780;
  --line: #e3e1ee;
  --brand: #5a3cf4;        /* padlizsán-indigó */
  --on-brand: #ffffff;
  --brand-soft: #ebe7ff;
  --lime: #c9f23d;         /* a bolti útvonal és a haladás színe */
  --on-lime: #1b2300;
  --hot: #dd3b26;
  --shadow: 0 10px 30px rgba(40, 30, 90, .12);
  --display: 'Bricolage', system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0d15; --card: #1a1925; --ink: #f4f3fb; --muted: #a09db6; --line: #2b293a;
    --brand: #9280ff; --on-brand: #0e0d15; --brand-soft: #262145; --hot: #ff6f59;
    --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--body); -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.05; letter-spacing: -0.025em; }
h1 { font-size: 2.35rem; font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 750; }
p { margin: 0; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }

#app { max-width: 620px; margin: 0 auto; min-height: 100dvh; padding: 0 16px calc(128px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; gap: 8px; padding: calc(14px + env(safe-area-inset-top)) 0 0; font: 700 .95rem var(--display); color: var(--muted); }
.mark { width: 26px; height: 26px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; }
.mark i { width: 14px; height: 14px; border-radius: 50%; background: var(--lime); }
.view-head .actions { display: flex; gap: 8px; align-items: center; }
.view-head { padding: 10px 0 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.view-head p { color: var(--muted); font-size: .92rem; margin-top: 6px; }
.back { display: inline-flex; align-items: center; gap: 4px; padding: 12px 12px 12px 0; margin-top: env(safe-area-inset-top); color: var(--brand); font-weight: 650; text-decoration: none; }

/* Gombok, mezők */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--brand); color: var(--on-brand); font-weight: 700; text-decoration: none; transition: transform .12s; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--brand-soft); color: var(--brand); }
.btn.lime { background: var(--lime); color: var(--on-lime); }
.btn.danger { background: transparent; color: var(--hot); box-shadow: inset 0 0 0 1.5px var(--hot); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: .9rem; }
.btn.wide { width: 100%; }
.btn:disabled { background: var(--line); color: var(--muted); box-shadow: none; }
.btn svg { width: 20px; height: 20px; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card); color: var(--ink); display: grid; place-items: center; flex: 0 0 auto; }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn.on { color: var(--hot); }
.iconbtn.on svg { fill: currentColor; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .85rem; font-weight: 650; color: var(--muted); margin: 0 0 6px 4px; }
.field small { display: block; color: var(--muted); font-size: .8rem; margin: 5px 0 0 4px; }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 50px; padding: 11px 16px; border: 1.5px solid transparent; border-radius: 16px; background: var(--card);
}
.sheet input, .sheet select, .panel input { background: var(--bg); }
textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
input[type=file] { width: 100%; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.row > .fit { flex: 0 0 auto; }
.error { color: var(--hot); font-weight: 650; margin: 0 0 12px; }
.muted { color: var(--muted); }
.stack > * + * { margin-top: 12px; }
.panel { background: var(--card); border-radius: 24px; padding: 18px; }
.section-title { margin: 30px 0 12px; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--card); font-weight: 650; color: var(--ink); text-decoration: none; }
.chip[aria-pressed=true] { background: var(--ink); color: var(--bg); }
.chip.quick { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); min-height: 34px; padding: 0 12px; font-size: .88rem; }

/* Belépés */
.auth { padding-top: 9vh; }
.auth .logo { width: 72px; height: 72px; border-radius: 24px; background: var(--brand); display: grid; place-items: center; margin-bottom: 22px; }
.auth .logo i { width: 38px; height: 38px; border-radius: 50%; background: var(--lime); display: grid; place-items: center; color: var(--on-lime); }
.auth .logo svg { width: 24px; height: 24px; }
.auth h1 { font-size: 3.3rem; letter-spacing: -0.045em; line-height: .92; }
.auth .lead { margin: 14px 0 28px; color: var(--muted); max-width: 32ch; font-size: 1.05rem; }

/* Lebegő alsó menü */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); width: min(calc(100% - 24px), 460px); z-index: 5;
  background: color-mix(in srgb, var(--card) 82%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border-radius: 28px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); padding: 6px; }
.tabbar nav { display: grid; grid-template-columns: repeat(5, 1fr); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0 5px; font-size: .68rem; font-weight: 650; color: var(--muted); text-decoration: none; border-radius: 22px; }
.tabbar a span { width: 52px; height: 30px; border-radius: 15px; display: grid; place-items: center; }
.tabbar a[aria-current=page] { color: var(--brand); }
.tabbar a[aria-current=page] span { background: var(--brand-soft); }
.tabbar svg { width: 22px; height: 22px; }

/* Bevásárlólista */
.addwrap { position: sticky; top: 0; z-index: 3; padding: 8px 0 10px; background: linear-gradient(var(--bg) 82%, transparent); }
.addbar { display: flex; align-items: center; background: var(--card); border-radius: 999px; padding: 6px 6px 6px 8px; box-shadow: var(--shadow); }
.addbar input { flex: 1; min-width: 0; border: 0; background: transparent; min-height: 46px; padding: 0 10px; }
.addbar input:focus { border: 0; }
.addbar button { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; flex: 0 0 auto; }
.addbar button svg { width: 24px; height: 24px; }
.quickrow { margin-bottom: 12px; }
.progress { display: flex; align-items: center; gap: 12px; margin: 16px 2px 0; font: 700 .9rem var(--display); }
.progress .track { flex: 1; height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.progress .fill { height: 100%; border-radius: 5px; background: var(--lime); transition: width .25s; }

.aisle { margin-top: 22px; }
.aisle-head { display: flex; align-items: center; gap: 10px; padding: 0 2px 10px; }
.aisle-head h2 { font-size: 1.15rem; }
.emoji { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 12px; background: var(--card); display: grid; place-items: center; font-size: 1.15rem; position: relative; }
.stop { position: absolute; top: -7px; left: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--lime); color: var(--on-lime); font: 800 .72rem/20px var(--display); text-align: center; }
.aisle-head .count { margin-left: auto; color: var(--muted); font-size: .85rem; font-weight: 600; }
.items { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: 22px; overflow: hidden; }
.item { display: flex; align-items: stretch; border-top: 1px solid var(--bg); }
.item:first-child { border-top: 0; }
.item .tick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 8px 4px 8px 16px; background: none; border: 0; text-align: left; }
.box { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--muted); display: grid; place-items: center; color: var(--on-lime); transition: transform .15s; }
.box svg { width: 16px; height: 16px; opacity: 0; }
.item.done .box { background: var(--lime); box-shadow: none; }
.item.done .box svg { opacity: 1; }
.tick:active .box { transform: scale(.85); }
.item .label { min-width: 0; }
.item .name { font-weight: 650; overflow-wrap: anywhere; }
.item .qty { font: 750 .95rem var(--display); color: var(--brand); margin-right: 7px; white-space: nowrap; }
.item .sub { display: block; font-size: .82rem; color: var(--muted); }
.item.done .name, .item.done .qty { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.item .more { flex: 0 0 48px; background: none; border: 0; color: var(--muted); display: grid; place-items: center; }
.item .more svg { width: 22px; height: 22px; }
.basket { margin-top: 30px; }
.basket .aisle-head h2 { color: var(--muted); }
.empty { text-align: center; padding: 44px 12px; color: var(--muted); }
.empty .big { font-size: 3rem; line-height: 1; margin-bottom: 12px; }
.empty h2 { color: var(--ink); margin-bottom: 8px; }
.offline { background: var(--lime); color: var(--on-lime); border-radius: 16px; padding: 10px 14px; font-size: .88rem; font-weight: 650; margin-bottom: 12px; }
.fold { width: 100%; background: none; border: 0; text-align: left; padding: 16px 2px; color: var(--brand); font-weight: 650; }

/* Receptek */
.recipes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
.rcard { position: relative; border-radius: 24px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--card); }
.rcard a { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; text-decoration: none; color: #fff; }
.rcard .photo { position: absolute; inset: 0; display: grid; place-items: center; font: 800 4rem var(--display); }
.rcard img, .hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rcard .body { position: relative; padding: 40px 14px 14px; background: linear-gradient(transparent, rgba(10, 8, 25, .82)); }
.rcard h3 { font-size: 1.12rem; font-weight: 750; overflow-wrap: anywhere; }
.rcard .meta { font-size: .8rem; opacity: .85; margin-top: 4px; }
.rcard .iconbtn { position: absolute; top: 8px; right: 8px; width: 38px; height: 38px; background: rgba(255, 255, 255, .9); color: #15131f; }
.rcard .iconbtn.on { color: #dd3b26; }
.rcard .iconbtn svg { width: 19px; height: 19px; }
.hero { aspect-ratio: 16 / 11; border-radius: 28px; overflow: hidden; margin-bottom: 18px; }
.recipe-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.recipe-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .92rem; margin: 10px 0 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 3px 11px; font-size: .8rem; font-weight: 650; }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--card); border-radius: 999px; padding: 4px; }
.stepper button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--brand-soft); color: var(--brand); font-size: 1.3rem; font-weight: 700; line-height: 1; }
.stepper output { min-width: 6ch; text-align: center; font: 750 .95rem var(--display); }
.ingredients { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: 22px; overflow: hidden; }
.ingredients label { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 16px; border-top: 1px solid var(--bg); }
.ingredients li:first-child label { border-top: 0; }
.ingredients input { width: 22px; height: 22px; accent-color: var(--brand); flex: 0 0 auto; }
.ingredients .qty { font: 750 .95rem var(--display); color: var(--brand); min-width: 4.2em; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 10px 0; max-width: 62ch; }
.steps li::before { content: counter(step); width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 750 .9rem/30px var(--display); text-align: center; }
.sticky-cta { position: sticky; bottom: calc(100px + env(safe-area-inset-bottom)); margin-top: 14px; z-index: 2; }
.sticky-cta .btn { box-shadow: var(--shadow); }
.importbox { background: var(--brand-soft); border-radius: 24px; padding: 16px; margin-bottom: 22px; }
.importbox strong { display: block; font: 750 1.05rem var(--display); margin-bottom: 4px; }
.importbox p { font-size: .88rem; color: var(--muted); margin-bottom: 12px; }

/* Főzés mód */
dialog.cook { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: var(--bg); color: var(--ink); }
.cook-body { display: flex; flex-direction: column; height: 100%; max-width: 620px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom)); }
.cook-top { display: flex; align-items: center; justify-content: space-between; font: 750 1rem var(--display); color: var(--muted); }
.cook-top button { background: none; border: 0; color: var(--brand); font-weight: 650; padding: 10px; margin: -10px; }
.cook-step { flex: 1; display: flex; flex-direction: column; justify-content: center; overflow-y: auto; }
.cook-step b { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--lime); color: var(--on-lime); font: 800 1.5rem var(--display); margin-bottom: 18px; }
.cook-step p { font: 600 1.7rem/1.25 var(--display); letter-spacing: -0.015em; }

/* Heti menü */
.weeknav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.weeknav strong { font: 750 1rem var(--display); }
.day { background: var(--card); border-radius: 22px; padding: 12px 12px 12px 16px; margin-top: 10px; display: flex; gap: 12px; align-items: flex-start; }
.day.today { box-shadow: inset 0 0 0 2px var(--brand); }
.day .when { flex: 0 0 62px; padding-top: 5px; }
.day .when b { display: block; font: 750 1rem var(--display); text-transform: capitalize; }
.day .when span { font-size: .8rem; color: var(--muted); }
.day .meals { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.meal { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 14px; padding: 4px 4px 4px 12px; }
.meal a { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; font-weight: 650; padding: 6px 0; line-height: 1.25; }
.meal small { display: block; color: var(--muted); font-weight: 500; font-size: .8rem; margin-top: 2px; }
.meal button, .day .add { width: 38px; height: 38px; border-radius: 50%; border: 0; background: none; color: var(--muted); display: grid; place-items: center; flex: 0 0 auto; }
.day .add { background: var(--brand-soft); color: var(--brand); }
.meal svg, .day .add svg { width: 20px; height: 20px; }
.pick { display: block; width: 100%; text-align: left; background: var(--card); border: 0; border-radius: 16px; padding: 14px 16px; font-weight: 650; margin-top: 8px; }
.pick small { display: block; color: var(--muted); font-weight: 500; }

/* Boltok */
.order { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: 22px; overflow: hidden; }
.order li { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 0 6px 0 12px; border-top: 1px solid var(--bg); background: var(--card); }
.order li:first-child { border-top: 0; }
.order li.dragging { position: relative; z-index: 2; box-shadow: var(--shadow); border-radius: 16px; }
.order .num { width: 22px; font: 800 .9rem var(--display); color: var(--muted); text-align: center; }
.order .name { flex: 1; font-weight: 650; }
.order button { width: 40px; height: 44px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; }
.order button:disabled { opacity: .25; }
.order .grip { touch-action: none; cursor: grab; }
.order svg { width: 20px; height: 20px; }
.linkrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 62px; padding: 0 18px; background: var(--card); border-radius: 20px; text-decoration: none; color: var(--ink); font: 750 1.05rem var(--display); margin-top: 10px; }
.linkrow span:last-child { color: var(--muted); font: 500 .88rem var(--body); }

/* Profil */
.invite { background: var(--bg); border-radius: 18px; padding: 12px 14px; }
.invite code { display: block; font-size: .8rem; overflow-wrap: anywhere; color: var(--muted); margin: 4px 0 10px; font-family: inherit; }
.members { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.members li { display: inline-flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 999px; padding: 5px 14px 5px 5px; font-weight: 650; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font: 800 .85rem var(--display); }

/* Alulról nyíló lap */
dialog.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 620px; max-height: 88dvh; border-radius: 28px 28px 0 0; background: var(--card); color: var(--ink); }
dialog.sheet .pick { background: var(--bg); }
dialog::backdrop { background: rgba(10, 8, 25, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet-body { padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-head button { background: none; border: 0; padding: 10px; margin: -10px; font-weight: 650; color: var(--brand); }

#toast { position: fixed; left: 50%; bottom: calc(104px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 650; font-size: .92rem; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 50; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--hot); color: #fff; }

@media (min-width: 560px) { .recipes { grid-template-columns: repeat(3, 1fr); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
