:root {
  --md-sys-color-primary: #8e7cc3;
  /* Pastel Purple */
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #e4d7f5;
  --md-sys-color-surface: #faf8fc;
  --md-sys-color-surface-variant: #e8e0f0;
  --md-sys-color-on-surface: #1d1b20;
  --md-sys-color-on-surface-variant: #49454f;
  --md-sys-color-outline: #79747e;
  --md-sys-color-error: #ba1a1a;
  --row-h: 40px;
}

[data-theme="dark"] {
  --md-sys-color-primary: #d0bcff;
  --md-sys-color-on-primary: #381e72;
  --md-sys-color-primary-container: #4f378b;
  --md-sys-color-surface: #141218;
  --md-sys-color-surface-variant: #2b2831;
  --md-sys-color-on-surface: #e6e0e9;
  --md-sys-color-on-surface-variant: #cac4d0;
  --md-sys-color-outline: #938f99;
  --md-sys-color-error: #ffb4ab;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  font-family: Roboto, sans-serif;
  background: var(--md-sys-color-primary);
  /* Full-bleed premium background */
  color: var(--md-sys-color-on-surface);
  min-height: 100vh;
}

header {
  background: var(--md-sys-color-primary) !important;
  color: #ffffff !important;
  padding: 8px 16px;
  position: sticky;
  top: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.header-main-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#header-title {
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

header span.material-symbols-outlined {
  font-size: 24px;
}

.header-actions-group {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.header-icons-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

/* On wider screens, keep everything on one row */
@media (min-width: 600px) {
  header {
    flex-direction: row;
    justify-content: space-between;
    height: 64px;
    padding: 0 24px;
    gap: 24px;
  }

  .header-actions-group {
    width: auto;
    flex: 1;
    max-width: 600px;
  }
}

.header-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--md-sys-color-on-primary);
  display: flex;
  align-items: center;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  justify-content: center;
  transition: background .15s, transform .1s;
  outline: none;
}

.header-action-btn:hover {
  background: rgba(255, 255, 255, .15);
}

.header-action-btn:active {
  transform: scale(0.92);
}

.header-action-btn .material-symbols-outlined {
  font-size: 22px;
}

.header-action-btn.text-btn {
  width: auto;
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.15);
}

.header-action-btn.text-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.spin {
  animation: spin .6s linear;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* List Containers: Separate grocery list to restore white background for readability */
#list-container {
  padding: 0 0 100px 0;
  margin-top: 0;
  background: var(--md-sys-color-surface);
  min-height: calc(100vh - 120px);
}

#recipe-list-container,
#recipe-detail-container {
  padding: 0 0 100px 0;
  margin-top: 0;
  background: transparent;
  min-height: calc(100vh - 120px);
}

/* Custom Themed Select Dropdown Replacement */
.custom-dropdown-container {
  position: relative;
  flex: 1;
  height: 40px;
}

.custom-dropdown-toggle {
  width: 100%;
  height: 36px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 18px;
  color: #fff;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.custom-dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--md-sys-color-surface);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  border: 1px solid var(--md-sys-color-outline-variant);
}

.custom-dropdown-menu.active {
  display: flex;
}

.dropdown-item {
  padding: 12px 16px;
  color: var(--md-sys-color-on-surface);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: var(--md-sys-color-primary-container);
}

.dropdown-item.active {
  background: var(--md-sys-color-primary);
  color: #fff;
}

.dropdown-item .material-symbols-outlined {
  font-size: 18px;
}

.dropdown-item.add-store-item {
  border-top: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-primary);
  font-weight: 800;
}

/* Bottom Navigation */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 0 env(safe-area-inset-bottom);
  background: var(--md-sys-color-primary);
  display: flex;
  justify-content: center;
  z-index: 50;
  /* Inner shadow to cast above the bottom nav */
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
}

.nav-button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  /* Muted white when inactive */
  cursor: pointer;

  font-family: Roboto, sans-serif;
  transition: all .2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  outline: none;
}

.nav-button:hover {
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.05);
}

.nav-button.active {
  color: #ffffff;
  font-weight: 700;
}

.nav-icon-container {
  width: 50px;
  height: 34px;
  border-radius: 17px;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-button.active .nav-icon-container {
  background: linear-gradient(135deg, #a88feb, #8e7cc3);
  /* 3D gradient pill */
  box-shadow: 0 4px 10px rgba(142, 124, 195, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-4px);
}

.nav-icon {
  font-size: 22px;
  color: inherit;
  transition: color .2s;
}

.nav-icon.shopping_cart {
  font-size: 21px;
}

.nav-button.active .nav-icon {
  color: white;
}

.nav-label {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: transform .2s;
}

.nav-button.active .nav-label {
  transform: translateY(-1px);
}

/* Redundant container styles removed, consolidated at top */

#view-plan {
  padding: 0 0 100px;
  /* Reduced top padding to eliminate gap */
  min-height: calc(100vh - 120px);
  background: transparent;
}


.section-header.deep-freeze {
  color: #4a90c4;
  border-bottom-color: #c4dff0;
  border-top: 2px dashed #c4dff0;
}

[data-theme="dark"] .section-header.deep-freeze {
  color: #90c8f0;
  border-bottom-color: #1e3a50;
  border-top-color: #1e3a50;
}

.item-row {
  display: flex;
  align-items: stretch;
  min-height: var(--row-h);
  padding: 4px 8px 4px 4px;
  border-bottom: 1px solid var(--md-sys-color-surface-variant);
  transition: background .12s, opacity .2s;
}

.item-row:hover {
  background: var(--md-sys-color-surface-variant);
}

.item-row.dragging {
  opacity: 0.4;
}

.section-header {
  background: var(--md-sys-color-primary);
  color: #ffffff;
  padding: 12px 16px;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: var(--main-header-h);
  z-index: 10;
  transition: background 0.2s, color 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-header:hover {
  background: #5a4391;
}

.section-header.drag-over {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.section-header.collapsed+.collapsible-content {
  display: none;
}

.chevron {
  margin-left: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 18px !important;
}

.section-header.collapsed .chevron {
  transform: rotate(-90deg);
}

.item-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  margin-left: 8px;
  font-weight: 600;
}

/* Mobile drag support touch-action */
.item-drag-handle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-sys-color-outline);
  cursor: grab;
  flex-shrink: 0;
  touch-action: none;
}

.item-check {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--md-sys-color-on-surface-variant);
  border-radius: 50%;
  transition: background .12s;
}

.item-check:hover {
  background: rgba(142, 124, 195, .12);
}

.item-check .material-symbols-outlined {
  font-size: 20px;
}

.item-name {
  flex: 1 1 auto;
  font-size: 16px;
  padding: 6px 2px 6px 6px;
  min-width: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.item-name-text {
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
  font-weight: 900;
}

.item-url {
  font-size: 13px;
  color: var(--md-sys-color-primary);
  text-decoration: none;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.item-url:hover {
  text-decoration: underline;
}

.item-url .material-symbols-outlined {
  font-size: 14px;
}

.item-name.checked .item-name-text {
  text-decoration: line-through;
  color: var(--md-sys-color-outline);
  font-weight: 700;
}

.item-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: auto;
  /* pushes nothing — sits right after text */
}

/* Mobile Refinements (Google Keep style) */
@media (max-width: 600px) {
  .item-actions {
    margin-right: 0;
    margin-left: auto;
    /* Push actions all the way to the right */
  }

  .item-name {
    font-size: 15px;
  }

  .item-row {
    min-height: 44px;
  }

  .item-check {
    width: 28px;
    height: 28px;
  }
}

.item-delete {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--md-sys-color-outline);
  border-radius: 50%;
  transition: color .12s, background .12s;
}

.item-delete:hover {
  color: var(--md-sys-color-error);
  background: rgba(186, 26, 26, .08);
}

.item-delete .material-symbols-outlined {
  font-size: 18px;
}

/* Bottom sheet */
#sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 30;
  animation: fadeIn .15s ease;
}

#sheet-backdrop.open {
  display: block;
}

#sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--md-sys-color-surface);
  border-radius: 20px 20px 0 0;
  padding: 12px 16px 32px;
  z-index: 31;
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.2, 0, 0, 1);
  max-width: 600px;
  margin: 0 auto;
}

#sheet.open {
  transform: translateY(0);
}

#sheet-handle {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--md-sys-color-outline);
  margin: 0 auto 14px;
  opacity: .4;
}

#sheet-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sheet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.section-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--md-sys-color-outline);
  font-size: 13px;
  font-family: Roboto, sans-serif;
  background: none;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}

.section-chip:hover {
  background: var(--md-sys-color-surface-variant);
}

.section-chip.active {
  background: var(--md-sys-color-primary-container);
  border-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-surface);
  font-weight: 500;
}

#sheet-remember {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 16px;
  cursor: pointer;
}

#sheet-remember input[type=checkbox] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--md-sys-color-primary);
}

#sheet-confirm {
  width: 100%;
  height: 44px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 500;
  font-family: Roboto, sans-serif;
  cursor: pointer;
  transition: opacity .15s;
}

#sheet-confirm:hover {
  opacity: .88;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Edit Modal */
#edit-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 40;
  animation: fadeIn .15s ease;
}

#edit-backdrop.open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 200px 24px 24px 24px;
  box-sizing: border-box;
  /* Moved down so title is visible above Apple keyboard */
}

#edit-modal {
  background: var(--md-sys-color-surface);
  width: 90%;
  max-width: 400px;
  border-radius: 24px;
  /* More premium rounding */
  padding: 0;
  /* Removing inner padding for full-bleed headers */
  box-shadow: 0 12px 48px rgba(0, 0, 0, .3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#edit-modal h3 {
  background: var(--md-sys-color-primary);
  color: #ffffff;
  padding: 18px 20px;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

#edit-name-input {
  width: calc(100% - 32px);
  margin: 16px;
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 12px;
  font-size: 16px;
  font-family: Roboto, sans-serif;
  resize: vertical;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  outline: none;
}

#edit-url-container {
  display: none;
  flex-direction: column;
  margin-top: 8px;
}

#edit-url-container label {
  background: #6a53a1;
  /* Slightly different purple for internal label */
  color: #ffffff;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin: 0;
  display: block;
}

#edit-url-input {
  width: calc(100% - 32px);
  margin: 8px 16px 16px 16px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 12px;
  font-size: 14px;
  font-family: Roboto, sans-serif;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  outline: none;
}

.edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 16px 20px 16px;
}

.edit-btn {
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: Roboto, sans-serif;
}

.edit-btn.cancel {
  background: transparent;
  color: var(--md-sys-color-primary);
}

.edit-btn.cancel:hover {
  background: rgba(142, 124, 195, .08);
}

.edit-btn.save {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.edit-btn.save:hover {
  opacity: .9;
}

/* Add Button */
#add-btn {
  border: none;
  background: #ffb7b2;
  /* Pastel Pink Banana Color */
  color: var(--md-sys-color-on-surface);
  border-radius: 50%;
  width: var(--row-h);
  height: var(--row-h);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  flex-shrink: 0;
}

#add-btn:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

#add-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* FAB & Toast bottom adjustments */
#fab {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-surface);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .25);
  transition: box-shadow .2s, opacity .2s;
  z-index: 20;
}

#fab:hover {
  box-shadow: 0 6px 14px rgba(0, 0, 0, .3);
  opacity: .9;
}

#fab .material-symbols-outlined {
  font-size: 26px;
}

#fab.loading {
  opacity: .6;
  pointer-events: none;
}

#toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  background: #323232;
  color: #fff;
  padding: 10px 8px 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 12px;
}

#toast.show {
  opacity: 1;
  pointer-events: auto;
}

#toast-undo {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-surface);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: Roboto, sans-serif;
  padding: 6px 12px;
  border-radius: 12px;
  margin-left: auto;
  letter-spacing: .5px;
  transition: opacity .12s;
}

#toast-undo:hover {
  opacity: .8;
}

.item-row.pending-remove {
  opacity: .4;
  transition: opacity .3s;
}

/* Recipe Book List Views */
.recipe-card {
  background: var(--md-sys-color-surface);
  border-radius: 20px;
  margin: 8px 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--md-sys-color-surface-variant);
}

.recipe-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.recipe-times-made {
  font-size: 10px;
  font-weight: 800;
  color: var(--md-sys-color-outline);
  letter-spacing: 0.5px;
}

.recipe-prep-time {
  font-size: 10px;
  font-weight: 800;
  color: #ff9800;
  /* Subtle orange for prep/timer feel */
  letter-spacing: 0.5px;
  margin-left: 8px;
}

.recipe-meta {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  display: flex;
  gap: 8px;
  align-items: center;
  opacity: 0.8;
}

.rating-stars {
  color: #f2b01e;
  font-size: 14px;
}

.recipe-header-actions {
  padding: 8px 16px;
  gap: 8px;
}

/* Recipe Detail Modal Redesign */
.full-screen-modal {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--md-sys-color-surface);
}

.recipe-hero {
  height: 0;
  overflow: hidden;
  position: relative;
}

.close-modal-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.8);
  color: var(--md-sys-color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.recipe-sticky-header {
  position: sticky;
  top: 0;
  background: var(--md-sys-color-surface);
  padding: 16px 20px;
  border-bottom: 1px solid var(--md-sys-color-surface-variant);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.category-badge {
  background: var(--md-sys-color-primary);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.rating-display {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 12px;
  transition: background 0.2s;
}

.rating-display:hover {
  background: var(--md-sys-color-surface-variant);
}

.plan-pill {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s;
}

.plan-pill:active {
  transform: scale(0.95);
}

.recipe-content-body {
  padding: 0 20px 120px;
}

.recipe-content-body>.recipe-section-header:first-child {
  margin-top: 0;
}


/* ── Ingredient Table ─────────────────────────────────────────────────────── */
.ingredient-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
}

.ingredient-row {
  border-bottom: 1px solid var(--md-sys-color-surface-variant);
}

.ingredient-row:last-child {
  border-bottom: none;
}

.ingredient-row td {
  padding: 10px 8px;
  vertical-align: middle;
  color: var(--md-sys-color-on-surface);
  font-size: 15px;
}

.ing-check {
  width: 32px;
  text-align: center;
  padding-left: 0 !important;
  padding-right: 4px !important;
}

.ing-qty {
  width: 90px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 13px;
  white-space: nowrap;
}

.ing-name {
  font-weight: 500;
}

.ingredient-row.is-staple .ing-name {
  color: var(--md-sys-color-on-surface);
}

.ingredient-row.in-basket .ing-name {
  color: var(--md-sys-color-primary);
  font-weight: 700;
}

.ingredient-row.in-basket td {
  background: color-mix(in srgb, var(--md-sys-color-primary) 6%, transparent);
}

.ingredient-row.in-basket .ing-qty {
  color: var(--md-sys-color-primary);
}

.recipe-sub-section-header {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
  padding: 12px 8px 4px;
}


.recipe-section-header {
  background: #6a53a1;
  /* Same as grocery store headers */
  color: white;
  padding: 10px 16px;
  margin: 24px -20px 16px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.recipe-section-header .material-symbols-outlined {
  font-size: 18px;
}

.note-box {
  background: rgba(106, 83, 161, 0.05);
  color: var(--md-sys-color-on-surface);
  padding: 20px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.6;
  border: 1px dashed #6a53a1;
  border-left: 6px solid #6a53a1;
}

/* Cook Tab Category Filters */
.category-filters-container {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 12px 16px 20px;
  background: var(--md-sys-color-primary);
  /* Blend with header */
  scrollbar-width: none;
}

.category-filters-container::-webkit-scrollbar {
  display: none;
}

.category-filter-btn {
  padding: 6px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.category-filter-btn.active {
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-surface);
}

/* Add bar dropdowns */
#add-bar select,
#filter-select,
#status-select,
#add-section {
  height: 40px;
  padding: 0 32px 0 16px;
  border: none;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-family: Roboto, sans-serif;
  background: #ffffff;
  color: var(--md-sys-color-primary);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24' fill='%23444746'%3E%3Cpath d='M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 18px;
  transition: border-color .2s;
  flex: 1;
  min-width: 0;
}

#add-bar select:focus,
#filter-select:focus,
#status-select:focus,
#add-section:focus {
  border-color: var(--md-sys-color-primary);
}

/* Add Item Modal */
#add-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 2500;
  animation: fadeIn .15s ease;
  backdrop-filter: blur(2px);
}

#add-modal-backdrop.open {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 230px 24px 24px 24px;
  box-sizing: border-box;
}

#add-modal {
  background: var(--md-sys-color-surface);
  width: 100%;
  max-width: 340px;
  border-radius: 24px;
  padding: 0;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}


#add-modal-title {
  background: var(--md-sys-color-primary);
  color: #ffffff;
  margin: 0;
  padding: 18px 20px;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

#add-modal input {
  margin: 20px;
  width: calc(100% - 40px);
}

#add-modal .edit-actions {
  padding: 0 20px 20px 20px;
  margin: 0 !important;
}

#add-name {
  width: calc(100% - 32px);
  margin: 16px;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 12px;
  font-size: 16px;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  outline: none;
}

#add-name:focus {
  border-color: var(--md-sys-color-primary);
  border-width: 2px;
}

#add-section {
  height: 48px;
  border-radius: 12px;
  font-size: 14px;
  flex: none;
  width: 100%;
}

/* Mobile layout tweaks */
@media (max-width: 480px) {
  #add-bar {
    gap: 8px;
    padding: 8px 12px;
  }

  #add-bar input {
    flex: 1 1 70%;
    order: 1;
  }

  #add-bar button {
    order: 2;
  }

  #filter-select {
    flex: 1 1 45%;
    max-width: none;
    order: 3;
  }

  #new-section {
    flex: 1 1 45%;
    max-width: none;
    order: 4;
  }
}

/* Rating Picker & Animations */
.rating-picker-stars {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 20px;
}

.rating-star-btn {
  font-size: 32px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--md-sys-color-outline);
  transition: transform 0.2s, color 0.2s;
}

.rating-star-btn.active {
  color: #f2b01e;
  transform: scale(1.2);
}

.rating-star-btn:active {
  transform: scale(0.9);
}

@keyframes starPop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.5);
    filter: brightness(1.5);
  }

  100% {
    transform: scale(1);
  }
}

.star-pop {
  animation: starPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Plan Tab: Calendar UI */
#view-plan {
  background: var(--md-sys-color-primary);
  /* Ensure whole view is purple foundation */
  min-height: 100vh;
}

.plan-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  position: sticky;
  top: var(--plan-header-top, 40px);
  /* Dynamic overlap from JS */
  z-index: 200;
  background-color: var(--md-sys-color-primary) !important;
  color: white;
  box-shadow: none !important;
}

@media (max-width: 480px) {
  .plan-header {
    padding: 10px 12px;
  }

  /* On very small screens, let buttons move to their own row */
  .plan-header>div {
    flex-shrink: 0;
  }
}

.plan-title {
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.plan-actions {
  display: flex;
  gap: 8px;
}

.plan-action-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  padding: 6px 10px;
  /* Slimmer padding for mobile */
  border-radius: 12px;
  font-size: 11px;
  /* Slightly smaller for mobile fit */
  font-weight: 800;
  /* Bolder for readability */
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}

.plan-action-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.plan-action-btn.primary {
  background: white;
  color: var(--md-sys-color-primary);
}

/* Custom Calendar Picker */
.calendar-picker {
  background: white;
  border-radius: 16px;
  padding: 12px;
  user-select: none;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 4px;
}

.calendar-month-title {
  font-weight: 800;
  color: var(--md-sys-color-primary);
  text-transform: uppercase;
  font-size: 14px;
}

.calendar-nav-btn {
  background: none;
  border: none;
  color: var(--md-sys-color-primary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 50%;
}

.calendar-nav-btn:hover {
  background: rgba(106, 83, 161, 0.1);
}

.calendar-grid-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.calendar-weekday {
  font-size: 10px;
  font-weight: 800;
  color: #aaa;
  padding: 8px 0;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s;
  position: relative;
  z-index: 1;
}

.calendar-day.other-month {
  color: #ccc;
}

.calendar-day:hover:not(.empty) {
  background: rgba(106, 83, 161, 0.1);
}

.calendar-day.selected {
  background: var(--md-sys-color-primary) !important;
  color: white !important;
}

.calendar-day.in-range {
  background: rgba(106, 83, 161, 0.15);
  border-radius: 0;
}

.calendar-day.range-start {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-top-left-radius: 50%;
  border-bottom-left-radius: 50%;
}

.calendar-day.range-end {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 50%;
  border-bottom-right-radius: 50%;
}

.calendar-day.today {
  border: 1px solid var(--md-sys-color-primary);
}

.calendar-grid {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  /* Gapless for solid block look */
  background: var(--md-sys-color-primary);
  /* Fill gaps with purple */
  position: relative;
  z-index: 5;
}

/* Date Nav Buttons */
.nav-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-btn:hover {
  background: white;
  color: var(--md-sys-color-primary);
}

/* Search Dropdown */
.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  margin-top: 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  border: 1px solid var(--md-sys-color-outline-variant);
}

.search-results-dropdown.active {
  display: block;
}

.search-result-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: #f8f6ff;
}

.search-res-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--md-sys-color-primary);
  text-transform: uppercase;
}

.search-res-meta {
  font-size: 10px;
  font-weight: 700;
  color: #888;
  display: flex;
  justify-content: space-between;
}

/* Date Picker Modal */
#date-picker-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#date-picker-backdrop.active {
  display: flex;
}

#date-picker-modal {
  background: white;
  width: 100%;
  max-width: 400px;
  border-radius: 32px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  color: var(--md-sys-color-primary);
}

.date-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

/* Store Modal Styles */
.store-list-scroll {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.store-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(var(--md-sys-color-primary-rgb), 0.04);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  user-select: none;
}

.store-item:hover {
  background: rgba(var(--md-sys-color-primary-rgb), 0.08);
  transform: translateY(-1px);
}

.store-item.selected {
  background: var(--md-sys-color-primary);
  color: white;
}

.store-item-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.store-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--md-sys-color-primary);
}

.selected .store-dot {
  background: white;
}

.store-name {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.store-actions {
  display: flex;
  gap: 4px;
}

.store-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.store-item:hover .store-action-btn {
  opacity: 0.8;
}

.store-action-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  opacity: 1 !important;
}

.selected .store-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.dragging {
  opacity: 0.5;
  background: var(--md-sys-color-primary-container);
}

.date-option {
  padding: 16px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.date-option:hover {
  background: #f8f6ff;
  border-color: var(--md-sys-color-primary);
}

.date-option.selected {
  background: var(--md-sys-color-primary);
  color: white;
  border-color: var(--md-sys-color-primary);
}

.date-option-main {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.date-option-sub {
  font-size: 10px;
  opacity: 0.7;
}

/* Day Row Sticky Headers */
.day-header-row {
  position: sticky;
  top: var(--day-sticky-top, 125px);
  /* Dynamically calculated overlap */
  z-index: 100;
  background-color: var(--md-sys-color-primary) !important;
  margin: 0;
  padding: 16px;
  color: white !important;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  border: none !important;
  opacity: 1 !important;
}

.day-label {
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  color: white !important;
}

.day-card {
  background: var(--md-sys-color-surface);
  border-radius: 0;
  /* Flat for seamless integration */
  padding: 16px 12px;
  box-shadow: none;
  margin: 0;
  border-bottom: 8px solid var(--md-sys-color-primary);
  /* Purple space between cards */
}

.meal-slots {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meal-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: white;
  border-radius: 8px;
  border: 1px solid #eee;
  cursor: pointer;
  transition: all .2s;
}

.meal-slot:hover {
  border-color: var(--md-sys-color-primary);
  background: #fdfbff;
}

.meal-type {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--md-sys-color-outline);
  min-width: 60px;
}

.meal-recipe {
  font-size: 14px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meal-recipe.empty {
  color: var(--md-sys-color-outline);
  font-style: italic;
  font-size: 13px;
}

.add-meal-icon {
  color: var(--md-sys-color-primary);
  font-size: 18px !important;
}

/* Recipe Picker Modal */
#picker-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

#picker-modal {
  background: white;
  width: 90%;
  max-width: 400px;
  border-radius: 16px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.picker-header {
  padding: 16px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.picker-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
}

.picker-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f9f9f9;
  cursor: pointer;
  transition: background .2s;
}

.picker-item:hover {
  background: #f5f5f5;
}

.picker-item-title {
  font-size: 15px;
  font-weight: 500;
}

.picker-item-meta {
  font-size: 12px;
  color: #777;
}

#recipe-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--md-sys-color-surface);
  z-index: 1000;
  animation: slideInUp .3s cubic-bezier(0, 0, 0.2, 1);
}

#recipe-modal-backdrop.open {
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
}

.full-screen-modal {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--md-sys-color-surface);
}

.recipe-hero {
  height: 0;
  overflow: hidden;
  position: relative;
}

.close-modal-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  color: #333;
  border: none;
  z-index: 10;
}

.recipe-sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #6a53a1;
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.close-modal-btn-minimal {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

.close-modal-btn-minimal:hover {
  background: rgba(255, 255, 255, 0.25);
}

.recipe-header-center {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.recipe-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

#recipe-modal-title {
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  color: white !important;
}

.plan-pill-mini {
  background: white;
  color: #6a53a1;
  border: none;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  transition: transform 0.1s;
}

.plan-pill-mini:active {
  transform: scale(0.95);
}

.recipe-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.static-stars {
  display: flex;
  gap: 2px;
  color: #ffeb3b;
  font-size: 16px;
  cursor: pointer;
}

.category-badge-integrated {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recipe-section-header {
  background: #6a53a1;
  /* Purple background like grocery */
  color: white;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 32px -16px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.recipe-sub-section-header {
  background: #e8e0f0;
  /* Lighter purple for sub-sections */
  color: #6a53a1;
  padding: 8px 16px;
  margin: 16px -16px 8px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-left: 4px solid #6a53a1;
}

[data-theme="dark"] .recipe-sub-section-header {
  background: #2b2831;
  color: #d0bcff;
  border-left-color: #d0bcff;
}

.note-box {
  background: var(--md-sys-color-surface-variant) !important;
  color: var(--md-sys-color-on-surface);
  padding: 16px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.6;
  border: 1px dashed var(--md-sys-color-outline);
  cursor: pointer;
  transition: background 0.2s;
}

.note-box:hover {
  background: var(--md-sys-color-primary-container) !important;
}

.category-badge {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-primary);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.rating-display {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 12px;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rating-display.jump {
  transform: scale(1.4);
}

.rating-display:active {
  transform: scale(0.9);
}

.rating-picker-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.rating-star-btn {
  background: none;
  border: none;
  font-size: 36px;
  color: #ddd;
  cursor: pointer;
  transition: transform 0.2s, color 0.2s;
}

.rating-star-btn.active {
  color: #f2b01e;
}

.rating-star-btn:hover {
  transform: scale(1.2);
}

.star-pop {
  animation: starPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes starPop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.4);
    color: #ffeb3b;
  }

  100% {
    transform: scale(1);
  }
}

.plan-pill {
  background: #8e7cc3;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 24px;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(142, 124, 195, 0.4);
}

.staple-badge {
  background: #8e7cc3;
  color: white;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
  margin-left: 8px;
  vertical-align: middle;
}

.instruction-section-header {
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 1.5px;
  color: var(--md-sys-color-primary);
  margin: 32px 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(var(--md-sys-color-primary-rgb), 0.1);
  text-transform: uppercase;
}


.instruction-step {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #6a53a1;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  flex-shrink: 0;
}

.step-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--md-sys-color-on-surface);
  flex: 1;
}

.ing-link {
  color: #6a53a1;
  font-weight: 800;
  border-bottom: 2px solid rgba(106, 83, 161, 0.2);
  cursor: help;
}

[data-theme="dark"] .ing-link {
  color: #d0bcff;
  border-bottom-color: rgba(208, 188, 255, 0.2);
}

.ingredient-row.checked .ing-name,
.ingredient-row.checked .ing-qty {
  text-decoration: line-through;
  opacity: 0.5;
}

.ing-check {
  width: 40px;
  text-align: center;
  vertical-align: middle;
  padding: 12px 0;
  border-bottom: 1px solid var(--md-sys-color-surface-variant);
}

.add-all-btn {
  margin-left: auto;
  background: white;
  border: none;
  color: #6a53a1;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.1s;
}

.add-all-btn:active {
  transform: scale(0.95);
}

.recipe-modal-footer {
  position: sticky;
  bottom: 0;
  background: var(--md-sys-color-surface);
  padding: 16px 20px env(safe-area-inset-bottom);
  border-top: 1px solid var(--md-sys-color-surface-variant);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 150;
  box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.1);
}

.footer-main-actions {
  display: flex;
  gap: 12px;
}

.premium-footer-btn {
  flex: 1;
  height: 48px;
  border-radius: 24px;
  border: none;
  font-weight: 900;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: transform 0.1s, opacity 0.2s;
}

.premium-footer-btn.primary {
  background: #6a53a1;
  color: white;
  box-shadow: 0 4px 12px rgba(106, 83, 161, 0.3);
}

.premium-footer-btn.success {
  background: #4CAF50;
  color: white;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.premium-footer-btn.danger {
  background: #F44336;
  color: white;
  width: 56px;
  flex: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.premium-footer-btn:active {
  transform: scale(0.96);
}

.modal-nav-tabs {
  display: flex;
  justify-content: space-around;
  padding-top: 8px;
}

.modal-tab-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  color: var(--md-sys-color-outline);
  cursor: pointer;
  transition: color 0.2s;
}

.modal-tab-btn.active {
  color: #6a53a1;
}

.modal-tab-btn .material-symbols-outlined {
  font-size: 22px;
}

/* Animations */

@keyframes splash {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -150%) scale(4);
    opacity: 0;
  }
}

.star-splash {
  position: fixed;
  pointer-events: none;
  color: #ffeb3b;
  font-size: 40px;
  z-index: 3000;
  text-shadow: 0 0 20px rgba(255, 235, 59, 0.8);
  animation: splash 0.8s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes jump {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.4);
  }
}

.jump {
  display: inline-block;
  animation: jump 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.category-badge {
  background: rgba(106, 83, 161, 0.1);
  color: var(--md-sys-color-primary);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Animations */
@keyframes explode {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

.star-splash {
  position: fixed;
  font-size: 40px;
  color: #FFD700;
  pointer-events: none;
  z-index: 9999;
  animation: explode 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

@keyframes jump {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }
}

.jump {
  animation: jump 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.static-stars.jump span {
  animation: jump 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- Star Rating Splash & Jump Animations --- */
.star-splash {
  position: fixed;
  font-size: 40px;
  color: #ffca28;
  pointer-events: none;
  z-index: 3000;
  animation: starSplashAnim 0.8s ease-out forwards;
  text-shadow: 0 0 15px rgba(255, 202, 40, 0.6);
}

@keyframes starSplashAnim {
  0% {
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 1;
  }

  50% {
    transform: translate(-50%, -150%) scale(1.5) rotate(20deg);
    opacity: 0.8;
  }

  100% {
    transform: translate(-50%, -250%) scale(2) rotate(45deg);
    opacity: 0;
  }
}

.static-stars.jump {
  animation: jumpAnim 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes jumpAnim {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3) translateY(-5px);
  }

  100% {
    transform: scale(1);
  }
}

.rating-star-btn {
  background: none;
  border: none;
  font-size: 32px;
  color: #e0e0e0;
  cursor: pointer;
  transition: transform 0.2s, color 0.2s;
  padding: 4px;
}

.rating-star-btn:hover {
  transform: scale(1.2);
  color: #ffca28;
}

/* --- Premium Store Item Styling --- */
.store-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--md-sys-color-surface-variant);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.store-item:hover {
  background: var(--md-sys-color-primary-container);
  transform: translateX(4px);
}

.store-item.selected {
  background: var(--md-sys-color-primary);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
}

.store-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--md-sys-color-primary);
  margin-right: 12px;
}

.store-item.selected .store-dot {
  background: white;
}

.store-name {
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.store-actions {
  display: flex;
  gap: 4px;
}

.store-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  opacity: 0.6;
  transition: all 0.2s;
}

.store-action-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* --- Improved Store Management Scroll --- */
.store-list-scroll {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.store-list-scroll::-webkit-scrollbar {
  width: 4px;
}

.store-list-scroll::-webkit-scrollbar-thumb {
  background: var(--md-sys-color-outline-variant);
  border-radius: 2px;
}

/* --- Store Management Modal Styling (Fixed) --- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  display: flex;
  opacity: 1;
}

.premium-modal {
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  width: 90%;
  max-width: 450px;
  max-height: 85vh;
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 10, 30, 0.4);
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-backdrop.active .premium-modal {
  transform: translateY(0);
}

.modal-header {
  margin-bottom: 20px;
}

.modal-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--md-sys-color-primary);
}

.modal-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--md-sys-color-surface-variant);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: var(--md-sys-color-surface-variant);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 1 — BASKET ENGINE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── First-Check Popup ───────────────────────────────────────────────────── */
#first-check-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 5000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  backdrop-filter: blur(4px);
}

#first-check-modal.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

#first-check-modal-card {
  background: var(--md-sys-color-surface);
  border-radius: 28px;
  padding: 0;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

#first-check-icon-wrap {
  background: linear-gradient(135deg, var(--md-sys-color-primary), #9c70d8);
  padding: 28px 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#first-check-icon-wrap .material-symbols-outlined {
  font-size: 48px;
  color: #ffffff;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

#first-check-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--md-sys-color-on-surface);
  margin: 20px 24px 8px;
  line-height: 1.3;
}

#first-check-body {
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0 24px 10px;
  line-height: 1.5;
}

#first-check-plan-note {
  font-size: 13px;
  color: var(--md-sys-color-primary);
  font-weight: 600;
  margin: 0 24px 8px;
  line-height: 1.4;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--md-sys-color-primary) 10%, transparent);
  border-radius: 10px;
  border-left: 3px solid var(--md-sys-color-primary);
}

#first-check-alt-note {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0 24px 20px;
  opacity: 0.8;
  font-style: italic;
}

#first-check-bullets {
  margin: 0 24px 20px;
  padding-left: 20px;
  list-style: disc;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
  line-height: 1.8;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#first-check-bullets strong {
  color: var(--md-sys-color-primary);
  font-weight: 700;
}

#first-check-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 24px 24px;
}

#first-check-confirm-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--md-sys-color-primary), #9c70d8);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--md-sys-color-primary) 40%, transparent);
}

#first-check-confirm-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--md-sys-color-primary) 50%, transparent);
}

#first-check-confirm-btn .material-symbols-outlined {
  font-size: 18px;
}

#first-check-dismiss-btn {
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: 50px;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#first-check-dismiss-btn:hover {
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-variant);
}

/* ── Basket Footer ───────────────────────────────────────────────────────── */
#basket-footer {
  position: fixed;
  bottom: 72px;
  /* sits above the nav bar */
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--md-sys-color-primary), #7b4fa6);
  color: #ffffff;
  padding: 12px 16px;
  display: none;
  align-items: center;
  justify-content: space-between;
  z-index: 1800;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.25s ease;
}

#basket-footer.visible {
  display: flex;
}

#basket-footer-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.basket-cart-icon {
  font-size: 24px;
  opacity: 0.9;
}

#basket-footer-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.basket-count {
  font-weight: 700;
  font-size: 14px;
}

.basket-staple-note {
  font-size: 12px;
  opacity: 0.85;
  font-weight: 500;
}

#basket-footer-actions {
  display: flex;
  gap: 8px;
}

#basket-view-btn,
#basket-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

#basket-view-btn:hover,
#basket-add-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

#basket-add-btn {
  background: #ffffff;
  color: var(--md-sys-color-primary);
  border: none;
}

#basket-add-btn:hover {
  background: #f0f0f0;
}


#basket-view-btn .material-symbols-outlined {
  font-size: 16px;
}

/* ── Ingredient Row — In Basket ─────────────────────────────────────────── */
.ingredient-row.in-basket {
  background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
  border-radius: 8px;
}

.ingredient-row.in-basket .ing-name {
  font-weight: 700;
  color: var(--md-sys-color-primary);
}

.ingredient-row.in-basket td {
  transition: all 0.2s;
}

/* ── Pantry Badge ───────────────────────────────────────────────────────── */
.pantry-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 7px 2px 4px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--md-sys-color-primary) 15%, transparent);
  color: var(--md-sys-color-primary);
  margin-left: 6px;
  vertical-align: middle;
  border: 1px solid color-mix(in srgb, var(--md-sys-color-primary) 30%, transparent);
}

.pantry-badge .material-symbols-outlined {
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 2 — PANTRY TRIAGE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Triage Card ─────────────────────────────────────────────────────────── */
.triage-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: color-mix(in srgb, #f59e0b 10%, var(--md-sys-color-surface-variant));
  border-radius: 16px;
  border: 1.5px solid color-mix(in srgb, #f59e0b 25%, transparent);
  transition: all 0.25s ease;
  gap: 12px;
}

.triage-card.have-it {
  background: color-mix(in srgb, #6a53a1 8%, var(--md-sys-color-surface));
  border-color: transparent;
  opacity: 0.55;
}

.triage-card.need-it {
  background: color-mix(in srgb, #22c55e 12%, var(--md-sys-color-surface-variant));
  border-color: color-mix(in srgb, #22c55e 40%, transparent);
  opacity: 1;
}

.triage-card-info {
  flex: 1;
  min-width: 0;
}

.triage-card-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.triage-card.have-it .triage-card-name {
  text-decoration: line-through;
  color: var(--md-sys-color-on-surface-variant);
}

.triage-card-qty {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 500;
  margin-top: 2px;
}

/* ── Triage Pill Buttons ─────────────────────────────────────────────────── */
.triage-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.triage-btn {
  padding: 7px 13px;
  border-radius: 50px;
  border: none;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.triage-btn-need {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
  border: 1.5px solid rgba(34, 197, 94, 0.4);
}

.triage-btn-need.active {
  background: #22c55e;
  color: white;
  border-color: #22c55e;
  box-shadow: 0 3px 10px rgba(34, 197, 94, 0.4);
}

.triage-btn-have {
  background: rgba(107, 114, 128, 0.1);
  color: var(--md-sys-color-on-surface-variant);
  border: 1.5px solid rgba(107, 114, 128, 0.25);
}

.triage-btn-have.active {
  background: var(--md-sys-color-outline);
  color: var(--md-sys-color-surface);
  border-color: var(--md-sys-color-outline);
}

.triage-btn:active {
  transform: scale(0.94);
}

[data-theme="dark"] .triage-btn-need {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.4);
}

[data-theme="dark"] .triage-btn-need.active {
  background: #16a34a;
  color: white;
}

/* ── Triage Select-All Row ───────────────────────────────────────────────── */
.triage-select-all-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--md-sys-color-surface-variant);
}

.triage-select-all-btn {
  font-size: 11px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 50px;
  border: 1.5px solid var(--md-sys-color-outline-variant);
  background: none;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.15s;
}

.triage-select-all-btn:hover {
  background: var(--md-sys-color-surface-variant);
}

.recipe-source-chip {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  background: color-mix(in srgb, var(--md-sys-color-primary) 15%, transparent);
  color: var(--md-sys-color-primary);
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.header-action-btn.clear-all-btn {
  color: var(--md-sys-color-error);
}

.header-action-btn.clear-all-btn:hover {
  background: color-mix(in srgb, var(--md-sys-color-error) 10%, transparent);
}

.premium-footer-btn.clear-basket {
  background: color-mix(in srgb, var(--md-sys-color-error) 10%, transparent);
  color: var(--md-sys-color-error);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-error) 20%, transparent);
}

.premium-footer-btn.clear-basket:hover {
  background: color-mix(in srgb, var(--md-sys-color-error) 20%, transparent);
}

/* ── Inline Triage (Grocery List) ────────────────────────────────────────── */
.item-row.is-staple-row {
  background: color-mix(in srgb, var(--md-sys-color-primary) 5%, var(--md-sys-color-surface));
}

.item-row.is-staple-row.have-it {
  opacity: 0.6;
}

.item-row.is-staple-row.have-it .item-name-text {
  text-decoration: line-through;
  color: var(--md-sys-color-outline);
}

.inline-triage-btns {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}

.inline-triage-btn {
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 800;
  border-radius: 12px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all 0.2s;
  white-space: nowrap;
}

.inline-triage-btn-need {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.2);
}

.inline-triage-btn-need.active {
  background: #22c55e;
  color: white;
  border-color: #22c55e;
}

.inline-triage-btn-have {
  background: rgba(107, 114, 128, 0.1);
  color: var(--md-sys-color-on-surface-variant);
  border-color: rgba(107, 114, 128, 0.2);
}

.inline-triage-btn-have.active {
  background: var(--md-sys-color-outline);
  color: white;
  border-color: var(--md-sys-color-outline);
}

.inline-triage-btn:active {
  transform: scale(0.95);
}

[data-theme="dark"] .item-row.is-staple-row {
  background: color-mix(in srgb, var(--md-sys-color-primary) 8%, var(--md-sys-color-surface));
}

[data-theme="dark"] .inline-triage-btn-need {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.3);
}

[data-theme="dark"] .inline-triage-btn-need.active {
  background: #16a34a;
  color: white;
}