/**
 * Shared components: summary tiles, food cards and rows, day chips,
 * search, location tabs, filters, empty state, cards, prompts, menus.
 */

/* Summary tiles (Today): number + words, tappable */
.tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.tile{border:0;border-radius:18px;padding:14px 12px;display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;font:inherit}
.tile b{font-size:34px;font-weight:800;line-height:1}
.tile span{font-size:15px;font-weight:700}
.tile.r{background:var(--red-bg);color:var(--red)} .tile.y{background:var(--yel-bg);color:var(--yel)} .tile.g{background:var(--grn-bg);color:var(--grn)}

/* Day chip: days left in words, in the traffic-light colour (D9) */
.dchip{flex:none;font-weight:800;font-size:14px;padding:6px 10px;border-radius:999px;white-space:nowrap}
.dchip.r{background:var(--red-bg);color:var(--red)} .dchip.y{background:var(--yel-bg);color:var(--yel)} .dchip.g{background:var(--grn-bg);color:var(--grn)}
.dchip.muted{background:var(--surface-2);color:var(--muted)}

/* Older badge, still used by a few sheets */
.badge{flex:none;min-width:52px;padding-inline:4px;height:52px;border-radius:14px;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1}
.badge b{font-size:24px;font-weight:800}
.badge small{font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;margin-top:2px}
.badge.r{background:var(--red-bg);color:var(--red)} .badge.y{background:var(--yel-bg);color:var(--yel)} .badge.g{background:var(--grn-bg);color:var(--grn)}
.badge.word b{font-size:17px}
.badge.muted-badge{background:var(--surface-2);color:var(--muted)}

/* Food card (Today "Use these first") */
.ucard{background:var(--surface);border-radius:var(--r-lg);padding:14px;display:flex;flex-direction:column;gap:12px}
.ucard-top{display:flex;justify-content:space-between;align-items:center;gap:10px;border:0;background:none;padding:0;text-align:left;width:100%;color:inherit}
.ucard-name{display:flex;flex-direction:column;gap:2px;min-width:0}
.ucard-name b{font-size:18px;font-weight:700}
.ucard-name span{font-size:14px;color:var(--muted)}
.tip{display:flex;align-items:center;gap:8px;background:var(--accent-soft);border-radius:var(--r-sm);padding:10px 12px;font-size:14px;color:var(--accent-strong)}
.acts{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:8px}

/* Search */
.search{width:100%;min-height:52px;border:1px solid var(--line);background:var(--surface);border-radius:var(--r-md);padding:12px 16px;font-size:17px}

/* Segmented control (location tabs, fill levels) */
.seg{display:flex;background:var(--surface-2);border-radius:var(--r-md);padding:4px;gap:4px;overflow-x:auto;scrollbar-width:none}
.seg::-webkit-scrollbar{display:none}
.seg button{flex:1;min-width:64px;min-height:48px;border:0;background:none;border-radius:12px;padding:6px 6px;font-size:15px;font-weight:600;color:var(--muted);display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.15}
.seg button small{font-size:12px;font-weight:600}
.seg button[aria-pressed="true"]{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.12);font-weight:800}
.pills{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none;margin:0 -18px;padding-inline:18px}
.pills::-webkit-scrollbar{display:none}
.pill{flex:none;min-height:40px;border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:6px 14px;font-size:15px;font-weight:600}
.pill[aria-pressed="true"]{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.controls{display:flex;flex-direction:column;gap:12px}

/* Groups and rows */
.group{display:flex;flex-direction:column;gap:10px}
.ghead{display:flex;align-items:center;justify-content:space-between;gap:8px}
.ghead h2{font-size:20px;font-weight:800}
.gtitle{font-size:14px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;margin:0}
.gtitle.r{color:var(--red)} .gtitle.y{color:var(--yel)} .gtitle.g{color:var(--grn)}
.shelf{background:var(--surface);border-radius:var(--r-lg);overflow:hidden}
.row{display:flex;align-items:center;gap:12px;width:100%;min-height:66px;border:0;background:none;text-align:left;padding:12px 16px;border-top:1px solid var(--line);color:inherit}
.row:first-child{border-top:0}
.row-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.nm{font-weight:700;font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.meta{font-size:14px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.date{font-size:14px;color:var(--muted);flex:none}

/* Empty state */
.empty{background:var(--surface);border-radius:var(--r-xl);padding:28px 20px;display:flex;flex-direction:column;gap:14px;align-items:flex-start}
.empty h2{font-size:26px;font-weight:800}
.empty p{margin:0;color:var(--muted);max-width:42ch}
.shelfart{width:100%;height:84px;border-radius:14px;background:
  linear-gradient(var(--line),var(--line)) 0 28px/100% 2px no-repeat,
  linear-gradient(var(--line),var(--line)) 0 58px/100% 2px no-repeat, var(--surface-2)}

/* Cards and prompts */
.card{background:var(--surface);border-radius:var(--r-lg);padding:16px;display:flex;flex-direction:column;gap:12px}
.status{display:flex;gap:12px;align-items:center}
.status .badge{width:60px;height:60px}
.status .badge b{font-size:30px}
.stepper{display:flex;align-items:center;gap:8px}
.stepper .inp{text-align:center}
.stepper button{flex:none;width:52px;height:52px;border-radius:14px;border:1px solid var(--line);background:var(--surface-2);font-size:26px;font-weight:700}
.prompt{background:var(--accent-soft);border-radius:var(--r-md);padding:14px;display:flex;flex-direction:column;gap:10px;font-size:16px}
.tag{display:inline-block;font-size:12px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;padding:3px 8px;border-radius:7px;background:var(--surface-2);color:var(--muted)}
.tag.known{background:var(--grn-bg);color:var(--grn)} .tag.suggested{background:var(--yel-bg);color:var(--yel)} .tag.new{background:var(--accent-soft);color:var(--accent-strong)} .tag.ignored{background:var(--surface-2);color:var(--muted)}
.closeacts{display:flex;flex-direction:column;gap:10px}

/* Lists of settings (item details, More) */
.list{background:var(--surface);border-radius:var(--r-lg);overflow:hidden}
.list>.kv{padding:6px 16px;border-top:1px solid var(--line);flex-wrap:wrap;row-gap:6px}
.list>.kv:first-child{border-top:0}

/* Add menu tiles */
.menu{display:flex;flex-direction:column;gap:8px}
.menu button{display:flex;gap:14px;align-items:center;text-align:left;border:0;background:var(--surface);border-radius:var(--r-md);padding:14px}
.menu button:disabled{opacity:.5}
.menu .ic{flex:none;width:44px;height:44px;border-radius:12px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center}
.menu .ic svg{width:22px;height:22px}
.menu b{display:block;font-size:17px}
.menu span span{font-size:14px;color:var(--muted)}

/* Newly added item: brief highlight after saving */
@keyframes rowflash{0%,40%{background:var(--accent-soft)}100%{background:transparent}}
.row.flash{animation:rowflash 2.4s ease-out}
