/* Yumiz: quiet neutral surfaces. Color carries meaning only in two places: a soft tint plus illustration per dish type,
   and the meat / dairy / parve marks. Everything else stays neutral so the food and the text lead. */
:root {
  --paper: #F7F8F5;
  --surface: #EDF0EA;
  --ink: #1F2B25;
  --ink-soft: #5A6961;
  --line: #DBE1D8;
  --focus: #3F6EA3;
  --done: #4C8A5D;
  --on-done: #FFFFFF;

  --k-meat: #9E4335;
  --k-dairy: #3A6499;
  --k-parve: #3F7A50;
  --star: #C8901A;

  --first-tint: #F5EBD0;  --first-a: #FBF5E6;  --first-b: #EBCF8E;  --first-l: #7A5B1F;
  --main-tint: #F3DDD6;   --main-a: #FBEFEA;   --main-b: #E3A99B;   --main-l: #8A3B2B;
  --side-tint: #DDEBDD;   --side-a: #F2F8F1;   --side-b: #A9CDA9;   --side-l: #2F5F3B;
  --salad-tint: #E6EDCB;  --salad-a: #F5F8E7;  --salad-b: #BBD27C;  --salad-l: #52651F;
  --dessert-tint: #F2DCE6; --dessert-a: #FBEFF4; --dessert-b: #E2A6C0; --dessert-l: #86325A;
  --soup-tint: #D9E5F1;   --soup-a: #EFF5FA;   --soup-b: #A3C0DE;   --soup-l: #2F4F7A;

  --display: 'Suez One', 'David', 'Times New Roman', serif;
  --body: 'Assistant', 'Arial', 'Helvetica', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121A16; --surface: #1B2620; --ink: #E8EEE9; --ink-soft: #A0B0A6; --line: #2C3A32;
    --focus: #9DBAF2; --done: #5DA070; --on-done: #0F1712;
    --k-meat: #EFA093; --k-dairy: #9DBAF2; --k-parve: #8CCB9C; --star: #E2B04A;
    --first-tint: #322D1C;  --first-a: #3F3822;  --first-b: #8A7233;  --first-l: #EAD58F;
    --main-tint: #37241F;   --main-a: #46302A;   --main-b: #9A5645;   --main-l: #F0B5A5;
    --side-tint: #1F3025;   --side-a: #2A3E31;   --side-b: #4F7F5A;   --side-l: #B5DDBC;
    --salad-tint: #2B321B;  --salad-a: #363F23;  --salad-b: #71872F;  --salad-l: #CDE28D;
    --dessert-tint: #382230; --dessert-a: #482D3E; --dessert-b: #9B4F73; --dessert-l: #F0B5D0;
    --soup-tint: #1E2B3B;   --soup-a: #283A4E;   --soup-b: #4A76A6;   --soup-l: #B4D0EE;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121A16; --surface: #1B2620; --ink: #E8EEE9; --ink-soft: #A0B0A6; --line: #2C3A32;
  --focus: #9DBAF2; --done: #5DA070; --on-done: #0F1712;
  --k-meat: #EFA093; --k-dairy: #9DBAF2; --k-parve: #8CCB9C; --star: #E2B04A;
  --first-tint: #322D1C;  --first-a: #3F3822;  --first-b: #8A7233;  --first-l: #EAD58F;
  --main-tint: #37241F;   --main-a: #46302A;   --main-b: #9A5645;   --main-l: #F0B5A5;
  --side-tint: #1F3025;   --side-a: #2A3E31;   --side-b: #4F7F5A;   --side-l: #B5DDBC;
  --salad-tint: #2B321B;  --salad-a: #363F23;  --salad-b: #71872F;  --salad-l: #CDE28D;
  --dessert-tint: #382230; --dessert-a: #482D3E; --dessert-b: #9B4F73; --dessert-l: #F0B5D0;
  --soup-tint: #1E2B3B;   --soup-a: #283A4E;   --soup-b: #4A76A6;   --soup-l: #B4D0EE;
  color-scheme: dark;
}

/* one dish type = one set of tones, used by tiles, thumbnails and headers */
.t-first   { --tint: var(--first-tint);   --a: var(--first-a);   --b: var(--first-b);   --l: var(--first-l); }
.t-main    { --tint: var(--main-tint);    --a: var(--main-a);    --b: var(--main-b);    --l: var(--main-l); }
.t-side    { --tint: var(--side-tint);    --a: var(--side-a);    --b: var(--side-b);    --l: var(--side-l); }
.t-salad   { --tint: var(--salad-tint);   --a: var(--salad-a);   --b: var(--salad-b);   --l: var(--salad-l); }
.t-dessert { --tint: var(--dessert-tint); --a: var(--dessert-a); --b: var(--dessert-b); --l: var(--dessert-l); }
.t-soup    { --tint: var(--soup-tint);    --a: var(--soup-a);    --b: var(--soup-b);    --l: var(--soup-l); }

.ill { display: block; width: 100%; height: auto; }
.ill * { stroke: var(--l); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ill .a { fill: var(--a); }
.ill .b { fill: var(--b); }
.ill .l { fill: none; }

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.5; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 720px; margin-inline: auto; padding-inline: 16px; padding-block: 20px 110px; display: flex; flex-direction: column; gap: 20px; }
.col { display: flex; flex-direction: column; gap: 20px; }

/* ---------- home ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mark { font-family: var(--display); font-weight: 400; font-size: 2.2rem; line-height: 1; }
.seg { display: inline-flex; background: var(--surface); border-radius: 999px; padding: 4px; }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 0.95rem; color: var(--ink-soft); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }

.search input { width: 100%; padding: 13px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--paper); font-size: 1rem; }
.search input::placeholder { color: var(--ink-soft); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 620px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { border: 0; border-radius: 20px; padding: 12px 12px 14px; background: var(--tint); display: flex; flex-direction: column; gap: 4px; align-items: stretch; text-align: start; }
.tile .art { padding-inline: 8px; }
.tile .name { font-family: var(--display); font-size: 1.35rem; line-height: 1.1; }
.tile .count { color: var(--ink-soft); font-size: 0.9rem; }

h2.sec { font-family: var(--display); font-weight: 400; font-size: 1.3rem; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- recipe cards with thumbnail ---------- */
.card { width: 100%; border: 1.5px solid var(--line); background: var(--paper); border-radius: 16px; padding: 10px; text-align: start; display: flex; align-items: center; gap: 14px; }
.thumb { flex: none; width: 76px; height: 76px; border-radius: 12px; background: var(--tint); display: grid; place-items: center; padding: 6px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.card .title { font-weight: 700; font-size: 1.08rem; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--ink-soft); font-size: 0.92rem; }
.k { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.9rem; color: var(--kc); }
.k::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--kc); }
.k-meat { --kc: var(--k-meat); }
.k-dairy { --kc: var(--k-dairy); }
.k-parve { --kc: var(--k-parve); }
.stars { color: var(--star); letter-spacing: 1px; }
.empty { color: var(--ink-soft); padding: 18px 4px; }

/* ---------- inner screens ---------- */
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 6px 2px; font-weight: 600; color: var(--ink-soft); }
.hero { border-radius: 22px; background: var(--tint); padding: 16px; display: flex; align-items: center; gap: 16px; }
.hero .art { flex: none; width: 104px; }
.hero .art img { width: 104px; height: 104px; object-fit: cover; border-radius: 14px; }
.hero .kicker { color: var(--ink-soft); font-weight: 600; font-size: 0.95rem; }
.hero h1 { font-family: var(--display); font-weight: 400; font-size: 1.9rem; line-height: 1.1; text-wrap: balance; }
.head-band { border-radius: 22px; background: var(--tint); padding: 18px; display: flex; align-items: center; gap: 16px; }
.head-band .art { flex: none; width: 96px; }
.head-band h1 { font-family: var(--display); font-weight: 400; font-size: 2rem; line-height: 1.1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1.5px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 0.95rem; }
.chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border-radius: 999px; padding: 4px; }
.stepper button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--paper); font-size: 1.3rem; font-weight: 700; line-height: 1; }
.stepper .val { min-width: 84px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.toggle, .ghost { border: 1.5px solid var(--line); background: transparent; border-radius: 999px; padding: 8px 16px; font-weight: 700; text-decoration: none; display: inline-block; }
.toggle[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.hint { color: var(--ink-soft); font-size: 0.9rem; }
.ghost.small { padding: 6px 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 0.92rem; color: var(--ink-soft); }
.top-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: transparent; display: grid; place-items: center; color: var(--ink-soft); }
.invite { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.invite .link { overflow-wrap: anywhere; font-weight: 600; text-align: start; }
.member { display: flex; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.note-warn { background: var(--surface); border-radius: 12px; padding: 10px 14px; font-size: 0.95rem; }

.group-title { font-weight: 700; margin-block: 8px 2px; color: var(--ink-soft); }
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: flex-start; gap: 12px; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 11px 2px; text-align: start; }
.box { flex: none; width: 22px; height: 22px; margin-top: 2px; border: 2px solid var(--ink-soft); border-radius: 6px; display: grid; place-items: center; font-size: 0.85rem; line-height: 1; }
.row[aria-pressed="true"] .box { background: var(--done); border-color: var(--done); color: var(--on-done); }
.row[aria-pressed="true"] .txt { text-decoration: line-through; color: var(--ink-soft); }
.num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); font-weight: 700; font-size: 0.9rem; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.row[aria-pressed="true"] .num { background: var(--done); color: var(--on-done); }
.txt { min-width: 0; }
.cook .txt { font-size: 1.35rem; line-height: 1.5; }
.cook .row { padding-block: 16px; }
.cook .box { width: 28px; height: 28px; }

.note { border-top: 1px solid var(--line); padding-block: 10px; display: flex; flex-direction: column; gap: 2px; }
.form { display: flex; flex-direction: column; gap: 10px; }
.form label { font-weight: 600; font-size: 0.95rem; }
.form input, .form textarea, .form select { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); }
.form textarea { min-height: 76px; resize: vertical; }
.form .line { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form .line select { width: auto; }
.form .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.primary { border: 0; border-radius: 14px; background: var(--ink); color: var(--paper); font-weight: 700; padding: 13px 20px; }
.primary[disabled], .opt[disabled] { opacity: 0.55; cursor: default; }
.secondary { border: 1.5px solid var(--line); border-radius: 14px; background: transparent; font-weight: 700; padding: 13px 20px; }

/* ---------- bottom navigation: search (right), add (middle, most prominent), home (left) ---------- */
.nav { position: fixed; inset-inline: 0; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); padding: 6px 16px calc(6px + env(safe-area-inset-bottom, 0px)); }
.nav-in { max-width: 720px; margin-inline: auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.nav-btn { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); }
.nav-btn[aria-current="page"] { color: var(--ink); }
.nav-add { width: 60px; height: 60px; margin-block: -22px 2px; border-radius: 50%; border: 4px solid var(--paper); background: var(--ink); color: var(--paper); display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22); }
.sheet-back { position: fixed; inset: 0; background: rgba(10, 20, 14, 0.5); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 720px; background: var(--paper); border-radius: 24px 24px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; }
.opt { border: 1.5px solid var(--line); background: transparent; border-radius: 14px; padding: 14px 16px; text-align: start; display: flex; flex-direction: column; gap: 2px; }
.opt b { font-size: 1.05rem; }
.opt span { color: var(--ink-soft); font-size: 0.9rem; }
.linkish { border: 0; background: transparent; font-weight: 700; padding: 10px; color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- sign-in, account, messages ---------- */
.login { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 14px; }
.login .mark { font-size: 3rem; margin: 0; }
.login .lead { font-size: 1.15rem; max-width: 30ch; margin: 0; }
.login .hint { max-width: 36ch; }
.google-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; color: #1F1F1F; font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer; }
.google-btn[disabled] { opacity: 0.6; cursor: default; }
.toast { position: fixed; inset-inline: 16px; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); margin-inline: auto; max-width: 520px;
  background: var(--ink); color: var(--paper); border-radius: 14px; padding: 12px 16px; font-weight: 600; text-align: center; z-index: 30; }
.claim { color: var(--k-dairy); font-weight: 600; }
.install { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface);
  border-radius: 16px; padding: 12px 14px; margin-block: 4px 12px; }
.install div { display: flex; flex-direction: column; gap: 2px; }
.install span { color: var(--ink-soft); font-size: 0.9rem; }
.install .primary { flex: none; }
