/*
 * Sneaky Quick View (Local preview, Phase 1). The dialog lives at the end of <body>, outside every page root, so it
 * carries its own tokens (the approved Eat landing's values). Desktop: a centred card. Phones: a full-height sheet with a
 * sticky bar, its own scroll, safe-area padding and large targets. Motion is gentle and off under reduced motion.
 */
.sqv {
	--sqv-ink: #122c3a; --sqv-copy: #375568; --sqv-muted: #587183; --sqv-line: rgba(61, 148, 66, .18); --sqv-soft: #eef7ec;
	--sqv-tone: #3d9442; --sqv-tone-ink: #2f7a34; --sqv-tone-soft: #eef7ec;
	--sqv-p: #2f7a34; --sqv-c: #7dbd62; --sqv-f: #e0a33a;
	--sqv-display: "Sneaky Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--sqv-text: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	width: min(760px, calc(100vw - 48px)); max-width: none; max-height: min(88vh, 920px); height: auto;
	margin: auto; padding: 0; border: 0; border-radius: 28px; background: #fff; color: var(--sqv-copy);
	box-shadow: 0 50px 100px -40px rgba(15, 34, 48, .55), 0 0 0 1px rgba(61, 148, 66, .14);
	overflow: hidden; font: 400 16px/1.5 var(--sqv-text);
}
.sqv[data-sqv-tone="train"] { --sqv-tone: #2b8fd6; --sqv-tone-ink: #1b6fae; --sqv-tone-soft: #edf6fd; }
.sqv::backdrop { background: rgba(15, 34, 48, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sqv[open] { display: flex; }
.sqv *, .sqv *::before, .sqv *::after { box-sizing: border-box; }
.sqv-sheet { display: flex; flex-direction: column; width: 100%; max-height: inherit; min-height: 0; }

/* the bar: kind, title, Favorite, Share, Close (sticky because only the body scrolls) */
.sqv-bar { position: relative; flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "back head acts x" "status status status status"; align-items: center; gap: 0 12px; padding: 18px 18px 14px 22px; background: linear-gradient(180deg, #fbfefa, #fff); border-bottom: 1px solid var(--sqv-line); }
.sqv-bar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, #e0a33a, #7dbd62 40%, #2f7a34 72%, #6ec4e8); }
.sqv-back { grid-area: back; }
.sqv-head { grid-area: head; min-width: 0; }
.sqv-acts { grid-area: acts; display: flex; align-items: center; gap: 8px; }
.sqv-x { grid-area: x; }
.sqv-status { grid-area: status; margin: 0; font: 600 13px/1.4 var(--sqv-text); color: var(--sqv-tone-ink); min-height: 0; }
.sqv-status:not(:empty) { margin-top: 6px; }
.sqv-kind { margin: 0; font: 800 11.5px/1.3 var(--sqv-text); letter-spacing: .12em; text-transform: uppercase; color: var(--sqv-tone-ink); }
.sqv-title { margin: 2px 0 0; font: 750 clamp(1.15rem, 1rem + .7vw, 1.5rem)/1.2 var(--sqv-display); letter-spacing: -.015em; color: var(--sqv-ink); text-wrap: balance; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; outline: none; }

/* round controls: Close and Back restate every state (the theme's reset paints button:hover pink) */
.sqv .sqv-x, .sqv .sqv-x:hover, .sqv .sqv-x:focus { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1.5px solid #d5e7cf; border-radius: 50%; background: #fff; color: var(--sqv-ink); white-space: nowrap; cursor: pointer; }
.sqv .sqv-x:hover, .sqv .sqv-x:focus-visible { border-color: var(--sqv-tone); background: var(--sqv-tone-soft); color: var(--sqv-ink); }
.sqv .sqv-back, .sqv .sqv-back:hover, .sqv .sqv-back:focus { display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 12px 0 6px; border: 0; border-radius: 999px; background: transparent; color: var(--sqv-tone-ink); font: 700 15px/1 var(--sqv-text); white-space: nowrap; cursor: pointer; }
.sqv .sqv-back[hidden] { display: none; }
.sqv .sqv-back:hover, .sqv .sqv-back:focus-visible { background: var(--sqv-tone-soft); color: var(--sqv-tone-ink); }
.sqv :focus-visible { outline: 2px solid var(--sqv-ink); outline-offset: 3px; }
/* the title takes focus on open so screen readers announce it; it is not a control, so it draws no ring */
.sqv .sqv-title:focus, .sqv .sqv-title:focus-visible { outline: none; }

/* the site's own Favorite and Share, as they look elsewhere, sized for the bar */
/* relative, not static: the heart's own halo and burst are positioned against it */
.sqv .sqv-acts .sfav-heart { position: relative; inset: auto; width: 44px; height: 44px; flex: none; }
.sqv .sqv-acts .sh-social { position: relative; }
.sqv .sqv-acts .sh-social > summary { min-height: 44px; }

/* the body scrolls on its own */
.sqv-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 24px 26px; -webkit-overflow-scrolling: touch; }
.sqv-body[aria-busy="true"] { overflow: hidden; }
.sqv-foot { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--sqv-line); background: #fbfefa; }
.sqv .sqv-full, .sqv .sqv-full:hover, .sqv .sqv-full:focus { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; background: #246b5f; color: #fff; font: 700 15.5px/1 var(--sqv-text); text-decoration: none; white-space: nowrap; box-shadow: 0 14px 28px -16px rgba(36, 107, 95, .9); }
.sqv .sqv-full:hover, .sqv .sqv-full:focus-visible { background: #173d39; color: #fff; }
.sqv .sqv-return, .sqv .sqv-return:hover, .sqv .sqv-return:focus { min-height: 48px; padding: 0 20px; border: 1.5px solid #c7ddeb; border-radius: 999px; background: #fff; color: var(--sqv-ink); font: 700 15.5px/1 var(--sqv-text); white-space: nowrap; cursor: pointer; }
.sqv .sqv-return:hover, .sqv .sqv-return:focus-visible { border-color: var(--sqv-tone); background: #fff; color: var(--sqv-ink); }

/* loading and errors */
.sqv-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sqv-skel { display: grid; gap: 14px; }
.sqv-skel i { display: block; height: 18px; border-radius: 10px; background: linear-gradient(90deg, #eef4ec, #f7faf5, #eef4ec); background-size: 200% 100%; }
.sqv-skel i:nth-child(2) { width: 46%; height: 34px; }
.sqv-skel i:nth-child(3) { width: 80%; }
.sqv-skel i:nth-child(4) { height: 120px; }
.sqv-err { padding: 22px; border-radius: 20px; border: 1.5px dashed #cfe3c8; }
.sqv-err p { margin: 0 0 8px; color: var(--sqv-copy); }
.sqv-err strong { color: var(--sqv-ink); }
.sqv-err-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px !important; }
.sqv .sqv-btn, .sqv .sqv-btn:hover, .sqv .sqv-btn:focus { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: #246b5f; color: #fff; font: 700 15px/1 var(--sqv-text); text-decoration: none; white-space: nowrap; cursor: pointer; }
.sqv .sqv-btn--ghost, .sqv .sqv-btn--ghost:hover, .sqv .sqv-btn--ghost:focus { background: #fff; color: var(--sqv-ink); border: 1.5px solid #c7ddeb; }

/* ---------- the meal ---------- */
.sqv-meal { --sqv-role: #7dbd62; }
.sqv-hero { display: flex; align-items: center; gap: 12px; }
.sqv-art { width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--sqv-role); color: #fff; box-shadow: 0 0 0 5px #fff, 0 0 0 6px var(--sqv-line), 0 14px 24px -14px rgba(18, 44, 58, .55); }
.sqv-art .sl-i { width: 26px; height: 26px; }
.sqv-kicker { margin: 0; font: 800 12px/1.3 var(--sqv-text); letter-spacing: .1em; text-transform: uppercase; color: var(--sqv-muted); }
.sqv-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 18px 0 0; padding: 0; border: 0; min-width: 0; }
.sqv-switch legend { float: left; margin-right: 6px; padding: 0; font: 700 12px/44px var(--sqv-text); letter-spacing: .08em; text-transform: uppercase; color: var(--sqv-muted); }
.sqv-switch label { position: relative; display: inline-flex; cursor: pointer; }
.sqv-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sqv-switch span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid #cfe3c8; background: #fff; font: 650 14.5px/1 var(--sqv-text); color: var(--sqv-ink); white-space: nowrap; }
.sqv-switch input:checked + span { background: #2f7a34; border-color: #2f7a34; color: #fff; }
.sqv-switch input:focus-visible + span { outline: 2px solid var(--sqv-ink); outline-offset: 3px; }
.sqv-ctx { margin: 14px 0 0; }
.sqv-ctx b { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; background: var(--sqv-soft); font: 700 13px/1.25 var(--sqv-text); color: #2f7a34; }
.sqv-ctx b.is-lib { background: #fcf2df; color: #8f5507; }
.sqv-sum { display: grid; gap: 8px; margin-top: 12px; }
.sqv-kcal { display: flex; align-items: baseline; gap: 8px; margin: 0; }
.sqv-kcal b { font: 800 32px/1 var(--sqv-display); letter-spacing: -.02em; color: var(--sqv-ink); font-variant-numeric: tabular-nums; }
.sqv-kcal > span { font-size: 14px; color: var(--sqv-muted); }
.sqv-macs { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font: 600 14.5px/1.4 var(--sqv-text); color: var(--sqv-ink); font-variant-numeric: tabular-nums; }
.sqv-macs .sqv-v { display: inline-flex; flex-wrap: wrap; gap: 6px 16px; }
.sqv-macs .sqv-v.sqv-v--lib { display: none; }
.sqv-mac { display: inline-flex; align-items: center; }
.sqv-k { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.sqv-k--p { background: var(--sqv-p); } .sqv-k--c { background: var(--sqv-c); } .sqv-k--f { background: var(--sqv-f); }
.sqv-h3 { margin: 22px 0 6px; font: 800 12px/1.3 var(--sqv-text); letter-spacing: .1em; text-transform: uppercase; color: var(--sqv-tone-ink); }
.sqv-items { display: grid; margin: 0; padding: 0; list-style: none; }
.sqv-items li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid #edf3ea; }
.sqv-items li:last-child { border-bottom: 0; }
.sqv-food { display: grid; gap: 2px; min-width: 0; }
.sqv-food b { font: 650 15.5px/1.3 var(--sqv-text); color: var(--sqv-ink); }
.sqv-food small { font-size: 13.5px; color: var(--sqv-muted); font-variant-numeric: tabular-nums; }
.sqv-items em { flex: none; font-style: normal; font-size: 14.5px; color: var(--sqv-copy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sqv-note { margin: 10px 0 0; font-size: 14px; line-height: 1.55; color: var(--sqv-muted); }
.sqv-prep { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--sqv-copy); }
.sqv-caution { display: flex; gap: 8px; align-items: flex-start; margin: 22px 0 0; padding: 12px 14px; border-radius: 16px; background: #fdf4f8; font-size: 14px; line-height: 1.5; color: #5e1a39; }
.sqv-caution .sl-i { width: 18px; height: 18px; margin-top: 1px; flex: none; color: #b0285a; }

/* the switch: CSS does it (the day's portions are the default) */
.sqv-v--lib { display: none; }
@supports selector(:has(*)) {
	.sqv-meal:has(input[value="lib"]:checked) .sqv-v--lib { display: inline-flex; }
	.sqv-meal:has(input[value="lib"]:checked) .sqv-kcal .sqv-v--lib, .sqv-meal:has(input[value="lib"]:checked) .sqv-food .sqv-v--lib, .sqv-meal:has(input[value="lib"]:checked) .sqv-items em .sqv-v--lib, .sqv-meal:has(input[value="lib"]:checked) .sqv-ctx .sqv-v--lib { display: inline; }
	.sqv-meal:has(input[value="lib"]:checked) .sqv-v--day, .sqv-meal:has(input[value="lib"]:checked) .sqv-macs .sqv-v.sqv-v--day { display: none; }
	.sqv-meal:has(input[value="lib"]:checked) .sqv-macs .sqv-v.sqv-v--lib { display: inline-flex; }
}
@supports not selector(:has(*)) { .sqv-switch { display: none; } }

/* the page behind keeps its place; it just cannot scroll while the dialog is open */
html.sqv-lock { overflow: hidden; scrollbar-gutter: stable; }

/* ---------- phones: a full-height sheet ---------- */
@media (max-width: 640px) {
	.sqv { width: 100vw; max-height: none; height: 100%; height: 100dvh; border-radius: 0; }
	.sqv-bar { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "back head x" "acts acts acts" "status status status"; gap: 10px 10px; padding: calc(14px + env(safe-area-inset-top)) 14px 12px 16px; }
	.sqv-acts { justify-content: flex-start; }
	.sqv-body { padding: 18px 16px 22px; }
	.sqv-foot { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
	.sqv-foot > * { flex: 1 1 auto; justify-content: center; }
	.sqv .sqv-full, .sqv .sqv-return { justify-content: center; }
	.sqv-items li { padding: 10px 2px; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
	.sqv[open] { animation: sqv-in .26s cubic-bezier(.2, .7, .2, 1); }
	.sqv[open]::backdrop { animation: sqv-fade .26s ease; }
	.sqv-skel i { animation: sqv-shimmer 1.2s linear infinite; }
	.sqv-body > * { animation: sqv-fade .22s ease; }
	.sqv .sqv-x, .sqv .sqv-full, .sqv .sqv-return { transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), background-color .2s ease, border-color .2s ease; }
	.sqv .sqv-x:hover { transform: rotate(90deg); }
	.sqv .sqv-full:hover, .sqv .sqv-return:hover { transform: translateY(-2px); }
	.sqv-art { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
	.sqv-hero:hover .sqv-art { transform: rotate(-12deg) scale(1.06); }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 640px) {
	.sqv[open] { animation: sqv-up .3s cubic-bezier(.2, .7, .2, 1); }
}
@keyframes sqv-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes sqv-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes sqv-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sqv-shimmer { from { background-position: 200% 0; } to { background-position: 0 0; } }
/* ---------- foods: inside a meal they open in place; the food itself ---------- */
.sqv .sqv-food-link { color: var(--sqv-ink); text-decoration: underline; text-decoration-color: #b9dcae; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.sqv .sqv-food-link:hover, .sqv .sqv-food-link:focus-visible { color: #2f7a34; text-decoration-color: currentColor; }
.sqv-record { margin: 10px 0 0; font-size: 13.5px; color: var(--sqv-muted); }
.sqv-usage { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sqv-usage li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--sqv-soft); border: 1px solid #d5e7cf; }
.sqv-usage li.is-lib { background: #fdf8ee; border-color: #f1e0b8; }
.sqv-usage span { display: grid; gap: 2px; min-width: 0; }
.sqv-usage b { font: 700 14.5px/1.3 var(--sqv-text); color: var(--sqv-ink); }
.sqv-usage small { font-size: 13px; color: var(--sqv-muted); }
.sqv-usage em { flex: none; font-style: normal; font: 650 14px/1.3 var(--sqv-text); color: var(--sqv-ink); font-variant-numeric: tabular-nums; text-align: right; }
.sqv-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.sqv-tiles li { display: grid; gap: 4px; padding: 12px 14px; border-radius: 16px; background: #f8fbf6; border: 1px solid #e3eedf; }
.sqv-tiles span { font: 700 12px/1.2 var(--sqv-text); letter-spacing: .08em; text-transform: uppercase; color: var(--sqv-muted); }
.sqv-tiles b { font: 800 24px/1 var(--sqv-display); letter-spacing: -.02em; color: var(--sqv-ink); font-variant-numeric: tabular-nums; }
.sqv-tiles small { margin-left: 4px; font: 600 13px/1 var(--sqv-text); letter-spacing: 0; color: var(--sqv-muted); }
.sqv-more { margin-top: 18px; border-radius: 16px; border: 1px solid #e3eedf; background: #fbfdfa; }
.sqv-more summary { cursor: pointer; min-height: 48px; padding: 14px 16px; font: 700 14.5px/1.35 var(--sqv-text); color: var(--sqv-ink); }
.sqv-more-body { padding: 0 16px 14px; }
.sqv-group { margin: 12px 0 4px; font: 800 11.5px/1.3 var(--sqv-text); letter-spacing: .1em; text-transform: uppercase; color: var(--sqv-tone-ink); }
.sqv-nlist { display: grid; margin: 0; padding: 0; list-style: none; }
.sqv-nlist li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 2px; border-bottom: 1px solid #edf3ea; font-size: 14.5px; color: var(--sqv-copy); }
.sqv-nlist b { color: var(--sqv-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (min-width: 560px) { .sqv-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } .sqv-tiles li:first-child { grid-column: auto; } }
@media (max-width: 640px) { .sqv-usage li { flex-direction: column; align-items: flex-start; } .sqv-usage em { text-align: left; } }

@media print { .sqv { display: none !important; } }
