/* ============================================================
   Oat Queen – Receptkezelő app (page-recipe-app.php)
   Önálló stíluslap, a téma style.css-ét nem tölti be.
   ============================================================ */
:root {
	--bg: #fafaf5;
	--surface: #ffffff;
	--tint: #eef2ea;
	--blush: #f7ece2;
	--ink: #1e2920;
	--muted: #5c675e;
	--line: #e1e5db;
	--green: #4d8a5a;
	--green-deep: #2b4d33;
	--red: #b93e37;
	--peach: #f0cdac;
	--f-display: "Fraunces", Georgia, serif;
	--f-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--f-hand: "Caveat", cursive;
	--r: 18px;
	--top-h: 60px;
	--safe-t: env(safe-area-inset-top, 0px);
	--safe-b: env(safe-area-inset-bottom, 0px);
	--pad: 16px;
	--shadow: 0 10px 30px -14px rgba(30, 50, 35, .28);
	color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
	min-height: 100dvh; background: var(--bg); color: var(--ink);
	font: 400 16px/1.5 var(--f-body);
	-webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
	overscroll-behavior-y: none;
}
body.no-scroll { overflow: hidden; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2.5px solid var(--green); outline-offset: 2px; }

.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Gombok ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 52px; padding: 0 22px; border-radius: 999px;
	font-weight: 600; font-size: 16px; letter-spacing: .01em;
	transition: transform .15s ease, background-color .2s, opacity .2s;
	user-select: none; -webkit-user-select: none;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn .i { width: 20px; height: 20px; }
.btn--block { width: 100%; }
.btn--grow { flex: 1; }
.btn--sm { min-height: 42px; padding: 0 16px; font-size: 14.5px; }
.btn--sm .i { width: 18px; height: 18px; }
.btn--primary { background: var(--green-deep); color: #fff; }
.btn--danger { background: var(--red); color: #fff; }
.btn--soft { background: var(--tint); color: var(--green-deep); }
.btn--ghost { color: var(--muted); }
.btn--danger-ghost { color: var(--red); }

.iconbtn {
	width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--ink);
	transition: background-color .2s, transform .15s;
}
.iconbtn:active { transform: scale(.92); background: var(--tint); }
.iconbtn:disabled { opacity: .35; }
.iconbtn--soft { background: var(--tint); color: var(--green-deep); }
.iconbtn--sm { width: 36px; height: 36px; color: var(--muted); }
.iconbtn--sm .i { width: 20px; height: 20px; }

.link { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--green); font-weight: 600; font-size: 15px; }
.link .i { width: 18px; height: 18px; }

/* ---------- Felső sáv ---------- */
.top {
	position: sticky; top: 0; z-index: 20;
	display: flex; align-items: center; gap: 4px;
	min-height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 8px 0;
	background: rgba(250, 250, 245, .86); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
	border-bottom: 1px solid rgba(225, 229, 219, .7);
}
.top__title { flex: 1; min-width: 0; font: 400 20px/1.2 var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; }
.top__dirty { font-size: 12px; font-weight: 600; color: #9a6a2f; background: var(--blush); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.top--large {
	position: static; align-items: flex-end; justify-content: space-between;
	padding: calc(var(--safe-t) + 18px) var(--pad) 6px; border: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
.top--large h1 { font: 400 40px/1.05 var(--f-display); letter-spacing: -.02em; }
.hello { font: 600 24px/1 var(--f-hand); color: var(--red); margin-bottom: 4px; }

/* ---------- Lista ---------- */
.list { padding: 10px var(--pad) calc(110px + var(--safe-b)); max-width: 720px; margin: 0 auto; }
.top--large { max-width: 720px; margin: 0 auto; }

.search {
	display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px; border-radius: 16px;
	background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted);
}
.search:focus-within { box-shadow: inset 0 0 0 2px var(--green); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; color: var(--ink); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.seg { display: flex; gap: 4px; padding: 4px; margin: 14px 0 6px; border-radius: 14px; background: var(--tint); }
.seg button { flex: 1; height: 38px; border-radius: 10px; font-size: 14.5px; font-weight: 600; color: var(--muted); transition: background-color .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 2px 6px -2px rgba(30, 50, 35, .2); }

.count { font-size: 13px; color: var(--muted); margin: 14px 4px 6px; }
.rlist { list-style: none; display: grid; gap: 8px; margin-bottom: 16px; }
#listBody.is-busy { opacity: .6; transition: opacity .2s; }
.row {
	display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 10px; border-radius: var(--r);
	background: var(--surface); box-shadow: 0 1px 0 var(--line); transition: transform .15s;
}
.row:active { transform: scale(.985); background: #fdfdfa; }
.row__img { flex: none; width: 60px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--tint); display: grid; place-items: center; color: var(--green); }
.row__img img { width: 100%; height: 100%; object-fit: cover; }
.row__img .i { width: 26px; height: 26px; opacity: .5; }
.row__body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.row__body b { font: 400 17.5px/1.25 var(--f-display); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row__body small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pill { flex: none; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--line); color: var(--muted); white-space: nowrap; }
.pill--publish { background: #dcebdc; color: var(--green-deep); }
.pill--pending { background: var(--blush); color: #9a6a2f; }
.pill--future { background: #e4ecf5; color: #36597d; }

.rlist--skel .row__img, .rlist--skel b, .rlist--skel small {
	background: linear-gradient(90deg, var(--tint) 0%, #f6f8f3 50%, var(--tint) 100%); background-size: 200% 100%; animation: skel 1.2s infinite linear; border-radius: 8px;
}
.rlist--skel b { height: 18px; width: 70%; }
.rlist--skel small { height: 12px; width: 40%; }
@keyframes skel { to { background-position: -200% 0; } }

.empty { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty__ico { width: 44px; height: 44px; color: var(--green); margin-bottom: 12px; }
.empty h2 { font: 400 24px/1.2 var(--f-display); color: var(--ink); margin-bottom: 6px; }

.fab {
	position: fixed; z-index: 15; right: max(var(--pad), env(safe-area-inset-right, 0px)); bottom: calc(18px + var(--safe-b));
	display: inline-flex; align-items: center; gap: 8px; height: 58px; padding: 0 24px 0 20px; border-radius: 999px;
	background: var(--red); color: #fff; font-weight: 700; font-size: 16px; box-shadow: 0 14px 30px -10px rgba(185, 62, 55, .6);
	transition: transform .15s;
}
.fab:active { transform: scale(.95); }
.fab .i { width: 24px; height: 24px; stroke-width: 2.2; }

.tip { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0 4px; padding: 14px 8px 14px 14px; border-radius: var(--r); background: var(--blush); font-size: 14.5px; line-height: 1.45; }
.tip p + .btn, .tip .tip__btns { margin-top: 10px; }
.tip__btns { display: flex; gap: 6px; flex-wrap: wrap; }
.tip__ico { color: var(--red); margin-top: 1px; }
.tip > div { flex: 1; }
.tip--warn { background: #fff4e2; }

/* ---------- Szerkesztő ---------- */
.ed { padding: 14px var(--pad) 0; max-width: 720px; margin: 0 auto; display: grid; gap: 14px; }
.ed__spacer { height: calc(96px + var(--safe-b)); }
.loading { display: grid; place-items: center; padding: 80px 0; }

.statusbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 2px 2px 0; }
.statusbar small { color: var(--muted); font-size: 13px; flex: 1; }

.card { background: var(--surface); border-radius: var(--r); padding: 18px 16px; box-shadow: 0 1px 0 var(--line); display: grid; gap: 16px; }
.card__title { font: 400 21px/1.2 var(--f-display); }

.fld { display: grid; gap: 7px; }
.fld > span { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.fld > small { font-size: 12.5px; color: var(--muted); }
.fld input, .fld textarea, .grp__title, .ing input, .step textarea, .paste {
	width: 100%; border: 0; outline: 0; border-radius: 12px; background: var(--bg);
	box-shadow: inset 0 0 0 1px var(--line); padding: 13px 14px; font-size: 16px; line-height: 1.45; color: var(--ink);
	transition: box-shadow .15s, background-color .15s;
	-webkit-appearance: none; appearance: none;
}
.fld input:focus, .fld textarea:focus, .grp__title:focus, .ing input:focus, .step textarea:focus, .paste:focus { box-shadow: inset 0 0 0 2px var(--green); background: #fff; }
textarea { resize: none; overflow: hidden; min-height: 50px; }
.fld textarea.big { font: 400 22px/1.3 var(--f-display); }
::placeholder { color: #a3aba4; opacity: 1; }
.locked { font-size: 14px; color: var(--muted); background: var(--bg); border-radius: 12px; padding: 12px 14px; border: 1px dashed var(--line); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.unit { position: relative; display: block; }
.unit input { padding-right: 52px; }
.unit i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 14px; color: var(--muted); pointer-events: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
	display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 15px; border-radius: 999px;
	background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; font-weight: 500; color: var(--ink);
	transition: background-color .15s, color .15s, transform .12s;
}
.chip:active { transform: scale(.95); }
.chip .i { width: 16px; height: 16px; stroke-width: 2.4; margin-left: -3px; }
.chip[aria-pressed="true"] { background: var(--green-deep); color: #fff; box-shadow: none; }

/* Képek */
.drop {
	width: 100%; display: grid; justify-items: center; gap: 6px; padding: 34px 16px; border-radius: 16px;
	background: var(--tint); border: 1.5px dashed #b9cbb8; color: var(--green-deep); text-align: center;
}
.drop .i { width: 34px; height: 34px; color: var(--green); margin-bottom: 4px; }
.drop small { color: var(--muted); font-size: 13px; }
.drop--sq { aspect-ratio: 1; padding: 0; place-items: center; }
.drop--sq .i { margin: 0; }
.slot { position: relative; border-radius: 14px; overflow: hidden; background: var(--tint); }
.slot img { width: 100%; height: 100%; object-fit: cover; }
.slot--cover { aspect-ratio: 3 / 4; max-width: 340px; width: 100%; justify-self: center; }
.slot--step { aspect-ratio: 4 / 3; max-width: 260px; margin-top: 8px; }
.slot--sq { aspect-ratio: 1; }
.slot__x {
	position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
	background: rgba(20, 28, 22, .62); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.slot__x .i { width: 18px; height: 18px; stroke-width: 2.2; }
.slot--busy img { opacity: .55; filter: blur(1px); }
.slot__bar { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .7); overflow: hidden; }
.slot__bar i { display: block; height: 100%; background: var(--green); transition: width .2s; }
.slot--busy:not(:has(img)) { min-height: 120px; }
.card > .link { justify-self: center; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* Hozzávalók */
.grp { display: grid; gap: 10px; padding-bottom: 6px; }
.grp + .grp { border-top: 1px solid var(--line); padding-top: 16px; }
.grp__head { display: flex; gap: 4px; align-items: center; }
.grp__title { font: 600 22px/1.2 var(--f-hand) !important; color: var(--red) !important; background: transparent !important; box-shadow: none !important; padding: 6px 4px !important; }
.grp__title:focus { box-shadow: inset 0 -2px 0 var(--green) !important; border-radius: 0 !important; }
.ings { list-style: none; display: grid; gap: 10px; }
.ing { display: grid; grid-template-columns: 92px 1fr 36px; gap: 6px; align-items: center; padding: 8px; border-radius: 14px; background: var(--bg); }
.ing input { background: #fff; padding: 11px 12px; }
.ing__amt { font-weight: 600; color: var(--green-deep) !important; }
.ing__note { grid-column: 1 / 3; font-size: 14px !important; padding: 8px 12px !important; box-shadow: none !important; background: transparent !important; color: var(--muted) !important; }
.ing__note:focus { background: #fff !important; box-shadow: inset 0 0 0 2px var(--green) !important; }
.row-btns { display: flex; gap: 18px; flex-wrap: wrap; padding: 0 4px; }

/* Lépések */
.steps { list-style: none; display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.step__n { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--green); display: grid; place-items: center; font: italic 400 17px/1 var(--f-display); color: var(--green-deep); margin-top: 8px; }
.step__body { min-width: 0; }
.step__tools { display: flex; justify-content: space-between; align-items: center; min-height: 40px; }

/* Kapcsoló */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 15px; line-height: 1.35; }
.switch > span:last-child { display: inline-flex; align-items: center; gap: 8px; }
.switch > span:last-child .i { color: var(--green); width: 20px; height: 20px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__ui { flex: none; position: relative; width: 50px; height: 30px; border-radius: 999px; background: var(--line); transition: background-color .2s; }
.switch__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .15); transition: transform .2s; }
.switch input:checked + .switch__ui { background: var(--green); }
.switch input:checked + .switch__ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__ui { outline: 2.5px solid var(--green); outline-offset: 2px; }

/* Alsó gombsáv */
.bar {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
	display: flex; gap: 10px; padding: 12px var(--pad) calc(12px + var(--safe-b));
	background: rgba(250, 250, 245, .9); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
	border-top: 1px solid rgba(225, 229, 219, .8);
}
.bar:empty { display: none; }
@media (min-width: 760px) { .bar { padding-inline: calc(50% - 344px); } }

/* ---------- Alsó panel ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(20, 28, 22, .42); opacity: 0; transition: opacity .25s; }
.sheet__panel {
	position: absolute; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow: auto;
	background: var(--surface); border-radius: 24px 24px 0 0; padding: 10px 18px calc(14px + var(--safe-b));
	transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
	max-width: 560px; margin: 0 auto;
}
.sheet.is-on .sheet__backdrop { opacity: 1; }
.sheet.is-on .sheet__panel { transform: none; }
.sheet__grab { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet__title { font: 400 22px/1.25 var(--f-display); text-align: center; }
.sheet__text { color: var(--muted); text-align: center; font-size: 15px; margin-top: 8px; }
.sheet__actions { display: grid; gap: 8px; margin-top: 18px; }
.sheet__actions .btn--soft { justify-content: flex-start; padding-left: 20px; background: var(--bg); color: var(--ink); }
.sheet__actions .btn--soft .i { color: var(--green); }
.sheet__actions .btn--danger-ghost, .sheet__actions .btn--danger { justify-content: center; }
.sheet__actions > .btn--danger:not(:only-child):first-child { justify-content: center; }
.paste { margin-top: 16px; min-height: 170px; overflow: auto; resize: vertical; }

/* ---------- Előnézet ---------- */
.pv { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.pv.is-on { transform: none; }
.pv__body { position: relative; flex: 1; }
.pv iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; opacity: 0; transition: opacity .25s; }
.pv.is-loaded iframe { opacity: 1; }
.pv .spinner { position: absolute; top: 40%; left: 50%; margin-left: -16px; }

.spinner { display: inline-block; width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--tint); border-top-color: var(--green); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

/* ---------- Értesítés ---------- */
.toast {
	position: fixed; z-index: 45; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translate(-50%, 20px);
	width: min(calc(100% - 2 * var(--pad)), 520px);
	display: flex; align-items: center; gap: 12px; padding: 14px 10px 14px 18px; border-radius: 16px;
	background: var(--ink); color: #fff; font-size: 15px; line-height: 1.35; box-shadow: var(--shadow);
	opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast span { flex: 1; }
.toast button { flex: none; min-height: 36px; padding: 0 12px; border-radius: 10px; color: var(--peach); font-weight: 700; }
.toast--err { background: #7c2a25; }

/* ---------- Bejelentkezés ---------- */
.auth {
	min-height: 100dvh; max-width: 420px; margin: 0 auto;
	display: flex; flex-direction: column; justify-content: center; gap: 28px;
	padding: calc(32px + var(--safe-t)) 22px calc(32px + var(--safe-b));
}
.auth__brand { text-align: center; display: grid; justify-items: center; gap: 10px; }
.auth__brand img { width: 84px; height: 84px; border-radius: 22px; box-shadow: var(--shadow); }
.auth__brand h1 { font: 400 34px/1.1 var(--f-display); letter-spacing: -.02em; margin-top: 8px; }
.auth__brand p { color: var(--muted); max-width: 32ch; }
.auth__form { display: grid; gap: 16px; }
.auth__error { background: #fbe7e5; color: #7c2a25; border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.auth__lost { text-align: center; color: var(--muted); font-size: 14px; padding: 6px; }
.fld__pw { position: relative; display: block; }
.fld__pw input { padding-right: 54px; }
.fld__eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; color: var(--muted); }
.fld__eye svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.fld__eye.is-on { color: var(--green); }
.auth .switch { margin: 4px 0 6px; }

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