/*
  Ripeline styles
  ---------------
  This file controls how everything LOOKS: colors, sizes, spacing.
  The colors at the top come straight from the Figma design.
  Change one here and it changes everywhere in the app.
*/

:root {
  --background: #c1fbb0;    /* light green page background */
  --card: #d9d9d9;          /* grey cards */
  --white: #ffffff;
  --text: #000000;
  --muted: #6e6e6e;         /* grey helper text, e.g. "(optional)" */
  --button: #68dd53;        /* bright green buttons */
  --link-red: #ff383c;      /* "Add to a recipe" links */
  --tag-green: #92dd6a;     /* "Fresh" / "Yes" tag background */
  --tag-green-text: #648757;
  --tag-yes-text: #184300;
  --tag-orange: #ff7438;    /* "No" tag background */
  --tag-orange-text: #830505;
  --nav-text: #49454f;
  --nav-highlight: #c1fbb0;
  --accent: #86e46b;        /* profile name card */
  --page-edge: #a9e597;     /* around the app on a computer */
  --focus: #3fa52b;

  --gutter: 12px;           /* space at the left and right edge of each screen */
  --nav-height: 64px;
}

/*
  COLOUR SCHEMES (chosen on the Profile screen)
  Each one swaps the main colours above. "Fresh Green" is the default.
*/
:root[data-theme="peach"] {
  --background: #ffe4d2; --button: #ffa86f; --nav-highlight: #ffe4d2;
  --accent: #ffc59e; --page-edge: #f5c8a8; --focus: #e07a35;
}
:root[data-theme="lavender"] {
  --background: #ebe3ff; --button: #b796f5; --nav-highlight: #ebe3ff;
  --accent: #cdb8fb; --page-edge: #d3c3f7; --focus: #8a62de;
}
:root[data-theme="ocean"] {
  --background: #d6ecff; --button: #5eb2f2; --nav-highlight: #d6ecff;
  --accent: #93cdf7; --page-edge: #aed6f5; --focus: #2f8bd1;
}

/* ---------- Basic page setup ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* anything marked "hidden" stays hidden */

html, body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-weight: 500;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* On a computer, the area around the phone-sized app is a slightly darker green */
body { background: var(--page-edge); }

p, h1, h2, ul { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

/* The phone-sized "frame" that holds every screen */
.app {
  position: relative;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--background);
}

/* ---------- Screens ---------- */
.screen {
  position: relative;
  display: none;                       /* hidden unless it is the active screen */
  padding: 38px var(--gutter) calc(var(--nav-height) + 32px + env(safe-area-inset-bottom));
}
.screen.is-active { display: block; }
.screen--no-top { padding-top: 0; }

/* ---------- Shared text styles ---------- */
.title {
  font-size: 28px;
  font-weight: 600;
  line-height: 34px;
}
.title--bold { font-weight: 700; }

.subtitle {
  margin-top: 7px;
  font-size: 20px;
  line-height: 24px;
}

/* ---------- Shared pieces ---------- */

/* Square-ish photo boxes with white background and rounded corners */
.photo {
  overflow: hidden;
  border-radius: 10px;
  background: var(--white);
  flex-shrink: 0;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }

/* Two photos are zoomed/cropped in Figma; these match that crop */
.photo img.crop-milk   { width: 108.62%; height: 114.89%; max-width: none; margin: -6.38% 0 0 -7.03%; }
.photo img.crop-cheese { width: 104.89%; height: 120.79%; max-width: none; margin: -9.9% 0 0 -0.13%; }

.arrow { width: 25px; height: auto; }
.arrow--down { width: 15px; transform: rotate(90deg); }

/* Small pill-shaped labels: Fresh / Yes / No */
.tag {
  display: inline-block;
  min-width: 62px;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 15px;
  text-align: center;
}
.tag--fresh { background: var(--tag-green); color: var(--tag-green-text); }
.tag--yes   { background: var(--tag-green); color: var(--tag-yes-text); }
.tag--no    { background: var(--tag-orange); color: var(--tag-orange-text); }

/* Search boxes */
.search {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 32px;
  margin-top: 7px;
  padding: 0 10px;
  background: var(--white);
  border-radius: 12px;
}
.search--round { border-radius: 15px; margin-top: 11px; }
.search__icon {
  width: 16px; height: 16px; flex-shrink: 0;
  fill: none; stroke: #1e1e1e; stroke-width: 2.5; stroke-linecap: round;
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
}
.search input::placeholder { color: var(--text); }

/* Filter buttons (All, Meats, Dairy...) */
.chips {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;                    /* swipe sideways if they don't fit */
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  height: 26px;
  padding: 0 10px;
  border: 1px solid #000;
  border-radius: 12px;
  background: var(--card);
  font-size: 12px;
}
.chip.is-selected { background: var(--white); }
.chip.is-selected { background: var(--white); font-weight: 600; }
.chips--small .chip { flex: 1 0 auto; height: 20px; padding: 0 12px; }

/* Big green buttons ("+ Add Food", "+ Add to My Fridge") */
.big-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 91px;
  margin-top: 47px;
  border: 0;
  border-radius: 12px;
  background: var(--button);
  font-size: 36px;
  font-weight: 500;
  text-align: center;
}

/* Smaller green buttons on the recipe screen */
.green-button {
  display: block;
  width: 100%;
  height: 36px;
  margin-top: 14px;
  border: 0;
  border-radius: 12px;
  background: var(--button);
  font-size: 16px;
}

.big-button:active, .green-button:active, .chip:active, .recipe-card__button:active { filter: brightness(0.92); }

/* ---------- Screen 1: Home ---------- */
.summary-card {
  margin-top: 42px;
  padding: 9px;
  height: 100px;
  border-radius: 15px;
  background: var(--card);
}
.summary-card__label { font-size: 12px; }
.summary-card__count { margin-top: 6px; font-size: 24px; line-height: 29px; }
.summary-card__note  { margin-top: 7px; font-size: 16px; }

.section-heading { margin-top: 16px; font-size: 20px; font-weight: 600; line-height: 24px; }
.section-note    { margin-top: 2px; font-size: 13px; }

.expiring-card {
  display: flex;
  gap: 15px;
  height: 137px;
  margin-top: 16px;
  padding: 7px;
  border-radius: 12px;
  background: var(--card);
}
.expiring-card + .expiring-card { margin-top: 20px; }
.expiring-card__photo { width: 144px; height: 123px; }
.expiring-card__text { padding-top: 6px; font-weight: 600; }
.expiring-card__name { font-size: 20px; line-height: 24px; }
.expiring-card__when { margin-top: 6px; font-size: 13px; }
.expiring-card__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--link-red);
}

/* ---------- Screen 2: My Fridge ---------- */
.items-card {
  margin-top: 40px;
  padding: 9px 9px 13px;
  border-radius: 12px;
  background: var(--card);
}
.items-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1px 4px;
  font-size: 15px;
}
.items-card__sort { display: flex; align-items: center; gap: 8px; font-size: 12px; }

.item { display: flex; gap: 14px; padding-top: 9px; }
.item__photo { width: 109px; height: 109px; }
.item__name { margin: 15px 0 14px; font-size: 15px; line-height: 18px; }

/* ---------- Screen 3: Add Food ---------- */
.form-card {
  margin-top: 20px;
  padding: 14px 9px 54px;
  border-radius: 15px;
  background: var(--card);
}
.field { display: block; }
.field + .field { margin-top: 27px; }
.field__label { display: block; font-size: 20px; line-height: 24px; }
.field__optional { font-size: 12px; color: var(--muted); }
.field__input {
  display: block;
  width: 100%;
  height: 38px;
  margin-top: 27px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--white);
  font: inherit;
  font-size: 15px;
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
}
.field__input::placeholder { color: var(--text); }
.field__select { position: relative; display: block; }
.field__select::after {                 /* the little "v" arrow on the dropdowns */
  content: "";
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 6px;
  height: 6px;
  border-right: 2px solid #1e1e1e;
  border-bottom: 2px solid #1e1e1e;
  transform: rotate(45deg);
  pointer-events: none;
}
.form-card + .big-button { margin-top: 7px; }

/* ---------- Screen 4: Recipe Finder ---------- */
#recipes { padding-top: 41px; }
#recipes .chips { margin-top: 10px; }
.recipes-heading {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 500;
  line-height: 34px;
  text-align: center;
}
.recipe-card {
  max-width: 337px;
  margin: 9px auto 0;
  background: var(--card);
}
.recipe-card__photo { width: 100%; aspect-ratio: 337 / 232; object-fit: cover; }
.recipe-card__footer { padding: 10px 14px 9px; }
.recipe-card__name { font-size: 15px; line-height: 18px; }
.recipe-card__button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 25px;
  margin-top: 6px;
  border-radius: 12px;
  background: var(--white);
  font-size: 12px;
  font-weight: 400;
}

/* ---------- Screen 5: Recipe Details ---------- */
.recipe-hero {
  width: calc(100% + 2 * var(--gutter));
  max-width: none;
  height: 198px;
  margin: 0 calc(-1 * var(--gutter));
  object-fit: cover;
}
.title--recipe { margin-top: 6px; font-weight: 500; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 13px;
}
.stat {
  height: 84px;
  padding-top: 16px;
  border-radius: 12px;
  background: var(--white);
  text-align: center;
  font-size: 20px;
  line-height: 24px;
}
.stat__value { font-weight: 300; }
.stat__label { margin-top: 7px; }

.ingredients-heading { margin-top: 29px; font-size: 20px; font-weight: 500; line-height: 24px; }
.ingredients {
  margin-top: 6px;
  padding: 20px 20px 12px 25px;
  list-style: none;
  border-radius: 12px;
  background: var(--white);
}
.ingredients li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 36px;
  font-size: 15px;
  line-height: 18px;
}
.ingredients li + li { margin-top: 14px; }
.ingredients .tag { margin-top: 6px; }
.ingredients + .green-button { margin-top: 7px; }

/* ---------- Bottom navigation bar ---------- */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding: 0 8px env(safe-area-inset-bottom);
  background: var(--white);
  z-index: 10;
}
.tab {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 0 16px;
  border-radius: 100px;
  color: var(--nav-text);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
}
.tab svg {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round;
}
.tab.is-active { background: var(--nav-highlight); color: #1d1b20; }
.tab.is-active svg { fill: currentColor; fill-opacity: 0.15; }

/* ---------- "Coming soon" pop-up ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + 16px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  max-width: calc(min(100%, 430px) - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: #1d1b20;
  color: #fff;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

/* =========================================================
   Added for the working (dynamic) version
   ========================================================= */

/* Food with no photo shows a big emoji on a white tile instead */
.photo--emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  line-height: 1;
}

/* More tag colours */
.tag--soon    { background: var(--tag-orange); color: var(--tag-orange-text); }
.tag--expired { background: #e5484d; color: #fff; }
.tag--none    { background: #ececec; color: #555; }

/* Plain text-style button (e.g. "Reset to example food") */
.text-button {
  display: block;
  margin: 16px auto 0;
  padding: 8px;
  border: 0;
  background: none;
  font-size: 13px;
  color: #3b5f2e;
  text-decoration: underline;
}

/* Empty-state messages */
.empty-card {
  margin-top: 16px;
  padding: 20px 16px;
  border-radius: 12px;
  background: var(--card);
  font-size: 15px;
  text-align: center;
}
.empty-card .text-button { margin-top: 8px; }
.empty-text { padding: 24px 8px; font-size: 15px; text-align: center; }

/* ---------- Home ---------- */
.summary-card { display: block; }
.summary-card:active { filter: brightness(0.95); }
.expiring-card__photo-link { display: block; flex-shrink: 0; }
.expiring-card__text { min-width: 0; }
.expiring-card__name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expiring-card__when.is-expired { color: #c2272d; }
.expiring-card__used {
  display: block;
  margin-top: 10px;
  padding: 3px 10px;
  border: 1px solid #000;
  border-radius: 12px;
  background: var(--white);
  font-size: 12px;
  font-weight: 500;
}
.expiring-card { height: auto; min-height: 137px; }
.more-link {
  display: block;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: underline;
}

/* ---------- My Fridge ---------- */
.items-card__sort {
  border: 0;
  background: none;
  padding: 4px 0;
}
.item { align-items: center; padding: 9px 0 0; border-radius: 12px; }
.item__info { flex: 1; min-width: 0; }
.item__name { margin: 0; font-size: 15px; line-height: 18px; }
.item__details { margin: 3px 0 8px; font-size: 12px; color: #4a4a4a; min-height: 15px; }
.item.is-highlighted { animation: highlight 2.4s ease-out; }
@keyframes highlight {
  0%, 40% { background: #fff6b3; box-shadow: 0 0 0 6px #fff6b3; }
  100%    { background: transparent; box-shadow: 0 0 0 6px transparent; }
}
.item__remove {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  width: 48px;
  padding: 6px 0;
  margin-right: 4px;
  border: 1px solid #000;
  border-radius: 12px;
  background: var(--white);
  font-size: 15px;
  line-height: 1;
}
.item__remove span { font-size: 10px; }

/* ---------- Add Food: quick pick ---------- */
.browse-card {
  margin-top: 16px;
  padding: 12px 9px;
  border-radius: 15px;
  background: var(--card);
}
.browse-card__title { font-size: 17px; font-weight: 600; }
.browse-card__hint { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--muted); }
.browse-card .chips { margin-top: 10px; }
.browse-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 232px;                 /* scroll inside the box if there are lots of foods */
  margin-top: 10px;
  overflow-y: auto;
}
.food-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 72px;
  padding: 6px 4px;
  border: 0;
  border-radius: 12px;
  background: var(--white);
}
.food-tile:active { filter: brightness(0.92); }
.food-tile__emoji { font-size: 26px; line-height: 1; }
.food-tile__name { font-size: 11px; line-height: 13px; text-align: center; }

/* ---------- Add Food: the form ---------- */
.form-card { margin-top: 16px; padding-bottom: 20px; scroll-margin-top: 12px; }
.field + .field { margin-top: 20px; }
.field__input { margin-top: 12px; }
.field__row { display: flex; gap: 8px; }
.field__row > .field__input { flex: 1; min-width: 0; }
.field__row > .field__select { flex: 1; }
.field__row .field__input { margin-top: 12px; }
.field__hint { margin-top: 6px; font-size: 12px; color: #4a4a4a; }
.field__hint:empty { display: none; }
.field__error { margin-top: 6px; font-size: 13px; color: #c2272d; }
.field__input.has-error { box-shadow: 0 0 0 2px #e5484d; }
.field__input:focus { outline: 2px solid var(--focus); outline-offset: 0; }
.field__autocomplete { position: relative; }

.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 4px;
  list-style: none;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 5;
}
.suggestions button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 15px;
  text-align: left;
}
.suggestions button:hover, .suggestions button:focus { background: #eefbe9; }
.suggestions small { margin-left: auto; font-size: 11px; color: var(--muted); }

/* ---------- Recipes ---------- */
.recipe-card + .recipe-card { margin-top: 16px; }
.recipe-card__have { margin-top: 3px; font-size: 12px; color: #4a4a4a; }

/* ---------- Pop-up with Undo ---------- */
.toast { display: flex; align-items: center; justify-content: center; gap: 14px; }
.toast__action {
  border: 0;
  background: none;
  color: #8ef17a;
  font-size: 14px;
  font-weight: 600;
  padding: 0;
}

/* =========================================================
   Profile, profile button, recipes, shopping
   ========================================================= */

/* Profile button: top-right of every screen */
.profile-button {
  position: absolute;
  top: 22px;
  right: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  z-index: 3;
}
.profile-button svg {
  width: 30px; height: 30px;
  fill: none; stroke: #1e1e1e; stroke-width: 2; stroke-linecap: round;
}
.profile-button:active { background: rgba(0, 0, 0, 0.08); }
.profile-button.is-active svg { stroke-width: 2.6; }
/* Over the recipe photo it needs a white circle so you can see it */
#recipe .profile-button { top: 12px; background: rgba(255, 255, 255, 0.9); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
#recipe .profile-button svg { width: 24px; height: 24px; }
/* Keep long titles from running under the button */
.screen > .title { padding-right: 48px; }

/* ---------- Profile screen ---------- */
#profile { padding-top: 20px; }
.profile-subtitle { margin-top: 8px; font-size: 14px; }

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 69px;
  margin-top: 19px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent);
}
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--white);
  font-size: 14px;
  font-weight: 700;
}
.profile-card__text { flex: 1; min-width: 0; font-size: 13px; line-height: 16px; }
.profile-card__name, .profile-card__email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-card__edit {
  flex-shrink: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 12px;
}
.profile-card__edit:active { background: rgba(255, 255, 255, 0.5); }

.panel {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--white);
}
.panel__label { display: block; margin-top: 10px; font-size: 14px; }
.panel__label:first-child { margin-top: 0; }
.panel .field__input { margin-top: 6px; background: #f3f3f3; }
.panel__buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.small-button {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--button);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.small-button--plain { background: #ececec; }
.small-button--danger { background: #e5484d; color: #fff; }
.small-button:active { filter: brightness(0.92); }

.profile-heading { margin-top: 28px; font-size: 20px; font-weight: 500; line-height: 24px; }

.white-card {
  margin-top: 14px;
  padding: 10px 12px 18px;
  border-radius: 12px;
  background: var(--white);
}
.white-card__title { display: flex; align-items: center; gap: 10px; font-size: 20px; line-height: 24px; }
.white-card__text { margin-top: 8px; font-size: 13px; line-height: 18px; color: #333; }
.white-card__note { margin-top: 8px; font-size: 11px; color: var(--muted); }

.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 25px;
  margin-top: 20px;
  padding: 0 9px;
}
.theme-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  height: 60px;
  padding: 0 4px 6px;
  border: 1px solid #000;
  border-radius: 12px;
  background: var(--white);
  font-size: 13px;
  font-weight: 300;
}
.theme-tile__swatches { display: flex; gap: 4px; }
.theme-tile__swatches i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.15); }
.theme-tile.is-selected { border-width: 2.5px; font-weight: 600; }

.white-card--list { padding: 0; overflow: hidden; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 69px;
  padding: 0 15px;
  border: 0;
  background: none;
  font-size: 20px;
  font-weight: 400;
  text-align: left;
}
.settings-row + .privacy-panel + .settings-row,
.settings-row + .settings-row { border-top: 1px solid #000; }
.settings-row:active { background: #f3f3f3; }
.settings-row__icon {
  width: 24px; height: 24px;
  fill: none; stroke: #1e1e1e; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.2s;
}
.settings-row.is-open .settings-row__icon { transform: rotate(90deg); }
.privacy-panel { padding: 0 15px 16px; font-size: 13px; line-height: 18px; color: #333; }
.privacy-panel .small-button { margin-top: 12px; }

/* ---------- Home: shopping list ---------- */
.section-heading--spaced { margin-top: 28px; }
.empty-card--small { padding: 14px; font-size: 13px; }
.shopping {
  margin-top: 12px;
  padding: 4px 0;
  list-style: none;
  border-radius: 12px;
  background: var(--white);
}
.shopping li { display: flex; align-items: center; gap: 8px; padding: 8px 12px; }
.shopping li + li { border-top: 1px solid #eee; }
.shopping__name { flex: 1; min-width: 0; font-size: 15px; }
.shopping__name small { display: block; font-size: 11px; color: var(--muted); }
.shopping__got, .shopping__remove {
  width: 34px; height: 34px;
  border: 1px solid #000;
  border-radius: 50%;
  background: var(--white);
  font-size: 16px;
  line-height: 1;
}
.shopping__got { background: var(--tag-green); }
.shopping__remove { border-color: #bbb; color: #666; }

/* ---------- My Fridge: recipes link ---------- */
.item__recipes { margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--link-red); }

/* ---------- Recipe Finder ---------- */
.recipes-status { margin-top: 14px; font-size: 14px; font-weight: 600; }
.text-button--inline { display: inline; margin: 0 0 0 6px; padding: 0; }
#recipe-list { margin-top: 14px; }
.recipe-card { margin-top: 0; }
.recipe-card__picture-link { display: block; }
.recipe-card__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mini-tag { padding: 1px 7px; border-radius: 8px; background: var(--white); font-size: 10px; }
.recipe-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 84px;
  line-height: 1;
  background: linear-gradient(135deg, var(--white), var(--accent));
}
.recipe-card__photo.recipe-emoji { aspect-ratio: 337 / 180; }

/* ---------- Recipe Details ---------- */
.recipe-hero-wrap .recipe-hero.recipe-emoji { font-size: 110px; }
.green-button { font-weight: 500; }
.steps-card {
  margin-top: 18px;
  padding: 14px 16px 16px;
  border-radius: 12px;
  background: var(--white);
  scroll-margin-top: 12px;
}
.steps-card__title { font-size: 20px; font-weight: 600; }
.steps { margin: 10px 0 0; padding-left: 0; list-style: none; counter-reset: step; }
.steps li {
  position: relative;
  padding-left: 36px;
  font-size: 15px;
  line-height: 21px;
  counter-increment: step;
}
.steps li + li { margin-top: 12px; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--button);
  font-size: 13px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}
.steps-card__credit { margin-top: 12px; font-size: 11px; color: var(--muted); }
.steps-card__time { margin-top: 4px; font-size: 13px; color: #555; }

/* =========================================================
   Built-in recipes, Shopping tab, editing food
   ========================================================= */

/* Warning when the browser can't save */
.storage-warning {
  margin: 0;
  padding: 10px 14px;
  background: #fff3c4;
  font-size: 13px;
  line-height: 18px;
  text-align: center;
}

/* Bottom bar with four tabs */
.tab-bar { padding: 0 4px env(safe-area-inset-bottom); }
.tab {
  position: relative;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  height: 52px;
  min-width: 72px;
  padding: 0 10px;
  border-radius: 18px;
  font-size: 11px;
  letter-spacing: 0.3px;
}
.tab svg { width: 22px; height: 22px; }
.tab__badge {
  position: absolute;
  top: 3px;
  right: 14px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: #e5484d;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

/* Small helpers */
.text-button--danger { color: #c2272d; }
.empty-card--link { display: block; }
.empty-card--link strong { display: block; margin-top: 6px; }

/* ---------- Home: recipe pick + shopping link ---------- */
.pick-card {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  padding: 7px;
  border-radius: 12px;
  background: var(--card);
}
.pick-card:active { filter: brightness(0.95); }
.pick-card__picture {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  object-fit: cover;
}
.pick-card__picture.recipe-emoji { font-size: 52px; }
.pick-card__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-top: 4px; }
.pick-card__name { font-size: 17px; font-weight: 600; line-height: 21px; }
.pick-card__reason { font-size: 13px; line-height: 17px; color: #2d5a1e; }
.pick-card__meta { font-size: 12px; color: #444; }

.shopping-link {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 14px 14px;
  border-radius: 12px;
  background: var(--white);
  font-size: 15px;
}
.shopping-link span { margin-left: auto; }
.shopping-link:active { filter: brightness(0.96); }

/* ---------- My Fridge: tap a food to edit ---------- */
.item__photo-link { display: block; flex-shrink: 0; border-radius: 10px; }
.item__name { display: block; }
.item__edit {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
}

/* ---------- Recipe Finder: whole card is a link ---------- */
a.recipe-card { display: block; }
a.recipe-card:active { filter: brightness(0.96); }
.recipe-card + .recipe-card { margin-top: 16px; }
.recipe-card__footer { display: block; }
.recipe-card__name { display: block; font-size: 16px; font-weight: 600; }
.recipe-card__reason { display: block; margin-top: 4px; font-size: 13px; line-height: 17px; color: #2d5a1e; }
.recipe-card__reason.is-urgent, .recipe-reason.is-urgent { color: #a3410f; font-weight: 600; }
.recipe-card__have { display: block; margin-top: 4px; font-size: 12px; color: #444; }
.recipe-card__tags:empty { display: none; }
.recipe-card__button { margin-top: 8px; }
.recipe-card__photo.recipe-emoji { aspect-ratio: 337 / 150; font-size: 72px; }

/* ---------- Recipe Details ---------- */
.recipe-reason { margin-top: 6px; font-size: 15px; line-height: 20px; color: #2d5a1e; }
.recipe-categories { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.recipe-categories .mini-tag { font-size: 11px; padding: 2px 8px; }
.ingredients-heading__count { font-size: 13px; font-weight: 500; color: #444; }
.ingredients small { font-size: 11px; color: var(--muted); }

/* ---------- Shopping screen ---------- */
.shopping-add { display: flex; gap: 8px; margin-top: 14px; }
.shopping-add .field__input { margin-top: 0; height: 40px; }
.shopping-add .small-button { height: 40px; }
#shopping-add-error { margin-top: 6px; }
.shopping-card { margin-top: 16px; }
.shopping-card .shopping { margin-top: 6px; }
.shopping__name em { font-style: normal; font-size: 12px; color: #555; }
.shopping-help { margin-top: 10px; color: #444; }

/* Storage warning banner: one message per line, optional OK button */
.storage-warning span { display: block; }
.storage-warning span + span { margin-top: 6px; }
.storage-warning__close {
  margin-top: 6px;
  padding: 4px 14px;
  border: 1px solid #000;
  border-radius: 10px;
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
}

.item__edit, .item__recipes { white-space: nowrap; }

/* "Show more" under the recipe list */
.show-more { margin-top: 18px; }



/* ---------- Your Account screen ---------- */
a.settings-row { text-decoration: none; color: inherit; }
.privacy-panel p + p { margin-top: 8px; }
.account-tabs { margin-top: 16px; }
.account-tabs .chip { flex: 1; height: 32px; font-size: 14px; }
.account-form { margin-top: 14px; }
.account-show { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; }
.account-submit { height: 64px; margin-top: 16px; font-size: 26px; }
.account-note { margin-top: 12px; font-size: 12px; line-height: 17px; color: #444; text-align: center; }
.account-message {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff3c4;
  font-size: 14px;
  line-height: 19px;
}
.account-message--error { background: #ffe1df; color: #8a1712; }
.account-message--success { background: #dcf5d2; color: #1f4d12; }
.account-card { margin-top: 18px; }
.account-card__label { font-size: 13px; color: #555; }
.account-card__email { margin-top: 2px; font-size: 18px; font-weight: 600; word-break: break-all; }
.account-card__status { margin-top: 4px; font-size: 13px; color: #2d5a1e; }
.account-card .green-button { margin-top: 16px; }
#account > .text-button { margin-top: 20px; }

/* ---------- Locked (not logged in) and loading states ---------- */
.app-checking { display: none; padding: 120px 24px; font-size: 16px; text-align: center; color: #444; }
body.is-checking .app-checking { display: block; }
body.is-checking .screen, body.is-checking .tab-bar { display: none !important; }
/* Until someone logs in: no bottom tabs, no profile button, no "back" link */
body.is-locked .tab-bar,
body.is-locked .profile-button,
body.is-locked .account-back { display: none !important; }
body.is-locked .screen { padding-bottom: 40px; }

/* ---------- Recipe pictures: emoji "illustrations" ---------- */
.recipe-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.55) 28%, transparent 62%),
    radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.5) 0 8%, transparent 9%),
    radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.35) 0 10%, transparent 11%),
    var(--art-color, #ffe9c7);
  box-shadow: inset 0 -18px 30px rgba(0, 0, 0, 0.06);
}
.recipe-art__main {
  position: relative;
  z-index: 1;
  font-size: 84px;
  line-height: 1;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.2));
}
.recipe-art__side {
  position: absolute;
  font-size: 30px;
  line-height: 1;
  opacity: 0.9;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.15));
}
.recipe-art__side--1 { left: 13%; top: 16%; transform: rotate(-14deg); }
.recipe-art__side--2 { right: 13%; bottom: 14%; transform: rotate(12deg); }
.recipe-art__side--3 { right: 16%; top: 14%; transform: rotate(8deg); font-size: 24px; }
/* Recipe card (list) */
.recipe-card__photo.recipe-art { aspect-ratio: 337 / 160; font-size: inherit; }
/* Big picture on Recipe Details */
.recipe-hero.recipe-art .recipe-art__main { font-size: 110px; }
.recipe-hero.recipe-art .recipe-art__side { font-size: 38px; }
/* Small picture on Home's "Recipe Pick for You" */
.pick-card__picture.recipe-art .recipe-art__main { font-size: 52px; }
.pick-card__picture.recipe-art .recipe-art__side { font-size: 18px; }
.pick-card__picture.recipe-art .recipe-art__side--3 { display: none; }

/* ---------- Notifications: on/off switch ---------- */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.switch-row__title { display: block; font-size: 18px; line-height: 22px; }
.switch-row__hint { display: block; margin-top: 2px; font-size: 13px; color: #555; }
.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 52px;
  height: 30px;
  margin: 0;
  border-radius: 15px;
  background: #cfcfcf;
  cursor: pointer;
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}
.switch:checked { background: var(--button); }
.switch:checked::after { transform: translateX(22px); }
.switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.reminders-options { margin-top: 14px; }
.reminders-options .field__input { margin-top: 6px; background: #f3f3f3; }
#reminders-card .white-card__note { margin-top: 12px; }

/* Account sync status (Profile) */
.sync-status { margin-top: 8px; font-size: 12px; color: #555; min-height: 15px; }
.sync-status--ok { color: #2d5a1e; }
.sync-status--warn { color: #8a5a00; }

/* Ripeline logo on the sign up / log in screen */
.account-logo { display: block; width: 72px; height: 72px; margin: 8px 0 6px; border-radius: 16px; }
body:not(.is-locked) .account-logo { display: none; }
