/* ==========================================================================
   Food composition database – stylesheet
   Herb green + saffron, Bricolage Grotesque headings, Instrument Sans text.
   Mobile first; breakpoints at 640px, 900px, 1200px.
   ========================================================================== */

@font-face { font-family: "Instrument"; font-weight: 400 700; font-display: swap;
  src: url(../fonts/instrument-sans-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "Instrument"; font-weight: 400 700; font-display: swap;
  src: url(../fonts/instrument-sans-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Bricolage"; font-weight: 200 800; font-display: swap;
  src: url(../fonts/bricolage-grotesque-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "Bricolage"; font-weight: 200 800; font-display: swap;
  src: url(../fonts/bricolage-grotesque-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ink: #1F2A24;
  --ink-2: #4A5A50;
  --ink-3: #6B7A70;
  --paper: #F6F8F4;
  --surface: #FFFFFF;
  --sage: #DCE3D8;
  --sage-2: #EDF1EA;
  --leaf: #2F6B3F;
  --leaf-dark: #22512F;
  --leaf-tint: #E3EFE5;
  --saffron: #E8A317;
  --saffron-tint: #FCF1D9;
  --danger: #B8322B;

  /* traffic light (label only) */
  --tl-green: #3E9B4F;
  --tl-amber: #E8A317;
  --tl-red: #C8423B;
  --tl-grey: #A7B0A9;

  /* chart categorical slots (validated reference order) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4;

  --f-text: "Instrument", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-head: "Bricolage", "Instrument", system-ui, sans-serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --gap: clamp(16px, 3vw, 28px);
  --wrap: 1280px;
  --topbar-h: 60px;
  --focus: 0 0 0 3px #fff, 0 0 0 5px var(--leaf);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 12px); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.55 var(--f-text);
  font-variant-numeric: tabular-nums;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1 0 auto; outline: none; }
img { max-width: 100%; height: auto; }
a { color: var(--leaf); text-underline-offset: 2px; }
a:hover { color: var(--leaf-dark); }
h1, h2, h3, h4 { font-family: var(--f-head); line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.6rem); font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: 1.125rem; font-weight: 650; }
p { margin: 0 0 1em; }
.lead { color: var(--ink-2); font-size: 1.0625rem; max-width: 62ch; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { text-align: right; white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--r-sm); z-index: 100; }
.skip:focus { top: 8px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gap); }
.page { padding-block: clamp(20px, 4vw, 44px) 56px; }
.page-head { margin-bottom: clamp(18px, 3vw, 30px); }
.page-head .row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; }

/* ---------------------------------------------------------------- top bar */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--leaf); color: #fff; }
.topbar-in { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gap); min-height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--f-head);
  font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; margin-right: auto; min-width: 0; }
.brand:hover { color: #fff; }
.brand-logo { max-height: 38px; width: auto; }
.brand-mark { width: 26px; height: 26px; border-radius: 50% 50% 50% 4px; background: var(--saffron); flex: none;
  box-shadow: inset -6px -6px 0 rgba(0,0,0,.12); }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 0; background: transparent; color: #fff; border-radius: var(--r-sm); cursor: pointer; }
.burger, .burger::before, .burger::after { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px;
  position: relative; transition: transform .2s, background .2s; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -7px; } .burger::after { top: 7px; }
.nav-open .burger { background: transparent; }
.nav-open .burger::before { transform: translateY(7px) rotate(45deg); }
.nav-open .burger::after { transform: translateY(-7px) rotate(-45deg); }

.mainnav { position: fixed; inset: var(--topbar-h) 0 auto 0; background: var(--leaf-dark); padding: 8px var(--gap) 20px;
  display: none; max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; box-shadow: 0 12px 24px rgba(20,40,25,.25); }
.nav-open .mainnav { display: block; }
.mainnav ul { list-style: none; margin: 0; padding: 0; }
.mainnav li a { display: block; padding: 12px 4px; color: #fff; text-decoration: none; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.12); }
.mainnav a[aria-current="page"] { color: var(--saffron); }
.nav-side { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding-top: 16px; }
.lang { display: inline-flex; border: 1px solid rgba(255,255,255,.4); border-radius: 999px; overflow: hidden; }
.lang a { color: #fff; text-decoration: none; padding: 6px 12px; font-size: .875rem; font-weight: 700; min-width: 44px; text-align: center; }
.lang a[aria-current="true"] { background: #fff; color: var(--leaf-dark); }
.logout { display: flex; align-items: center; gap: 10px; margin: 0; color: rgba(255,255,255,.85); font-size: .875rem; min-width: 0; }
.who { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { background: none; border: 0; padding: 6px 0; color: #fff; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

@media (min-width: 1100px) {
  .nav-toggle { display: none; }
  .mainnav { position: static; display: flex !important; align-items: center; gap: 20px; padding: 0; background: none;
    box-shadow: none; max-height: none; overflow: visible; }
  .mainnav ul { display: flex; gap: 2px; }
  .mainnav li a { border: 0; padding: 8px 11px; border-radius: var(--r-sm); font-size: .9375rem; color: rgba(255,255,255,.9); }
  .mainnav li a:hover { background: rgba(255,255,255,.1); color: #fff; }
  .mainnav li a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 var(--saffron); border-radius: 0; }
  .nav-side { padding: 0; flex-wrap: nowrap; }
}

/* ---------------------------------------------------------------- buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: var(--r-sm); border: 1px solid transparent; background: var(--leaf); color: #fff; font: 700 .9375rem/1.2 var(--f-text);
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s; }
.btn:hover { background: var(--leaf-dark); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-accent { background: var(--saffron); color: var(--ink); }
.btn-accent:hover { background: #D69210; color: var(--ink); }
.btn-ghost { background: transparent; border-color: currentColor; color: inherit; }
.topbar .btn-ghost { color: #fff; }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-line { background: var(--surface); color: var(--leaf); border-color: var(--sage); }
.btn-line:hover { background: var(--leaf-tint); color: var(--leaf-dark); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #EBC8C5; }
.btn-danger:hover { background: #FBEDEC; color: var(--danger); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .875rem; }
.icon-btn { width: 40px; height: 40px; min-height: 40px; padding: 0; }
.btn svg, .icon-btn svg { width: 18px; height: 18px; flex: none; }

label, .label { display: block; font-weight: 700; font-size: .9375rem; margin-bottom: 6px; color: var(--ink); }
.hint { display: block; font-weight: 400; color: var(--ink-3); font-size: .875rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #C7D1C4; border-radius: var(--r-sm); background: var(--surface);
  color: var(--ink); font: 400 1rem/1.4 var(--f-text); }
textarea { min-height: 110px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%232F6B3F' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(47,107,63,.2); }
input[type=number] { text-align: right; }
.field { margin-bottom: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--leaf); flex: none; }
.form-error { color: var(--danger); font-weight: 700; margin: 8px 0 0; }
.notice { padding: 12px 14px; border-radius: var(--r-sm); background: var(--leaf-tint); color: var(--leaf-dark); border-left: 4px solid var(--leaf); }
.notice.warn { background: var(--saffron-tint); color: #6B4A06; border-color: var(--saffron); }
.notice.error { background: #FBEDEC; color: var(--danger); border-color: var(--danger); }

.search-input { position: relative; }
.search-input svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--ink-3); pointer-events: none; }
.search-input input { padding-left: 42px; }

/* ---------------------------------------------------------------- panels */
.panel { background: var(--surface); border: 1px solid var(--sage); border-radius: var(--r-md); padding: clamp(16px, 2.5vw, 24px); }
.panel + .panel { margin-top: 16px; }
.panel h2, .panel h3 { margin-bottom: 12px; }
.prose { max-width: 70ch; }
.prose li { margin-bottom: .4em; }

/* ---------------------------------------------------------------- food database */
.db-hero { background: var(--leaf); color: #fff; padding: clamp(22px, 4vw, 40px) 0 clamp(26px, 4vw, 44px); }
.db-hero h1 { color: #fff; margin-bottom: 6px; }
.db-hero .lead { color: rgba(255,255,255,.88); margin-bottom: 18px; }
.db-hero .lead { margin-bottom: 0; }
.db-main { padding-block: var(--gap) 56px; }
.db-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.db-toolbar label { margin: 0; }
.db-toolbar select { width: auto; max-width: 100%; min-width: 260px; }
.m-only { display: none !important; }
@media (max-width: 639px) {
  .db-toolbar { display: grid; grid-template-columns: 1fr; }
  .db-toolbar select { min-width: 0; width: 100%; }
  .db-toolbar .m-only { display: block !important; }
}
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--saffron-tint);
  color: #7A5408; margin-left: 6px; vertical-align: 1px; cursor: pointer; line-height: 1.5; }
.badge:hover { background: #F8E3B4; }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-2); background: var(--surface); border: 1px dashed #C7D1C4; border-radius: var(--r-md); }

/* ---------------------------------------------------------------- Tabulator theme */
.food-tab.tabulator { background: var(--surface); border: 1px solid var(--sage); border-radius: var(--r-md); font-size: 1rem; overflow: hidden; }
.food-tab .tabulator-header { background: var(--sage-2); border-bottom: 1px solid var(--sage); color: var(--ink-2); font-weight: 700; }
.food-tab .tabulator-header .tabulator-col { background: transparent; border-right: 0; }
.food-tab .tabulator-header .tabulator-col .tabulator-col-content { padding: 10px 14px; }
.food-tab.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title { font-size: .8125rem; white-space: normal; text-overflow: clip; overflow-wrap: anywhere; }
.food-tab .tabulator-header .tabulator-col.tabulator-sortable:hover { background: var(--leaf-tint); }
.food-tab .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter { color: var(--ink-3); }
.food-tab .sort-ind { display: inline-block; width: 10px; height: 14px; position: relative; }
.food-tab .sort-ind::before, .food-tab .sort-ind::after { content: ""; position: absolute; left: 1px; border: 4px solid transparent; }
.food-tab .sort-ind::before { top: -2px; border-bottom-color: #B7C2B3; }
.food-tab .sort-ind::after { bottom: -2px; border-top-color: #B7C2B3; }
.food-tab .tabulator-col[aria-sort="ascending"] .sort-ind::before { border-bottom-color: var(--leaf); }
.food-tab .tabulator-col[aria-sort="descending"] .sort-ind::after { border-top-color: var(--leaf); }
.food-tab .tabulator-col[aria-sort="ascending"] .tabulator-col-title, .food-tab .tabulator-col[aria-sort="descending"] .tabulator-col-title { color: var(--leaf-dark); }
.food-tab .tabulator-header-filter { margin-top: 8px; }
.food-tab .tabulator-header-filter input, .food-tab .tabulator-header-filter select {
  min-height: 38px !important; padding: 7px 10px !important; border: 1px solid #C7D1C4 !important; border-radius: var(--r-sm) !important;
  background-color: var(--surface) !important; font: 400 .9375rem/1.3 var(--f-text) !important; color: var(--ink); box-sizing: border-box; }
.food-tab .tabulator-header-filter input:focus { border-color: var(--leaf) !important; box-shadow: 0 0 0 3px rgba(47,107,63,.2); outline: none; }
.food-tab .tabulator-col[tabulator-field="val"] .tabulator-header-filter input { text-align: right; }
.food-tab .tabulator-col[tabulator-field="name"] .tabulator-header-filter input { padding-left: 34px !important;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236B7A70' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat 10px center !important; }
.food-tab .tabulator-tableholder .tabulator-table { background: var(--surface); }
.food-tab .tabulator-row { background: var(--surface); border-bottom: 1px solid var(--sage-2); min-height: 56px; cursor: pointer; }
.food-tab .tabulator-row.tabulator-row-even { background: var(--surface); }
.food-tab .tabulator-row:hover, .food-tab .tabulator-row.tabulator-selectable:hover { background: #F4F8F1 !important; }
.food-tab .tabulator-row .tabulator-cell { padding: 12px 14px; border-right: 0; white-space: normal; line-height: 1.35; vertical-align: middle; }
.food-tab .tabulator-cell[tabulator-field="val"] { text-align: right; }
.food-tab .tabulator-cell[tabulator-field="val"] small { display: block; color: var(--ink-3); font-size: .8125rem; }
.food-tab .tabulator-cell[tabulator-field="gcode"] { color: var(--ink-2); font-size: .9375rem; }
.food-tab .fname { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; display: inline; }
.food-tab .tabulator-row:hover .fname { color: var(--leaf); text-decoration: underline; }
.food-tab .m-group { display: none; font-size: .875rem; color: var(--ink-2); margin-top: 2px; }
.food-tab .tabulator-placeholder span { color: var(--ink-2) !important; font-size: 1rem !important; font-weight: 400 !important; padding: 32px 16px !important; white-space: normal; }
.food-tab .tabulator-alert { background: rgba(255,255,255,.7); }
.food-tab .tabulator-alert .tabulator-alert-msg { border: 1px solid var(--sage); border-radius: var(--r-sm); font: 700 .9375rem var(--f-text); color: var(--ink-2); padding: 10px 16px; }
.food-tab .tabulator-footer { background: var(--sage-2); border-top: 1px solid var(--sage); color: var(--ink-2); font-weight: 400; padding: 8px 10px; }
.food-tab .tabulator-footer .tabulator-footer-contents { flex-wrap: wrap; gap: 8px; }
.food-tab .tabulator-footer .tabulator-page-size { min-height: 38px; width: auto; margin: 0 6px 0 4px; padding: 6px 30px 6px 10px; border: 1px solid var(--sage);
  border-radius: var(--r-sm); font: 700 .875rem var(--f-text); color: var(--ink); background-color: var(--surface); }
.food-tab .tabulator-footer .tabulator-paginator > label { font-size: .875rem; font-weight: 400; color: var(--ink-2); align-self: center; margin: 0; }
.food-tab .tabulator-footer .tabulator-page-counter { font-size: .875rem; font-weight: 400; color: var(--ink-2); }
.food-tab .tabulator-footer .tabulator-paginator { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; font-family: var(--f-text); }
.food-tab .tabulator-footer .tabulator-page { min-width: 38px; min-height: 38px; margin: 0; padding: 6px 10px; border: 1px solid var(--sage); border-radius: var(--r-sm);
  background: var(--surface); color: var(--leaf); font: 700 .875rem var(--f-text); }
.food-tab .tabulator-footer .tabulator-page:not(:disabled):hover { background: var(--leaf-tint); color: var(--leaf-dark); }
.food-tab .tabulator-footer .tabulator-page.active { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.food-tab .tabulator-footer .tabulator-page:disabled { opacity: .45; }
@media (max-width: 639px) {
  .food-tab .m-group { display: block; }
  .food-tab .tabulator-footer .tabulator-footer-contents { justify-content: center; }
  .food-tab .tabulator-footer .tabulator-page-counter { width: 100%; text-align: center; }
  .food-tab .tabulator-footer .tabulator-paginator { justify-content: center; flex: 1 1 100%; }
  .food-tab .tabulator-footer .tabulator-page[data-page="first"], .food-tab .tabulator-footer .tabulator-page[data-page="last"] { display: none; }
  /* "Per page" on its own line above the page buttons */
  .food-tab .tabulator-footer .tabulator-paginator > label { order: 0; }
  .food-tab .tabulator-footer .tabulator-page-size { order: 1; }
  .food-tab .tabulator-footer .tabulator-paginator::before { content: ""; order: 2; flex-basis: 100%; height: 4px; }
  .food-tab .tabulator-footer .tabulator-paginator > button, .food-tab .tabulator-footer .tabulator-paginator > span { order: 3; }
}

/* ---------------------------------------------------------------- drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(20,32,24,.45); z-index: 70; opacity: 0; transition: opacity .2s; }
.drawer { position: fixed; z-index: 71; top: 0; right: 0; bottom: 0; width: min(720px, 100%); background: var(--paper);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease; box-shadow: -12px 0 32px rgba(20,32,24,.2); }
.drawer.is-open { transform: none; }
.drawer-backdrop.is-open { opacity: 1; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px var(--gap); background: var(--surface); border-bottom: 1px solid var(--sage); }
.drawer-head h2 { margin: 0; font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); }
.drawer-head .sub { color: var(--ink-3); font-size: .9375rem; margin-top: 4px; }
.drawer-head .icon-btn { margin-left: auto; flex: none; }
.drawer-body { overflow-y: auto; padding: 18px var(--gap) 40px; flex: 1; -webkit-overflow-scrolling: touch; }
.drawer-body .panel { margin-bottom: 14px; }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-backdrop, .burger, .burger::before, .burger::after { transition: none; } }

.food-top { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 14px; }
.food-top.has-img { grid-template-columns: 1fr; }
@media (min-width: 560px) { .food-top.has-img { grid-template-columns: 1fr 180px; } }
.food-photo { border-radius: var(--r-md); overflow: hidden; aspect-ratio: 1; background: var(--sage-2); }
.food-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.big-energy { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.big-energy b { font-family: var(--f-head); font-size: clamp(2.4rem, 2rem + 2vw, 3.2rem); line-height: 1; font-weight: 700; color: var(--leaf); font-variant-numeric: proportional-nums; }
.big-energy span { color: var(--ink-2); }
.macro-row { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; }
.macro-row div { font-size: .9375rem; color: var(--ink-2); }
.macro-row b { display: block; color: var(--ink); font-size: 1.125rem; }

/* traffic-light label – the signature element */
.tl { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.tl-cap { border-radius: 14px 14px 26px 26px; padding: 10px 6px 12px; text-align: center; background: var(--surface);
  border: 2px solid var(--tl-grey); position: relative; overflow: hidden; min-height: 108px; display: flex; flex-direction: column; justify-content: space-between; }
.tl-cap::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 8px; background: var(--tl-grey); }
.tl-cap .n { font-weight: 700; font-size: .8125rem; color: var(--ink-2); margin-top: 6px; line-height: 1.2; }
.tl-cap .v { font-family: var(--f-head); font-weight: 700; font-size: 1.0625rem; line-height: 1.15; }
.tl-cap .p { display: inline-block; align-self: center; font-weight: 700; font-size: .875rem; padding: 2px 9px; border-radius: 999px; background: var(--sage-2); }
.tl-cap.green { border-color: var(--tl-green); } .tl-cap.green::before { background: var(--tl-green); } .tl-cap.green .p { background: var(--tl-green); color: #fff; }
.tl-cap.amber { border-color: var(--tl-amber); } .tl-cap.amber::before { background: var(--tl-amber); } .tl-cap.amber .p { background: var(--tl-amber); color: var(--ink); }
.tl-cap.red { border-color: var(--tl-red); } .tl-cap.red::before { background: var(--tl-red); } .tl-cap.red .p { background: var(--tl-red); color: #fff; }
.tl-cap .state { position: absolute; top: 12px; right: 7px; width: 9px; height: 9px; border-radius: 50%; }
.tl-note { font-size: .8125rem; color: var(--ink-3); margin: 10px 0 0; }

/* segmented bar (energy split) */
.seg { display: flex; gap: 2px; height: 28px; margin: 6px 0 10px; }
.seg span { border-radius: 4px; color: #fff; font-size: .8125rem; font-weight: 700; display: flex; align-items: center; padding-left: 6px;
  overflow: hidden; white-space: nowrap; min-width: 0; }
.seg span.dark { color: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 0; padding: 0; font-size: .875rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend b { color: var(--ink); }

/* single-series horizontal bars */
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: .9375rem; }
.hbars .bar { grid-column: 1 / -1; height: 10px; background: var(--sage-2); border-radius: 5px; overflow: hidden; }
.hbars .bar i { display: block; height: 100%; background: var(--leaf); border-radius: 0 4px 4px 0; }
.hbars b { font-weight: 700; }

/* data tables */
.dtable { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.dtable th, .dtable td { padding: 8px 10px; border-bottom: 1px solid var(--sage-2); text-align: left; vertical-align: top; }
.dtable thead th { font-size: .8125rem; color: var(--ink-2); background: var(--sage-2); border-bottom: 1px solid var(--sage); white-space: normal; vertical-align: bottom; }
.dtable td.num, .dtable th.num { text-align: right; }
.dtable tr.grp th { background: var(--leaf-tint); color: var(--leaf-dark); font-family: var(--f-head); font-size: .9375rem; }
.dtable tfoot td, .dtable tfoot th { font-weight: 700; border-top: 2px solid var(--sage); border-bottom: 0; }
.dtable tr.key td { font-weight: 700; }
.dtable .code { color: var(--ink-3); font-size: .8125rem; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.portion-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.portion-list div { background: var(--sage-2); border-radius: var(--r-sm); padding: 8px 12px; font-size: .875rem; color: var(--ink-2); }
.portion-list b { display: block; color: var(--ink); font-size: 1.0625rem; }

/* ---------------------------------------------------------------- recipes list */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.toolbar .search-input { flex: 1 1 260px; }
.usage { font-size: .875rem; color: var(--ink-2); }
.usage .meter { display: block; width: 160px; height: 8px; background: var(--sage); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.usage .meter i { display: block; height: 100%; background: var(--leaf); border-radius: 4px; }
.rec-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.rec-card { background: var(--surface); border: 1px solid var(--sage); border-radius: var(--r-md); display: flex; flex-direction: column; overflow: hidden; }
.rec-card .top { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; padding: 16px; }
.rec-card .card-icons { display: flex; flex-direction: column; gap: 6px; }
.rec-thumb { width: 76px; height: 76px; border-radius: var(--r-sm); background: var(--sage-2); overflow: hidden; display: grid; place-items: center; color: var(--leaf); }
.rec-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rec-thumb svg { width: 32px; height: 32px; opacity: .55; }
.rec-card h3 { margin: 0 0 4px; font-size: 1.125rem; overflow-wrap: anywhere; }
.rec-card h3 a { color: var(--ink); text-decoration: none; }
.rec-card h3 a:hover { color: var(--leaf); text-decoration: underline; }
.rec-card .meta { font-size: .875rem; color: var(--ink-3); }
.rec-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--sage-2); border-bottom: 1px solid var(--sage-2); }
.rec-stats div { padding: 10px 8px; text-align: center; font-size: .75rem; color: var(--ink-3); }
.rec-stats div + div { border-left: 1px solid var(--sage-2); }
.rec-stats b { display: block; font-size: 1rem; color: var(--ink); }
.rec-card .actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; margin-top: auto; }
.rec-card .actions .btn { flex: 1 1 auto; }

/* ---------------------------------------------------------------- editor */
.editor { display: grid; gap: var(--gap); padding-bottom: 96px; }
@media (min-width: 1000px) {
  .editor { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; padding-bottom: 40px; }
  .editor-side { position: sticky; top: calc(var(--topbar-h) + 16px); }
}
input.name-input { font-family: var(--f-head); font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem) !important; font-weight: 700; border: 0 !important;
  border-bottom: 2px solid var(--sage) !important; border-radius: 0 !important; background: transparent !important; padding: 6px 0 !important; box-shadow: none !important; }
input.name-input:focus { border-bottom-color: var(--leaf) !important; }
.grid-2 { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
details.fold { background: var(--surface); border: 1px solid var(--sage); border-radius: var(--r-md); }
details.fold > summary { list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: ""; margin-left: auto; width: 10px; height: 10px; border-right: 2px solid var(--leaf); border-bottom: 2px solid var(--leaf);
  transform: rotate(45deg); transition: transform .15s; }
details.fold[open] > summary::after { transform: rotate(-135deg); }
details.fold > .fold-body { padding: 0 18px 18px; }

.add-box { background: var(--leaf-tint); border-radius: var(--r-md); padding: 16px; margin-bottom: 16px; }
.add-row { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; align-items: end; }
.add-row .f-food { grid-column: 1 / -1; position: relative; }
.add-row .f-btn { grid-column: 1 / -1; }
@media (min-width: 720px) {
  .add-row { grid-template-columns: minmax(0, 1fr) 110px 110px auto; }
  .add-row .f-food, .add-row .f-btn { grid-column: auto; }
}
.add-row label { font-size: .875rem; }
.picked { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface);
  border: 1px solid var(--leaf); font-weight: 700; }
.picked span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin-top: 4px; background: var(--surface); border: 1px solid var(--sage);
  border-radius: var(--r-md); box-shadow: 0 12px 28px rgba(20,32,24,.16); max-height: 320px; overflow-y: auto; list-style: none; padding: 4px; }
.suggest li { padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.suggest li small { color: var(--ink-3); white-space: nowrap; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--leaf-tint); }
.suggest .none { color: var(--ink-3); cursor: default; }
.group-filter { margin-top: 10px; }
.group-filter summary { cursor: pointer; font-size: .875rem; font-weight: 700; color: var(--leaf-dark); }
.group-filter .opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; margin-top: 8px; }
.group-filter .check { font-size: .875rem; }

.ing-list { list-style: none; margin: 0; padding: 0; }
.ing { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--sage-2); align-items: center; }
.ing:last-child { border-bottom: 0; }
.ing .nm { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.ing .nm:hover { color: var(--leaf); text-decoration: underline; }
.ing .am { font-size: .875rem; color: var(--ink-2); grid-column: 1; }
.ing .am b { color: var(--ink); }
.ing .acts { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; }
.ing.editing { background: var(--saffron-tint); margin: 0 -12px; padding-inline: 12px; border-radius: var(--r-sm); }
.ing-total { display: flex; justify-content: flex-end; gap: 18px; font-size: .9375rem; padding-top: 12px; border-top: 2px solid var(--sage); }

.nut-card .nut-big { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.nut-card .nut-big b { font-family: var(--f-head); font-size: 2.6rem; line-height: 1; color: var(--leaf); font-variant-numeric: proportional-nums; }
.nut-card table { width: 100%; border-collapse: collapse; font-size: .9375rem; margin: 10px 0; }
.nut-card th, .nut-card td { padding: 6px 0; border-bottom: 1px solid var(--sage-2); }
.nut-card th { text-align: left; font-weight: 400; color: var(--ink-2); }
.nut-card thead th { font-size: .8125rem; }
.nut-card td { text-align: right; font-weight: 700; }
.nut-card .totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: .875rem; color: var(--ink-2); margin: 8px 0 14px; }
.nut-card .totals b { color: var(--ink); text-align: right; }
.nut-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-box { margin-top: 14px; }
.photo-box .ph { aspect-ratio: 4 / 3; border-radius: var(--r-md); background: var(--sage-2); overflow: hidden; display: grid; place-items: center; color: var(--ink-3);
  margin-bottom: 8px; }
.photo-box .ph img { width: 100%; height: 100%; object-fit: cover; }

.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--sage);
  padding: 10px var(--gap) calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px; align-items: center; }
.savebar .state { flex: 1; font-size: .875rem; color: var(--ink-3); min-width: 0; }
.savebar .state.dirty { color: #7A5408; font-weight: 700; }
@media (min-width: 1000px) {
  .savebar { position: static; padding: 0; border: 0; background: none; margin-top: 14px; flex-wrap: wrap; }
  .savebar .state { flex-basis: 100%; }
  .savebar .btn { flex: 1; }
}

/* ---------------------------------------------------------------- detail & label pages */
.rec-hero { display: grid; gap: var(--gap); margin-bottom: var(--gap); }
@media (min-width: 800px) { .rec-hero.has-img { grid-template-columns: minmax(0, 1fr) 280px; } }
.rec-hero .photo { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 1; }
.rec-hero .photo img { width: 100%; height: 100%; object-fit: cover; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.facts dt { font-weight: 700; color: var(--ink-2); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.two-col { display: grid; gap: 16px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; } }
.two-col > .panel + .panel { margin-top: 0; }
.draft-flag { display: inline-block; background: var(--saffron-tint); color: #7A5408; font-weight: 700; padding: 4px 10px; border-radius: 999px; font-size: .875rem; margin-bottom: 10px; }
.ri { color: #7A5408; }

.label-opts { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.label-sheet { background: var(--surface); border: 1px solid var(--ink); border-radius: var(--r-sm); padding: clamp(16px, 3vw, 28px); max-width: 820px; }
.label-sheet h2 { font-size: 1.6rem; border-bottom: 3px solid var(--ink); padding-bottom: 8px; }
.label-sheet section { padding: 12px 0; border-bottom: 1px solid var(--sage); }
.label-sheet section:last-child { border-bottom: 0; }
.label-sheet h3 { font-size: 1rem; margin-bottom: 6px; }
.qr-row { display: flex; gap: 16px; align-items: center; }
.qr-row img { width: 120px; height: 120px; image-rendering: pixelated; }

/* ---------------------------------------------------------------- misc pages */
.auth { max-width: 460px; margin: 0 auto; }
.auth .panel { padding: clamp(20px, 4vw, 32px); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: .875rem; margin: 22px 0 14px; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--sage); flex: 1; }
.contact-grid { display: grid; gap: var(--gap); }
@media (min-width: 860px) { .contact-grid { grid-template-columns: 300px minmax(0, 1fr); align-items: start; } }
.contact-card dl { margin: 0; display: grid; gap: 12px; }
.contact-card dt { font-size: .8125rem; color: var(--ink-3); }
.contact-card dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.hp { position: absolute; left: -9999px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.toc a { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--sage); text-decoration: none; font-size: .875rem; font-weight: 700; }

/* ---------------------------------------------------------------- footer & toast */
.footer { background: var(--ink); color: rgba(255,255,255,.8); margin-top: auto; font-size: .875rem; }
.footer-in { max-width: var(--wrap); margin: 0 auto; padding: 22px var(--gap) calc(22px + env(safe-area-inset-bottom)); }
.footer a { color: #fff; }
.footer-row { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.footer-row p { margin: 0; }
.partners-band { background: var(--surface); border-top: 1px solid var(--sage); padding: 28px 0 32px; }
.partners-band h2 { font-size: 1rem; font-weight: 650; color: var(--ink-2); text-align: center; margin-bottom: 18px; }
.partners { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 20px 40px; }
.partners a { display: grid; place-items: center; height: 64px; padding: 6px; border-radius: var(--r-sm); }
.partners a:hover { background: var(--sage-2); }
.partners img { max-height: 56px; max-width: 180px; width: auto; height: auto; object-fit: contain; }
@media (max-width: 639px) {
  .partners { gap: 16px 24px; }
  .partners a { height: 52px; }
  .partners img { max-height: 44px; max-width: 130px; }
}
body.has-savebar .footer { padding-bottom: 70px; }
@media (min-width: 1000px) { body.has-savebar .footer { padding-bottom: 0; } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: var(--r-md); box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100% - 32px); font-weight: 700; }
.toast.error { background: var(--danger); }
body.has-savebar .toast { bottom: 84px; }

.modal { border: 0; border-radius: var(--r-lg); padding: 0; max-width: min(440px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--ink); }
.modal::backdrop { background: rgba(20,32,24,.5); }
.modal .m-body { padding: 22px 22px 8px; }
.modal .m-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 22px 20px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- print */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 11pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .topbar, .footer, .no-print, .toast, .skip, .savebar { display: none !important; }
  .page { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .panel, .label-sheet { border: 0; padding: 0; }
  .label-sheet { border: 1px solid #000; padding: 6mm; }
  .p-off { display: none !important; }
  a { color: inherit; text-decoration: none; }
}

/* label section toggles: dimmed on screen, removed when printing */
@media screen { .p-off { opacity: .28; } }

/* temporary image diagnostics (DEBUG_IMAGES) */
.img-debug { border: 2px dashed var(--saffron); background: var(--saffron-tint); }
.img-debug dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: .8125rem; }
.img-debug dt { font-weight: 700; color: var(--ink-2); }
.img-debug dd { margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.img-debug dd.bad { color: var(--danger); font-weight: 700; }

.partners-band h2:empty { display: none; }
.brand-mark-img { width: 28px; height: 28px; object-fit: contain; flex: none; }
.group-tools { display: flex; gap: 16px; margin: 8px 0 4px; }
.link-act { background: none; border: 0; padding: 4px 0; font: 700 .875rem var(--f-text); color: var(--leaf); text-decoration: underline; cursor: pointer; }
.link-act:hover { color: var(--leaf-dark); }
.suggest li { align-items: center; }
.suggest li .s-name { flex: 1; min-width: 0; }
.suggest li .s-info { flex: none; background: var(--surface); border: 1px solid var(--sage); border-radius: var(--r-sm); padding: 4px 10px;
  font: 700 .8125rem var(--f-text); color: var(--leaf); cursor: pointer; }
.suggest li .s-info:hover { background: var(--leaf); color: #fff; border-color: var(--leaf); }
.drawer-action { display: flex; justify-content: flex-end; margin-bottom: 14px; }

/* ---------------------------------------------------------------- stacked tables (rec_detail on phones / small tablets) */
.su { display: none; }
@media screen and (max-width: 900px) {
  .dtable.stack, .dtable.stack tbody, .dtable.stack tfoot, .dtable.stack tr, .dtable.stack td, .dtable.stack th { display: block; }
  .dtable.stack thead { display: none; }
  .dtable.stack tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 14px; padding: 10px 0; border-bottom: 1px solid var(--sage-2); }
  .dtable.stack td, .dtable.stack th { padding: 0; border: 0; text-align: left !important; white-space: normal; }
  .dtable.stack .c-name { grid-column: 1 / -1; font-weight: 700; color: var(--ink); }
  .dtable.stack td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 400; color: var(--ink-3); line-height: 1.3; }
  .dtable.stack td:empty, .dtable.stack .c-unit, .dtable.stack .c-empty { display: none; }
  .dtable.stack .su { display: inline; }
  .dtable.stack tr.grp { display: block; padding: 0; border: 0; margin-top: 10px; }
  .dtable.stack tr.grp th { padding: 8px 10px; border-radius: var(--r-sm); }
  .dtable.stack tfoot tr { border-top: 2px solid var(--sage); border-bottom: 0; }
  .dtable.stack tfoot td, .dtable.stack tfoot th { border: 0; }
  .dtable.stack tr.key { background: transparent; }
}
@media screen and (max-width: 480px) {
  .dtable.stack tr { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 10px; }
  .dtable.stack td { font-size: .9375rem; }
  .dtable.stack td[data-label]::before { font-size: .6875rem; }
}

/* ---------------------------------------------------------------- print: tables fit the page */
@media print {
  .table-scroll { overflow: visible !important; }
  .dtable { font-size: 8.5pt; width: 100%; }
  .dtable th, .dtable td { padding: 3px 5px; }
  .dtable thead th { font-size: 8pt; white-space: normal; }
  .dtable td.num { white-space: nowrap; }
  .dtable tr { break-inside: avoid; page-break-inside: avoid; }
  .dtable thead { display: table-header-group; }
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
  .panel { break-inside: auto; }
  .two-col { display: grid !important; grid-template-columns: 1fr 1fr; gap: 6mm; }
  .rec-hero.has-img { grid-template-columns: 1fr 45mm; }
  .facts { font-size: 10pt; }
}

/* ---------------------------------------------------------------- instructions page */
.help-head { margin-bottom: clamp(18px, 3vw, 30px); }
.help-layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
.help-toc, .help-body { min-width: 0; }
.help-toc ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.help-toc a { display: block; white-space: nowrap; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--sage);
  text-decoration: none; font-size: .875rem; font-weight: 700; color: var(--leaf-dark); }
.help-toc a[aria-current="true"] { background: var(--leaf); border-color: var(--leaf); color: #fff; }
@media (min-width: 1000px) {
  .help-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 48px; align-items: start; }
  .help-toc { position: sticky; top: calc(var(--topbar-h) + 20px); }
  .help-toc ol { flex-direction: column; gap: 2px; overflow: visible; border-left: 2px solid var(--sage); padding: 0; }
  .help-toc a { border: 0; border-radius: 0; background: none; padding: 7px 14px; margin-left: -2px; border-left: 2px solid transparent; font-weight: 400; color: var(--ink-2); white-space: normal; }
  .help-toc a:hover { color: var(--leaf); }
  .help-toc a[aria-current="true"] { background: none; color: var(--leaf-dark); font-weight: 700; border-left-color: var(--leaf); }
}
.help-body section { padding-top: 8px; margin-bottom: 44px; scroll-margin-top: calc(var(--topbar-h) + 16px); }
.help-body section + section { border-top: 1px solid var(--sage); padding-top: 36px; }
.help-body h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.85rem); margin-bottom: 12px; }
.help-body h3 { margin: 22px 0 8px; }
.help-body p, .help-body li, .help-body dd { max-width: 72ch; }
.help-body ul { padding-left: 1.2em; }
.help-body li { margin-bottom: .45em; }
.help-body code { background: var(--sage-2); padding: 1px 6px; border-radius: 4px; font-size: .9em; }
.help .badge { cursor: default; }
.split { display: grid; gap: 4px 32px; align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1fr) minmax(280px, 46%); } .split > .shot { margin-top: 6px; } }
.shot { margin: 16px 0 22px; }
.shot a { display: block; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--sage); background: var(--surface);
  box-shadow: 0 1px 2px rgba(31,42,36,.06), 0 8px 24px rgba(31,42,36,.06); }
.shot a:focus-visible { box-shadow: var(--focus); }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { font-size: .875rem; color: var(--ink-3); margin-top: 8px; }
.shot.narrow { max-width: 380px; }
.shot.phone { max-width: 260px; }
.shot.phone a { border-radius: 26px; border: 8px solid var(--ink); }
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 12px 0 0; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 46px; margin-bottom: 18px; max-width: none; }
@media (max-width: 639px) { ol.steps > li { padding-left: 40px; } ol.steps > li .shot { margin-left: -40px; } }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: -1px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--leaf); color: #fff; font: 700 .9375rem/30px var(--f-head); text-align: center; }
ol.steps > li > h3 { margin-top: 2px; }
ol.steps > li > h3 + p { margin-top: 0; }
.tl-word { display: inline-block; padding: 0 8px; border-radius: 999px; font-weight: 700; font-size: .875em; }
.tl-word.green { background: var(--tl-green); color: #fff; }
.tl-word.amber { background: var(--tl-amber); color: var(--ink); }
.tl-word.red { background: var(--tl-red); color: #fff; }
.calc-list { display: grid; gap: 6px 22px; margin: 0; }
@media (min-width: 700px) { .calc-list { grid-template-columns: 190px minmax(0, 1fr); } }
.calc-list dt { font-weight: 700; color: var(--leaf-dark); }
.calc-list dd { margin: 0 0 8px; }
.help-end { font-family: var(--f-head); font-size: 1.125rem; font-weight: 650; color: var(--leaf-dark); margin-top: 26px; }

/* guest time limit on the food database */
.guest-note { margin: 0 0 10px; font-size: .88rem; color: var(--ink-3); }
.guest-note a { font-weight: 600; }
body.guest-locked .db-hero, body.guest-locked .db-main { filter: blur(6px); pointer-events: none; user-select: none; }
.guest-lock { position: fixed; inset: 0; z-index: 35; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(20,32,24,.35); }
.guest-lock[hidden] { display: none; }
.guest-card { background: var(--surface); color: var(--ink); border-radius: var(--r-lg, 16px); box-shadow: 0 20px 60px rgba(0,0,0,.3);
  max-width: 440px; width: 100%; padding: 26px 24px 22px; text-align: center; }
.guest-card h2 { margin: 6px 0 8px; font-size: 1.35rem; }
.guest-card p { margin: 0 0 18px; }
.guest-icon { width: 52px; height: 52px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--leaf); color: #fff; }
.guest-icon svg { width: 28px; height: 28px; }
.guest-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* contact: phone / e-mail revealed on click */
.reveal-row { display: flex; gap: 12px; margin-top: 16px; }
.reveal-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--leaf); color: #fff; transition: background .15s, transform .15s; }
.reveal-btn:hover, .reveal-btn:focus-visible { background: var(--leaf-dark); transform: translateY(-1px); }
.reveal-btn.on { background: var(--leaf-dark); }
.reveal-btn svg { width: 24px; height: 24px; }
.reveal-out { margin: 12px 0 0; display: grid; gap: 6px; font-weight: 700; overflow-wrap: anywhere; }
.reveal-out:empty { display: none; }

/* back-to-top button */
.to-top { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 45;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--leaf); color: #fff; box-shadow: 0 6px 18px rgba(20,32,24,.28); opacity: .92;
  transition: background .15s, transform .15s, opacity .15s; }
.to-top:hover, .to-top:focus-visible { background: var(--leaf-dark); opacity: 1; transform: translateY(-2px); }
.to-top[hidden] { display: none; }
.to-top svg { width: 22px; height: 22px; }
.to-top.in-drawer { position: absolute; z-index: 2; }
body.has-savebar .to-top:not(.in-drawer) { bottom: 84px; }
body.guest-locked .to-top { display: none; }
@media print { .to-top { display: none !important; } }
