.sidebar-logo { font-family: var(--font-display); font-style: italic; font-weight: 700; color: white; font-size: 1.25rem; text-decoration: none; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
  .category-group-animated {
    animation: fadeInUp 0.32s ease both;
  }
  .category-group-animated:nth-child(1) { animation-delay: 0.00s; }
  .category-group-animated:nth-child(2) { animation-delay: 0.06s; }
  .category-group-animated:nth-child(3) { animation-delay: 0.12s; }
  .category-group-animated:nth-child(4) { animation-delay: 0.18s; }
  .category-group-animated:nth-child(5) { animation-delay: 0.24s; }
  .category-group-animated:nth-child(6) { animation-delay: 0.30s; }
  .category-group-animated:nth-child(7) { animation-delay: 0.36s; }
  .category-group-animated:nth-child(8) { animation-delay: 0.42s; }
  .no-animate .category-group-animated { animation: none; opacity: 1; }
}
/* Instacart affiliate banner — sticky footer */
.instacart-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--clr-card, #fff);
  border-top: 1px solid var(--clr-border);
  padding: 10px 20px;
}

/* Push content above the sticky banner */
.main-content { padding-bottom: 80px; }

.instacart-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.instacart-banner-text {
  display: flex;
  align-items: center;
  gap: 12px;
}

.instacart-banner-logo {
  width: 40px;
  height: 40px;
  background: var(--clr-card);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-primary);
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(26,61,43,0.08);
}

.instacart-banner-heading {
  font-family: var(--font-body, Inter, sans-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--clr-primary-dark);
  margin-bottom: 2px;
}

.instacart-banner-sub {
  font-family: var(--font-body, Inter, sans-serif);
  font-size: 13px;
  color: var(--clr-primary);
  opacity: 0.8;
}

.instacart-banner-btn {
  display: inline-flex;
  align-items: center;
  background: var(--clr-primary);
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: var(--font-body, Inter, sans-serif);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease;
  min-height: 44px;
  flex-shrink: 0;
}

.instacart-banner-btn:hover {
  background: var(--clr-primary-dark);
  color: white;
  opacity: 1;
}

.instacart-banner-disclaimer {
  font-size: 11px;
  color: var(--clr-muted-fg);
  margin-top: 10px;
  text-align: right;
}

/* Dark mode */
[data-theme="dark"] .instacart-banner {
  background: var(--clr-surface, #1e2a23);
  border-color: var(--clr-border);
}

/* Hide banner if user is not in US/CA (set by JS) */
.instacart-banner.hidden { display: none; }

html[data-theme="dark"] .main-content,
html[data-theme="dark"] body {
  background: var(--clr-muted-bg);
}

[data-theme="dark"] .app-layout {
  background: var(--clr-muted-bg);
}
[data-theme="dark"] .grocery-header {
  background: var(--clr-muted-bg);
}
html[data-theme="dark"] #manualItemInput,
html[data-theme="dark"] .form-input {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
}

.grocery-item {
  min-width: 0;
  overflow: visible;
}
.grocery-item-name,
.grocery-item-qty,
.grocery-item-cost {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Summary card: full subtle border replaces left-only stripe */
.grocery-progress {
  border: 1px solid rgba(0,0,0,0.08) !important;
}
html[data-theme="dark"] .grocery-progress {
  border: 1px solid rgba(255,255,255,0.08);
}

/* Fix 4: dark mode checkboxes */
[data-theme="dark"] .grocery-item input[type="checkbox"]:not(:checked) {
  appearance: none;
  -webkit-appearance: none;
  width: 1rem;
  height: 1rem;
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.2);
  cursor: pointer;
}

/* "+ Add" button: green outlined style */
#manualItemInput + .btn-outline {
  border: 1.5px solid var(--color-green);
  color: var(--color-green);
  background: transparent;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
}
#manualItemInput + .btn-outline:hover {
  background: var(--color-green);
  color: white;
}

/* Fix 5: dark mode add-item input border weight + button */
[data-theme="dark"] #manualItemInput {
  border: 1.5px solid rgba(255,255,255,0.12) !important;
}
[data-theme="dark"] #manualItemInput + .btn-outline {
  background: var(--color-green) !important;
  border-color: var(--color-green) !important;
  color: white !important;
}

/* Fix 6: category badge count — brand green in both modes */
.badge.badge-muted {
  background: rgba(61,139,94,0.2) !important;
  color: var(--color-green) !important;
}
/* Dark mode: brighter green for badge contrast against dark bg */
[data-theme="dark"] .badge.badge-muted {
  background: rgba(74,222,128,0.18) !important;
  color: var(--clr-brand-light) !important;
}

/* Checkbox focus ring */
.grocery-item input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--clr-brand, var(--clr-primary));
  outline-offset: 2px;
}

/* Cost cell + inline edit (hover-reveal pencil) */
.grocery-item-cost-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.grocery-item-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-muted-fg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.grocery-item:hover .grocery-item-edit-btn,
.grocery-item-edit-btn:focus-visible {
  opacity: 1;
}
.grocery-item-edit-btn:hover {
  color: var(--color-green);
  background: rgba(var(--color-green-rgb), 0.1);
}
.grocery-item-edit-btn:focus-visible {
  outline: 2px solid var(--color-green);
  outline-offset: 2px;
}
.grocery-cost-input {
  width: 76px;
  padding: 2px 6px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--color-foreground);
  background: var(--clr-surface);
}
.grocery-cost-input:focus {
  outline: none;
  border-color: var(--color-green);
  box-shadow: 0 0 0 3px rgba(var(--color-green-rgb), 0.2);
}
[data-theme="dark"] .grocery-cost-input {
  background: rgba(255,255,255,0.06);
  color: var(--color-foreground);
}
