@font-face { font-family: "Fraunces"; font-weight: 400; font-style: normal; src: url(fonts/fraunces-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Fraunces"; font-weight: 400; font-style: normal; src: url(fonts/fraunces-latin-ext-400-normal.woff2) format("woff2"); 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: "Fraunces"; font-weight: 400; font-style: normal; src: url(fonts/fraunces-vietnamese-400-normal.woff2) format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Fraunces"; font-weight: 400; font-style: italic; src: url(fonts/fraunces-latin-400-italic.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Fraunces"; font-weight: 400; font-style: italic; src: url(fonts/fraunces-latin-ext-400-italic.woff2) format("woff2"); 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: "Fraunces"; font-weight: 400; font-style: italic; src: url(fonts/fraunces-vietnamese-400-italic.woff2) format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Fraunces"; font-weight: 600; font-style: normal; src: url(fonts/fraunces-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Fraunces"; font-weight: 600; font-style: normal; src: url(fonts/fraunces-latin-ext-600-normal.woff2) format("woff2"); 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: "Fraunces"; font-weight: 600; font-style: normal; src: url(fonts/fraunces-vietnamese-600-normal.woff2) format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Fraunces"; font-weight: 700; font-style: normal; src: url(fonts/fraunces-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Fraunces"; font-weight: 700; font-style: normal; src: url(fonts/fraunces-latin-ext-700-normal.woff2) format("woff2"); 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: "Fraunces"; font-weight: 700; font-style: normal; src: url(fonts/fraunces-vietnamese-700-normal.woff2) format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-style: normal; src: url(fonts/source-sans-3-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-style: normal; src: url(fonts/source-sans-3-latin-ext-400-normal.woff2) format("woff2"); 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: "Source Sans 3"; font-weight: 400; font-style: normal; src: url(fonts/source-sans-3-vietnamese-400-normal.woff2) format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-style: italic; src: url(fonts/source-sans-3-latin-400-italic.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-style: italic; src: url(fonts/source-sans-3-latin-ext-400-italic.woff2) format("woff2"); 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: "Source Sans 3"; font-weight: 400; font-style: italic; src: url(fonts/source-sans-3-vietnamese-400-italic.woff2) format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-style: normal; src: url(fonts/source-sans-3-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-style: normal; src: url(fonts/source-sans-3-latin-ext-600-normal.woff2) format("woff2"); 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: "Source Sans 3"; font-weight: 600; font-style: normal; src: url(fonts/source-sans-3-vietnamese-600-normal.woff2) format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-style: normal; src: url(fonts/source-sans-3-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-style: normal; src: url(fonts/source-sans-3-latin-ext-700-normal.woff2) format("woff2"); 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: "Source Sans 3"; font-weight: 700; font-style: normal; src: url(fonts/source-sans-3-vietnamese-700-normal.woff2) format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }

/* ================================================================ tokens */
:root {
  --bg: #F7F3EC;
  --surface: #FFFFFF;
  --sunk: #EFE9DF;
  --ink: #1F1A15;
  --ink-2: #4A4038;
  --muted: #877B6E;
  --line: #E6DED2;
  --line-2: #D8CEC0;
  --accent: #B8432A;
  --accent-2: #9C3520;
  --on-accent: #FFFFFF;
  --veg: #4F7A35;
  --gf: #A07020;
  --warn: #B8432A;
  --cc: #B8432A;
  --kc: #888;
  --shadow-1: 0 1px 2px rgba(40, 28, 15, .06);
  --shadow-2: 0 2px 6px rgba(40, 28, 15, .06), 0 10px 28px rgba(40, 28, 15, .10);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Source Sans 3", system-ui, -apple-system, sans-serif;
  --r: 14px;
  --r-s: 10px;
  --pad: 1.125rem;
  --bar: 3.5rem;
  color-scheme: light;
}
html.dark {
  --bg: #15120F;
  --surface: #211C17;
  --sunk: #1B1713;
  --ink: #F2EADF;
  --ink-2: #D2C6B6;
  --muted: #9C8F80;
  --line: #332B24;
  --line-2: #43392F;
  --accent: #E27A5B;
  --accent-2: #F08E70;
  --on-accent: #1A1411;
  --veg: #9CC27A;
  --gf: #DDB062;
  --shadow-1: none;
  --shadow-2: 0 10px 30px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
html.size-large { font-size: 19px; }
html.size-xl { font-size: 21px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--sans); font-size: 1rem; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; }
body.cooking { overflow: hidden; }
html, body { overflow-x: clip; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }
svg { width: 1.25rem; height: 1.25rem; fill: currentColor; flex: none; display: block; }
a { color: var(--accent); }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
.view { max-width: 46rem; margin: 0 auto; }

/* ================================================================ shared controls */
.icon-btn {
  position: relative; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); flex: none;
}
.icon-btn svg { width: 1.4rem; height: 1.4rem; }
.icon-btn:active { background: var(--sunk); }
.icon-btn.on { color: var(--cc); background: color-mix(in srgb, var(--cc) 12%, transparent); }
.icon-btn b {
  position: absolute; top: .3rem; right: .2rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem;
  border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .7rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--bg);
}
.primary-btn {
  height: 3.25rem; padding: 0 1.6rem; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 1.02rem; letter-spacing: .01em; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem; text-align: center;
  box-shadow: 0 2px 0 var(--accent-2) inset, 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .12s ease, opacity .12s ease;
}
.primary-btn:active { transform: scale(.97); }
.primary-btn:disabled { background: var(--line-2); color: var(--muted); box-shadow: none; }
.primary-btn svg { width: 1.15rem; height: 1.15rem; }
.primary-btn.small { height: 2.75rem; font-size: .95rem; padding: 0 1.3rem; }
.primary-btn.wide { width: 100%; }
.ghost-btn {
  height: 3.25rem; padding: 0 1.25rem; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--surface);
  font-weight: 700; font-size: 1rem; color: var(--ink-2); line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.ghost-btn:active { background: var(--sunk); }
.ghost-btn.round { width: 3.25rem; padding: 0; flex: none; }
.ghost-btn.round svg { width: 1.35rem; height: 1.35rem; }
.ghost-btn:disabled { opacity: .4; }
.link-btn { height: 2rem; padding: 0 .2rem; color: var(--accent); font-weight: 700; font-size: .88rem; display: inline-flex; align-items: center; }
.seg { display: inline-flex; background: var(--sunk); border-radius: 999px; padding: 3px; gap: 2px; border: 1px solid var(--line); }
.seg button {
  height: 2.25rem; padding: 0 .95rem; border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; flex: 1; white-space: nowrap; line-height: 1;
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.seg.small button { height: 2rem; padding: 0 .75rem; font-size: .85rem; }
.scroller { display: flex; gap: .45rem; overflow-x: auto; scrollbar-width: none; padding: 0 var(--pad); }
.scroller::-webkit-scrollbar { display: none; }

/* ================================================================ home */
/* cover */
.cover {
  position: relative; overflow: hidden; color: #FFFFFF;
  padding: calc(env(safe-area-inset-top) + .7rem) var(--pad) 3.1rem;
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(var(--cv-glow, 255, 196, 140), .30), transparent 60%),
    linear-gradient(165deg, var(--cv1, #C9573A) 0%, var(--cv2, #A63A22) 55%, var(--cv3, #7E2A18) 100%);
}
html.dark .cover {
  color: #FFFFFF;
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(var(--cv-glow, 255, 170, 120), .14), transparent 60%),
    linear-gradient(165deg, var(--cv1, #6A2A1A) 0%, var(--cv2, #4A1C11) 60%, var(--cv3, #2E120B) 100%);
}
.cover-art { position: absolute; inset: 0; color: #FFFFFF; opacity: .12; pointer-events: none; }
.cover-art svg { width: 100%; height: 100%; }
html.dark .cover-art { opacity: .12; }
.cover-in { position: relative; }
.brand-row { display: flex; align-items: center; justify-content: space-between; height: 2.9rem; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.75rem; letter-spacing: -.03em; line-height: 1; }
.brand-d { color: var(--cover-hi, #FFD7A8); }
.top-actions { display: flex; gap: .1rem; margin-right: -.55rem; }
.cover .icon-btn { color: inherit; }
.cover .icon-btn:active { background: rgba(255, 255, 255, .14); }
.cover .icon-btn b { background: var(--cover-hi, #FFD7A8); color: var(--cv3, #6A2414); box-shadow: none; }
.cover-title {
  margin: 1.5rem 0 .55rem; font-family: var(--serif); font-weight: 600; font-size: 2.15rem; line-height: 1.04; letter-spacing: -.02em;
  text-wrap: balance;
}
.tagline { margin: 0; color: rgba(255, 255, 255, .9); font-size: .92rem; font-weight: 600; }
.search-wrap { position: relative; z-index: 2; margin: -1.6rem var(--pad) 0; }
.search-wrap .search { box-shadow: var(--shadow-2); border-color: transparent; height: 3.25rem; }
.search {
  display: flex; align-items: center; gap: .6rem; height: 3.1rem; padding: 0 .4rem 0 1rem;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-1);
}
.search:focus-within { border-color: var(--ink-2); }
.search > svg { color: var(--muted); }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 1rem;
}
.search input::placeholder { color: var(--muted); text-overflow: ellipsis; }
.search input { text-overflow: ellipsis; }
.search input::-webkit-search-cancel-button { display: none; }
.q-clear { width: 2.3rem; height: 2.3rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: var(--sunk); }
.q-clear svg { width: 1.05rem; height: 1.05rem; }

#home-body { padding: .6rem 0 7.5rem; }
.block { padding: 1.15rem var(--pad) 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; height: 2rem; margin-bottom: .55rem; }
.block-head h3, .fgroup h4 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--muted);
}
.fgroup h4 { margin-bottom: .6rem; }
.block-note { color: var(--muted); font-size: .85rem; }
.hint { color: var(--muted); font-size: .9rem; margin: -.3rem 0 .6rem; }
.hint.boxed { margin: 0; padding: .85rem 1rem; border: 1.5px dashed var(--line-2); border-radius: var(--r); text-align: center; }

/* cuisine cards: equal size, everything centred on one axis */
.cuisines { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.cuisine {
  position: relative; min-height: 4.4rem; padding: .45rem min(1rem, 3.2vw) .45rem min(.85rem, 3.2vw); border-radius: var(--r);
  background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow-1);
  display: flex; align-items: center; gap: min(.7rem, 2.6vw); overflow: hidden; transition: border-color .15s, background .15s;
}
.flag {
  width: min(1.95rem, 7.5vw); height: min(1.3rem, 5vw); flex: none; display: block; border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.14), 0 1px 3px rgba(0,0,0,.12);
}
.flag-none { background: var(--cc); }
.cuisine-text { display: flex; flex-direction: column; justify-content: center; min-width: 0; flex: 1; gap: .12rem; }
.cuisine-text b { font-family: var(--serif); font-weight: 600; font-size: min(1.14rem, 4.7vw); overflow-wrap: break-word; line-height: 1.1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.cuisine-text b.long { font-size: min(1.02rem, 4.1vw); }
.cuisine-text b.xlong { font-size: min(.94rem, 3.6vw); letter-spacing: -.01em; }
.cuisine-text b.xxlong { font-size: min(.86rem, 3.25vw); letter-spacing: -.02em; }  /* 5.5: a hyphenated 11+ letter word that must not break ("Sub-Saharan") */  /* an 11+ letter word ("Philippines") */  /* labels with a 9+ letter word ("Indonesia") keep whole words */
.cuisine-text small { font-size: min(.8rem, 3.7vw); color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }
.cuisine-check {
  position: absolute; top: .3rem; left: .3rem; width: 1.15rem; height: 1.15rem; border-radius: 50%;
  display: none; align-items: center; justify-content: center; color: #fff; background: var(--cc);
}
.cuisine-check svg { width: .8rem; height: .8rem; }
.cuisine.on .cuisine-check { display: inline-flex; }
.cuisine.on { border-color: var(--cc); background: color-mix(in srgb, var(--cc) 8%, var(--surface)); }
.cuisine.on .cuisine-text b { color: color-mix(in srgb, var(--cc) 75%, var(--ink)); }
/* narrow phones (wider ones with large text): flag above the name, so long names ("Indonesia & Malaysia") keep whole words */
@media (max-width: 370px) {
  .cuisine { flex-direction: column; align-items: flex-start; justify-content: center; gap: .3rem; padding-top: .55rem; padding-bottom: .55rem; }
  .cuisine-text { width: 100%; flex: none; }
}
@media (max-width: 400px) {
  .size-large .cuisine { flex-direction: column; align-items: flex-start; justify-content: center; gap: .3rem; padding-top: .55rem; padding-bottom: .55rem; }
  .size-large .cuisine-text { width: 100%; flex: none; }
}
@media (max-width: 430px) {
  .size-xl .cuisine { flex-direction: column; align-items: flex-start; justify-content: center; gap: .3rem; padding-top: .55rem; padding-bottom: .55rem; }
  .size-xl .cuisine-text { width: 100%; flex: none; }
}
.cuisine.dim { opacity: .45; }
.cuisine:active { transform: scale(.985); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  height: 2.4rem; padding: 0 .95rem; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line);
  font-weight: 600; font-size: .92rem; color: var(--ink-2); line-height: 1; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
}
.chip em { font-style: normal; font-size: .78rem; color: var(--muted); font-weight: 700; min-width: 1.1rem; text-align: center; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip.on em { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.chip.dim { opacity: .4; }
.chip.no.on { background: var(--warn); border-color: var(--warn); color: #fff; }
.chip-x { display: inline-flex; margin-left: -.2rem; }
.chip-x svg { width: .95rem; height: .95rem; }

/* region checklist */
.checklist { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: .6rem; box-shadow: var(--shadow-1); }
.checklist-head { display: flex; align-items: center; gap: .55rem; height: 2.6rem; padding: 0 1rem; font-weight: 700; font-size: .9rem; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--cc) 6%, var(--surface)); }
.dot { width: .62rem; height: .62rem; border-radius: 50%; background: var(--cc); flex: none; display: inline-block; }
.check { width: 100%; min-height: 3rem; padding: .45rem 1rem; display: flex; align-items: center; gap: .8rem; border-top: 1px solid var(--line); }
.checklist-head + .check { border-top: 0; }
.check .box { width: 1.35rem; height: 1.35rem; border-radius: 6px; border: 1.75px solid var(--line-2); flex: none; display: inline-flex; align-items: center; justify-content: center; color: transparent; }
.check .box svg { width: .95rem; height: .95rem; }
.check.on .box { background: var(--cc); border-color: var(--cc); color: #fff; }
.check-label { flex: 1; font-weight: 600; font-size: .96rem; line-height: 1.25; }
.check em { font-style: normal; color: var(--muted); font-weight: 700; font-size: .82rem; }
.check:active { background: var(--sunk); }
.check.more { justify-content: center; color: var(--accent); font-weight: 700; font-size: .9rem; gap: .35rem; }
.check.more i { display: inline-flex; }
.check.more i.up { transform: rotate(180deg); }

/* facet tiles: equal buttons in two columns; the options open under the tapped row */
.facets { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.ftile { position: relative; min-width: 0; }
.ftile-btn {
  width: 100%; height: 100%; min-height: 5.3rem; padding: .75rem .85rem .7rem; border-radius: var(--r);
  background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: .45rem;
  transition: transform .12s ease;
}
.ftile-btn:active { transform: scale(.985); }
.ftile-ic {
  width: 2.15rem; height: 2.15rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: var(--fc); background: color-mix(in srgb, var(--fc) 13%, transparent);
}
html.dark .ftile-ic { color: color-mix(in srgb, var(--fc) 55%, #fff); background: color-mix(in srgb, var(--fc) 26%, transparent); }
.si { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ftile-text { display: flex; flex-direction: column; gap: .05rem; min-width: 0; width: 100%; }
.ftile-text b { font-family: var(--serif); font-weight: 600; font-size: 1.02rem; line-height: 1.15; }
.ftile-text small {
  font-size: .84rem; font-weight: 600; color: var(--muted); line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ftile.set .ftile-btn { border-color: color-mix(in srgb, var(--fc) 55%, var(--line)); background: color-mix(in srgb, var(--fc) 7%, var(--surface)); }
.ftile.set .ftile-text small { color: color-mix(in srgb, var(--fc) 80%, var(--ink)); }
html.dark .ftile.set .ftile-text small { color: color-mix(in srgb, var(--fc) 50%, #fff); }
.ftile.set .ftile-ic { background: var(--fc); color: #fff; }
.ftile.open .ftile-btn { border-color: var(--fc); box-shadow: 0 0 0 1.5px var(--fc); }
.ftile-chev { position: absolute; top: .95rem; right: .8rem; color: var(--muted); display: inline-flex; transition: transform .2s; pointer-events: none; }
.ftile-chev svg { width: 1.1rem; height: 1.1rem; }
.ftile.open .ftile-chev { transform: rotate(180deg); color: var(--fc); }
.ftile-x {
  position: absolute; top: .45rem; right: .45rem; width: 2rem; height: 2rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted);
}
.ftile-x svg { width: 1rem; height: 1rem; }
.ftile-x:active { background: var(--sunk); }
.fpanel {
  grid-column: 1 / -1; position: relative; margin-top: .25rem;
  background: var(--surface); border: 1.5px solid var(--fc); border-radius: var(--r); box-shadow: var(--shadow-2);
  animation: fpanel-in .18s ease-out;
}
.fpanel::before {
  content: ""; position: absolute; top: -.5rem; left: calc(var(--notch, 25%) - .5rem); width: .9rem; height: .9rem; transform: rotate(45deg);
  background: var(--surface); border-left: 1.5px solid var(--fc); border-top: 1.5px solid var(--fc);
}
@keyframes fpanel-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.fpanel-body { padding: 1rem 1rem .4rem; }
.fpanel-body .fgroup + .fgroup { margin-top: 1rem; }
.fpanel-body .cuisines { margin-bottom: .8rem; }
.fpanel-body .hint { margin: .8rem 0 .2rem; font-size: .86rem; line-height: 1.4; }
.fpanel-body .hint.first { margin: 0 0 .8rem; }
.fpanel-foot { display: flex; align-items: center; justify-content: space-between; padding: .2rem .7rem .7rem 1rem; }
.done-btn {
  height: 2.6rem; padding: 0 1.4rem; border-radius: 999px; font-weight: 700; font-size: .95rem; line-height: 1;
  background: var(--ink); color: var(--bg); display: inline-flex; align-items: center;
}
.checklist-head small { margin-left: auto; color: var(--muted); font-weight: 600; font-size: .8rem; }
.fpanel .checklist { box-shadow: none; }

/* floating dock: centred action */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: center; gap: .6rem;
  padding: 1.6rem var(--pad) calc(env(safe-area-inset-bottom) + 1rem);
  background: linear-gradient(to bottom, transparent, var(--bg) 45%);
  pointer-events: none;
}
.dock > * { pointer-events: auto; }
.dock .primary-btn { flex: 0 1 22rem; min-width: 0; }
.dock .primary-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body:not([data-view=home]) .dock { display: none; }

/* ================================================================ bars */
.bar {
  position: sticky; top: 0; z-index: 15; height: calc(var(--bar) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) .35rem 0;
  display: flex; align-items: center; gap: .25rem; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.bar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.bar-title h2 { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#count { color: var(--muted); font-size: .8rem; font-weight: 600; line-height: 1.2; }
.list-bar { border-bottom: 1px solid transparent; }
body.scrolled .list-bar { border-bottom-color: var(--line); }

/* ================================================================ list */
.list-tools { display: flex; flex-direction: column; gap: .55rem; padding: .25rem 0 .7rem; }
.seg-chip {
  height: 2.2rem; padding: 0 .95rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface);
  font-weight: 600; font-size: .88rem; color: var(--ink-2); white-space: nowrap; flex: none; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.seg-chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.apill {
  height: 2rem; padding: 0 .55rem 0 .8rem; border-radius: 999px; flex: none; white-space: nowrap; line-height: 1;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent-2); font-weight: 700; font-size: .84rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
}
html.dark .apill { color: var(--accent); }
.apill svg { width: .9rem; height: .9rem; opacity: .7; }
.apill.edit { background: transparent; border: 1.5px solid var(--line-2); color: var(--ink-2); padding: 0 .85rem; }

#list { padding: 0 var(--pad) 3rem; display: flex; flex-direction: column; gap: .5rem; }
.rows { display: flex; flex-direction: column; gap: .5rem; }
.row {
  position: relative; width: 100%; display: flex; align-items: center; gap: .85rem; min-height: 4.6rem;
  padding: .75rem .9rem .75rem 1.05rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-1); overflow: hidden; content-visibility: auto; contain-intrinsic-size: auto 5rem;
}
.row:active { background: var(--sunk); }
.row-mark { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--cc); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .12rem; }
.row-title { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; line-height: 1.22; display: flex; align-items: baseline; gap: .35rem; }
.row-heart { flex: none; align-self: center; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; margin: -.4rem -.45rem -.4rem -.35rem; border-radius: 50%; color: var(--muted); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.row-heart svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.8; overflow: visible; }
.row-heart.on { color: #D7263D; }
.row-heart.on svg { fill: currentColor; }
.row-heart:active { background: var(--sunk); }
.row-heart:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.row-heart.pop svg { animation: heartpop .28s ease-out; }
@keyframes heartpop { 0% { transform: scale(.8); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
@media (hover: hover) { .row-heart:hover { color: #D7263D; } }
.row-alt { font-size: .86rem; color: var(--muted); font-style: italic; line-height: 1.25; }
.row-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--kc); margin-top: .2rem; line-height: 1.3; }
.row-place { font-size: .84rem; color: var(--muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: .3rem; min-width: 3.6rem; }
.row-time { font-weight: 700; font-size: .86rem; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-badges { display: flex; gap: .25rem; }
.row-badges:empty { display: none; }
.badge { height: 1.25rem; padding: 0 .4rem; border-radius: 5px; font-size: .68rem; font-weight: 700; letter-spacing: .03em; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.badge.veg { color: var(--veg); background: color-mix(in srgb, var(--veg) 13%, transparent); }
.badge.gf { color: var(--gf); background: color-mix(in srgb, var(--gf) 14%, transparent); }
.lvl { display: inline-flex; gap: 2px; align-items: center; }
.lvl i { width: .5rem; height: .5rem; border-radius: 2px; background: var(--line-2); display: block; }
.lvl i.on { background: var(--ink-2); }
.country-head { display: flex; align-items: center; gap: .55rem; font-family: var(--serif); font-size: 1.5rem; font-weight: 700; margin: 1.1rem 0 0; letter-spacing: -.01em; }
.country-head .dot { width: .8rem; height: .8rem; }
.country-head small { margin-left: auto; font-family: var(--sans); color: var(--muted); font-size: .8rem; font-weight: 600; }
.region-head { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin: .8rem 0 .1rem; }
.empty { padding: 3rem 2rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.1rem; color: var(--ink-2); }
.empty-mark { width: 3.5rem; height: 3.5rem; border-radius: 50%; border: 2px dashed var(--line-2); }

/* ================================================================ detail */
.detail-bar .bar-title h2 { opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; font-size: 1.08rem; }
body.scrolled .detail-bar .bar-title h2 { opacity: 1; transform: none; }
body.scrolled .detail-bar { border-bottom: 1px solid var(--line); }
.fav-btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
.fav-btn.on { color: var(--accent); background: transparent; }
.fav-btn.on svg { fill: currentColor; }
#detail { padding: 0 var(--pad); }
.hero { padding: .4rem 0 1rem; }
.hero-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hero-kicker span:nth-child(2) { color: color-mix(in srgb, var(--cc) 80%, var(--ink)); }
.hero-kicker i { font-style: normal; color: var(--line-2); }
.hero h1 { font-family: var(--serif); font-weight: 700; font-size: 2.15rem; line-height: 1.05; letter-spacing: -.02em; margin: .55rem 0 .5rem; }
.subtitle { font-size: 1.05rem; color: var(--ink-2); line-height: 1.4; }
.hero-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .85rem; }
.tag { height: 1.75rem; padding: 0 .7rem; border-radius: 999px; background: var(--sunk); color: var(--ink-2); font-size: .8rem; font-weight: 700; display: inline-flex; align-items: center; line-height: 1; }
.tag.cat { background: color-mix(in srgb, var(--kc) 14%, transparent); color: color-mix(in srgb, var(--kc) 85%, var(--ink)); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.stat { padding: .7rem .4rem; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .2rem; min-height: 4.2rem; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .k { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; color: var(--muted); line-height: 1.1; }
.stat .v { font-weight: 700; font-size: .98rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .v small { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; }
.stat.main .v { color: color-mix(in srgb, var(--cc) 80%, var(--ink)); }
.stat .v.lv { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.time-note { font-size: .88rem; color: var(--muted); margin-top: .55rem; }
.lead { font-size: 1.04rem; line-height: 1.6; color: var(--ink-2); margin-top: 1.1rem; }
.alt-names { margin-top: .7rem; font-size: .9rem; color: var(--muted); font-style: italic; }
.alt-names span { font-style: normal; font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; margin-right: .25rem; }

.secnav {
  position: sticky; top: calc(var(--bar) + env(safe-area-inset-top)); z-index: 12; display: flex; flex-wrap: wrap; gap: .3rem .25rem;
  margin: 1.2rem calc(-1 * var(--pad)) 0; padding: .5rem var(--pad); background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.secnav::-webkit-scrollbar { display: none; }
.secnav button { height: 2.15rem; padding: 0 .75rem; border-radius: 999px; font-weight: 700; font-size: .86rem; color: var(--ink-2); background: var(--sunk); white-space: nowrap; flex: none; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.secnav button:active { background: var(--line); }
.cta-row { display: flex; justify-content: center; margin: 1rem 0 .2rem; }

.sec { padding-top: 1.6rem; scroll-margin-top: 7rem; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.sec-head h2 { font-family: var(--serif); font-weight: 700; font-size: 1.45rem; letter-spacing: -.01em; }
.sec-head span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.sec .sec-head:not(:first-child) { margin-top: 1.5rem; }
.note { font-size: .86rem; color: var(--muted); background: var(--sunk); padding: .55rem .8rem; border-radius: var(--r-s); margin-bottom: .7rem; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem .5rem; margin-bottom: .9rem; }
.toolbar .tb-right { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.stepper { display: inline-flex; align-items: center; height: 2.6rem; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); }
.stepper button { width: 2.6rem; height: 100%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; font-weight: 600; color: var(--ink-2); line-height: 1; }
.stepper button:active { background: var(--sunk); border-radius: 999px; }
.stepper span { min-width: 4.4rem; display: inline-flex; align-items: baseline; justify-content: center; gap: .3rem; line-height: 1; }
.stepper.fixed span { padding: 0 1rem; }
.stepper b { font-size: 1.05rem; }
.stepper small { font-size: .78rem; color: var(--muted); font-weight: 600; max-width: 5.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-btn { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex: none; }
.sq-btn.on { background: #F2B632; border-color: #F2B632; color: #3A2A05; }

.ing-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .2rem 0; margin-bottom: .7rem; box-shadow: var(--shadow-1); }
.ing-group h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--muted); padding: .65rem 1rem .25rem; }
.ing { width: 100%; display: grid; grid-template-columns: 1.35rem 4.1rem minmax(0, 1fr); gap: .75rem; align-items: start; padding: .6rem 1rem; text-align: left; }
.ing + .ing { border-top: 1px solid var(--line); }
.ing .box { width: 1.35rem; height: 1.35rem; border-radius: 6px; border: 1.75px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; color: transparent; margin-top: .05rem; }
.ing .box svg { width: .95rem; height: .95rem; }
.ing .qty { font-weight: 700; font-size: .95rem; overflow-wrap: normal; line-height: 1.3; font-variant-numeric: tabular-nums; }
.ing .qty small { display: block; font-weight: 600; color: var(--muted); font-size: .76rem; }
.ing .name { font-size: .97rem; line-height: 1.35; overflow-wrap: anywhere; min-width: 0; }
.ing .name small { display: block; color: var(--muted); font-size: .84rem; margin-top: .1rem; }
.opt { font-style: normal; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 .3rem; margin-left: .4rem; vertical-align: .1em; }
.ing.done .box { background: var(--veg); border-color: var(--veg); color: #fff; }
.ing.done .qty, .ing.done .name { opacity: .4; text-decoration: line-through; text-decoration-thickness: 1px; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.step { display: grid; grid-template-columns: 2.25rem 1fr; gap: .85rem; padding: .2rem 0 1.3rem; position: relative; }
.step:not(:last-child)::before { content: ""; position: absolute; left: 1.1rem; top: 2.6rem; bottom: .3rem; width: 2px; background: var(--line); }
.step-num { width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--surface); border: 1.75px solid var(--ink); font-weight: 700; font-size: .95rem; display: inline-flex; align-items: center; justify-content: center; line-height: 1; z-index: 1; }
.step-num svg { width: 1.1rem; height: 1.1rem; }
.step.done .step-num { background: var(--veg); border-color: var(--veg); color: #fff; }
.step.done .step-body { opacity: .5; }
.step-body h3 { font-weight: 700; font-size: 1.03rem; line-height: 1.3; margin: .3rem 0 .3rem; }
.step-body p { font-size: 1rem; line-height: 1.6; color: var(--ink-2); }
.step-row { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .8rem; margin-top: .6rem; }
.dur { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-weight: 700; font-size: .86rem; }
.dur svg { width: 1rem; height: 1rem; }
.timer-btn { height: 2.15rem; padding: 0 .85rem 0 .7rem; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent-2); font-weight: 700; font-size: .86rem; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; line-height: 1; }
html.dark .timer-btn { color: var(--accent); }
.timer-btn svg { width: 1.05rem; height: 1.05rem; }
.timer-btn.big { height: 2.9rem; padding: 0 1.2rem 0 1rem; font-size: 1rem; }

.callout { border-radius: var(--r); padding: .95rem 1rem; margin-top: 1.1rem; border: 1px solid var(--line); background: var(--surface); }
.callout-head { display: flex; align-items: center; gap: .45rem; }
.callout-head b { font-size: .98rem; }
.callout-head em { margin-left: auto; font-style: normal; font-weight: 700; font-size: .85rem; height: 1.6rem; padding: 0 .6rem; border-radius: 999px; display: inline-flex; align-items: center; background: var(--surface); }
.callout.fast { background: color-mix(in srgb, #F2B632 14%, var(--surface)); border-color: color-mix(in srgb, #F2B632 40%, var(--line)); }
.callout.fast .callout-head svg { color: #C98A0C; }
.callout.oven { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }
.callout.oven .callout-head svg { color: var(--accent); }
.callout-title { font-weight: 700; margin: .5rem 0 .25rem; }
.callout ul { margin: .2rem 0 0; padding-left: 1.1rem; }
.callout li { margin: .25rem 0; font-size: .95rem; }
.trade { font-size: .9rem; color: var(--ink-2); margin-top: .5rem; }
.trade.ok { display: flex; align-items: center; gap: .35rem; color: var(--veg); font-weight: 600; }
.trade.ok svg { width: 1rem; height: 1rem; }
.oven-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .5rem; margin-top: .7rem; }
.oven-step { background: var(--surface); border-radius: var(--r-s); padding: .65rem .75rem; border: 1px solid var(--line); }
.oven-step .phase { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); }
.oven-step .big { font-weight: 700; font-size: 1.2rem; display: flex; align-items: baseline; gap: .5rem; margin: .15rem 0; }
.oven-step .big span { font-size: .9rem; color: var(--ink-2); }
.oven-step .mode { font-size: .85rem; color: var(--ink-2); }
.oven-step .sig { font-size: .84rem; color: var(--muted); margin-top: .3rem; line-height: 1.35; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin: .8rem 0 0; font-size: .9rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; }
.pct { margin-top: .6rem; font-size: .88rem; display: flex; flex-wrap: wrap; gap: .3rem .5rem; }
.pct b { flex-basis: 100%; }
.pct span { background: var(--surface); border-radius: 6px; padding: .1rem .45rem; }

.bullets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.bullets li { position: relative; padding-left: 1.4rem; line-height: 1.55; color: var(--ink-2); }
.bullets li::before { content: ""; position: absolute; left: .25rem; top: .58rem; width: .45rem; height: .45rem; border-radius: 50%; background: var(--veg); }
.bullets.warn li::before { background: var(--warn); border-radius: 2px; transform: rotate(45deg); }
.bullets.alt li::before { background: var(--cc); }
.prose { line-height: 1.65; color: var(--ink-2); }
.zone { margin-top: .6rem; font-size: .88rem; color: var(--muted); font-style: italic; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1.6rem; }
.info { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem .95rem; }
.info.wide { margin-top: .6rem; }
.info h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--muted); margin-bottom: .3rem; }
.info p { font-size: .92rem; line-height: 1.45; color: var(--ink-2); }
.pills { display: flex; flex-wrap: wrap; gap: .35rem; }
.pills span { background: var(--sunk); padding: .25rem .6rem; border-radius: 999px; font-size: .84rem; color: var(--ink-2); }
.notes { margin-top: 1.4rem; border-top: 1px solid var(--line); }
.notes summary { list-style: none; height: 3.2rem; display: flex; align-items: center; justify-content: space-between; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.notes summary::-webkit-details-marker { display: none; }
.notes[open] summary svg { transform: rotate(180deg); }
.notes .info + .info { margin-top: .6rem; }
.sources { margin: 0; padding-left: 1rem; font-size: .88rem; word-break: break-word; }
.end-space { height: calc(4rem + env(safe-area-inset-bottom)); }
body.has-timers .end-space { height: 8rem; }

/* ================================================================ cook mode */
.cook { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; }
.cook-top { display: flex; align-items: center; gap: .3rem; padding: calc(env(safe-area-inset-top) + .3rem) .35rem .3rem; height: calc(var(--bar) + env(safe-area-inset-top)); }
.cook-title { flex: 1; min-width: 0; text-align: center; display: flex; flex-direction: column; line-height: 1.2; }
.cook-title b { font-family: var(--serif); font-size: 1.02rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cook-title span { font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.cook-progress { height: 3px; background: var(--line); margin: 0 var(--pad); border-radius: 2px; overflow: hidden; }
.cook-progress i { display: block; height: 100%; background: var(--cc); transition: width .25s ease; }
.cook-body { flex: 1; overflow-y: auto; padding: 1.4rem 1.4rem 1rem; }
.cook-step { max-width: 36rem; margin: 0 auto; }
.cook-num { width: 3rem; height: 3rem; border-radius: 50%; background: var(--cc); color: #fff; font-weight: 700; font-size: 1.3rem; display: flex; align-items: center; justify-content: center; line-height: 1; }
.cook-step h2 { font-family: var(--serif); font-weight: 700; font-size: 1.7rem; line-height: 1.15; margin: 1rem 0 .8rem; letter-spacing: -.01em; }
.cook-step p { font-size: 1.28rem; line-height: 1.6; color: var(--ink); }
.cook-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem 1.2rem; margin-top: 1.4rem; }
.cook-actions .dur { font-size: 1rem; }
.cook-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin: 2.2rem 0 .5rem; }
.cook-dots button { width: .7rem; height: .7rem; border-radius: 50%; background: var(--line-2); }
.cook-dots button.done { background: color-mix(in srgb, var(--cc) 45%, var(--line-2)); }
.cook-dots button.on { background: var(--cc); transform: scale(1.35); }
.cook-foot { display: grid; grid-template-columns: 1fr 2fr; gap: .6rem; padding: .8rem var(--pad) calc(env(safe-area-inset-bottom) + .9rem); border-top: 1px solid var(--line); }
.cook-foot .primary-btn, .cook-foot .ghost-btn { width: 100%; }
.cook-ing { position: absolute; top: calc(var(--bar) + env(safe-area-inset-top) + 3px); left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--bg) 97%, transparent); overflow-y: auto; padding: 1rem var(--pad) 2rem; }
.cook-ing h3 { font-family: var(--serif); font-size: 1.35rem; margin-bottom: .6rem; }
.cook-ing .ing-group { padding: .3rem 0; }
.cing { display: grid; grid-template-columns: 5.5rem 1fr; gap: .7rem; padding: .5rem 1rem; font-size: 1.02rem; }
.cing + .cing { border-top: 1px solid var(--line); }
.cing b { font-variant-numeric: tabular-nums; }

/* ================================================================ timers, toast */
.timers { position: fixed; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + .8rem); z-index: 50; display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: 0 var(--pad); pointer-events: none; }
body.cooking .timers { bottom: calc(env(safe-area-inset-bottom) + 5.6rem); }
body[data-view=home] .timers { bottom: calc(env(safe-area-inset-bottom) + 5.2rem); }
.tmr { pointer-events: auto; width: 100%; max-width: 30rem; height: 3.3rem; display: flex; align-items: center; gap: .65rem; padding: 0 .4rem 0 .9rem; border-radius: 999px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2); }
.tmr .t { font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; min-width: 3.4rem; }
.tmr .l { flex: 1; min-width: 0; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.tmr button { width: 2.5rem; height: 2.5rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--bg) 15%, transparent); }
.tmr.ring { background: var(--accent); color: #fff; animation: ring 1s ease-in-out infinite; }
@keyframes ring { 50% { transform: scale(1.02); } }
.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 4rem); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); padding: .65rem 1.1rem; border-radius: 999px; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-2); white-space: nowrap; max-width: calc(100vw - 2rem); overflow: hidden; text-overflow: ellipsis; }

/* ================================================================ sheet */
.scrim { position: fixed; inset: 0; background: rgba(20, 14, 8, .42); z-index: 70; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; max-width: 40rem; margin: 0 auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: .5rem var(--pad) calc(env(safe-area-inset-bottom) + 1rem); max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-2); }
.sheet-grip { width: 2.6rem; height: 4px; border-radius: 4px; background: var(--line-2); margin: 0 auto .8rem; }
.sheet-head h2 { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; }
.setting { margin-top: 1.2rem; }
/* button rows in Settings (Account, Your data): equal-width buttons, an odd last one spans the row */
.backup-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: 0 0 .7rem; }
.backup-row .ghost-btn { width: 100%; min-width: 0; height: auto; min-height: 2.9rem; padding: .55rem .8rem; white-space: normal; line-height: 1.2; text-align: center; }
.backup-row > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.setting .backup-row + .hint { margin: 0 0 .6rem; line-height: 1.45; }
.setting h4 { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--muted); margin-bottom: .5rem; }
.setting .seg { display: flex; width: 100%; }
.setting .seg button { white-space: normal; height: auto; min-height: 2.25rem; padding: .35rem .5rem; line-height: 1.15; text-align: center; min-width: 0; }
.about { margin-top: 1.5rem; font-size: .86rem; color: var(--muted); line-height: 1.5; }
.sheet-foot { display: flex; justify-content: center; margin-top: 1.3rem; }
.sheet-foot .primary-btn { width: 100%; max-width: 22rem; }

@media (min-width: 640px) {
  .cuisines { grid-template-columns: repeat(3, 1fr); }
  .facets { grid-template-columns: repeat(4, 1fr); }
  .hero h1 { font-size: 2.6rem; }
}
@media (max-width: 360px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .info-grid { grid-template-columns: 1fr; }
}

html.size-xl .ing { gap: .6rem; padding: .6rem .8rem; }
html.size-xl .secnav button { padding: 0 .6rem; font-size: .8rem; }

/* nutrition card */
.nutri { margin-top: 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1rem .8rem; }
.nutri-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .2rem .8rem; }
.nutri-head h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--muted); }
.nutri-head span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.nutri-kcal { display: flex; align-items: baseline; gap: .35rem; margin: .25rem 0 .55rem; }
.nutri-kcal b { font-family: var(--serif); font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.nutri-kcal span { font-weight: 700; color: var(--ink-2); }
.nutri dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.nutri dl > div { display: flex; justify-content: space-between; gap: .5rem; padding: .28rem 0; border-top: 1px solid var(--line); font-size: .92rem; }
.nutri dt { color: var(--ink-2); min-width: 0; }
.nutri dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nutri dl > div.sub dt { padding-left: .7rem; color: var(--muted); font-size: .86rem; }
.nutri dl > div.sub dd { font-weight: 600; color: var(--ink-2); }
.nutri-note { margin-top: .55rem; font-size: .78rem; color: var(--muted); line-height: 1.4; }

/* 4.7: a lone last facet tile spans the whole row */

/* 4.7: collections, saved lists, notes */
.col-btn.on { color: var(--accent); }
.col-btn.on svg { fill: var(--accent); }
.row-note { display: inline-flex; margin-left: .3rem; color: var(--muted); vertical-align: -2px; }
.row-note svg { width: .95rem; height: .95rem; fill: currentColor; }
body.saved-mode .list-tools { display: none; }
.lcards { display: grid; gap: .6rem; padding: .9rem 1rem 0; }
.lcard { display: flex; align-items: center; gap: .85rem; width: 100%; min-height: 4rem; padding: .7rem 1rem; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.lcard:active { background: var(--sunk); }
.lcard-ic { width: 2.4rem; height: 2.4rem; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
.lcard-ic svg { width: 1.3rem; height: 1.3rem; fill: currentColor; }
.lcard.lnotes .lcard-ic { background: color-mix(in srgb, #2E7D6B 14%, var(--surface)); color: #2E7D6B; }
.lcard-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.lcard-text b { font-size: 1.02rem; overflow-wrap: anywhere; }
.lcard-text small { color: var(--muted); font-weight: 600; font-size: .85rem; }
.lcard-chev { display: inline-flex; color: var(--muted); transform: rotate(-90deg); }
.lcard-chev svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }
.newcol-btn { display: flex; gap: .4rem; margin: .9rem 1rem 0; width: calc(100% - 2rem); justify-content: center; }
.newcol-btn svg, .ghost-btn svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }
.newcol { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .9rem 1rem 0; }
#gen-body .newcol { margin: .9rem 0 0; }
.newcol input { flex: 1 1 12rem; min-width: 0; height: 2.9rem; padding: 0 1rem; border-radius: 999px; border: 1.5px solid var(--line-2);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 1rem; }
.newcol input:focus { outline: 0; border-color: var(--ink-2); }
.primary-btn.small { height: 2.9rem; padding: 0 1.2rem; font-size: .95rem; }
.saved-hint { margin: 1rem 1rem 0; }
.colpick { margin: 0; }
.gen-msg { margin: .2rem 0 1rem; line-height: 1.45; color: var(--ink-2); }
.gen-row { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; }
.ghost-btn.wide { width: 100%; margin-top: 1rem; }
.danger-txt { color: #B3261E; border-color: color-mix(in srgb, #B3261E 35%, var(--line-2)); }
.primary-btn.danger { background: #B3261E; box-shadow: none; }
.mynotes textarea { width: 100%; box-sizing: border-box; min-height: 7rem; padding: .85rem 1rem; border-radius: var(--r);
  border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-size: 1rem; line-height: 1.45; resize: vertical; }
.mynotes textarea:focus { outline: 0; border-color: var(--cc, var(--ink-2)); }
.mynotes .sec-head span { color: var(--muted); font-weight: 600; font-size: .85rem; }
.note-peek { display: flex; gap: .6rem; align-items: flex-start; width: 100%; margin-top: .9rem; padding: .75rem .9rem; text-align: left;
  border-radius: var(--r); background: color-mix(in srgb, #2E7D6B 9%, var(--surface)); border: 1.5px solid color-mix(in srgb, #2E7D6B 25%, var(--line));
  color: var(--ink-2); font-size: .95rem; line-height: 1.4; }
.note-peek svg { width: 1.1rem; height: 1.1rem; fill: #2E7D6B; flex: none; margin-top: .15rem; }
.note-peek b { color: #2E7D6B; margin-right: .25rem; }

/* 4.7.1: filter options as an even grid of equal cells, two columns on phones, three on wide screens */
.fpanel .chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
@media (min-width: 640px) { .fpanel .chips { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fpanel .chip {
  height: auto; min-height: 3.4rem; padding: .55rem .85rem; border-radius: 12px; white-space: normal; line-height: 1.2;
  flex-direction: column; align-items: flex-start; justify-content: center; text-align: left; gap: .2rem; position: relative;
}
.fpanel .chip span { min-width: 0; overflow-wrap: break-word; }
.fpanel .chip em { flex: none; text-align: left; min-width: 0; font-size: .76rem; }
/* one column when the text is extra large or the screen very narrow: the same in every panel */
@media (max-width: 339px) { .fpanel .chips { grid-template-columns: 1fr; } }
html.size-xl .fpanel .chips { grid-template-columns: 1fr; }
@media (max-width: 339px) { .fpanel .chip { flex-direction: row; align-items: center; justify-content: space-between; min-height: 3rem; } }
html.size-xl .fpanel .chip { flex-direction: row; align-items: center; justify-content: space-between; min-height: 3rem; }
.fpanel .chip-x { position: absolute; top: .5rem; right: .55rem; margin: 0; }
.fpanel .fgroup h4 { margin: 0 0 .55rem; }
.fpanel-body .fgroup + .fgroup { margin-top: 1.1rem; }
.fpanel-body .hint.first { margin: 0 0 .85rem; font-size: .86rem; line-height: 1.4; }
.fpanel-body .cuisines + .checklist { margin-top: .9rem; }
@media (min-width: 640px) { .facets { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ================================================================ 4.8: tabs, meal plan, shopping list, what I have, cook mode */
:root { --tabh: 3.9rem; --pk: 0px; }

/* tab bar: four equal tabs on the top-level pages */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr)); height: calc(var(--tabh) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 96%, transparent); border-top: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
body.tabs .tabbar { display: grid; }
body.typing .tabbar, body.cooking .tabbar { display: none; }
.tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; color: var(--muted); font-size: .74rem; font-weight: 700; letter-spacing: .02em; line-height: 1; }
.tabbar button svg { width: 1.45rem; height: 1.45rem; }
.tabbar button::before { content: ""; position: absolute; top: .42rem; left: 50%; width: 3.6rem; height: 2rem; border-radius: 999px; transform: translateX(-50%) scaleX(.6); opacity: 0; background: color-mix(in srgb, var(--accent) 13%, transparent); transition: transform .18s ease, opacity .18s ease; }
.tabbar button svg, .tabbar button span { position: relative; }
.tabbar button.on { color: var(--accent); }
.tabbar button.on::before { opacity: 1; transform: translateX(-50%) scaleX(1); }
.tabbar b { position: absolute; top: .3rem; left: calc(50% + .45rem); min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .66rem; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--surface); }
body.tabs:not(.typing) .dock { bottom: var(--tabh); padding-bottom: calc(env(safe-area-inset-bottom) + .8rem); }
body.tabs:not(.typing) #home-body { padding-bottom: calc(7.5rem + var(--tabh)); }
body.tabs:not(.typing) #list { padding-bottom: calc(3rem + var(--tabh)); }
body.tabs:not(.typing) .timers { bottom: calc(env(safe-area-inset-bottom) + var(--tabh) + .8rem); }
body.tabs:not(.typing)[data-view=home] .timers { bottom: calc(env(safe-area-inset-bottom) + var(--tabh) + 5.2rem); }
body.tabs .end-space { height: calc(var(--tabh) + 2.5rem + env(safe-area-inset-bottom)); }
.root-bar .bar-title, body.saved-mode .list-bar .bar-title { padding-left: .8rem; }
.root-bar #plan-sub, .root-bar #shop-sub { color: var(--muted); font-size: .8rem; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* choosing a recipe for the plan: a strip across the top, an add button on the recipe */
body.picking { --pk: 3.6rem; padding-top: var(--pk); }
.bar { top: var(--pk); }
.secnav { top: calc(var(--bar) + env(safe-area-inset-top) + var(--pk)); }
.pickbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 35; height: calc(var(--pk) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) .5rem 0 var(--pad);
  display: flex; align-items: center; gap: .7rem; background: var(--ink); color: var(--bg);
}
.pickbar-ic { width: 2.1rem; height: 2.1rem; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--bg) 16%, transparent); }
.pickbar-ic svg { width: 1.15rem; height: 1.15rem; }
.pickbar-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.pickbar-t b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pickbar-t small { font-size: .8rem; opacity: .75; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pickbar-x { height: 2.4rem; padding: 0 1rem; border-radius: 999px; font-weight: 700; font-size: .9rem; border: 1.5px solid color-mix(in srgb, var(--bg) 35%, transparent); flex: none; }
.pick-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 1.4rem var(--pad) calc(env(safe-area-inset-bottom) + .9rem);
  background: linear-gradient(to bottom, transparent, var(--bg) 40%); pointer-events: none;
}
.pick-dock-in { pointer-events: auto; max-width: 30rem; margin: 0 auto; display: flex; align-items: center; gap: .6rem; }
.pick-dock .stepper { height: 3.25rem; background: var(--surface); box-shadow: var(--shadow-2); flex: none; }
.pick-dock .primary-btn { flex: 1; min-width: 0; }
.pick-dock .primary-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.picking .end-space { height: 7.5rem; }
body.picking.has-timers .timers { bottom: calc(env(safe-area-inset-bottom) + 5.4rem); }

/* calendar */
#plan-body, #shop-body { padding: .3rem var(--pad) 0; }
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); padding: .35rem .5rem .7rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; height: 2.9rem; }
.cal-head b { font-family: var(--serif); font-weight: 600; font-size: 1.12rem; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow span { text-align: center; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: .2rem 0 .35rem; }
.cal-grid { gap: 2px; }
.cal-d { position: relative; height: 2.75rem; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .18rem; font-variant-numeric: tabular-nums; }
.cal-d .n { font-weight: 700; font-size: .98rem; line-height: 1; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.cal-d.out .n { color: var(--muted); font-weight: 600; opacity: .6; }
.cal-d.past:not(.sel) .n { color: var(--muted); }
.cal-d.today .n { box-shadow: inset 0 0 0 1.75px var(--accent); color: var(--accent); }
.cal-d.sel { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.cal-d.sel .n { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.cal-d:active { background: var(--sunk); }
.cal-dots { display: flex; gap: 2px; height: .38rem; }
.cal-dots i, .cal-legend i, .sdot { width: .38rem; height: .38rem; border-radius: 50%; background: var(--sc); display: block; flex: none; }
.cal-legend { display: grid; grid-template-columns: repeat(4, auto); justify-content: center; gap: .3rem 1rem; margin-top: .55rem; font-size: .76rem; font-weight: 600; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.plan-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; margin: .8rem 0 0; }
.plan-quick .seg-chip, .shop-range .seg-chip { padding: 0 .4rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.seg-chip:disabled { opacity: .4; }
.plan-empty { margin-top: 1rem; padding: 1.1rem 1rem; border: 1.5px dashed var(--line-2); border-radius: var(--r); text-align: center; color: var(--muted); font-size: .95rem; }
.plan-multi { margin-top: 1rem; padding: .85rem; border-radius: var(--r); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--accent) 25%, var(--line)); }
.plan-multi-t { display: flex; flex-direction: column; gap: .1rem; margin-bottom: .65rem; }
.plan-multi-t b { font-size: .98rem; }
.plan-multi-t small { color: var(--muted); font-weight: 600; font-size: .84rem; }
.slot-btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
.slot-btns button { height: 2.6rem; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--line); display: inline-flex; align-items: center; justify-content: center; gap: .35rem; font-weight: 700; font-size: .86rem; min-width: 0; }
.slot-btns button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-btns button i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--sc); flex: none; }
@media (max-width: 479px) { .slot-btns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
html.size-xl .slot-btns, html.size-large .slot-btns { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* one card per chosen day, a row per meal */
.pday { margin-top: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden; }
.pday-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; padding: .8rem 1rem .55rem; }
.pday-head h3 { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; line-height: 1.2; }
.pday-head span { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.pslot { border-top: 1px solid var(--line); padding: .15rem 0 .35rem; }
.pslot-h { display: flex; align-items: center; gap: .5rem; min-height: 2.75rem; padding: 0 .45rem 0 1rem; }
.pslot-h b { font-size: .92rem; }
.pslot-h small { color: var(--muted); font-weight: 600; font-size: .8rem; font-variant-numeric: tabular-nums; }
.pslot-add { margin-left: auto; height: 2.1rem; padding: 0 .75rem 0 .55rem; border-radius: 999px; display: inline-flex; align-items: center; gap: .2rem; color: var(--accent); font-weight: 700; font-size: .86rem; }
.pslot-add svg { width: 1.05rem; height: 1.05rem; }
.pslot-add:active { background: var(--sunk); }
.pentry { margin: 0 .6rem .35rem 1.85rem; padding: .55rem .5rem .55rem .75rem; border-radius: 12px; background: var(--sunk); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem; border-left: 3px solid var(--sc); }
.pentry-main { min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.pentry-main b { font-family: var(--serif); font-weight: 600; font-size: 1rem; line-height: 1.25; }
.pentry-main small { color: var(--muted); font-size: .8rem; font-weight: 600; line-height: 1.3; }
.pentry-ctl { display: flex; align-items: center; gap: .15rem; }
.stepper.sm { height: 2.2rem; background: var(--surface); }
.stepper.sm button { width: 2.1rem; font-size: 1.15rem; }
.stepper.sm span { min-width: 3.4rem; }
.stepper.sm b { font-size: .92rem; }
.stepper.sm small { font-size: .7rem; max-width: 4rem; }
.pentry-x { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.pentry-x svg { width: 1.05rem; height: 1.05rem; }
.pentry-x:active { background: var(--line); }
@media (max-width: 400px) { .pentry { grid-template-columns: 1fr; } .pentry-ctl { justify-content: space-between; } }
html.size-large .pentry, html.size-xl .pentry { grid-template-columns: 1fr; }
html.size-large .pentry-ctl, html.size-xl .pentry-ctl { justify-content: space-between; }
.ghost-btn svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }
.plan-shop { gap: .5rem; margin-top: 1.1rem; }

/* shopping list */
.shop-range { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: .4rem; }
@media (max-width: 400px) { .shop-range[style*="--n:4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
html.size-large .shop-range, html.size-xl .shop-range { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shop-sum { margin: .7rem .2rem 0; color: var(--muted); font-size: .88rem; font-weight: 600; }
.remind-card { width: 100%; margin-top: .8rem; display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); text-align: left; }
.remind-card > svg, .remind-top svg { width: 1.3rem; height: 1.3rem; color: var(--accent); flex: none; }
.remind-card > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .05rem; }
.remind-card b { font-size: .95rem; }
.remind-card small { color: var(--muted); font-size: .84rem; font-weight: 600; }
.remind-card em { font-style: normal; color: var(--accent); font-weight: 700; font-size: .88rem; }
.remind-card.edit { flex-direction: column; align-items: stretch; gap: .8rem; }
.remind-top { display: flex; align-items: center; gap: .6rem; }
.remind-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.remind-fields label { display: flex; flex-direction: column; gap: .25rem; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.remind-fields input, .time-row input { height: 2.9rem; padding: 0 .8rem; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--bg); color: var(--ink); font: inherit; font-size: 1rem; min-width: 0; width: 100%; }
.remind-card .hint { margin: 0; }
.sgroup { margin-top: 1.2rem; }
.sgroup-h { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: 2rem; margin-bottom: .45rem; padding: 0 .2rem; }
.sgroup-h h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--muted); }
.sgroup-h span { color: var(--muted); font-size: .82rem; font-weight: 600; }
.slist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden; }
.sitem { display: flex; align-items: stretch; }
.sitem + .sitem { border-top: 1px solid var(--line); }
.sitem-main { flex: 1; min-width: 0; display: grid; grid-template-columns: 1.35rem minmax(0, 1fr) auto; align-items: start; gap: .75rem; padding: .7rem 1rem; text-align: left; }
.sitem-main:active { background: var(--sunk); }
.sitem .box { width: 1.35rem; height: 1.35rem; border-radius: 6px; border: 1.75px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; color: transparent; margin-top: .05rem; }
.sitem .box svg { width: .95rem; height: .95rem; }
.sitem-t { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.sitem-t b { font-weight: 600; font-size: .98rem; line-height: 1.3; overflow-wrap: anywhere; }
.sitem-t small { color: var(--muted); font-size: .8rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sitem-q { font-weight: 700; font-size: .92rem; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: .05rem; max-width: 9rem; white-space: normal; }
.sitem-x { width: 2.8rem; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.sitem-x svg { width: 1rem; height: 1rem; }
.sitem.on .box { background: var(--veg); border-color: var(--veg); color: #fff; }
.sitem.on .sitem-t b, .sitem.on .sitem-q { opacity: .45; text-decoration: line-through; text-decoration-thickness: 1px; }
.sgroup.done .slist { box-shadow: none; background: transparent; }
.slist-done { display: flex; align-items: center; justify-content: center; gap: .4rem; padding: 1rem; color: var(--veg); font-weight: 700; }
.slist-done svg { width: 1.1rem; height: 1.1rem; }
.shop-add { margin: 1rem 0 0 !important; }
.shop-empty { padding: 2.2rem 1rem 1rem; }

/* what I have */
.have-block { padding-top: 1.3rem; }
.have { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); padding: .8rem; display: flex; flex-direction: column; gap: .7rem; }
.have-items { display: flex; flex-wrap: wrap; gap: .4rem; }
.have-item { height: 2.3rem; padding: 0 .55rem 0 .9rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: .9rem; display: inline-flex; align-items: center; gap: .35rem; line-height: 1; max-width: 100%; }
.have-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.have-item svg { width: .95rem; height: .95rem; opacity: .75; }
.have-field input { width: 100%; height: 2.9rem; padding: 0 1rem; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--bg); color: var(--ink); font: inherit; font-size: 1rem; }
.have-field input:focus { outline: 0; border-color: var(--ink-2); }
.have-field input::placeholder { color: var(--muted); }
.have-sug { display: flex; flex-wrap: wrap; gap: .4rem; }
.have-sug:empty { display: none; }
.hchip { height: 2.2rem; padding: 0 .8rem 0 .55rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: .88rem; display: inline-flex; align-items: center; gap: .25rem; line-height: 1; max-width: 100%; }
.hchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hchip svg { width: 1rem; height: 1rem; color: var(--accent); }
.hchip.free { border-style: dashed; }
.hchip:active { background: var(--sunk); }
.have-mode { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .7rem; }
.have-mode small { color: var(--muted); font-size: .84rem; font-weight: 600; }
.have-note { color: var(--muted); font-size: .86rem; line-height: 1.4; }
.row-have { display: flex; align-items: flex-start; gap: .3rem; margin-top: .25rem; font-size: .8rem; font-weight: 700; color: var(--veg); line-height: 1.3; }
.row-have svg { width: .9rem; height: .9rem; flex: none; margin-top: .05rem; }

/* sheets: add to plan, plan settings */
.gen-sub { font-family: var(--serif); font-size: 1.05rem; color: var(--ink-2); margin-top: .2rem; }
.gen-h { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--muted); margin: 1.2rem 0 .55rem; }
.gen-h small { text-transform: none; letter-spacing: 0; font-weight: 600; margin-left: .3rem; }
.gen-hint { margin: .55rem 0 0; font-size: .86rem; line-height: 1.4; }
.day-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3rem; }
.dchip { height: 3.6rem; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; line-height: 1; min-width: 0; }
.dchip small { font-size: .66rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; max-width: 100%; }
.dchip b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.dchip i { font-style: normal; font-size: .7rem; color: var(--accent); height: .5rem; line-height: .5rem; letter-spacing: -.05em; }
.dchip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.dchip.on small, .dchip.on i { color: var(--on-accent); }
.slot-seg { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
.slot-seg button { padding: 0 .3rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
html.size-xl .slot-seg, html.size-large .slot-seg { grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 16px; }
.wide-seg { display: grid !important; grid-template-columns: 1fr 1fr; width: 100%; }
.gen-cta { margin-top: 1.4rem; }
.time-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.time-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .2rem .45rem; padding: .55rem .7rem .65rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: .9rem; }
.time-row input { grid-column: 1 / -1; height: 2.6rem; }
html.size-xl .time-grid { grid-template-columns: 1fr; }

/* cook mode: what the step needs, what comes next, reading aloud */
#cook-speak.on { color: var(--on-accent); background: var(--cc); }
.cook-need { margin-top: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .55rem 0 .3rem; }
.cook-need h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--muted); padding: .1rem 1rem .3rem; }
.cook-need h4 small { font-size: inherit; text-transform: none; letter-spacing: 0; font-weight: 600; }
.cook-upnext { width: 100%; margin-top: 1rem; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .6rem; padding: .75rem .8rem .75rem 1rem; border-radius: var(--r); border: 1.5px dashed var(--line-2); text-align: left; color: var(--ink-2); }
.cook-upnext small { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cook-upnext span { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cook-upnext svg { width: 1.1rem; height: 1.1rem; color: var(--muted); }

@media (max-width: 400px) { .plan-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
html.size-large .plan-quick, html.size-xl .plan-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pick-dock-in { flex-wrap: wrap; justify-content: center; }
.pick-dock .primary-btn { flex: 1 1 10rem; }

.pday-side { display: flex; align-items: center; gap: .7rem; flex: none; }
.pday-side .link-btn { font-size: .84rem; }

/* ================================================================ 4.9: colour palettes (light and dark), checked for contrast */
html.pal-terracotta:not(.dark) {
  --bg: #F7F3EC; --surface: #FFFFFF; --sunk: #EFE9DF; --ink: #1F1A15; --ink-2: #463C34; --muted: #6F6458;
  --line: #E3DACD; --line-2: #CFC3B3; --accent: #B03F26; --accent-2: #93311B; --on-accent: #FFFFFF; --warn: #B03F26;
  --veg: #3F6B27; --gf: #8A5E12; --cv1: #C9573A; --cv2: #A63A22; --cv3: #7E2A18; --cv-glow: 255,196,140; --cover-hi: #FFD7A8;
}
html.dark.pal-terracotta {
  --bg: #13110F; --surface: #1E1A17; --sunk: #181512; --ink: #F7F1E9; --ink-2: #E0D6CA; --muted: #BBAE9F;
  --line: #3A322B; --line-2: #51463C; --accent: #F2927A; --accent-2: #F7A892; --on-accent: #1A0F0B; --warn: #F2927A;
  --veg: #A9CF86; --gf: #E4BC72; --cv1: #7A3220; --cv2: #56220F; --cv3: #331308; --cv-glow: 255,170,120; --cover-hi: #FFD0A8;
}
html.pal-sea:not(.dark) {
  --bg: #F1F5F9; --surface: #FFFFFF; --sunk: #E5ECF3; --ink: #132130; --ink-2: #364759; --muted: #5B6B7D;
  --line: #D9E2EB; --line-2: #C3D0DD; --accent: #1E5DA6; --accent-2: #174A85; --on-accent: #FFFFFF; --warn: #1E5DA6;
  --veg: #3F6B27; --gf: #8A5E12; --cv1: #2F72BA; --cv2: #1D5594; --cv3: #123A68; --cv-glow: 170,215,255; --cover-hi: #CFE6FF;
}
html.dark.pal-sea {
  --bg: #0E131A; --surface: #18202A; --sunk: #131A22; --ink: #EEF4FA; --ink-2: #D0DCE8; --muted: #A8B8C9;
  --line: #2B3746; --line-2: #3E4D5F; --accent: #7DB4F5; --accent-2: #9AC6FA; --on-accent: #0A1522; --warn: #7DB4F5;
  --veg: #A9CF86; --gf: #E4BC72; --cv1: #1D4A7C; --cv2: #14365C; --cv3: #0C223B; --cv-glow: 120,180,255; --cover-hi: #BFDDFF;
}
html.pal-olive:not(.dark) {
  --bg: #F4F4EC; --surface: #FFFFFF; --sunk: #E9EBDE; --ink: #1B1F15; --ink-2: #40483A; --muted: #636B57;
  --line: #DEE1D1; --line-2: #CAD0B9; --accent: #4A6A26; --accent-2: #3A5419; --on-accent: #FFFFFF; --warn: #4A6A26;
  --veg: #3F6B27; --gf: #8A5E12; --cv1: #678A3E; --cv2: #4C6B2B; --cv3: #33491B; --cv-glow: 230,240,170; --cover-hi: #E6F2C4;
}
html.dark.pal-olive {
  --bg: #11130E; --surface: #1B1E17; --sunk: #161812; --ink: #F1F3EA; --ink-2: #D5DAC8; --muted: #ADB59D;
  --line: #33382A; --line-2: #474E3A; --accent: #B2D087; --accent-2: #C4DD9F; --on-accent: #121A08; --warn: #B2D087;
  --veg: #A9CF86; --gf: #E4BC72; --cv1: #3E5524; --cv2: #2C3E19; --cv3: #1C2810; --cv-glow: 200,230,140; --cover-hi: #DDEDBE;
}
html.pal-plum:not(.dark) {
  --bg: #F8F3F5; --surface: #FFFFFF; --sunk: #EFE6EA; --ink: #21191E; --ink-2: #4A3D45; --muted: #6B5C66;
  --line: #E6DBE1; --line-2: #D4C5CE; --accent: #86356A; --accent-2: #6C2955; --on-accent: #FFFFFF; --warn: #86356A;
  --veg: #3F6B27; --gf: #8A5E12; --cv1: #9C4A80; --cv2: #7A3463; --cv3: #521F42; --cv-glow: 255,190,230; --cover-hi: #FAD2EC;
}
html.dark.pal-plum {
  --bg: #141013; --surface: #20191E; --sunk: #1A1418; --ink: #F7EFF4; --ink-2: #E0D2DA; --muted: #BBA7B3;
  --line: #3B2F37; --line-2: #51424C; --accent: #E79BCB; --accent-2: #F0B3D9; --on-accent: #1E0B17; --warn: #E79BCB;
  --veg: #A9CF86; --gf: #E4BC72; --cv1: #5E2A4C; --cv2: #431D36; --cv3: #2A1022; --cv-glow: 240,150,210; --cover-hi: #F7CBE6;
}

html.dark .cover-art { opacity: .08; }
/* dark mode: cuisine colours used as text are lightened, so deep blues and greens stay readable */
html.dark .cuisine.on .cuisine-text b,
html.dark .hero-kicker span:nth-child(2),
html.dark .stat.main .v { color: color-mix(in srgb, var(--cc) 42%, #FFFFFF); }
html.dark .icon-btn.on { color: color-mix(in srgb, var(--cc) 50%, #FFFFFF); background: color-mix(in srgb, var(--cc) 22%, transparent); }
html.dark .ftile-ic { color: color-mix(in srgb, var(--fc) 45%, #fff); background: color-mix(in srgb, var(--fc) 30%, transparent); }
html.dark .ftile.set .ftile-text small { color: color-mix(in srgb, var(--fc) 40%, #fff); }
html.dark .ftile.set .ftile-btn { border-color: color-mix(in srgb, var(--fc) 55%, #fff 10%); background: color-mix(in srgb, var(--fc) 14%, var(--surface)); }
html.dark .lcard.lnotes .lcard-ic, html.dark .note-peek b { color: #7FD1BD; }
html.dark .note-peek svg { fill: #7FD1BD; }
html.dark .note-peek { background: color-mix(in srgb, #2E7D6B 18%, var(--surface)); }
html.dark .callout.fast .callout-head svg { color: #F2C14E; }
html.dark .scrim { background: rgba(0, 0, 0, .6); }
html.dark .primary-btn.danger { background: #E5604F; color: #1A0805; }
html.dark .danger-txt { color: #FF8A7A; }
/* settings: palette picker, an even 2 × 2 grid (4 across on wide screens) */
.pal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
@media (min-width: 560px) { .pal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pal { display: flex; flex-direction: column; gap: .4rem; padding: .45rem .45rem .55rem; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; }
.pal.on { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }
.pal-sw { position: relative; display: block; height: 3.1rem; border-radius: 9px; background: var(--pg); border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); overflow: hidden; }
.pal-sw i { position: absolute; left: .5rem; top: .55rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--ac); }
.pal-sw b { position: absolute; left: 2.1rem; right: .6rem; top: .7rem; height: .32rem; border-radius: 99px; background: color-mix(in srgb, var(--ac) 55%, var(--pg)); }
.pal-sw em { position: absolute; left: 2.1rem; right: 1.8rem; top: 1.3rem; height: .32rem; border-radius: 99px; background: color-mix(in srgb, var(--ac) 30%, var(--pg)); }
.pal-name { font-weight: 700; font-size: .9rem; padding-left: .15rem; }

/* ================================================================ 4.9: the die, fridge quick picks */
.die { width: 1.5rem; height: 1.5rem; overflow: visible; }
.die .f1 { fill: currentColor; stroke: currentColor; }
.die .f2 { fill: currentColor; stroke: currentColor; opacity: .78; }
.die .f3 { fill: currentColor; stroke: currentColor; opacity: .58; }
.die .pip { fill: var(--bg); }
.dice-btn {
  display: inline-flex; align-items: center; gap: .5rem; height: 2.7rem; padding: 0 1rem 0 .7rem; margin-right: .35rem;
  border-radius: 999px; background: #FFFFFF; color: var(--cv2, #A63A22); font-weight: 700; font-size: .95rem; line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.dice-btn .die { width: 1.9rem; height: 1.9rem; }
.dice-btn .die .pip { fill: #FFFFFF; }
html.dark .dice-btn { background: var(--surface); color: var(--accent); box-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
html.dark .dice-btn .die .pip { fill: var(--surface); }
.dice-btn:active { transform: scale(.96); }
.rolling .die { animation: roll .42s cubic-bezier(.3, .7, .4, 1); }
@keyframes roll { 0% { transform: rotate(0) scale(1); } 45% { transform: rotate(200deg) scale(1.18); } 100% { transform: rotate(360deg) scale(1); } }
@media (prefers-reduced-motion: reduce) { .rolling .die { animation: none; } }
@media (max-width: 359px) { .dice-btn span { display: none; } .dice-btn { padding: 0 .55rem; } }
html.size-xl .dice-btn span { display: none; }
html.size-xl .dice-btn { padding: 0 .55rem; }
.list-bar .die, #btn-list-random .die { width: 1.55rem; height: 1.55rem; }

/* What I have: three rows of three equal chips, a caption over each row */
.have-sug { display: flex; flex-direction: column; gap: .65rem; }
.hgroup small { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 .3rem .15rem; }
.hrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.hrow.typed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hrow .hchip { width: 100%; justify-content: flex-start; min-width: 0; }
.hrow .hchip.free { grid-column: 1 / -1; }
.have-none { grid-column: 1 / -1; color: var(--muted); font-size: .88rem; margin: .1rem .2rem; }
@media (min-width: 640px) { .hrow.typed { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 359px) { .hrow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
html.size-xl .hrow, html.size-large .hrow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hrow:not(.typed) .hchip:nth-child(n+4) { display: none; }
@media (max-width: 359px) { .hrow:not(.typed) .hchip:nth-child(4) { display: flex; } }
html.size-xl .hrow:not(.typed) .hchip:nth-child(4), html.size-large .hrow:not(.typed) .hchip:nth-child(4) { display: flex; }
.hchip.q { justify-content: center; padding: 0 .5rem; font-size: .9rem; }
/* dark mode: the selected segment must stand out as clearly as in light mode */
html.dark .seg { background: var(--bg); border-color: var(--line-2); }
html.dark .seg button.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
html.dark .seg button:not(.on) { color: var(--ink-2); }
/* 4.9.1: shopping ranges, an even 2 × 2 on phones (a fifth, "Chosen days", spans the row) */
@media (max-width: 639px) { .shop-range { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
.shop-range > :nth-child(5) { grid-column: 1 / -1; }
@media (min-width: 640px) { .shop-range[style*="--n:5"] > :nth-child(5) { grid-column: auto; } }

/* 5.1: my rating (stars) and sharing */
:root { --star: #D99A1E; --star-off: color-mix(in srgb, var(--line-2) 80%, var(--surface)); }
html.dark { --star: #F2C14E; --star-off: #5A4E43; }
.rate { display: flex; align-items: center; gap: .55rem; margin-top: .9rem; }
.rate-stars { display: inline-flex; gap: .1rem; }
.rate-star { width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 50%; color: var(--star-off); transition: transform .12s, color .12s; }
.rate-star svg { width: 1.55rem; height: 1.55rem; fill: currentColor; }
.rate-star.on { color: var(--star); }
.rate-star:active { transform: scale(.88); }
@media (hover: hover) { .rate-stars:hover .rate-star { color: var(--star); } .rate-stars .rate-star:hover ~ .rate-star { color: var(--star-off); } }
.rate-label { font-size: .88rem; font-weight: 600; color: var(--muted); }
.rate.hero-rate { margin-left: -.35rem; }
.rate.sheet-rate { justify-content: center; flex-direction: column; gap: .35rem; margin: .6rem 0 .4rem; }
.rate.sheet-rate .rate-star { width: 3.1rem; height: 3.1rem; }
.rate.sheet-rate .rate-star svg { width: 2.3rem; height: 2.3rem; }
.rate.sheet-rate .rate-label { font-size: 1rem; min-height: 1.4em; }
.row-rate { display: inline-flex; align-items: center; gap: .1rem; margin-left: .35rem; color: var(--star); vertical-align: -1px; font-style: normal; }
.row-rate svg { width: .9rem; height: .9rem; fill: currentColor; }
.row-rate b { font-size: .78rem; font-weight: 700; color: var(--muted); }
.lcard.lrated .lcard-ic { background: color-mix(in srgb, var(--star) 16%, var(--surface)); color: var(--star); }
.share-opts { display: grid; gap: .6rem; margin-top: .4rem; }
.share-opt { display: flex; align-items: flex-start; gap: .85rem; text-align: left; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); }
.share-opt:hover { border-color: var(--accent); }
.share-opt svg { flex: none; width: 1.4rem; height: 1.4rem; fill: var(--accent); margin-top: .1rem; }
.share-opt span { display: grid; gap: .2rem; }
.share-opt b { font-size: 1rem; }
.share-opt small { color: var(--muted); font-size: .86rem; line-height: 1.35; }
