/*
 * foodgasm web app — independent styles. No coupling to miniapp.
 * Design direction: warm, food-forward, readable. Fresh produce palette.
 */

:root {
  --fg-bg:        #fff9f2;
  --fg-bg-2:      #ffffff;
  --fg-fg:        #1d1914;
  --fg-muted:     #7a6e5f;
  --fg-hint:      #a69880;
  --fg-border:    #ecdfc9;
  --fg-accent:    #e24e1b;           /* tomato */
  --fg-accent-2:  #ff8f3c;           /* persimmon */
  --fg-accent-ink:#ffffff;
  --fg-green:     #4d8a2e;
  --fg-card:      #ffffff;
  --fg-shadow:    0 1px 2px rgba(20,15,10,0.04), 0 2px 10px rgba(20,15,10,0.05);
  --fg-shadow-hi: 0 2px 6px rgba(20,15,10,0.06), 0 10px 30px rgba(20,15,10,0.08);
  --fg-radius:    14px;
  --fg-radius-s:  10px;
  --fg-radius-xs: 8px;
  --fg-gap:       14px;
  --fg-font:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg-bg:     #1a1612;
    --fg-bg-2:   #231e18;
    --fg-fg:     #f2ece0;
    --fg-muted:  #b6a893;
    --fg-hint:   #867a67;
    --fg-border: #3b322a;
    --fg-card:   #262019;
    --fg-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 2px 10px rgba(0,0,0,0.35);
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--fg-bg);
  color: var(--fg-fg);
  font-family: var(--fg-font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#fg-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Top bar ────────────────────────────────────────────────────────── */
.fg-topbar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  align-items: center;
  padding: 14px 20px;
  background: var(--fg-bg);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--fg-border);
}
.fg-logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--fg-fg);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.fg-logo-emoji { font-size: 24px; }
.fg-logo-text {
  background: linear-gradient(90deg, var(--fg-accent), var(--fg-accent-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.fg-search {
  display: flex;
  gap: 6px;
  width: 100%;
  grid-column: 1 / -1;
  grid-row: 2;
}
.fg-search input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--fg-border);
  background: var(--fg-bg-2);
  color: inherit;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 120ms;
}
.fg-search input:focus { border-color: var(--fg-accent); }
.fg-search button {
  width: 40px; height: 40px;
  border-radius: 999px;
  border: none;
  background: var(--fg-accent);
  color: var(--fg-accent-ink);
  cursor: pointer;
  font-size: 16px;
}
.fg-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.fg-nav-link {
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--fg-fg);
  font-weight: 500;
  font-size: 14px;
  transition: background 120ms;
}
.fg-nav-link:hover { background: var(--fg-bg-2); }
.fg-nav-link.active {
  background: var(--fg-fg);
  color: var(--fg-bg);
}
.fg-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--fg-accent);
  color: var(--fg-accent-ink);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
}

.fg-nav-group { position: relative; display: inline-flex; }
.fg-nav-chevron { margin-left: 2px; font-size: 10px; opacity: 0.7; }
.fg-nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  list-style: none;
  padding: 6px;
  margin: 0;
  background: var(--fg-bg);
  border: 1px solid var(--fg-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  display: none;
  z-index: 30;
}
.fg-nav-group:hover > .fg-nav-dropdown,
.fg-nav-group:focus-within > .fg-nav-dropdown { display: block; }
.fg-nav-dropdown li a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--fg-fg);
  font-size: 14px;
  white-space: nowrap;
}
.fg-nav-dropdown li a:hover { background: var(--fg-bg-2); }

@media (min-width: 721px) {
  .fg-overflow { display: none; }
}
@media (max-width: 720px) {
  .fg-topbar { padding: 10px 14px; }
  .fg-nav-link { padding: 8px 10px; font-size: 13px; }
  .fg-nav-link span:not(.fg-badge) { display: none; }
  .fg-nav-primary { display: none; }
}

/* ── View frame ─────────────────────────────────────────────────────── */
.fg-view {
  flex: 1;
  padding: 28px 20px 60px;
}
@media (max-width: 720px) { .fg-view { padding: 16px 14px 40px; } }

.fg-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--fg-muted);
}
.fg-breadcrumb a, .fg-breadcrumb button {
  color: var(--fg-muted);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.fg-breadcrumb a:hover { color: var(--fg-accent); text-decoration: underline; }
.fg-breadcrumb .fg-bc-current { color: var(--fg-fg); font-weight: 600; }
.fg-breadcrumb .fg-bc-sep { opacity: 0.6; }

.fg-h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.fg-h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.fg-lead {
  color: var(--fg-muted);
  margin-bottom: 24px;
  font-size: 16px;
}

/* ── Category tile grid (home + shop) ───────────────────────────────── */
.fg-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--fg-gap);
  margin-bottom: 32px;
}
.fg-cat-tile {
  background: var(--fg-card);
  border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: transform 150ms, box-shadow 150ms, border-color 150ms;
  text-decoration: none;
  color: inherit;
  display: block;
}
.fg-cat-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--fg-shadow-hi);
  border-color: var(--fg-accent);
}
.fg-cat-tile:active { transform: translateY(0); }
.fg-cat-emoji {
  font-size: 40px;
  margin-bottom: 8px;
  display: block;
}
.fg-cat-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}
.fg-cat-count {
  font-size: 11px;
  color: var(--fg-hint);
  margin-top: 4px;
}

/* ── Product grid ───────────────────────────────────────────────────── */
.fg-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--fg-gap);
}
.fg-pcard {
  background: var(--fg-card);
  border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 150ms, box-shadow 150ms, border-color 150ms;
}
.fg-pcard:hover {
  transform: translateY(-2px);
  box-shadow: var(--fg-shadow-hi);
  border-color: var(--fg-accent);
}
.fg-pcard-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--fg-bg-2);
  padding: 12px;
  display: block;
}
.fg-pcard-ph {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fg-bg-2);
  font-size: 48px;
}
.fg-pcard-body { padding: 12px 14px 14px; flex: 1; display: flex; flex-direction: column; }
.fg-pcard-brand {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-hint);
  font-weight: 700;
  margin-bottom: 4px;
}
.fg-pcard-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fg-pcard-desc {
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fg-pcard-size {
  font-size: 12px;
  color: var(--fg-muted);
  margin-bottom: 8px;
}
.fg-pcard-price {
  font-size: 16px;
  font-weight: 800;
  margin-top: auto;
  color: var(--fg-fg);
}

/* ── PDP ────────────────────────────────────────────────────────────── */
.fg-pdp {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 720px) {
  .fg-pdp { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
}
.fg-pdp-hero {
  background: var(--fg-card);
  border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}
.fg-pdp-hero img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}
.fg-pdp-brand {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-hint);
  font-weight: 700;
  margin-bottom: 6px;
}
.fg-pdp-name {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}
.fg-pdp-size { color: var(--fg-muted); margin-bottom: 20px; }
.fg-pdp-price {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 4px;
}
.fg-pdp-unit { font-size: 13px; color: var(--fg-muted); margin-bottom: 20px; }
.fg-pdp-add {
  width: 100%;
  padding: 14px;
  background: var(--fg-accent);
  color: var(--fg-accent-ink);
  border: none;
  border-radius: var(--fg-radius-s);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms, transform 120ms;
}
.fg-pdp-add:hover { background: #cf4118; }
.fg-pdp-add:active { transform: scale(0.98); }
.fg-pdp-add:disabled { opacity: 0.6; cursor: not-allowed; }

.fg-pdp-section { margin-top: 24px; }
.fg-pdp-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--fg-fg);
}
.fg-pdp-section p {
  color: var(--fg-muted);
  line-height: 1.55;
}
.fg-pdp-nutrition {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--fg-border);
}
.fg-pdp-nutrition li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--fg-border);
  font-size: 13px;
}
.fg-pdp-nutrition .fg-label { color: var(--fg-muted); }
.fg-pdp-nutrition .fg-value { font-weight: 600; }

/* ── Hero CTA on home ───────────────────────────────────────────────── */
.fg-hero {
  background: linear-gradient(135deg, #fff1dc 0%, #ffdcbe 100%);
  border-radius: 22px;
  padding: 36px 32px;
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
@media (prefers-color-scheme: dark) {
  .fg-hero { background: linear-gradient(135deg, #3b2a1a 0%, #4a3320 100%); }
}
.fg-hero h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.fg-hero p {
  color: var(--fg-muted);
  font-size: 16px;
  margin-bottom: 20px;
  max-width: 52ch;
}
.fg-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  background: var(--fg-accent);
  color: var(--fg-accent-ink);
  border: none;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms, transform 120ms;
}
.fg-cta:hover { background: #cf4118; }
.fg-cta:active { transform: scale(0.98); }
.fg-hero-emoji { font-size: 96px; opacity: 0.85; }
@media (max-width: 720px) {
  .fg-hero { padding: 22px 20px; grid-template-columns: 1fr; }
  .fg-hero-emoji { font-size: 64px; justify-self: end; }
  .fg-hero h1 { font-size: 24px; }
}

/* ── Loading / toast ────────────────────────────────────────────────── */
/* HTML [hidden] is equivalent to display:none, but any CSS display rule
   overrides it on specificity. Force [hidden] to win. */
[hidden] { display: none !important; }

.fg-loading {
  position: fixed;
  inset: 0;
  background: rgba(255, 249, 242, 0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 400;
}
@media (prefers-color-scheme: dark) {
  .fg-loading { background: rgba(26, 22, 18, 0.6); }
}
.fg-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--fg-border);
  border-top-color: var(--fg-accent);
  border-radius: 50%;
  animation: fg-spin 700ms linear infinite;
}
@keyframes fg-spin { to { transform: rotate(360deg); } }
.fg-toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--fg-fg);
  color: var(--fg-bg);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--fg-shadow-hi);
  z-index: 500;
}
.fg-error-card {
  background: #fee;
  color: #b00;
  border-radius: var(--fg-radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.fg-footer {
  display: flex;
  justify-content: space-between;
  padding: 20px 20px 28px;
  color: var(--fg-hint);
  font-size: 12px;
  border-top: 1px solid var(--fg-border);
  margin-top: 40px;
}
.fg-footer a { color: var(--fg-hint); text-decoration: none; }
.fg-footer a:hover { color: var(--fg-accent); }

/* ── Login page ─────────────────────────────────────────────────────── */
.fg-login-wrap {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fg-login-card {
  background: var(--fg-card);
  border: 1px solid var(--fg-border);
  border-radius: 20px;
  padding: 36px 32px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--fg-shadow);
}
.fg-login-card h2 {
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 4px;
}
.fg-login-card .fg-lead { text-align: center; margin-bottom: 20px; }
.fg-login-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--fg-muted);
}
.fg-login-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius-s);
  font-size: 15px;
  font-family: inherit;
  background: var(--fg-bg);
  color: inherit;
  margin-bottom: 14px;
  outline: none;
  transition: border-color 120ms;
}
.fg-login-card input:focus { border-color: var(--fg-accent); }
.fg-login-card button[type=submit] {
  width: 100%;
  padding: 13px;
  background: var(--fg-accent);
  color: var(--fg-accent-ink);
  border: none;
  border-radius: var(--fg-radius-s);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.fg-login-error {
  background: #fee;
  color: #b00;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}

/* ── Welcome / birthday card ──────────────────────────────────────── */
.fg-welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 2000;
  animation: fg-welcome-fade 0.25s ease;
}
.fg-welcome-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: 100%;
}
.fg-welcome-bouquet {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  font-size: 44px;
  line-height: 1;
  animation: fg-welcome-sway 3.2s ease-in-out infinite;
  user-select: none;
}
.fg-welcome-bouquet-left  { transform-origin: bottom right; }
.fg-welcome-bouquet-right {
  transform-origin: bottom left;
  animation-delay: -1.6s;
}
.fg-welcome-bouquet span {
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}
@media (max-width: 640px) {
  .fg-welcome-bouquet { display: none; }
}
.fg-welcome-card {
  background: var(--fg-card);
  color: inherit;
  border: 1px solid var(--fg-border);
  border-radius: 20px;
  padding: 32px 28px 26px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--fg-shadow);
  animation: fg-welcome-pop 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.fg-welcome-emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 14px;
}
.fg-welcome-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 14px;
  line-height: 1.25;
}
.fg-welcome-body {
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 12px;
}
.fg-welcome-sign {
  font-size: 14px;
  font-style: italic;
  margin: 18px 0 22px;
  color: var(--fg-muted);
}
.fg-welcome-btn {
  width: 100%;
  padding: 14px;
  background: var(--fg-accent);
  color: var(--fg-accent-ink);
  border: none;
  border-radius: var(--fg-radius-s);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.fg-welcome-btn:active { transform: scale(0.98); }
@keyframes fg-welcome-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fg-welcome-pop {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes fg-welcome-sway {
  0%, 100% { transform: rotate(-3deg); }
  50%      { transform: rotate(3deg); }
}

/* ── Basket ─────────────────────────────────────────────────────────── */
.fg-basket {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 820px) {
  .fg-basket { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
}
.fg-basket-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fg-bitem {
  display: grid;
  grid-template-columns: 68px 1fr auto auto;
  gap: 14px;
  align-items: center;
  background: var(--fg-card);
  border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius);
  padding: 12px 14px;
}
.fg-bitem.fg-bitem-oos { border-color: #d93025; background: #fff5f4; }
@media (prefers-color-scheme: dark) { .fg-bitem.fg-bitem-oos { background: #3a1a17; } }
.fg-bitem-img {
  width: 68px; height: 68px; object-fit: contain;
  background: var(--fg-bg-2); border-radius: var(--fg-radius-xs); padding: 4px;
}
.fg-bitem-ph {
  display: flex; align-items: center; justify-content: center;
  background: var(--fg-bg-2); font-size: 28px;
}
.fg-bitem-info { min-width: 0; }
.fg-bitem-name {
  display: block; font-weight: 600; font-size: 14px; text-decoration: none; color: inherit;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fg-bitem-name:hover { color: var(--fg-accent); }
.fg-bitem-brand { font-size: 11px; color: var(--fg-hint); text-transform: uppercase; letter-spacing: 0.05em; }
.fg-bitem-warn  { font-size: 11px; color: #d93025; font-weight: 600; margin-top: 2px; }
.fg-bitem-controls {
  display: flex; gap: 4px; align-items: center;
  background: var(--fg-bg-2); border-radius: 999px; padding: 4px;
}
.fg-bitem-controls button {
  width: 28px; height: 28px; border-radius: 999px; border: none;
  background: transparent; color: inherit; cursor: pointer; font-size: 16px; font-weight: 600;
}
.fg-bitem-controls button:hover { background: var(--fg-card); }
.fg-bitem-controls .fg-bitem-rm:hover { color: #d93025; }
.fg-bitem-qty { min-width: 22px; text-align: center; font-size: 14px; font-weight: 600; }
.fg-bitem-price { font-weight: 800; font-size: 15px; }
@media (max-width: 520px) {
  .fg-bitem { grid-template-columns: 56px 1fr; grid-template-areas: "img info info" "img controls price"; }
  .fg-bitem-img { grid-area: img; width: 56px; height: 56px; }
  .fg-bitem-info { grid-area: info; }
  .fg-bitem-controls { grid-area: controls; }
  .fg-bitem-price { grid-area: price; justify-self: end; }
}

.fg-basket-summary {
  background: var(--fg-card);
  border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius);
  padding: 20px;
  position: sticky;
  top: 80px;
}
.fg-sum-row {
  display: flex; justify-content: space-between;
  padding: 6px 0; font-size: 14px;
}
.fg-sum-total {
  border-top: 1px solid var(--fg-border);
  margin-top: 10px; padding-top: 12px;
  font-size: 17px; font-weight: 800;
}
.fg-warn {
  margin: 12px 0;
  padding: 10px 12px;
  background: #fff4e6;
  color: #8a4a00;
  border-radius: var(--fg-radius-xs);
  font-size: 13px;
}
@media (prefers-color-scheme: dark) { .fg-warn { background: #3a2b15; color: #ffcf7d; } }
.fg-sum-note { font-size: 12px; color: var(--fg-hint); margin-top: 10px; text-align: center; }
.fg-sum-hint {
  font-size: 12px;
  color: var(--fg-accent);
  padding: 6px 8px;
  background: rgba(226, 78, 27, 0.08);
  border-radius: var(--fg-radius-xs);
  margin: 2px 0 4px;
  text-align: center;
  font-weight: 600;
}

/* ── Filter row + chips (shared offers/search/wizard) ───────────────── */
.fg-filter-row {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 14px;
}
.fg-select {
  padding: 8px 12px;
  border: 1px solid var(--fg-border);
  border-radius: 999px;
  background: var(--fg-bg-2);
  color: inherit;
  font: inherit; font-size: 13px;
  cursor: pointer;
}
.fg-ghost {
  padding: 8px 16px;
  background: transparent;
  color: inherit;
  border: 1px solid var(--fg-border);
  border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background 120ms;
}
.fg-ghost:hover { background: var(--fg-bg-2); }

.fg-filter-section { margin-bottom: 16px; }
.fg-filter-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--fg-hint);
  margin-bottom: 6px;
}
.fg-chip-row {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.fg-chip-scroll {
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  padding-bottom: 6px; margin-bottom: 14px;
}
.fg-chip-scroll::-webkit-scrollbar { display: none; }
.fg-chip-scroll .fg-chip { flex: 0 0 auto; }
.fg-chip {
  padding: 6px 12px;
  border: 1px solid var(--fg-border);
  border-radius: 999px;
  background: var(--fg-bg-2);
  font: inherit; font-size: 13px;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms, border-color 120ms;
}
.fg-chip:hover { background: var(--fg-card); border-color: var(--fg-accent); }
.fg-chip.active {
  background: var(--fg-accent);
  color: var(--fg-accent-ink);
  border-color: var(--fg-accent);
}
.fg-chip-n {
  margin-left: 4px; font-size: 10px;
  opacity: 0.7;
}

/* ── Offer card tweaks ──────────────────────────────────────────────── */
.fg-pcard-offer { position: relative; }
.fg-offer-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--fg-accent);
  color: var(--fg-accent-ink);
  font-weight: 800;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  z-index: 2;
  letter-spacing: 0.02em;
}
.fg-pcard-offer .fg-now  { color: var(--fg-accent); font-weight: 800; }
.fg-pcard-offer .fg-was  { color: var(--fg-hint); font-size: 12px; text-decoration: line-through; margin-left: 6px; font-weight: 500; }

/* ── Chat wizard ────────────────────────────────────────────────────── */
.fg-chat-input {
  background: var(--fg-card);
  border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius);
  padding: 16px;
  margin-bottom: 24px;
}
.fg-chat-input textarea {
  width: 100%; min-height: 90px;
  padding: 12px 14px;
  border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius-s);
  background: var(--fg-bg);
  color: inherit; font: inherit; font-size: 15px;
  resize: vertical; outline: none;
}
.fg-chat-input textarea:focus { border-color: var(--fg-accent); }
.fg-chat-actions {
  display: flex; gap: 8px; align-items: center;
  margin-top: 12px;
  justify-content: flex-end;
}
.fg-chat-icon {
  width: 42px; height: 42px;
  border: 1px solid var(--fg-border);
  border-radius: 999px;
  background: var(--fg-bg-2);
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.fg-chat-icon:hover { background: var(--fg-card); border-color: var(--fg-accent); }
.fg-chat-icon.recording { background: #fde2df; border-color: var(--fg-accent); }

/* Pasted-image preview inside the chat input card */
.fg-chat-attach {
  position: relative;
  display: inline-block;
  margin-top: 10px;
}
.fg-chat-attach img {
  max-width: 180px;
  max-height: 140px;
  border-radius: var(--fg-radius-s);
  border: 1px solid var(--fg-border);
  display: block;
  object-fit: cover;
}
.fg-chat-attach-remove {
  position: absolute;
  top: -8px; right: -8px;
  width: 24px; height: 24px;
  border-radius: 999px;
  border: 1px solid var(--fg-border);
  background: var(--fg-card);
  color: var(--fg-fg);
  font-size: 16px; line-height: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.fg-chat-attach-remove:hover { background: var(--fg-accent); color: var(--fg-accent-ink); }

.fg-history { list-style: none; padding: 0; }
.fg-history-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 12px 14px;
  background: var(--fg-card);
  border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius);
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
}
.fg-history-row:hover { border-color: var(--fg-accent); }
.fg-history-title { flex: 1; font-weight: 600; font-size: 14px; }
.fg-history-date  { font-size: 12px; color: var(--fg-hint); }
.fg-history-status { font-size: 14px; }
.fg-status-completed { color: var(--fg-green); }
.fg-status-active    { color: var(--fg-accent); }
.fg-status-abandoned { color: var(--fg-hint); }

.fg-wizard-card {
  background: var(--fg-card);
  border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius);
  padding: 20px;
  margin-bottom: 24px;
}
.fg-clarify-msg { font-weight: 500; margin-bottom: 14px; }
.fg-serv {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 14px;
  font-weight: 500;
}
.fg-serv button {
  width: 30px; height: 30px;
  border-radius: 999px;
  border: 1px solid var(--fg-border);
  background: var(--fg-bg-2);
  cursor: pointer; font-weight: 700;
}
.fg-checklist { list-style: none; padding: 0; margin: 14px 0; }
.fg-checklist li label {
  display: flex; gap: 12px; align-items: center;
  padding: 8px 0;
  cursor: pointer;
  border-bottom: 1px solid var(--fg-border);
}
.fg-checklist li:last-child label { border-bottom: none; }
.fg-ing-name { flex: 1; font-weight: 500; }
.fg-ing-name.fg-basic { color: var(--fg-muted); font-weight: 400; }
.fg-ing-qty  { font-size: 13px; color: var(--fg-muted); }

.fg-progress {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--fg-hint); font-weight: 700; margin-bottom: 8px;
}
.fg-wizard-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px;
}

.fg-recipe-list { list-style: none; padding: 0; margin: 16px 0; }
.fg-recipe-row {
  display: grid; grid-template-columns: 120px 1fr; gap: 16px;
  padding: 14px;
  background: var(--fg-card);
  border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius);
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 120ms, transform 120ms;
}
.fg-recipe-row:hover { border-color: var(--fg-accent); transform: translateY(-1px); }
.fg-recipe-img {
  width: 120px; height: 120px; object-fit: cover;
  border-radius: var(--fg-radius-xs);
  background: var(--fg-bg-2);
}
.fg-recipe-ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
}
.fg-recipe-title { font-weight: 700; font-size: 17px; margin-bottom: 4px; }
.fg-recipe-desc  { font-size: 13px; color: var(--fg-muted); }
.fg-recipe-servings { font-size: 12px; color: var(--fg-hint); margin-top: 6px; }

.fg-summary-list { list-style: none; padding: 0; margin: 18px 0; }
.fg-summary-row {
  display: grid; grid-template-columns: 60px 1fr auto auto; gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--fg-border);
}
.fg-summary-img {
  width: 60px; height: 60px; object-fit: contain;
  background: var(--fg-bg-2); border-radius: var(--fg-radius-xs);
}
.fg-summary-ph { display: flex; align-items: center; justify-content: center; font-size: 28px; }
.fg-summary-name  { font-weight: 500; }
.fg-summary-qty   { color: var(--fg-muted); }
.fg-summary-price { font-weight: 700; }
.fg-skipped { margin-top: 16px; font-size: 13px; color: var(--fg-muted); }
.fg-skipped summary { cursor: pointer; font-weight: 600; }
.fg-skipped ul { margin-top: 8px; padding-left: 20px; }
.fg-final-actions {
  display: flex; gap: 12px; margin-top: 24px;
}
.fg-final-actions .fg-cta { flex: 2; }
.fg-final-actions .fg-ghost { flex: 1; }

/* ── Empty state ────────────────────────────────────────────────────── */
.fg-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--fg-muted);
}
.fg-empty .fg-empty-emoji { font-size: 56px; display: block; margin-bottom: 16px; }

/* ── Overflow menu (⋯ in top-bar) ─────────────────────────────── */
.fg-overflow { position: relative; }
.fg-overflow-btn {
  background: none; border: none; font-size: 22px; cursor: pointer;
  padding: 4px 10px;
  color: var(--fg-fg);
  border-radius: var(--fg-radius-xs);
}
.fg-overflow-btn:hover { background: var(--fg-bg-2); }
.fg-overflow-menu {
  position: absolute; top: calc(100% + 4px); left: 0;
  background: var(--fg-card);
  color: var(--fg-fg);
  border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius);
  list-style: none; padding: 4px 0; margin: 0;
  min-width: 180px; z-index: 50;
  box-shadow: var(--fg-shadow-hi);
}
.fg-overflow-menu li a {
  display: block; padding: 10px 14px;
  color: var(--fg-fg);
  text-decoration: none; white-space: nowrap;
}
.fg-overflow-menu li a:hover { background: var(--fg-bg); }

.fg-saved-link { position: relative; }

/* ── Dashboard ─────────────────────────────────────────────────── */
.dash-wrap { max-width: 960px; margin: 0 auto; color: var(--fg-fg); }
.dash-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.dash-card {
  display: flex; flex-direction: column;
  background: var(--fg-card); border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius); overflow: hidden;
  text-decoration: none; color: var(--fg-fg);
  box-shadow: var(--fg-shadow);
  transition: transform .15s ease, box-shadow .15s ease;
  min-height: 120px;
}
.dash-card:hover { transform: translateY(-2px); box-shadow: var(--fg-shadow-hi); }
.dash-card-photo {
  aspect-ratio: 16 / 9;
  background: var(--fg-bg); background-size: cover; background-position: center;
}
.dash-card-body {
  padding: 12px 14px; display: flex; flex-direction: column; gap: 6px;
  flex: 1;
}
.dash-card-kicker {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--fg-muted); font-weight: 600;
}
.dash-card-title { margin: 0; font-size: 17px; line-height: 1.25; color: var(--fg-fg); }
.dash-card-meta  { color: var(--fg-muted); font-size: 13px; }
.dash-card-bignum {
  font-size: 42px; font-weight: 700; line-height: 1; color: var(--fg-fg);
  margin: 4px 0;
}
.dash-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: var(--fg-bg-2); color: var(--fg-fg);
  border: 1px solid var(--fg-border);
  font-size: 12px; margin-right: 4px;
}
.dash-badge-warn { background: color-mix(in srgb, #c47f00 16%, var(--fg-bg-2)); }
.dash-ok { color: var(--fg-green); font-weight: 600; }
.dash-empty-card { opacity: .85; }
.dash-empty-card .dash-card-body { justify-content: center; }

.dash-nav {
  display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap;
}
.dash-nav-link {
  padding: 10px 16px; border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius-s);
  background: var(--fg-card); color: var(--fg-fg);
  text-decoration: none; font-size: 14px; font-weight: 500;
}
.dash-nav-link:hover { background: var(--fg-bg-2); }

/* ── Migros throttle banner ───────────────────────────────────────── */
.fg-throttle-banner {
  position: fixed; bottom: 64px; left: 50%; transform: translateX(-50%);
  background: #8a3a00; color: #fff;
  border-radius: 10px; padding: 10px 14px;
  display: flex; gap: 8px; align-items: center;
  font-size: 13px; z-index: 1100;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  max-width: calc(100% - 24px);
}
.fg-throttle-btn {
  background: rgba(255,255,255,.15); color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 6px; padding: 4px 10px; font-size: 12px;
  cursor: pointer;
}
.fg-throttle-btn:hover { background: rgba(255,255,255,.25); }
.fg-throttle-dismiss { padding: 4px 8px; opacity: .85; }

/* ─────────────────────────────────────────────────────────────────
   Shop (ported from miniapp)
   Sidebar + breadcrumb + filter bar + product grid.
   ───────────────────────────────────────────────────────────────── */
.fg-shop-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  min-height: calc(100vh - 120px);
  position: relative;
}
.fg-shop-sidebar {
  width: 240px;
  flex: 0 0 240px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--fg-border);
  border-radius: 10px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: 8px;
}
.fg-shop-sidebar-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px 8px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--fg-muted); font-weight: 700;
  position: sticky; top: 0; background: inherit;
}
.fg-shop-sidebar-close {
  display: none;
  background: transparent; border: none; color: var(--fg-muted);
  font-size: 16px; cursor: pointer; padding: 2px 6px;
}
.fg-shop-sidebar-tree { padding: 4px 6px 16px; }
.sbn-root, .sbn-kids { list-style: none; margin: 0; padding: 0; }
.sbn-kids {
  display: none;
  padding-left: 12px;
  border-left: 2px solid transparent;
}
.sbn.open > .sbn-kids { display: block; }
.sbn-btn {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 7px 9px;
  background: transparent; border: none; color: inherit;
  text-align: left; font-size: 13px; font-weight: 500;
  border-radius: 6px; margin-bottom: 2px; cursor: pointer;
}
.sbn-btn:hover { background: rgba(255,255,255,.05); }
.sbn.active > .sbn-btn {
  background: var(--fg-accent, #d9792a);
  color: #fff;
}
.sbn-l1 > .sbn-btn { font-weight: 700; }
.sbn-l2 > .sbn-btn { font-size: 12px; padding-left: 6px; }
.sbn-l3 > .sbn-btn { font-size: 11px; padding-left: 6px; color: var(--fg-muted); }
.sbn-emoji { font-size: 16px; }
.sbn-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbn-chev {
  font-size: 12px; color: var(--fg-muted);
  transition: transform 160ms;
}
.sbn.open > .sbn-btn .sbn-chev { transform: rotate(90deg); }

.fg-shop-backdrop {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 150;
}
.fg-shop-backdrop.show { display: block; }

.fg-shop-main { flex: 1; min-width: 0; }
.fg-shop-topbar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 8px;
}
.fg-shop-sidebar-open {
  display: none;
  width: 36px; height: 36px;
  background: transparent; color: inherit;
  border: 1px solid var(--fg-border);
  border-radius: 8px; font-size: 18px; cursor: pointer;
  flex-shrink: 0;
}
.fg-shop-subgrid { margin: 8px 0 16px; }

/* Filter bar */
.fg-shop-filters {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--fg-border);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
}
.fg-filter-row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.fg-filter-select {
  padding: 7px 10px;
  border: 1px solid var(--fg-border);
  border-radius: 8px; font-size: 13px;
  background: var(--fg-bg); color: inherit; cursor: pointer;
  font-family: inherit;
}
.fg-filter-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; cursor: pointer; user-select: none;
}
.fg-filter-reset {
  margin-left: auto; background: transparent; border: none;
  color: var(--fg-accent, #d9792a); font-size: 13px; cursor: pointer;
  padding: 6px 8px; font-family: inherit;
}
.fg-filter-reset:hover { text-decoration: underline; }
.fg-filter-price-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; font-size: 13px;
}
.fg-filter-price-label { color: var(--fg-muted); font-weight: 500; }
.fg-filter-price-input {
  width: 80px; padding: 6px 8px;
  border: 1px solid var(--fg-border);
  border-radius: 6px; font-size: 13px;
  background: var(--fg-bg); color: inherit;
  font-family: inherit;
}
.fg-filter-dash { color: var(--fg-muted); }
.fg-filter-price-range { margin-left: 8px; font-size: 11px; color: var(--fg-muted); }
.fg-filter-brands, .fg-filter-tags { margin-top: 10px; }
.fg-filter-group-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--fg-muted); margin-bottom: 6px;
}
.fg-filter-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.fg-filter-chip {
  padding: 5px 10px;
  border: 1px solid var(--fg-border);
  border-radius: 14px; background: var(--fg-bg);
  font-size: 12px; cursor: pointer; color: inherit;
  font-family: inherit; white-space: nowrap;
}
.fg-filter-chip:hover { background: rgba(255,255,255,.05); }
.fg-filter-chip.active {
  background: var(--fg-accent, #d9792a); color: #fff;
  border-color: var(--fg-accent, #d9792a);
}
.fg-filter-chip-count { opacity: .7; margin-left: 3px; }

/* Mobile: sidebar → drawer */
@media (max-width: 820px) {
  .fg-shop-layout { display: block; }
  .fg-shop-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 85%; max-width: 320px;
    height: 100vh; max-height: 100vh;
    transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(.2,.8,.2,1);
    box-shadow: 2px 0 12px rgba(0,0,0,.45);
    z-index: 200; border-radius: 0;
  }
  .fg-shop-sidebar.open { transform: translateX(0); }
  .fg-shop-sidebar-close { display: block; }
  .fg-shop-sidebar-open  { display: flex; align-items: center; justify-content: center; }
}
