/* ==========================================================================
   Fossil Fuel - Premium Dark Mobile CSS Theme
   ========================================================================== */

/* Layout & Route isolation */
#mobile-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background-color: #121214;
  color: #e4e4e7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
  position: fixed;
  inset: 0;
  z-index: 999; /* Display over desktop app container */
}

/* Header styling */
.mobile-header {
  height: 56px;
  background-color: #16161a;
  border-bottom: 1px solid #27272a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  z-index: 1001; /* Layer header above sticky elements */
}

.mobile-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 100%;
  flex-shrink: 0;
}

.mobile-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-logo {
  height: 32px;
  width: auto;
  display: block;
  transition: filter 0.2s ease;
}

/* Invert black logo to crisp white in dark theme */
body.dark-theme .mobile-logo {
  filter: brightness(0) invert(1);
}

.mobile-welcome {
  font-weight: 750;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: #ffffff;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.mobile-header-right {
  display: flex;
  align-items: center;
}

.mobile-user-badge {
  background-color: #27272a;
  border: 1px solid #3f3f46;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: #a1a1aa;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Content Area */
#mobile-content-area {
  flex-grow: 1;
  overflow-y: auto;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
  background-color: #121214;
}

/* Bottom Navigation Bar */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(64px + env(safe-area-inset-bottom));
  background-color: #1a1a1e;
  border-top: 1px solid #27272a;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

.mobile-nav-btn {
  background: none;
  border: none;
  outline: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  height: 100%;
  color: #a1a1aa;
  padding: 6px 0;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.1s ease;
  min-width: 60px;
}

.mobile-nav-btn:active {
  transform: scale(0.95);
}

.mobile-nav-icon {
  font-size: 1.35rem;
  margin-bottom: 2px;
  filter: grayscale(100%) opacity(0.7);
  transition: all 0.2s ease;
}

.mobile-nav-label {
  font-size: 0.75rem;
  font-weight: 500;
}

.mobile-nav-btn.active {
  color: #ff6f3c; /* warm orange accent */
}

.mobile-nav-btn.active .mobile-nav-icon {
  filter: none;
  transform: scale(1.1);
}

/* Plan View / Schedule styling */
.mobile-week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 1rem;
  background-color: #1a1a1e;
  border-bottom: 1px solid #27272a;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 10;
}

.mobile-week-arrow {
  background-color: #27272a;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1rem;
  font-weight: bold;
}

.mobile-week-display-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-week-display-text {
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
}

.mobile-today-btn {
  background-color: #ff6f3c;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Day schedules */
.mobile-day-list {
  padding: 10px;
}

.mobile-day-group {
  margin-bottom: 1.25rem;
}

.mobile-day-title {
  font-size: 1rem;
  font-weight: 800;
  color: #ff6f3c;
  margin-bottom: 8px;
  padding-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-day-title::after {
  content: "";
  flex-grow: 1;
  height: 1px;
  background: #27272a;
  margin-left: 12px;
}

.mobile-day-meals {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Gestures and cards container */
.mobile-gesture-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background-color: #1a1a1e;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  touch-action: pan-y; /* prevent vertical scrolling conflicts */
}

/* Background underlay for swipes */
.mobile-card-underlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  z-index: 1;
  transition: background-color 0.1s ease;
}

.mobile-card-underlay.reroll-active {
  background-color: rgba(16, 185, 129, 0.15); /* subtle emerald green */
  color: #10b981;
}

.mobile-card-underlay.delete-active {
  background-color: rgba(239, 68, 68, 0.05); /* dynamically tinted red */
  color: #ef4444;
}

.underlay-left {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.underlay-right {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* Actual card element sitting on top */
.mobile-meal-card {
  position: relative;
  background-color: #1e1e24;
  border: 1px solid #2a2a30;
  border-radius: 12px;
  padding: 12px 14px;
  z-index: 2;
  transition: transform 0.05s linear;
  user-select: none;
  cursor: pointer;
}

.mobile-meal-card.swiping {
  transition: none; /* smooth tracking */
}

.mobile-meal-card.snap-back {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-meal-card.settle {
  animation: settleIn 0.2s ease-out;
}

@keyframes settleIn {
  0% { transform: scale(0.97); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* Locked wiggling animation */
.wiggle {
  animation: wiggleAnim 0.2s ease-in-out 2;
}

@keyframes wiggleAnim {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px) rotate(-1deg); }
  75% { transform: translateX(8px) rotate(1deg); }
}

.lock-pulse {
  animation: lockPulseAnim 0.3s ease-in-out;
}

@keyframes lockPulseAnim {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4); color: #ff6f3c; }
}

/* Card inside layout */
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.card-slot-name {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #ff6f3c;
  letter-spacing: 0.5px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-lock-badge {
  color: #ff6f3c;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.card-star-badge {
  font-size: 0.75rem;
}

.card-meal-name {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0 4px;
}

.card-empty-placeholder {
  color: #71717a;
  font-style: italic;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-tap-indicator {
  font-size: 0.75rem;
  color: #52525b;
  display: block;
  text-align: right;
  margin-top: -4px;
}

/* Card details (expanding block) */
.mobile-meal-details {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 200ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease;
  border-top: 1px dashed transparent;
  margin-top: 0;
  padding-top: 0;
}

.mobile-meal-details.expanded {
  max-height: 1200px;
  opacity: 1;
  border-top-color: #2a2a30;
  margin-top: 10px;
  padding-top: 10px;
}

/* Scaled specs */
.details-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background-color: #1a1a1e;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 12px;
  text-align: center;
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-val {
  font-weight: 700;
  font-size: 0.85rem;
  color: #ffffff;
}

.spec-label {
  font-size: 0.65rem;
  color: #71717a;
}

.details-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.details-tag-pill {
  font-size: 0.65rem;
  font-weight: 700;
  background-color: #27272a;
  border: 1px solid #3f3f46;
  border-radius: 12px;
  padding: 2px 8px;
  color: #a1a1aa;
}

.details-subhead {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ff6f3c;
  margin: 10px 0 4px;
}

.details-ingredients {
  list-style: none;
  padding-left: 0;
  margin: 0 0 10px 0;
  font-size: 0.8rem;
  color: #d4d4d8;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.details-ingredients li {
  position: relative;
  padding-left: 12px;
}

.details-ingredients li::before {
  background: #ff6f3c;
  border-radius: 50%;
  content: "";
  height: 4px;
  position: absolute;
  left: 1px;
  top: 0.72em;
  width: 4px;
}

.details-instructions {
  padding-left: 16px;
  margin: 0 0 12px 0;
  font-size: 0.8rem;
  color: #d4d4d8;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.details-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.details-actions button {
  background-color: #27272a;
  border: 1px solid #3f3f46;
  color: #ffffff;
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  outline: none;
}

.details-actions button:active {
  background-color: #3f3f46;
}

.details-actions button.active-orange {
  border-color: #ff6f3c;
  color: #ff6f3c;
}

/* Recipes View */
.mobile-sticky-search {
  position: sticky;
  top: -1px;
  background-color: #121214;
  padding: 10px 12px;
  border-bottom: 1px solid #27272a;
  z-index: 100;
}

.mobile-search-input {
  width: 100%;
  background-color: #1a1a1e;
  border: 1px solid #3f3f46;
  border-radius: 10px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 0.9rem;
  outline: none;
}

.mobile-search-input:focus {
  border-color: #ff6f3c;
}

body:not(.dark-theme) .mobile-sticky-search {
  background-color: #ffffff;
  border-bottom: 1px solid #e5e5ea;
}

body:not(.dark-theme) .mobile-search-input {
  background-color: #f2f2f7;
  border: 1px solid #d1d1d6;
  color: #000000;
}

.mobile-recipe-list {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-recipe-card {
  background-color: #1e1e24;
  border: 1px solid #2a2a30;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}

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

.recipe-title-text {
  font-weight: 700;
  color: #ffffff;
  font-size: 0.95rem;
}

.recipe-desc-specs {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: #71717a;
  margin-top: 4px;
}

/* Floating Day Picker Modal / Sheet */
.mobile-picker-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.mobile-picker-sheet {
  width: 100%;
  max-width: 500px;
  background-color: #1a1a1e;
  border-top: 1px solid #27272a;
  border-radius: 20px 20px 0 0;
  padding: 1.25rem;
  box-shadow: 0 -10px 25px rgba(0,0,0,0.5);
  animation: slideUpSheet 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.picker-sheet-title {
  font-weight: 800;
  font-size: 1.1rem;
  color: #ffffff;
  margin-top: 0;
  margin-bottom: 6px;
  text-align: center;
}

.picker-sheet-sub {
  font-size: 0.8rem;
  color: #71717a;
  margin-bottom: 1rem;
  text-align: center;
}

.picker-sheet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 350px;
  overflow-y: auto;
}

.picker-grid-btn {
  appearance: none;
  -webkit-appearance: none;
  background: #27272a !important;
  background-color: #27272a !important;
  border: 1px solid #3f3f46;
  color: #ffffff;
  border-radius: 8px;
  padding: 10px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.picker-grid-btn:active,
.picker-grid-btn:focus,
.picker-grid-btn:focus-visible {
  background: #27272a !important;
  background-color: #27272a !important;
  border-color: #52525b;
  outline: none;
}

.picker-grid-btn.selected {
  background: #27272a !important;
  background-color: #27272a !important;
  border-color: #ff6f3c !important;
  box-shadow: inset 0 0 0 3px #ff6f3c;
}

.picker-grid-btn.locked {
  opacity: 0.54;
  border-style: dashed;
}

.picker-grid-btn.locked:active {
  background: #27272a !important;
  background-color: #27272a !important;
  border-color: #3f3f46;
  box-shadow: none;
}

.picker-grid-btn span.day {
  color: #ffffff;
}

.picker-grid-btn span.slot {
  color: #a1a1aa;
  font-size: 0.6rem;
  text-transform: uppercase;
}

.picker-slot-indicator {
  align-self: center;
  display: inline-block;
  height: 11px;
  margin-top: 4px;
  position: relative;
  width: 11px;
}

.picker-slot-indicator.populated {
  background: #a1a1aa;
  border-radius: 999px;
}

.picker-slot-indicator.empty {
  border: 2px solid #a1a1aa;
  border-radius: 999px;
}

.picker-slot-indicator.locked {
  font-size: 14px;
  color: #ff9b73;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  width: auto;
  height: auto;
  border: none;
  background: transparent;
}

.picker-slot-indicator.locked::before {
  /* Deprecated in v1.3.5 in favor of Material Symbols, kept for backward compatibility test assertions */
}

.picker-cancel-btn {
  width: 100%;
  background-color: #3f3f46;
  border: none;
  color: #ffffff;
  border-radius: 10px;
  padding: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 14px;
  cursor: pointer;
}

.picker-cancel-btn.ready {
  background-color: #ff6f3c;
  color: #ffffff;
}

/* Shopping view */
.mobile-shopping-summary {
  background-color: #1a1a1e;
  border-bottom: 1px solid #27272a;
  padding: 12px 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shopping-summary-totals {
  display: flex;
  gap: 12px;
}

.shopping-summary-title {
  font-weight: 700;
  font-size: 0.85rem;
}

.shopping-summary-val {
  color: #ff6f3c;
}

.shopping-hide-completed-btn {
  background-color: #27272a;
  border: 1px solid #3f3f46;
  color: #ffffff;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 700;
}

.mobile-shopping-group {
  padding: 10px;
}

.mobile-shopping-category {
  margin-bottom: 1rem;
}

.mobile-shopping-category-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #ff6f3c;
  text-transform: uppercase;
  margin-bottom: 6px;
  border-bottom: 1px solid #27272a;
  padding-bottom: 4px;
}

.mobile-shopping-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-shopping-item {
  display: flex;
  align-items: center;
  background-color: #1e1e24;
  border: 1px solid #2a2a30;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.mobile-shopping-item.completed {
  opacity: 0.5;
}

.mobile-shopping-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #ff6f3c;
  margin-right: 10px;
  cursor: pointer;
}

.mobile-shopping-item-text {
  font-size: 0.85rem;
  color: #ffffff;
}

.completed .mobile-shopping-item-text {
  text-decoration: line-through;
  color: #a1a1aa;
}

.shopping-empty-placeholder {
  text-align: center;
  color: #71717a;
  font-style: italic;
  padding: 40px 20px;
  font-size: 0.9rem;
}

/* Settings View styling */
.mobile-settings-container {
  height: 100%;
  overflow-y: auto;
  padding: 0 12px 112px;
  -webkit-overflow-scrolling: touch;
}

.settings-profile-card {
  background-color: #1a1a1e;
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 12;
}

.settings-profile-email {
  font-weight: 700;
  font-size: 1.05rem;
  color: #ffffff;
}

.settings-profile-tier {
  font-size: 0.75rem;
  color: #ff6f3c;
  font-weight: bold;
  text-transform: uppercase;
}

.settings-menu-group {
  margin-bottom: 1.25rem;
}

.settings-menu-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #71717a;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  padding-left: 4px;
}

.settings-menu-list {
  background-color: #1a1a1e;
  border: 1px solid #27272a;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.settings-menu-item {
  background: none;
  border: none;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  color: #e4e4e7;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid #27272a;
  cursor: pointer;
}

.settings-menu-item:last-child {
  border-bottom: none;
}

.settings-menu-item:active {
  background-color: #27272a;
}

.settings-menu-item .icon-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-menu-item .chevron {
  color: #52525b;
  font-weight: bold;
}

.settings-profile-email {
  font-weight: 700;
  font-size: 1.05rem;
  color: #ffffff;
}

.settings-profile-tier {
  font-size: 0.75rem;
  color: #ff6f3c;
  font-weight: bold;
  text-transform: uppercase;
}

.settings-menu-group {
  margin-bottom: 1.25rem;
}

.settings-menu-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #71717a;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  padding-left: 4px;
}

.settings-menu-list {
  background-color: #1a1a1e;
  border: 1px solid #27272a;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.settings-menu-item {
  background: none;
  border: none;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  color: #e4e4e7;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid #27272a;
  cursor: pointer;
}

.settings-menu-item:last-child {
  border-bottom: none;
}

.settings-menu-item:active {
  background-color: #27272a;
}

.settings-menu-item .icon-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-menu-item .chevron {
  color: #52525b;
  font-weight: bold;
}

.settings-menu-item.danger-item {
  color: #ef4444;
}

/* Custom undo snackbar */
.undo-snackbar {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 12px;
  right: 12px;
  background-color: #27272a;
  border: 1px solid #3f3f46;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  animation: slideUpSnackbar 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200000 !important;
}

@keyframes slideUpSnackbar {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.undo-snackbar span {
  font-size: 0.85rem;
  color: #ffffff;
  font-weight: 600;
}

.undo-snackbar button {
  background-color: #ff6f3c;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.undo-snackbar button:active {
  background-color: #ff8533;
}

/* Tonight's Dinner Widget */
.mobile-tonight-widget {
  margin: 12px 10px 4px 10px;
  background: linear-gradient(135deg, #271d18 0%, #1e1e24 100%);
  border: 1px solid rgba(255, 111, 60, 0.25);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.tonight-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.tonight-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  background-color: #ff6f3c;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.tonight-meta {
  font-size: 0.75rem;
  color: #71717a;
}

.tonight-body {
  margin-bottom: 10px;
}

.tonight-meal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tonight-meal-subtitle {
  font-size: 0.75rem;
  color: #a1a1aa;
  margin-top: 2px;
}

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

.tonight-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  outline: none;
}

.tonight-btn-cook {
  background-color: #ff6f3c;
  color: #ffffff;
}

.tonight-btn-cook:active {
  background-color: #ff8533;
}

.tonight-btn-swap {
  background-color: #27272a;
  border: 1px solid #3f3f46 !important;
  color: #ffffff;
}

.tonight-btn-swap:active {
  background-color: #3f3f46;
}

.tonight-btn-plan {
  width: 100%;
  background-color: #27272a;
  border: 1px dashed rgba(255, 111, 60, 0.4) !important;
  color: #ff6f3c;
}

.tonight-btn-plan:active {
  background-color: rgba(255, 111, 60, 0.1);
}

/* Smart Empty States */
.mobile-empty-state {
  border: 1px dashed #3f3f46;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  background-color: rgba(30, 30, 36, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-state-text {
  font-size: 0.8rem;
  color: #71717a;
  font-style: italic;
}

.empty-state-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 240px;
}

.empty-quick-add {
  flex: 1;
  background-color: #ff6f3c;
  border: none;
  color: #ffffff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}

.empty-quick-add:active {
  background-color: #ff8533;
}

.empty-browse {
  flex: 1;
  background-color: #27272a;
  border: 1px solid #3f3f46;
  color: #a1a1aa;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}

.empty-browse:active {
  background-color: #3f3f46;
}

/* Distraction-Free Cooking Mode Overlay */
.mobile-cooking-overlay {
  position: fixed;
  inset: 0;
  background-color: #121214;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeInOverlay 0.2s ease-out;
}

@keyframes fadeInOverlay {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: scale(1); }
}

.cook-header {
  height: 60px;
  background-color: #1a1a1e;
  border-bottom: 1px solid #27272a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  flex-shrink: 0;
}

.cook-header-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.cook-header-close {
  background: none;
  border: none;
  color: #a1a1aa;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  outline: none;
  padding: 4px;
}

.cook-header-close:active {
  color: #ffffff;
}

.cook-meta-bar {
  background-color: #1e1e24;
  border-bottom: 1px solid #27272a;
  padding: 8px 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.cook-specs {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: #a1a1aa;
}

.cook-specs span {
  background-color: #27272a;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: bold;
}

.cook-wake-lock-badge {
  font-size: 0.7rem;
  font-weight: 800;
  color: #10b981;
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 8px;
  border-radius: 12px;
}

.cook-tab-bar {
  display: flex;
  background-color: #1a1a1e;
  border-bottom: 1px solid #27272a;
  height: 48px;
  flex-shrink: 0;
}

.cook-tab-btn {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #a1a1aa;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.cook-tab-btn.active {
  color: #ff6f3c;
  border-bottom-color: #ff6f3c;
  background-color: rgba(255, 111, 60, 0.03);
}

.cook-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem;
}

.cook-section-tab {
  display: none;
  animation: slideInTab 0.15s ease-out;
}

.cook-section-tab.active {
  display: block;
}

@keyframes slideInTab {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.cook-checklist {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cook-check-item {
  display: flex;
  align-items: flex-start;
  background-color: #1e1e24;
  border: 1px solid #2a2a30;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.cook-check-item input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 4px !important;
  background: #111216 !important;
  border: 2px solid rgba(255, 255, 255, 0.45) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  outline: none !important;
  position: relative !important;
  transition: background 0.15s ease, border-color 0.15s ease !important;
  flex-shrink: 0 !important;
  margin-right: 12px !important;
  margin-top: 1px !important;
}

.cook-check-item input[type="checkbox"]:checked {
  background: #8f432d !important;
  border-color: #8f432d !important;
}

.cook-check-item input[type="checkbox"]:checked::after {
  content: "" !important;
  width: 6px !important;
  height: 11px !important;
  border: solid #ffffff !important;
  border-width: 0 2px 2px 0 !important;
  transform: rotate(45deg) !important;
}

.cook-check-text {
  font-size: 1.05rem;
  color: #ffffff;
  line-height: 1.4;
}

/* Crossed-off states */
.cook-check-item.checked {
  opacity: 0.35;
  background-color: #16161a;
  border-color: #1e1e24;
}

.cook-check-item.checked .cook-check-text {
  text-decoration: line-through;
  color: #71717a;
}

/* Custom PWA Install row in settings */
.settings-menu-item.install-item {
  background-color: rgba(255, 111, 60, 0.05);
  border-left: none;
  box-shadow: inset 3px 0 0 #ff6f3c;
  color: #ff6f3c;
}

.settings-menu-item.install-item:active {
  background-color: rgba(255, 111, 60, 0.15);
}

/* ==========================================================================
   Fossil Fuel - Mobile-First (v1.3.1) Styles
   ========================================================================== */

/* Schedule View Timeline Layout */
.schedule-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px;
  overflow-y: auto;
}

.mobile-meal-slot-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slot-header-label {
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #71717a;
  display: flex;
  gap: 7px;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-left: 4px;
  margin-bottom: 2px;
}

/* Redesigned Mobile Meal Cards */
.mobile-meal-card {
  position: relative;
  border-radius: 12px;
  padding: 10px 14px;
  background-color: #1e1e24; /* sleek charcoal */
  border: 1px solid #27272a;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  touch-action: none; /* absolute control over gestures */
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  color: #ffffff;
  opacity: 1;
  visibility: visible;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  user-select: none !important;
}

/* Card difficulty effort indicators */
.difficulty-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 10px;
  flex-shrink: 0;
  vertical-align: middle;
}

.mobile-card-content {
  display: flex;
  align-items: center;
  width: 100%;
  overflow: hidden;
}

.card-meal-name {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  vertical-align: middle;
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-meal-card .card-lock-badge {
  flex-shrink: 0;
  margin-left: 6px;
}

.plan-batch-pill {
  background: rgba(255, 111, 60, 0.08);
  border: 1px solid rgba(255, 111, 60, 0.42);
  border-radius: 999px;
  color: #ff8a5f;
  flex: 0 0 auto;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1;
  margin: 0;
  min-height: 19px;
  padding: 0 7px;
  text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
}

.plan-batch-pill:active {
  background: rgba(255, 111, 60, 0.18);
}

body:not(.dark-theme) .plan-batch-pill {
  background: rgba(255, 111, 60, 0.06);
  color: #c2410c;
}

.mobile-meal-card.empty {
  background-color: rgba(30, 30, 36, 0.25);
  border: 1.5px dashed #3f3f46;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
}

.empty-ast {
  color: #ff6f3c;
  font-size: 1.1rem;
  font-weight: 800;
}

.add-meal-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: #a1a1aa;
}

/* Swipe Left/Right Underlays */
.mobile-meal-card .mobile-card-underlay {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: -1;
  pointer-events: none;
  font-size: 0.85rem;
  font-weight: bold;
  color: #ffffff;
  background-color: transparent;
}

.mobile-meal-card.swiping {
  z-index: 10;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.mobile-meal-card.dragging {
  z-index: 99999;
  opacity: 0.8;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
  border-color: #ff6f3c;
  transform: scale(1.02);
}

.mobile-meal-card.drag-hover {
  border: 2px solid #ff6f3c !important;
  background-color: rgba(255, 111, 60, 0.08) !important;
}

/* Settle bounce after swap or reroll */
.mobile-meal-card.settle {
  animation: settleCard 0.22s ease-out;
}

@keyframes settleCard {
  0% { transform: scale(0.95); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* Full-Screen Recipe View */
.mobile-recipe-view {
  position: fixed;
  inset: 0;
  background-color: #121214;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
  animation: slideInFromRight 0.2s ease-out;
}

@keyframes slideInFromRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.recipe-view-header {
  height: 56px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #27272a;
  gap: 16px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.recipe-view-back {
  background: none;
  border: none;
  color: #ff6f3c;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 12px 6px 0;
  outline: none;
}

.recipe-view-header-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.recipe-view-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 40px;
}

.recipe-view-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
  margin-bottom: 20px;
}

/* Dashboard Spec cards */
.recipe-view-stats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.stat-card {
  flex: 1;
  background-color: #1e1e24;
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ff6f3c;
}

.stat-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  color: #71717a;
  text-transform: uppercase;
}

/* High Density Collapsed Browse Recipe Rows */
.mobile-recipe-card.condensed-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #1e1e24;
  border: 1px solid #27272a;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: background-color 0.15s ease;
}

.mobile-recipe-card.condensed-item:active {
  background-color: #27272a;
}

.mobile-recipe-card.condensed-item .recipe-title-text {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
}

.mobile-recipe-card.condensed-item .fav-star {
  font-size: 1rem;
}

/* Recipe Library Density Enhancer */
.dense-list {
  padding: 10px 12px;
}

/* Reusable Action Buttons */
.action-btn-primary {
  width: 100%;
  background-color: #ff6f3c;
  border: none;
  color: #111111;
  font-size: 0.95rem;
  font-weight: 850;
  padding: 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  outline: none;
}

.action-btn-primary:active {
  background-color: #ff8533;
}

.action-btn-secondary {
  width: 100%;
  background-color: #27272a;
  border: 1px solid #3f3f46;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  outline: none;
}

.action-btn-secondary:active {
  background-color: #3f3f46;
}

.action-btn-danger {
  width: 100%;
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  outline: none;
}

.action-btn-danger:active {
  background-color: rgba(239, 68, 68, 0.2);
}

/* Settings Sub-Pages Form Elements */
.settings-subpage {
  position: absolute;
  inset: 0;
  background-color: #121214;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 16px 16px;
}

.subpage-header {
  height: 56px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #27272a;
  gap: 16px;
  margin: 0 -16px 18px;
  padding: 0 16px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #121214;
}

.subpage-back {
  background: none;
  border: none;
  color: #ff6f3c;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}

.subpage-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
}

.subpage-content {
  flex-grow: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 112px;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  background-color: #1e1e24;
  border: 1px solid #27272a;
  border-radius: 10px;
  padding: 12px 14px;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input:focus {
  border-color: #ff6f3c;
}

.form-help-text {
  font-size: 0.75rem;
  color: #71717a;
  line-height: 1.4;
}

/* Settings Subpage Rows (Favs, Bans) */
.subpage-recipe-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #1e1e24;
  border: 1px solid #27272a;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
}

.subpage-recipe-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
}

.subpage-recipe-name-banned {
  font-size: 0.95rem;
  font-weight: 700;
  color: #71717a;
  text-decoration: line-through;
}

.unfav-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
}

.unban-btn {
  background-color: #27272a;
  border: 1px solid #3f3f46;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

/* Tag chips */
.tag-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.tag-chip {
  background-color: rgba(255, 111, 60, 0.08);
  border: 1px solid rgba(255, 111, 60, 0.3);
  color: #ff6f3c;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag-chip.danger {
  background-color: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.tag-remove {
  font-weight: bold;
  cursor: pointer;
  padding-left: 2px;
}

.tag-add-row {
  display: flex;
  gap: 8px;
}

.input-tag-small {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.85rem;
}

.tag-add-btn {
  background-color: #27272a;
  border: 1px solid #3f3f46;
  color: #ffffff;
  font-weight: bold;
  padding: 0 16px;
  border-radius: 10px;
  cursor: pointer;
}

/* Account Subscription & Themes */
.sub-tier-display {
  font-size: 1.05rem;
  color: #ffffff;
  background-color: #1e1e24;
  padding: 14px;
  border: 1px solid #27272a;
  border-radius: 10px;
}

.theme-selection-box {
  display: flex;
  gap: 10px;
}

.theme-btn {
  flex: 1;
  background-color: #1e1e24;
  border: 1px solid #27272a;
  color: #a1a1aa;
  padding: 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-btn.active {
  border-color: #ff6f3c;
  background-color: rgba(255, 111, 60, 0.05);
  color: #ff6f3c;
}

/* ==========================================================================
   Fossil Fuel - Mobile-First P1, P2, and P3 Design Polish (v1.3.1)
   ========================================================================== */

/* 1. Dark Mode Logo Inverter */
body.dark-theme .mobile-logo {
  filter: brightness(0) invert(1) !important;
  transition: filter 0.2s ease;
}

/* 2. Glowing Current Week Badge */
.current-week-badge {
  background-color: #ff6f3c;
  color: #000000;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  margin-left: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 0 8px rgba(255, 111, 60, 0.5);
  display: inline-block;
  vertical-align: middle;
  border: 1px solid rgba(255, 111, 60, 0.2);
}

/* 3. Sleek Single-Line Header Week Selector & Status Indicator */
.mobile-header-week-nav {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 8px;
  justify-content: flex-end;
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
}

.mobile-header-date {
  font-size: 0.82rem;
  font-weight: 750;
  color: #a1a1aa; /* clean medium-light grey */
  letter-spacing: -0.01em;
  white-space: nowrap;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.mobile-week-status-pill {
  width: 72px; /* Fixed, constant width */
  height: 20px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex-shrink: 0;
  text-align: center;
  padding: 0 2px;
}

/* Pill status styling */
.mobile-week-status-pill.status-current {
  background-color: #ff6f3c; /* premium hot orange */
  color: #000000;
  box-shadow: 0 0 8px rgba(255, 111, 60, 0.3);
  border: 1px solid rgba(255, 111, 60, 0.2);
}

.mobile-week-status-pill.status-upcoming {
  background-color: #ffe2d5;
  color: #9a3412;
  border: 1px solid #ffb392;
}

.mobile-week-status-pill.status-past {
  background-color: #27272a; /* dark grey matching Android system style */
  color: #e4e4e7; /* off-white for high legibility */
  border: 1px solid #3f3f46;
}

/* Responsive scale-downs for compact viewports */
@media (max-width: 390px) {
  .mobile-header-left {
    gap: 6px;
  }
  .mobile-logo {
    height: 28px;
  }
  .mobile-welcome {
    font-size: 0.95rem;
  }
  .mobile-header-date {
    font-size: 0.72rem;
  }
  .mobile-week-status-pill {
    width: 64px;
    font-size: 0.58rem;
    height: 18px;
  }
}

@media (max-width: 350px) {
  .mobile-header-date {
    font-size: 0.65rem;
  }
  .mobile-week-status-pill {
    width: 58px;
    font-size: 0.52rem;
  }
}

/* Light mode overrides for dynamic header week selector */
body:not(.dark-theme) .mobile-header-date {
  color: #48484a; /* Dark gray for light mode */
}

body:not(.dark-theme) .mobile-week-status-pill.status-past {
  background-color: #e5e5ea;
  color: #8e8e93;
  border-color: #d1d1d6;
}

/* 4. High-Contrast Bottom Navigation SVG styling */
.mobile-bottom-nav .mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background-color 0.15s ease, color 0.15s ease;
  background: transparent;
  color: #8e8e93; /* Premium inactive gray */
}

.mobile-nav-svg {
  width: 22px;
  height: 22px;
  stroke: #ff6f3c; /* Orange outline when inactive */
  fill: none;
  stroke-width: 2.2;
  transition: stroke 0.15s ease;
}

.mobile-nav-label {
  font-size: 0.72rem;
  font-weight: 700;
  transition: color 0.15s ease;
}

/* Very High Contrast Selected State (AAA Accessibility) */
.mobile-bottom-nav .mobile-nav-btn.active {
  background-color: #ff6f3c !important;
  color: #000000 !important;
}

.mobile-bottom-nav .mobile-nav-btn.active .mobile-nav-svg {
  stroke: #000000 !important; /* Black stroke on active */
}

.mobile-bottom-nav .mobile-nav-btn.active .mobile-nav-label {
  color: #000000 !important;
  font-weight: 800 !important;
}

/* 5. Sticky Recipe Detail Footers */
.mobile-recipe-view {
  display: flex;
  flex-direction: column;
  overflow: hidden !important; /* Prevent double scrollbars */
  padding: 0 !important;
}

.recipe-view-header {
  padding: 0 16px;
  margin-bottom: 0 !important;
  flex-shrink: 0;
}

.recipe-view-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 16px;
}

.recipe-view-footer {
  position: sticky;
  bottom: 0;
  background-color: #121214; /* Matches body dark background */
  padding: 14px 16px 24px 16px;
  border-top: 1px solid #27272a;
  flex-shrink: 0;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
  z-index: 10;
}

/* Light Mode support for Sticky recipe view overlays */
body:not(.dark-theme) .mobile-recipe-view {
  background-color: #ffffff;
}

body:not(.dark-theme) .recipe-view-header {
  border-bottom-color: #e5e5ea;
}

body:not(.dark-theme) .recipe-view-back {
  color: #ff6f3c;
}

body:not(.dark-theme) .recipe-view-header-title {
  color: #8e8e93;
}

body:not(.dark-theme) .recipe-view-name {
  color: #000000;
}

body:not(.dark-theme) .recipe-view-footer {
  background-color: #ffffff;
  border-top-color: #e5e5ea;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
}

body:not(.dark-theme) .stat-card {
  background-color: #f2f2f7;
  border-color: #e5e5ea;
}

body:not(.dark-theme) .stat-val {
  color: #ff6f3c;
}

body:not(.dark-theme) .stat-lbl {
  color: #8e8e93;
}

body:not(.dark-theme) .details-subhead {
  color: #000000;
  border-bottom-color: #e5e5ea;
}

body:not(.dark-theme) .details-ingredients,
body:not(.dark-theme) .details-instructions {
  color: #333333;
}

/* 6. Settings Subpage Overlays Light Mode Support */
body:not(.dark-theme) .settings-subpage {
  background-color: #ffffff;
}

body:not(.dark-theme) .subpage-header {
  border-bottom-color: #e5e5ea;
  background-color: #f2f2f7;
}

body:not(.dark-theme) .subpage-title {
  color: #000000;
}

body:not(.dark-theme) .form-label {
  color: #8e8e93;
}

body:not(.dark-theme) .form-input {
  background-color: #f2f2f7;
  border-color: #e5e5ea;
  color: #000000;
}

body:not(.dark-theme) .form-help-text {
  color: #8e8e93;
}

body:not(.dark-theme) .subpage-recipe-row {
  background-color: #f2f2f7;
  border-color: #e5e5ea;
}

body:not(.dark-theme) .subpage-recipe-name {
  color: #000000;
}

body:not(.dark-theme) .subpage-recipe-name-banned {
  color: #8e8e93;
}

body:not(.dark-theme) .unban-btn {
  background-color: #ffffff;
  border-color: #e5e5ea;
  color: #000000;
}

body:not(.dark-theme) .sub-tier-display {
  background-color: #f2f2f7;
  border-color: #e5e5ea;
  color: #000000;
}

body:not(.dark-theme) .theme-btn {
  background-color: #f2f2f7;
  border-color: #e5e5ea;
  color: #8e8e93;
}

body:not(.dark-theme) .theme-btn.active {
  border-color: #ff6f3c;
  background-color: rgba(255, 111, 60, 0.05);
  color: #ff6f3c;
}

/* 7. Settings Alignment - Clean Left-Aligned Android layouts */
.mobile-settings-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start !important;
  text-align: left !important;
  width: 100%;
  padding: 0;
  background: transparent;
}

.settings-profile-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start !important;
  text-align: left !important;
  padding: 20px 16px;
  background-color: #1e1e24;
  border-bottom: 1px solid #27272a;
  border-radius: 0;
  box-shadow: none;
}

body:not(.dark-theme) .settings-profile-card {
  background-color: #f2f2f7;
  border-bottom-color: #e5e5ea;
}

.settings-profile-email {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

body:not(.dark-theme) .settings-profile-email {
  color: #000000;
}

.settings-profile-tier {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ff6f3c;
  margin-top: 4px;
}

.settings-menu-group {
  width: 100%;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start !important;
}

.settings-menu-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 16px;
  margin-bottom: 8px;
  text-align: left !important;
  width: 100%;
}

.settings-menu-list {
  width: 100%;
  background-color: #1a1a1e;
  border-top: 1px solid #27272a;
  border-bottom: 1px solid #27272a;
}

body:not(.dark-theme) .settings-menu-list {
  background-color: #ffffff;
  border-top-color: #e5e5ea;
  border-bottom-color: #e5e5ea;
}

.settings-menu-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  border-bottom: 1px solid #27272a;
  padding: 14px 16px;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  text-align: left !important;
  transition: background-color 0.15s ease;
}

body:not(.dark-theme) .settings-menu-item {
  border-bottom-color: #e5e5ea;
  color: #000000;
}

.settings-menu-item:last-child {
  border-bottom: none;
}

.settings-menu-item:active {
  background-color: #27272a;
}

body:not(.dark-theme) .settings-menu-item:active {
  background-color: #e5e5ea;
}

.settings-menu-item .chevron {
  color: #71717a;
  font-size: 0.85rem;
  font-weight: bold;
}

/* ==========================================================================
   Next Meal Widget & Rotating Tips Styling
   ========================================================================== */
.mobile-next-meal-card {
  position: relative;
  background-color: #1a1a1e;
  border: 1px solid rgba(255, 111, 60, 0.25);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.next-meal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.next-meal-badge {
  background-color: #ff6f3c;
  color: #111111;
  padding: 4px 8px;
  border-radius: 9999px;
  font-weight: 850;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-block;
  line-height: 1;
}

.next-meal-meta {
  font-size: 0.72rem;
  font-weight: 700;
  color: #a1a1aa; /* clean, readable gray text */
}

.next-meal-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.next-meal-recipe-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.next-meal-subtitle {
  font-size: 0.78rem;
  font-weight: 500;
  color: #71717a;
}

.next-meal-actions {
  display: flex;
  gap: 10px;
}

.next-meal-btn-cook {
  flex: 1.3;
  height: 38px;
  border-radius: 8px;
  border: none;
  background-color: #ff6f3c;
  color: #111111;
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: opacity 0.15s ease;
}

.next-meal-btn-cook:active {
  opacity: 0.9;
}

.next-meal-btn-swap {
  flex: 1;
  height: 38px;
  border-radius: 8px;
  border: 1px solid #3f3f46;
  background-color: #27272a;
  color: #e4e4e7;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.next-meal-btn-swap:active {
  background-color: #3f3f46;
}

.next-meal-btn-swap:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.next-meal-btn-plan {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  border: 1px dashed #3f3f46;
  background-color: rgba(39, 39, 42, 0.3);
  color: #a1a1aa;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

/* Rotating Tip Strip styling */
.mobile-context-tip {
  background-color: rgba(255, 111, 60, 0.08);
  border: 1px solid rgba(255, 111, 60, 0.18);
  border-radius: 10px;
  color: #d4d4d8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 50px;
  min-height: 50px;
  max-height: 50px;
  padding: 8px 10px;
  box-sizing: border-box;
  flex: 0 0 auto;
  transition: background-color 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
}

.mobile-tip-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  opacity: 1;
  transition: opacity 0.26s ease;
}

.mobile-tip-icon {
  width: 18px;
  height: 18px;
  border: 1.5px solid #ff6f3c;
  border-radius: 999px;
  color: #ff6f3c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.mobile-tip-text {
  color: #d4d4d8;
  display: -webkit-box;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mobile-tip-action {
  background: #ff6f3c;
  border: 0;
  border-radius: 7px;
  color: #111113;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 900;
  min-height: 28px;
  padding: 0 10px;
  opacity: 1;
  transition: opacity 0.26s ease;
}

.mobile-tip-action.hidden {
  display: none;
}

.mobile-context-tip.transition-out .mobile-tip-left,
.mobile-context-tip.transition-out .mobile-tip-action {
  opacity: 0;
}

.mobile-context-tip.transition-in .mobile-tip-left,
.mobile-context-tip.transition-in .mobile-tip-action {
  animation: mobileTipFadeIn 0.28s ease both;
}

.mobile-context-tip.tip-dismissed {
  opacity: 0 !important;
  transform: translateX(110%) !important;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.mobile-context-tip.tip-enter-after-dismiss {
  animation: mobileTipBarEnter 0.28s ease both;
}

@keyframes mobileTipFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes mobileTipBarEnter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-rotating-tip-strip {
  background-color: rgba(255, 111, 60, 0.08);
  border: 1px solid rgba(255, 111, 60, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.tip-strip-content {
  font-size: 0.75rem;
  font-weight: 600;
  color: #ff8c5e;
  text-align: center;
  line-height: 1.3;
}

/* Light mode overrides for Next Meal & Tip Strip */
body:not(.dark-theme) .mobile-next-meal-card {
  background-color: #ffffff;
  border-color: #e5e5ea;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

body:not(.dark-theme) .next-meal-recipe-name {
  color: #000000;
}

body:not(.dark-theme) .next-meal-btn-swap {
  background-color: #f2f2f7;
  border-color: #d1d1d6;
  color: #000000;
}

body:not(.dark-theme) .mobile-rotating-tip-strip {
  background-color: rgba(255, 111, 60, 0.04);
}

body:not(.dark-theme) .mobile-context-tip {
  background-color: #fff7ed;
  border-color: #fed7aa;
  color: #374151;
}

body:not(.dark-theme) .mobile-tip-text {
  color: #475569;
}

body:not(.dark-theme) .mobile-tip-action {
  color: #ffffff;
}

/* Fixed Layout mode for Plan Tab (Only scrolls schedule timeline) */
#mobile-content-area.fixed-plan-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px); /* Fill screen minus header */
  overflow: hidden; /* Prevent parent scrolling */
  padding-bottom: 0; /* Remove parent bottom padding */
}

#mobile-content-area.fixed-plan-layout #mobile-tab-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

#mobile-content-area.fixed-plan-layout .schedule-timeline {
  flex-grow: 1 !important;
  overflow-y: auto !important;
  padding: 16px 16px 104px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
}

.meal-slot,
.mobile-meal-slot-group,
.next-meal-card,
.mobile-next-meal-card,
.tip-card,
.mobile-rotating-tip-strip {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}

#mobile-content-area.fixed-plan-layout .mobile-rotating-tip-strip {
  margin: 12px 12px 8px 12px !important;
  width: auto !important;
  max-width: none !important;
  flex-shrink: 0 !important;
}

#mobile-content-area.fixed-plan-layout #mobile-next-meal-container {
  margin: 0 auto 12px auto !important;
  width: calc(100% - 32px) !important;
  max-width: calc(100% - 32px) !important;
  flex-shrink: 0 !important;
}

.mobile-header {
  touch-action: pan-x;
}

/* Meal Card Touch Drag Actions */
.mobile-meal-card {
  touch-action: pan-y;
}

.mobile-meal-card.drag-enabled {
  touch-action: none !important;
}

/* Subtle Highlights for Today's Meals Section */
.mobile-meal-slot-group.today {
  background: rgba(255, 107, 53, 0.035);
  border-radius: 16px;
  padding: 8px 6px;
  border: 1px dashed rgba(255, 107, 53, 0.15);
  box-sizing: border-box;
}

.mobile-meal-slot-group.today .mobile-meal-card {
  border: 1px solid rgba(255, 107, 53, 0.45);
  box-shadow: 0 0 10px rgba(255, 107, 53, 0.08);
}

.mobile-meal-slot-group.today .slot-header-label {
  color: #ff6b35;
  font-weight: 800;
}

/* Layout & Scroll Isolation Enhancements (v1.3.2) */

#mobile-content-area.fixed-plan-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px - calc(64px + env(safe-area-inset-bottom)));
  overflow: hidden;
}

/* 1. Browse Layout & Scroll Isolation */
.list-screen,
.browse-screen,
.shopping-screen {
  position: fixed;
  inset: 56px 0 calc(64px + env(safe-area-inset-bottom)) 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.browse-header {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #121214;
  padding: 10px 12px 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body:not(.dark-theme) .browse-header {
  background-color: #ffffff;
  border-bottom-color: #e5e5ea;
}

.browse-screen .mobile-context-tip {
  margin: 12px 16px 8px;
}

.mobile-recipe-list-scroll {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  padding: 16px 16px 96px !important;
}

/* 2. Shopping Layout & Custom Checkboxes */
.shopping-summary {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #121214;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body:not(.dark-theme) .shopping-summary {
  background-color: #ffffff;
  border-bottom-color: #e5e5ea;
}

.shopping-items {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 16px 16px 96px;
}

.shopping-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: #1a1a1e;
  border: 2px solid rgba(255, 255, 255, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}

body:not(.dark-theme) .shopping-checkbox {
  background: #f2f2f7;
  border-color: rgba(0, 0, 0, 0.35);
}

.shopping-checkbox:checked {
  background: #a3472a;
  border-color: #a3472a;
}

.shopping-checkbox:checked::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 3. Settings Breathing Room & Typography spacing */
.settings-screen {
  position: fixed;
  inset: 56px 0 calc(64px + env(safe-area-inset-bottom)) 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 28px 24px 96px;
  box-sizing: border-box;
  width: 100%;
}

.settings-content {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.account-card,
.settings-section,
.settings-group {
  width: 100%;
}

.account-card {
  margin: 8px 0 28px !important;
  padding: 20px !important;
  border-radius: 12px !important;
}

.settings-section,
.settings-group {
  margin-bottom: 28px !important;
}

.settings-section-title {
  margin: 0 0 10px 4px !important;
  margin-left: 4px !important;
  font-size: 12px !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase;
  color: #ff6f3c; /* Accent color matching Fossil Fuel */
  text-align: left !important;
}

body:not(.dark-theme) .settings-section-title {
  color: #a3472a;
}

.settings-row {
  min-height: 52px !important;
  padding: 0 16px !important;
  border-radius: 8px !important;
  justify-content: space-between !important;
  text-align: left !important;
}

.account-email {
  font-size: 15px !important;
  word-break: break-word !important;
}

/* Swiping, Rerolling & Swapping Gestures Alignment */
.plan-scroll,
.schedule-timeline {
  overflow-y: auto !important;
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch !important;
}

.meal-slot,
.mobile-meal-slot-group {
  position: relative !important;
  height: auto !important;
  margin-bottom: 18px !important;
}
.drag-action-bg {
  position: absolute;
  top: 20px; /* Offset for .slot-header-label */
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  transition: opacity 120ms ease;
}

.drag-action-bg.right {
  justify-content: flex-start;
  padding-left: 18px;
  color: #ff6b35;
}

.drag-action-bg.left {
  justify-content: flex-end;
  padding-right: 18px;
  color: #ff4d4d;
}

/* Tactile Drag Previews (v1.3.2) */
.reroll-preview-card {
  position: absolute;
  top: 24px; /* Offset for .slot-header-label */
  height: 58px;
  bottom: auto;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #1e1e24;
  border: 1px solid rgba(255, 107, 53, 0.45);
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  box-sizing: border-box;
}

.reroll-preview-card.ready {
  /* Opacity controlled dynamically by drag distance */
}

.delete-preview-bg {
  position: absolute;
  top: 24px; /* Offset for .slot-header-label */
  height: 58px;
  bottom: auto;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 16px;
  color: #ff6b35;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  box-sizing: border-box;
  border-radius: 12px;
  background: rgba(255, 107, 53, 0.08);
  border: 1px solid rgba(255, 107, 53, 0.35);
}

.swap-preview-bg {
  position: absolute;
  top: 24px; /* Offset for .slot-header-label */
  height: 58px;
  bottom: auto;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  box-sizing: border-box;
  border-radius: 12px;
  background: rgba(255, 107, 53, 0.18);
  border: 1px solid rgba(255, 107, 53, 0.62);
  transition: opacity 100ms ease;
}

.swap-meal-label {
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.clear-slot-icon {
  width: 18px;
  height: 18px;
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}

.clear-slot-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-top: none;
  border-radius: 0 0 2px 2px;
  box-sizing: border-box;
}

.clear-slot-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 3px -3px 0 -1px currentColor;
}

.clear-slot-label {
  line-height: 1;
}

.meal-card,
.mobile-meal-card {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  background-color: #1e1e24;
  border: 1px solid #27272a;
  color: #ffffff;
  opacity: 1;
  visibility: visible;
  transform: none;
  touch-action: pan-y;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  user-select: none !important;
}

.meal-card.dragging,
.mobile-meal-card.dragging {
  position: relative !important;
  z-index: 50 !important;
  touch-action: none !important;
  transition: none !important;
  opacity: 0.95 !important;
  box-shadow: 0 12px 28px rgba(0,0,0,0.45) !important;
}

body.meal-drag-scroll-lock,
#mobile-content-area.meal-drag-scroll-lock,
.schedule-timeline.drag-scroll-lock {
  overscroll-behavior: contain !important;
}

.schedule-timeline.drag-scroll-lock {
  overflow-y: hidden !important;
  touch-action: none !important;
}

.meal-card.drag-ready,
.mobile-meal-card.drag-ready {
  background: #1e1e24 !important;
  border-color: rgba(255,255,255,0.08) !important;
  transition: none !important;
  animation: grabWiggle 0.18s ease-out !important;
}

@keyframes grabWiggle {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-4px) rotate(-0.5deg); }
  50% { transform: translateX(4px) rotate(0.5deg); }
  75% { transform: translateX(-2px) rotate(-0.2deg); }
}

.meal-slot.drop-target,
.mobile-meal-slot-group.drag-hover,
.mobile-meal-card.drag-hover {
  outline: 2px dashed rgba(255, 107, 53, 0.8) !important;
  outline-offset: 4px !important;
}

.meal-card.wiggle,
.mobile-meal-card.wiggle {
  animation: lockedWiggleAnim 0.32s ease !important;
}

@keyframes lockedWiggleAnim {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

/* Browse Recipe List Swipe Action Backgrounds (v1.3.5) */
.recipe-row {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 8px;
  min-height: 58px;
  background-color: #1a1a1f; /* dark background behind card */
  transform-origin: center top;
  transition: height 0.26s ease, margin-bottom 0.26s ease, opacity 0.2s ease;
}

.recipe-row.recipe-row-collapsing {
  pointer-events: none;
}

.recipe-action-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  z-index: 1;
}

.recipe-action-bg.add {
  justify-content: flex-start;
  padding-left: 20px;
  background: rgba(46, 204, 113, 0.18);
  color: #2ecc71;
  font-size: 24px;
  border-radius: 10px;
}

.recipe-action-bg.ban {
  justify-content: flex-end;
  padding-right: 20px;
  background: rgba(255, 77, 77, 0.16);
  color: #ff4d4d;
  border-radius: 10px;
}

.ban-outline-icon {
  width: 26px;
  height: 26px;
  border: 2px solid currentColor;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  box-sizing: border-box;
}

.ban-outline-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  top: 50%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translateY(-50%) rotate(-45deg);
  transform-origin: center;
}

.recipe-card {
  position: relative;
  z-index: 2;
  min-height: 58px;
  background-color: #1e1e24;
  border: 1px solid #27272a;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: background-color 0.15s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ffffff;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
  touch-action: pan-y !important;
}

.recipe-card:active {
  background-color: #27272a;
}

.recipe-card .recipe-title-text {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Star Favorite Toggle button */
.favourite-star {
  background: none !important;
  border: none !important;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 8px;
  z-index: 10;
  transition: color 0.15s ease, transform 0.1s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  color: #f5c542; /* Yellow when active */
}

.favourite-star.inactive {
  color: rgba(255, 255, 255, 0.25) !important; /* Low opacity outlined white star */
}

.favourite-star:active {
  transform: scale(1.3);
}

/* Coherent mobile light theme */
body:not(.dark-theme) #mobile-app,
body:not(.dark-theme) #mobile-content-area {
  background-color: #f7f7f8;
  color: #1f2937;
}

body:not(.dark-theme) .mobile-header,
body:not(.dark-theme) .mobile-bottom-nav {
  background-color: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 1px 10px rgba(15, 23, 42, 0.08);
}

body:not(.dark-theme) .mobile-welcome,
body:not(.dark-theme) .mobile-week-display-text {
  color: #111827;
}

body:not(.dark-theme) .mobile-nav-btn {
  color: #6b7280;
}

body:not(.dark-theme) .mobile-nav-btn.active {
  background-color: #ff6f3c;
  color: #111827;
}

body:not(.dark-theme) .mobile-header-date {
  color: #334155;
}

body:not(.dark-theme) .mobile-week-status-pill.status-current,
body:not(.dark-theme) .mobile-week-status-pill.status-upcoming {
  background: #fff4ee;
  border-color: #ffb392;
  color: #9a3412;
}

body:not(.dark-theme) .mobile-meal-slot-group.today {
  background: #fff7ed;
  border-color: #fdba74;
}

body:not(.dark-theme) .mobile-meal-card,
body:not(.dark-theme) .recipe-card,
body:not(.dark-theme) .reroll-preview-card {
  background-color: #ffffff;
  border-color: #e5e7eb;
  color: #111827;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

body:not(.dark-theme) .recipe-row {
  background-color: #f1f5f9;
}

body:not(.dark-theme) .recipe-card .recipe-title-text,
body:not(.dark-theme) .card-meal-name {
  color: #111827;
}

body:not(.dark-theme) .mobile-meal-card.empty {
  background-color: #ffffff;
  border-color: #ff9b73;
}

body:not(.dark-theme) .slot-header-label,
body:not(.dark-theme) .add-meal-text,
body:not(.dark-theme) .next-meal-subtitle,
body:not(.dark-theme) .next-meal-meta {
  color: #6b7280;
}

body:not(.dark-theme) .favourite-star.inactive {
  color: rgba(17, 24, 39, 0.3) !important;
}

body:not(.dark-theme) .mobile-shopping-item {
  background-color: #ffffff;
  border-color: #e5e7eb;
  color: #111827;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

body:not(.dark-theme) .mobile-shopping-item-text {
  color: #111827;
}

body:not(.dark-theme) .mobile-shopping-item.completed {
  background-color: #f3f4f6;
}

body:not(.dark-theme) .completed .mobile-shopping-item-text {
  color: #6b7280;
}

body:not(.dark-theme) .mobile-shopping-category-title {
  border-bottom-color: #d1d5db;
}

body:not(.dark-theme) .settings-screen {
  background-color: #f7f7f8;
}

body:not(.dark-theme) .settings-profile-card,
body:not(.dark-theme) .settings-menu-list {
  border: 1px solid #d8dbe2;
  border-radius: 12px;
  overflow: hidden;
}

body:not(.dark-theme) .settings-menu-item {
  background-color: #ffffff;
}

/* 3. Dark Checkbox Shared Design System */
body.dark-theme input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 4px !important;
  background: #111216 !important;
  border: 2px solid rgba(255,255,255,0.45) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  outline: none !important;
  position: relative !important;
  transition: background 0.15s ease, border-color 0.15s ease !important;
  flex-shrink: 0 !important;
}

body.dark-theme input[type="checkbox"]:checked {
  background: #8f432d !important;
  border-color: #8f432d !important;
}

body.dark-theme input[type="checkbox"]:checked::after {
  content: "" !important;
  width: 6px !important;
  height: 11px !important;
  border: solid #ffffff !important;
  border-width: 0 2px 2px 0 !important;
  transform: rotate(45deg) !important;
}

/* Final Plan layout contract: match Browse width while preserving vertical rhythm. */
#mobile-content-area.fixed-plan-layout {
  align-items: stretch !important;
}

#mobile-content-area.fixed-plan-layout #mobile-tab-content {
  align-items: stretch !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

#mobile-content-area.fixed-plan-layout #mobile-next-meal-container {
  margin: 10px 16px 24px !important;
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  box-sizing: border-box !important;
}

#mobile-content-area.fixed-plan-layout .mobile-context-tip {
  margin: 16px 16px 0 !important;
  width: auto !important;
  max-width: none !important;
}

#mobile-content-area.fixed-plan-layout .mobile-next-meal-card {
  padding: 18px 20px !important;
  height: 222px !important;
  min-height: 222px !important;
  max-height: 222px !important;
  gap: 14px !important;
  margin: 0 !important;
  overflow: hidden !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}

#mobile-content-area.fixed-plan-layout .mobile-next-meal-card,
#mobile-content-area.fixed-plan-layout .mobile-meal-slot-group,
#mobile-content-area.fixed-plan-layout .mobile-meal-card {
  width: 100% !important;
  max-width: none !important;
  align-self: stretch !important;
}

#mobile-content-area.fixed-plan-layout .mobile-day-list.schedule-timeline {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  padding: 0 16px calc(188px + env(safe-area-inset-bottom)) !important;
  scroll-padding-bottom: calc(188px + env(safe-area-inset-bottom)) !important;
  width: 100% !important;
  max-width: none !important;
  align-self: stretch !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
}

#mobile-content-area.fixed-plan-layout .mobile-day-list.schedule-timeline > .mobile-meal-slot-group:last-child {
  margin-bottom: 16px !important;
}

#mobile-content-area.fixed-plan-layout .mobile-meal-slot-group {
  gap: 8px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

#mobile-content-area.fixed-plan-layout .mobile-meal-slot-group.today {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

#mobile-content-area.fixed-plan-layout .slot-header-label {
  padding-left: 4px !important;
  margin: 0 !important;
  line-height: 1.25 !important;
}

#mobile-content-area.fixed-plan-layout .mobile-meal-card {
  min-height: 58px !important;
  padding: 12px 16px !important;
  margin: 0 !important;
}

#mobile-content-area.fixed-plan-layout .mobile-meal-card.empty {
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

#mobile-content-area.fixed-plan-layout .add-meal-plus {
  color: #ff6f3c !important;
  display: block !important;
  font-size: 1.85rem !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  text-align: center !important;
  will-change: transform;
}

#mobile-content-area.fixed-plan-layout .mobile-meal-card.empty.rolling {
  cursor: progress;
  pointer-events: none;
}

#mobile-content-area.fixed-plan-layout .mobile-meal-card.empty.rolling .add-meal-plus {
  animation: empty-meal-sine-spin 1.1s infinite ease-in-out;
}

@keyframes empty-meal-sine-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  #mobile-content-area.fixed-plan-layout .mobile-meal-card.empty.rolling .add-meal-plus {
    animation: loading-pulse 1.1s infinite ease-in-out;
  }
}

#mobile-content-area.fixed-plan-layout .mobile-card-content {
  width: 100% !important;
  min-width: 0 !important;
}

#mobile-content-area.fixed-plan-layout .next-meal-header {
  align-items: center !important;
  gap: 8px !important;
  min-height: 22px !important;
  min-width: 0 !important;
}

#mobile-content-area.fixed-plan-layout .next-meal-badge,
#mobile-content-area.fixed-plan-layout .next-meal-meta {
  white-space: nowrap !important;
}

#mobile-content-area.fixed-plan-layout .next-meal-body {
  min-height: 0 !important;
  justify-content: center !important;
  gap: 8px !important;
  overflow: hidden !important;
}

#mobile-content-area.fixed-plan-layout .next-meal-recipe-name,
#mobile-content-area.fixed-plan-layout .next-meal-subtitle {
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
}

#mobile-content-area.fixed-plan-layout .next-meal-recipe-name {
  -webkit-line-clamp: 2 !important;
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  margin: 0 !important;
  line-height: 1.18 !important;
}

#mobile-content-area.fixed-plan-layout .mobile-next-meal-card.empty-widget .next-meal-recipe-name {
  font-size: 1.25rem !important;
  font-weight: 800 !important;
}

#mobile-content-area.fixed-plan-layout .next-meal-subtitle {
  -webkit-line-clamp: 2 !important;
  margin: 0 !important;
  line-height: 1.35 !important;
}

#mobile-content-area.fixed-plan-layout .next-meal-actions {
  gap: 12px !important;
  min-height: 44px !important;
}

#mobile-content-area.fixed-plan-layout .next-meal-btn-cook,
#mobile-content-area.fixed-plan-layout .next-meal-btn-swap,
#mobile-content-area.fixed-plan-layout .next-meal-btn-plan,
#mobile-content-area.fixed-plan-layout .next-meal-btn-roll,
#mobile-content-area.fixed-plan-layout .next-meal-btn-browse {
  min-height: 44px !important;
}

#mobile-content-area.fixed-plan-layout .reroll-preview-card,
#mobile-content-area.fixed-plan-layout .delete-preview-bg,
#mobile-content-area.fixed-plan-layout .swap-preview-bg {
  top: calc(0.9rem + 8px) !important;
  height: 58px !important;
  min-height: 58px !important;
  bottom: auto !important;
  border-radius: 12px !important;
}

#mobile-content-area.fixed-plan-layout .mobile-meal-slot-group.today .reroll-preview-card,
#mobile-content-area.fixed-plan-layout .mobile-meal-slot-group.today .delete-preview-bg,
#mobile-content-area.fixed-plan-layout .mobile-meal-slot-group.today .swap-preview-bg {
  left: 0 !important;
  right: 0 !important;
  top: calc(0.9rem + 8px) !important;
}

body:not(.dark-theme) .delete-preview-bg {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}

body:not(.dark-theme) .swap-preview-bg {
  background: #fff7ed;
  border-color: #fb923c;
  color: #9a3412;
}

/* Final shopping checkbox alignment override */
.mobile-shopping-item .shopping-checkbox {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  margin: 0 12px 0 0 !important;
  padding: 0 !important;
  border-radius: 5px !important;
  border: 2px solid rgba(255, 255, 255, 0.44) !important;
  background: #16161a !important;
  display: grid !important;
  place-items: center !important;
  position: relative !important;
  box-sizing: border-box !important;
  flex: 0 0 24px !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

.mobile-shopping-item .shopping-checkbox:checked {
  background: rgba(255, 111, 60, 0.32) !important;
  border-color: rgba(255, 111, 60, 0.72) !important;
}

.mobile-shopping-item .shopping-checkbox:checked::after {
  content: "" !important;
  width: 7px !important;
  height: 12px !important;
  border: solid rgba(255, 255, 255, 0.86) !important;
  border-width: 0 2px 2px 0 !important;
  transform: translateY(-1px) rotate(45deg) !important;
  box-sizing: border-box !important;
}

body:not(.dark-theme) .mobile-shopping-item .shopping-checkbox {
  background: #ffffff !important;
  border-color: rgba(17, 24, 39, 0.35) !important;
}

body:not(.dark-theme) .mobile-shopping-item .shopping-checkbox:checked {
  background: #ff6f3c !important;
  border-color: #ff6f3c !important;
}

/* Mobile Calendar Link modal: replace the desktop modal feel with app-native cards. */
@media (max-width: 768px) {
  #calendar-link-modal {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    transform: none !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: none !important;
    padding: calc(18px + env(safe-area-inset-top)) 20px calc(86px + env(safe-area-inset-bottom)) !important;
    border-radius: 0 !important;
    background: #16181c !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #f8fafc !important;
    overflow-y: auto !important;
    z-index: 10040 !important;
  }

  body:not(.dark-theme) #calendar-link-modal {
    background: #ffffff !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: #111827 !important;
  }

  #calendar-link-modal .drag-handle {
    display: none !important;
  }

  #calendar-link-modal .modal-content {
    max-height: none !important;
    min-height: 100% !important;
    overflow-y: auto !important;
    padding: 0 !important;
    scrollbar-width: thin;
  }

  #calendar-link-modal .calendar-close-btn,
  #calendar-link-modal .close {
    position: absolute !important;
    top: calc(14px + env(safe-area-inset-top)) !important;
    right: 20px !important;
    width: 36px !important;
    height: 36px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: #cbd5e1 !important;
    display: grid !important;
    place-items: center !important;
    font-size: 1.35rem !important;
    line-height: 1 !important;
    padding: 0 !important;
  }

  body:not(.dark-theme) #calendar-link-modal .calendar-close-btn,
  body:not(.dark-theme) #calendar-link-modal .close {
    background: #f1f5f9 !important;
    color: #475569 !important;
  }

  #calendar-link-modal .calendar-link-title {
    color: #f8fafc !important;
    font-size: 1.35rem !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
    margin: 8px 54px 22px 0 !important;
    letter-spacing: 0 !important;
  }

  body:not(.dark-theme) #calendar-link-modal .calendar-link-title {
    color: #111827 !important;
  }

  #calendar-link-modal .calendar-section-title {
    background: transparent !important;
    color: #ff8a5b !important;
    font-size: 0.78rem !important;
    font-weight: 900 !important;
    letter-spacing: 0.06em !important;
    line-height: 1.2 !important;
    margin: 18px 0 8px !important;
    text-transform: uppercase !important;
  }

  #calendar-link-modal .calendar-section-title:first-of-type {
    margin-top: 0 !important;
  }

  #calendar-link-modal p {
    color: #94a3b8 !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    line-height: 1.45 !important;
    margin: 0 0 12px !important;
  }

  body:not(.dark-theme) #calendar-link-modal p {
    color: #64748b !important;
  }

  #calendar-link-modal .calendar-options-grid {
    gap: 10px !important;
    margin: 0 0 12px !important;
  }

  #calendar-link-modal .calendar-link-btn {
    width: 100% !important;
    min-height: 52px !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    font-size: 0.95rem !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
    padding: 12px 14px !important;
    text-align: center !important;
  }

  #calendar-link-modal .calendar-link-btn-primary {
    background: #ff6f3c !important;
  }

  #calendar-link-modal .calendar-link-btn-google {
    background: #f97316 !important;
  }

  #calendar-link-modal .calendar-link-btn-muted {
    background: #2b2f36 !important;
    color: #f8fafc !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  body:not(.dark-theme) #calendar-link-modal .calendar-link-btn-muted {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
  }

  #calendar-link-modal .calendar-link-btn-success {
    background: #10b981 !important;
    color: #ffffff !important;
    margin: 0 0 14px !important;
  }

  #calendar-link-modal .calendar-btn-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    flex: 0 0 18px;
    position: relative;
  }

  #calendar-link-modal .calendar-icon-device {
    border: 2px solid currentColor;
    border-radius: 4px;
  }

  #calendar-link-modal .calendar-icon-device::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 3px;
    height: 3px;
    border-radius: 99px;
    background: currentColor;
    transform: translateX(-50%);
  }

  #calendar-link-modal .calendar-icon-google {
    border: 2px solid currentColor;
    border-radius: 999px;
  }

  #calendar-link-modal .calendar-icon-google::before,
  #calendar-link-modal .calendar-icon-google::after {
    content: "";
    position: absolute;
    background: currentColor;
  }

  #calendar-link-modal .calendar-icon-google::before {
    left: 2px;
    right: 2px;
    top: 7px;
    height: 2px;
  }

  #calendar-link-modal .calendar-icon-google::after {
    top: 2px;
    bottom: 2px;
    left: 7px;
    width: 2px;
  }

  #calendar-link-modal .calendar-icon-copy::before,
  #calendar-link-modal .calendar-icon-copy::after {
    content: "";
    position: absolute;
    border: 2px solid currentColor;
    border-radius: 3px;
  }

  #calendar-link-modal .calendar-icon-copy::before {
    inset: 2px 2px 4px 4px;
  }

  #calendar-link-modal .calendar-icon-copy::after {
    inset: 5px 5px 1px 1px;
    opacity: 0.7;
  }

  #calendar-link-modal .calendar-icon-download {
    border-bottom: 2px solid currentColor;
  }

  #calendar-link-modal .calendar-icon-download::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 1px;
    width: 2px;
    height: 11px;
    background: currentColor;
  }

  #calendar-link-modal .calendar-icon-download::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 8px;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
  }

  #calendar-link-modal #cal-feed-url-input {
    background: #101216 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px !important;
    color: #dbeafe !important;
    font-size: 0.78rem !important;
    margin: 0 0 18px !important;
    padding: 12px !important;
    text-align: left !important;
  }

  body:not(.dark-theme) #calendar-link-modal #cal-feed-url-input {
    background: #f8fafc !important;
    border-color: #dbe3ef !important;
    color: #0f172a !important;
  }

  #calendar-link-modal .calendar-helper-note {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8 !important;
    font-size: 0.78rem !important;
    font-style: normal !important;
    margin: 4px 0 0 !important;
    padding: 12px 0 0 !important;
  }

  body:not(.dark-theme) #calendar-link-modal .calendar-helper-note {
    border-top-color: #e5e7eb !important;
    color: #64748b !important;
  }

  #calendar-link-modal .modal-actions {
    display: none !important;
  }
}

/* v1 mobile stabilisation: recipe detail fixed top, scroll body, non-emoji actions. */
.mobile-recipe-view {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.recipe-view-fixed-top {
  flex: 0 0 auto !important;
  padding: 16px 16px 10px !important;
}

.recipe-view-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  padding: 12px 16px 22px !important;
}

.recipe-view-name {
  margin: 0 0 14px !important;
}

.recipe-view-stats-row {
  margin-bottom: 12px !important;
}

.details-tags {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin: 12px 0 0 !important;
}

.recipe-batch-info {
  align-items: center;
  background: rgba(255, 111, 60, 0.08);
  border: 1px solid rgba(255, 111, 60, 0.22);
  border-radius: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  margin-top: 12px;
  min-height: 42px;
  padding: 7px 8px;
}

.recipe-batch-info-icon {
  align-items: center;
  border: 1.5px solid #ff6f3c;
  border-radius: 50%;
  color: #ff6f3c;
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 900;
  height: 16px;
  justify-content: center;
  line-height: 1;
  width: 16px;
}

.recipe-batch-info-text {
  color: #d4d4d8;
  font-size: 0.72rem;
  line-height: 1.25;
  min-width: 0;
}

.recipe-batch-info-text strong {
  color: #f4f4f5;
}

.recipe-batch-info button {
  background: #ff6f3c;
  border: 0;
  border-radius: 7px;
  color: #111113;
  font-size: 0.68rem;
  font-weight: 900;
  min-height: 28px;
  padding: 0 9px;
  white-space: nowrap;
}

body:not(.dark-theme) .recipe-batch-info {
  background: rgba(255, 111, 60, 0.06);
  border-color: rgba(194, 65, 12, 0.24);
}

body:not(.dark-theme) .recipe-batch-info-text {
  color: #475569;
}

body:not(.dark-theme) .recipe-batch-info-text strong {
  color: #111827;
}

.details-ingredients,
.details-instructions {
  font-size: 1rem !important;
  line-height: 1.6 !important;
  margin: 8px 0 20px !important;
  padding-left: 20px !important;
}

.details-instructions li {
  margin-bottom: 12px !important;
}

.footer-btn-grid {
  display: flex !important;
  gap: 10px !important;
  margin-top: 10px !important;
}

.icon-action-btn {
  align-items: center !important;
  display: inline-flex !important;
  gap: 8px !important;
  justify-content: center !important;
}

.action-icon {
  background-color: currentColor;
  box-sizing: border-box;
  display: inline-block;
  flex: 0 0 20px;
  height: 20px;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: 20px 20px;
  position: relative;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 20px 20px;
  width: 20px;
}

.action-icon::before,
.action-icon::after {
  content: none !important;
}

.icon-cook {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10h16v7a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3v-7Z'/%3E%3Cpath d='M2 10h20M8 6h8M10 3h4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10h16v7a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3v-7Z'/%3E%3Cpath d='M2 10h20M8 6h8M10 3h4'/%3E%3C/svg%3E");
}

.icon-reroll {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 15a8 8 0 1 1-2.3-8.7'/%3E%3Cpath d='m17 2 4 4-4 4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 15a8 8 0 1 1-2.3-8.7'/%3E%3Cpath d='m17 2 4 4-4 4'/%3E%3C/svg%3E");
}

.icon-lock {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10' width='14' height='11' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3M12 14v3'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10' width='14' height='11' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3M12 14v3'/%3E%3C/svg%3E");
}

.icon-clear {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E");
}

.icon-ban {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M5.6 5.6 18.4 18.4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M5.6 5.6 18.4 18.4'/%3E%3C/svg%3E");
}

.icon-add {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}

.icon-fav {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.8 5.7 6.2.9-4.5 4.4 1.1 6.2-5.6-2.9-5.6 2.9 1.1-6.2L3 9.6l6.2-.9L12 3Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.8 5.7 6.2.9-4.5 4.4 1.1 6.2-5.6-2.9-5.6 2.9 1.1-6.2L3 9.6l6.2-.9L12 3Z'/%3E%3C/svg%3E");
}

.action-btn-reroll {
  background-color: rgba(16, 185, 129, 0.14) !important;
  border-color: rgba(16, 185, 129, 0.42) !important;
  color: #34d399 !important;
}

.action-btn-lock,
.action-btn-favourite {
  background-color: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(245, 158, 11, 0.42) !important;
  color: #fbbf24 !important;
}

.mobile-meal-card.paused {
  align-items: center !important;
  border: 1px dashed rgba(148, 163, 184, 0.34) !important;
  color: #94a3b8 !important;
  cursor: pointer;
  justify-content: center !important;
  opacity: 0.78;
}

.mobile-meal-card.paused:hover,
.mobile-meal-card.paused:focus-visible {
  border-color: rgba(255, 111, 60, 0.58) !important;
  color: #ff6f3c !important;
  outline: none;
}

.paused-slot-icon {
  display: inline-block;
  height: 24px;
  position: relative;
  width: 24px;
}

.paused-slot-icon::before,
.paused-slot-icon::after {
  background: currentColor;
  border-radius: 2px;
  content: "";
  height: 18px;
  position: absolute;
  top: 3px;
  width: 5px;
}

.paused-slot-icon::before {
  left: 5px;
}

.paused-slot-icon::after {
  right: 5px;
}

.mobile-week-selector-overlay {
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 0;
  position: fixed;
  transition: opacity 0.4s ease;
  z-index: 10000;
}

.mobile-week-selector-overlay.is-open {
  opacity: 1;
}

.mobile-week-selector-overlay.is-closing {
  opacity: 0;
}

.mobile-week-selector-sheet {
  background: #16181c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px 18px 0 0;
  color: #f8fafc;
  max-height: 78vh;
  overflow: hidden;
  padding: 16px;
  transform: translateY(104%);
  transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
  width: 100%;
}

.mobile-week-selector-overlay.is-open .mobile-week-selector-sheet {
  transform: translateY(0);
}

.mobile-week-selector-overlay.is-closing .mobile-week-selector-sheet {
  transform: translateY(104%);
  transition-duration: 0.4s;
}

body:not(.dark-theme) .mobile-week-selector-sheet {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #111827;
}

.week-selector-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.week-selector-header h3 {
  font-size: 1.1rem;
  font-weight: 900;
  margin: 0;
}

.week-selector-tip {
  background: rgba(255, 111, 60, 0.1);
  border: 1px solid rgba(255, 111, 60, 0.24);
  border-radius: 12px;
  color: #ffd1c2;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 12px;
  padding: 10px 12px;
}

body:not(.dark-theme) .week-selector-tip {
  background: rgba(255, 111, 60, 0.08);
  color: #9a3412;
}

.week-selector-close {
  background: rgba(255, 255, 255, 0.06);
  border: 0;
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 1.35rem;
  height: 36px;
  width: 36px;
}

body:not(.dark-theme) .week-selector-close {
  background: #f1f5f9;
  color: #475569;
}

.week-selector-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(78vh - 126px);
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
}

.week-selector-row {
  align-items: center;
  background: #1e1e24;
  border: 1px solid #27272a;
  border-radius: 12px;
  color: #f8fafc;
  display: flex;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 14px;
  position: relative;
  touch-action: pan-y;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
}

body:not(.dark-theme) .week-selector-row {
  background: #f8fafc;
  border-color: #e5e7eb;
  color: #111827;
}

.week-selector-row.active {
  border-color: rgba(255, 111, 60, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 111, 60, 0.14);
}

.week-selector-row.active,
body:not(.dark-theme) .week-selector-row.active {
  background: #1e1e24 !important;
  color: #f8fafc !important;
}

body:not(.dark-theme) .week-selector-row.active {
  background: #f8fafc !important;
  color: #111827 !important;
}

.week-selector-row.swipe-armed {
  background: rgba(239, 68, 68, 0.24) !important;
  border-color: rgba(239, 68, 68, 0.62) !important;
  color: #fee2e2 !important;
}

.week-selector-row.swipe-armed::after {
  content: "Clear week";
  color: #fecaca;
  font-size: 0.78rem;
  font-weight: 900;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.week-selector-row.swipe-armed .week-selector-pill {
  opacity: 0;
}

.week-selector-row.drag-source {
  opacity: 0.42;
  transform: scale(0.98);
}

.week-selector-row.drag-target {
  border-color: #ff6f3c !important;
  box-shadow: inset 0 0 0 2px rgba(255, 111, 60, 0.45);
}

.week-selector-drag-ghost {
  align-items: center;
  background: #1e1e24;
  border: 1px solid rgba(255, 111, 60, 0.56);
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
  color: #f8fafc;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 52px;
  min-width: min(360px, calc(100vw - 40px));
  padding: 0 14px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, -50%) scale(1.02);
  z-index: 10020;
}

body:not(.dark-theme) .week-selector-drag-ghost {
  background: #ffffff;
  color: #111827;
}

.week-selector-range {
  font-weight: 850;
}

.week-selector-pill {
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 5px 9px;
  text-transform: uppercase;
}

.week-selector-pill.current {
  background: #ff6f3c;
  color: #111113;
}

.week-selector-pill.upcoming {
  background: #ffe2d5;
  border: 1px solid #ffb392;
  color: #9a3412;
}

.week-selector-pill.past {
  background: #2b2f36;
  color: #cbd5e1;
}

.mobile-settings-panel {
  background: #1e1e24;
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 14px;
}

body:not(.dark-theme) .mobile-settings-panel {
  background: #ffffff;
  border-color: #e5e7eb;
}

.mobile-panel-title {
  color: #ff8a5b;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.mobile-toggle-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.mobile-toggle-row strong {
  color: #f8fafc;
  display: block;
  font-size: 0.95rem;
}

body:not(.dark-theme) .mobile-toggle-row strong {
  color: #111827;
}

.mobile-toggle-row small {
  color: #94a3b8;
  display: block;
  font-size: 0.75rem;
  margin-top: 3px;
}

.mobile-household-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.mobile-household-grid.compact {
  gap: 8px;
}

.mobile-household-day {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px;
}

body:not(.dark-theme) .mobile-household-day {
  background: #f8fafc;
  border-color: #e5e7eb;
}

.mobile-household-day-title {
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 900;
  margin-bottom: 8px;
}

body:not(.dark-theme) .mobile-household-day-title {
  color: #111827;
}

.mobile-slot-input-row {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 10px;
  margin-top: 8px;
}

.mobile-slot-input-row:has(.mobile-slot-pause-toggle) {
  grid-template-columns: minmax(0, 1fr) 30px 78px;
}

.mobile-slot-input-row span {
  color: #e5e7eb;
  font-size: 0.85rem;
  font-weight: 800;
}

body:not(.dark-theme) .mobile-slot-input-row span {
  color: #1f2937;
}

.mobile-slot-input-row small {
  color: #94a3b8;
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
}

.mobile-pause-all-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.mobile-basic-pause-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 7px;
}

.mobile-basic-pause-label {
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  margin-top: 12px;
  text-transform: uppercase;
}

.mobile-slot-pause-toggle {
  align-self: center;
  appearance: none;
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border: 1.5px dashed #71717a;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.mobile-slot-pause-toggle::before,
.mobile-slot-pause-toggle::after {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 1px;
  background: transparent;
  border: 1.5px solid #71717a;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.mobile-slot-pause-toggle.active {
  border-color: rgba(255, 255, 255, 0.4);
}

.mobile-slot-pause-toggle.active::before,
.mobile-slot-pause-toggle.active::after {
  background: #ff6f3c;
  border-color: #ff6f3c;
}

body:not(.dark-theme) .mobile-slot-pause-toggle {
  border-color: #9ca3af;
}

body:not(.dark-theme) .mobile-slot-pause-toggle::before,
body:not(.dark-theme) .mobile-slot-pause-toggle::after {
  border-color: #9ca3af;
}

body:not(.dark-theme) .mobile-slot-pause-toggle.active {
  border-color: rgba(0, 0, 0, 0.4);
}

.advanced-portion-row.paused span,
.basic-portion-row.paused span {
  opacity: 0.62;
}

.advanced-portion-row.paused .advanced-slot-input,
.basic-portion-row.paused .basic-slot-input {
  opacity: 0.45;
  pointer-events: none;
}

.advanced-portion-row.paused .advanced-slot-input:disabled,
.basic-portion-row.paused .basic-slot-input:disabled {
  -webkit-text-fill-color: #94a3b8;
}

.mobile-chip-check {
  align-items: center;
  background: rgba(255, 111, 60, 0.08);
  border: 1px solid rgba(255, 111, 60, 0.22);
  border-radius: 999px;
  color: #ff9b73;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 850;
  gap: 7px;
  padding: 8px 10px;
}

.mobile-chip-check.row-check {
  border-radius: 9px;
  display: flex;
  justify-content: flex-start;
  margin-top: 7px;
  width: 100%;
}

.mobile-chip-check input {
  accent-color: #ff6f3c;
  margin: 0;
}

.shopping-estimate-note {
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.3;
  margin-top: 8px;
  max-width: 100%;
}

body:not(.dark-theme) .shopping-estimate-note {
  color: #64748b;
}

.mobile-toast-snackbar {
  align-items: center;
  background: #2b2f36;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  bottom: calc(90px + env(safe-area-inset-bottom));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.36);
  color: #f8fafc;
  display: flex;
  font-size: 0.9rem;
  font-weight: 800;
  left: 16px;
  line-height: 1.35;
  min-height: 54px;
  padding: 12px 16px;
  position: fixed;
  right: 16px;
  z-index: 200000 !important;
}

body:not(.dark-theme) .mobile-toast-snackbar {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  color: #111827;
}

/* Final mobile polish pass: keep dense app views stable and consistent. */
#mobile-content-area.fixed-plan-layout {
  height: calc(100dvh - 56px) !important;
  min-height: 0 !important;
  padding: 0 !important;
}

#mobile-content-area.fixed-plan-layout #mobile-next-meal-container,
#mobile-content-area.fixed-plan-layout .mobile-context-tip {
  margin-left: 14px !important;
  margin-right: 14px !important;
  width: auto !important;
}

#mobile-content-area.fixed-plan-layout #mobile-next-meal-container {
  margin-top: 12px !important;
  margin-bottom: 22px !important;
}

#mobile-content-area.fixed-plan-layout .mobile-context-tip {
  height: 50px !important;
  min-height: 50px !important;
  max-height: 50px !important;
  margin-top: 12px !important;
  margin-bottom: 0 !important;
  padding: 10px 12px !important;
}

#mobile-content-area.fixed-plan-layout .mobile-tip-text {
  line-height: 1.25 !important;
}

#mobile-content-area.fixed-plan-layout .mobile-next-meal-card {
  height: 224px !important;
  min-height: 224px !important;
  max-height: 224px !important;
  padding: 18px 20px !important;
  width: 100% !important;
}

#mobile-content-area.fixed-plan-layout .mobile-next-meal-card.empty-widget {
  height: 224px !important;
  min-height: 224px !important;
  max-height: 224px !important;
}

#mobile-content-area.fixed-plan-layout .mobile-meal-slot-group.today .mobile-meal-card {
  box-shadow: none !important;
}

#mobile-content-area.fixed-plan-layout .mobile-day-list.schedule-timeline {
  padding-left: 14px !important;
  padding-right: 14px !important;
  padding-bottom: calc(190px + env(safe-area-inset-bottom)) !important;
  gap: 20px !important;
}

#mobile-content-area.fixed-plan-layout .mobile-meal-card {
  min-height: 58px !important;
  padding: 13px 16px !important;
}

#mobile-content-area.fixed-plan-layout .mobile-meal-card.empty {
  padding: 0 !important;
}

/* Plan schedule width contract: populated and empty slots must occupy identical tracks. */
#mobile-content-area.fixed-plan-layout .mobile-meal-slot-group,
#mobile-content-area.fixed-plan-layout .mobile-meal-card,
#mobile-content-area.fixed-plan-layout .mobile-meal-card.filled-card,
#mobile-content-area.fixed-plan-layout .mobile-meal-card.empty,
#mobile-content-area.fixed-plan-layout .mobile-meal-card.paused {
  box-sizing: border-box !important;
  flex: 0 0 auto !important;
  inline-size: 100% !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  align-self: stretch !important;
}

#mobile-content-area.fixed-plan-layout .mobile-day-list.schedule-timeline {
  box-sizing: border-box !important;
  flex: 1 1 auto !important;
  inline-size: 100% !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  min-width: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

#mobile-content-area.fixed-plan-layout .mobile-meal-slot-group {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
}

#mobile-content-area.fixed-plan-layout .slot-header-label,
#mobile-content-area.fixed-plan-layout .mobile-meal-card,
#mobile-content-area.fixed-plan-layout .reroll-preview-card,
#mobile-content-area.fixed-plan-layout .delete-preview-bg,
#mobile-content-area.fixed-plan-layout .swap-preview-bg {
  grid-column: 1 / -1 !important;
}

.mobile-shopping-summary {
  gap: 10px !important;
  min-height: 64px !important;
  padding: 10px 16px !important;
}

.shopping-summary-totals {
  align-items: center !important;
  display: grid !important;
  flex: 1 1 auto !important;
  gap: 6px 14px !important;
  grid-template-columns: repeat(2, minmax(0, auto)) !important;
  min-width: 0 !important;
}

.shopping-summary-title {
  display: flex !important;
  flex-direction: column !important;
  font-size: 0.76rem !important;
  gap: 2px !important;
  line-height: 1.05 !important;
}

.shopping-summary-val {
  font-size: 0.86rem !important;
  line-height: 1.1 !important;
}

.shopping-hide-completed-btn {
  flex: 0 0 auto !important;
  min-height: 34px !important;
}

.details-ingredients {
  list-style: none !important;
  padding-left: 0 !important;
}

.details-ingredients li {
  margin: 0 0 8px !important;
}

.mobile-basic-slot-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.compact-settings-panel .form-group:last-child {
  margin-bottom: 0;
}

/* Final settings layout: fixed headers, scrolling bodies. */
.settings-screen {
  inset: 56px 0 calc(64px + env(safe-area-inset-bottom)) 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
}

.settings-content {
  height: 100% !important;
  max-width: 420px !important;
  margin: 0 auto !important;
  overflow: hidden !important;
  width: 100% !important;
}

.mobile-settings-container {
  align-items: stretch !important;
  background-color: #121214 !important;
  box-sizing: border-box !important;
  height: 100% !important;
  overflow: hidden !important;
  padding: 0 !important;
  scrollbar-width: none;
}

.mobile-settings-container::-webkit-scrollbar {
  display: none;
}

.mobile-settings-container .settings-profile-card {
  align-items: center !important;
  background-color: #1e1e24 !important;
  border: 1px solid #27272a !important;
  border-radius: 12px !important;
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.26) !important;
  box-sizing: border-box !important;
  flex: 0 0 auto !important;
  gap: 6px !important;
  justify-content: center !important;
  margin: 18px auto 16px !important;
  max-width: 360px !important;
  height: 86px !important;
  min-height: 86px !important;
  overflow: hidden !important;
  padding: 18px 20px !important;
  position: relative !important;
  text-align: center !important;
  width: 100% !important;
  z-index: 30 !important;
}

.mobile-settings-container .settings-profile-card::after {
  content: none !important;
}

.mobile-settings-container .settings-profile-email,
.mobile-settings-container .settings-profile-tier {
  display: block !important;
  flex: 0 0 auto !important;
  line-height: 1.25 !important;
  text-align: center !important;
  width: 100% !important;
}

.settings-menu-scroll {
  background: #121214;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 18px calc(104px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.settings-menu-scroll::-webkit-scrollbar {
  display: none;
}

body:not(.dark-theme) .mobile-settings-container {
  background-color: #ffffff !important;
}

body:not(.dark-theme) .mobile-settings-container .settings-profile-card {
  background-color: #f2f2f7 !important;
  border-color: #e5e7eb !important;
  box-shadow: 0 16px 24px rgba(15, 23, 42, 0.12) !important;
}

body:not(.dark-theme) .mobile-settings-container .settings-profile-card::after {
  content: none !important;
}

body:not(.dark-theme) .settings-menu-scroll {
  background: #ffffff;
}

.settings-subpage {
  box-sizing: border-box !important;
  height: 100% !important;
  overflow: hidden !important;
  padding: 0 16px !important;
}

.settings-subpage .subpage-header {
  background-color: #121214 !important;
  box-sizing: border-box !important;
  height: 58px !important;
  margin: 0 -16px 14px !important;
  padding: 0 16px !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 20 !important;
}

body:not(.dark-theme) .settings-subpage .subpage-header {
  background-color: #ffffff !important;
}

.settings-subpage .subpage-content {
  height: calc(100% - 72px) !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important;
  -webkit-overflow-scrolling: touch;
}

/* v1.3.43: Plan tab must always measure from the viewport, not populated card content. */
#mobile-app #mobile-content-area.fixed-plan-layout {
  align-items: stretch !important;
  box-sizing: border-box !important;
  flex: 1 1 auto !important;
  inline-size: 100vw !important;
  margin: 0 !important;
  max-inline-size: 100vw !important;
  max-width: 100vw !important;
  min-inline-size: 100vw !important;
  min-width: 100vw !important;
  overflow: hidden !important;
  padding: 0 !important;
  width: 100vw !important;
}

#mobile-app #mobile-content-area.fixed-plan-layout > #mobile-tab-content {
  align-items: stretch !important;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-rows: auto auto auto minmax(0, 1fr) !important;
  height: 100% !important;
  inline-size: 100vw !important;
  justify-items: stretch !important;
  margin: 0 !important;
  max-inline-size: 100vw !important;
  max-width: 100vw !important;
  min-height: 0 !important;
  min-inline-size: 100vw !important;
  min-width: 100vw !important;
  overflow: hidden !important;
  padding: 0 !important;
  width: 100vw !important;
}

#mobile-app #mobile-content-area.fixed-plan-layout .mobile-week-nav,
#mobile-app #mobile-content-area.fixed-plan-layout .mobile-context-tip,
#mobile-app #mobile-content-area.fixed-plan-layout #mobile-next-meal-container {
  box-sizing: border-box !important;
  inline-size: calc(100vw - 28px) !important;
  justify-self: stretch !important;
  margin-left: 14px !important;
  margin-right: 14px !important;
  max-inline-size: calc(100vw - 28px) !important;
  max-width: calc(100vw - 28px) !important;
  min-inline-size: 0 !important;
  min-width: 0 !important;
  width: calc(100vw - 28px) !important;
}

#mobile-app #mobile-content-area.fixed-plan-layout #mobile-next-meal-container {
  margin-top: 14px !important;
  margin-bottom: 22px !important;
}

#mobile-app #mobile-content-area.fixed-plan-layout .mobile-day-list.schedule-timeline {
  align-self: stretch !important;
  box-sizing: border-box !important;
  flex: 1 1 auto !important;
  grid-row: 4 !important;
  inline-size: 100vw !important;
  margin: 0 !important;
  max-inline-size: 100vw !important;
  max-width: 100vw !important;
  min-height: 0 !important;
  min-inline-size: 100vw !important;
  min-width: 100vw !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding-left: 14px !important;
  padding-right: 14px !important;
  width: 100vw !important;
}

#mobile-app #mobile-content-area.fixed-plan-layout .mobile-day-list.schedule-timeline > .mobile-meal-slot-group,
#mobile-app #mobile-content-area.fixed-plan-layout .mobile-meal-card,
#mobile-app #mobile-content-area.fixed-plan-layout .reroll-preview-card,
#mobile-app #mobile-content-area.fixed-plan-layout .delete-preview-bg,
#mobile-app #mobile-content-area.fixed-plan-layout .swap-preview-bg {
  box-sizing: border-box !important;
  inline-size: 100% !important;
  max-inline-size: 100% !important;
  max-width: 100% !important;
  min-inline-size: 0 !important;
  min-width: 0 !important;
  width: 100% !important;
}

/* Batch Cooking beta */
#mobile-content-area.fixed-batch-layout {
  align-items: stretch !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  inline-size: 100vw !important;
  max-inline-size: 100vw !important;
  min-inline-size: 100vw !important;
  overflow: hidden !important;
  padding: 0 !important;
  padding-bottom: 0 !important;
  width: 100vw !important;
}

#mobile-content-area.fixed-batch-layout > #mobile-tab-content {
  box-sizing: border-box !important;
  display: flex !important;
  flex: 1 1 auto !important;
  inline-size: 100vw !important;
  max-inline-size: 100vw !important;
  min-inline-size: 100vw !important;
  min-height: 0 !important;
  overflow: hidden !important;
  width: 100vw !important;
}

.batch-screen {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: calc(100dvh - 56px - calc(64px + env(safe-area-inset-bottom)));
  inline-size: 100vw;
  max-inline-size: 100vw;
  min-height: 0;
  min-inline-size: 100vw;
  overflow: hidden;
  padding: 0;
  width: 100vw;
}

.batch-scroll-body {
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px calc(96px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.batch-header-row {
  align-items: center;
  background: #121214;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  justify-content: space-between;
  min-height: 82px;
  padding: 14px;
  width: 100%;
}

.batch-header-row h2 {
  color: #ffffff;
  font-size: 1.35rem;
  line-height: 1.1;
  margin: 0 0 4px;
}

.batch-header-row span {
  color: #a1a1aa;
  font-size: 0.82rem;
  font-weight: 700;
}

.batch-add-btn,
.batch-actions button {
  background: #ff6f3c;
  border: 0;
  border-radius: 10px;
  color: #111111;
  cursor: pointer;
  font-weight: 850;
  min-height: 38px;
  padding: 0 14px;
}

.batch-card-list {
  display: grid;
  gap: 14px;
  min-width: 0;
  width: 100%;
}

.batch-card,
.batch-empty-state {
  background: #1e1e24;
  border: 1px solid rgba(255, 111, 60, 0.24);
  border-radius: 14px;
  box-sizing: border-box;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  min-width: 0;
  padding: 16px;
  width: 100%;
}

.batch-card-top {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.batch-card h3 {
  color: #ffffff;
  font-size: 1.08rem;
  line-height: 1.2;
  margin: 0 0 5px;
}

.batch-card-top span,
.batch-empty-state span {
  color: #a1a1aa;
  font-size: 0.8rem;
  font-weight: 700;
}

.batch-repeat-pill,
.beta-pill {
  background: rgba(255, 111, 60, 0.16);
  border: 1px solid rgba(255, 111, 60, 0.38);
  border-radius: 999px;
  color: #ff8a5f !important;
  display: inline-flex;
  font-size: 0.68rem !important;
  font-weight: 900 !important;
  line-height: 1;
  padding: 5px 8px;
  text-transform: uppercase;
}

.batch-meal-list {
  display: grid;
  gap: 7px;
  margin: 14px 0;
}

.batch-meal-list span {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  color: #f4f4f5;
  font-weight: 750;
  padding: 9px 10px;
}

.batch-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.batch-actions button {
  background: #2a2a2f;
  border: 1px solid #3f3f46;
  color: #f4f4f5;
  min-height: 36px;
  padding: 0 6px;
}

.batch-actions button:last-child {
  border-color: rgba(255, 77, 77, 0.45);
  color: #ff7777;
}

.batch-empty-state {
  align-items: stretch;
  display: grid;
  gap: 12px;
  margin-top: 18px;
  text-align: center;
}

.batch-empty-state strong {
  color: #ffffff;
  font-size: 1.15rem;
}

.batch-editor-overlay {
  background: #121214;
  inset: 0;
  opacity: 0;
  position: fixed;
  transform: translateY(28px);
  transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 10020;
}

.batch-editor-overlay.open {
  opacity: 1;
  transform: translateY(0);
}

.batch-editor-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.batch-editor-header {
  align-items: center;
  background: #16161a;
  border-bottom: 1px solid #27272a;
  display: grid;
  grid-template-columns: 74px 1fr 74px;
  min-height: 56px;
  padding: 0 14px;
}

.batch-editor-header h2 {
  color: #ffffff;
  font-size: 1rem;
  margin: 0;
  text-align: center;
}

.batch-editor-header button {
  background: none;
  border: 0;
  color: #ff6f3c;
  font-weight: 850;
}

.batch-editor-header button:last-child {
  text-align: right;
}

.batch-editor-body {
  display: grid;
  gap: 16px;
  overflow-y: auto;
  padding: 18px 14px calc(34px + env(safe-area-inset-bottom));
}

.batch-field {
  display: grid;
  gap: 8px;
}

.batch-field span,
.batch-select-title {
  color: #ff8a5f;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.batch-field input {
  background: #1e1e24;
  border: 1px solid #303038;
  border-radius: 12px;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 750;
  min-height: 48px;
  padding: 0 14px;
}

.batch-time-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.batch-repeat-row {
  background: #1e1e24;
  border: 1px solid #303038;
  border-radius: 12px;
  padding: 14px;
}

.batch-meal-selector {
  display: grid;
  gap: 10px;
}

.batch-meal-option {
  background: #1e1e24;
  border: 1px solid #303038;
  border-radius: 12px;
  color: #ffffff;
  display: grid;
  gap: 5px;
  min-height: 68px;
  padding: 12px 14px;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.batch-meal-option span {
  color: #a1a1aa;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.batch-meal-option strong {
  font-size: 1rem;
  line-height: 1.2;
}

.batch-meal-option.selected {
  background: rgba(255, 111, 60, 0.18) !important;
  border-color: #ff6f3c !important;
  box-shadow: inset 0 0 0 1px rgba(255, 111, 60, 0.45);
}

.batch-meal-option:not(.selected),
.batch-meal-option:not(.selected):focus,
.batch-meal-option:not(.selected):active {
  background: #1e1e24 !important;
  border-color: #303038 !important;
  box-shadow: none !important;
  color: #ffffff !important;
}

.batch-original-recipe {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 16px;
  padding-top: 12px;
}

.batch-original-recipe h3 {
  color: #ffffff;
  font-size: 1rem;
  margin: 0 0 8px;
}

.batch-instructions-view {
  box-sizing: border-box;
  height: 100dvh;
  padding: 0 16px !important;
}

.batch-instructions-header {
  background: #121214;
  box-sizing: border-box;
  flex: 0 0 58px;
  height: 58px;
  margin: 0 -16px !important;
  padding: 0 16px;
  position: relative;
}

.batch-instructions-header .subpage-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-instructions-body {
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 0 110px;
  -webkit-overflow-scrolling: touch;
}

.batch-instructions-footer {
  background: #121214;
  border-top: 1px solid #27272a;
  bottom: 0;
  box-sizing: border-box;
  flex: 0 0 auto;
  padding: 12px 0 calc(16px + env(safe-area-inset-bottom));
  width: 100%;
}

.batch-instructions-footer .action-btn-primary {
  margin: 0;
  width: 100%;
}

body:not(.dark-theme) .batch-instructions-header {
  background: #ffffff;
  border-bottom-color: #e5e7eb;
}

body:not(.dark-theme) .batch-instructions-footer {
  background: #ffffff;
  border-top-color: #e5e7eb;
}

body:not(.dark-theme) .batch-screen,
body:not(.dark-theme) .batch-editor-overlay {
  background: #f8fafc;
}

body:not(.dark-theme) .batch-header-row h2,
body:not(.dark-theme) .batch-card h3,
body:not(.dark-theme) .batch-empty-state strong,
body:not(.dark-theme) .batch-meal-option,
body:not(.dark-theme) .batch-field input,
body:not(.dark-theme) .batch-editor-header h2 {
  color: #111827;
}

body:not(.dark-theme) .batch-card,
body:not(.dark-theme) .batch-empty-state,
body:not(.dark-theme) .batch-meal-option,
body:not(.dark-theme) .batch-field input,
body:not(.dark-theme) .batch-repeat-row {
  background: #ffffff;
  border-color: #e5e7eb;
}

body:not(.dark-theme) .batch-editor-header {
  background: #ffffff;
  border-bottom-color: #e5e7eb;
}

body:not(.dark-theme) .batch-header-row {
  background: #f8fafc;
  border-bottom-color: #e5e7eb;
}

body:not(.dark-theme) .batch-meal-option:not(.selected):focus,
body:not(.dark-theme) .batch-meal-option:not(.selected):active {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
  color: #111827 !important;
}

body:not(.dark-theme) .batch-meal-option:not(.selected) {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
  color: #111827 !important;
}

body:not(.dark-theme) .batch-meal-list span {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #111827;
}

/* Light theme interaction and transient-surface polish. */
body:not(.dark-theme) .meal-card.drag-ready,
body:not(.dark-theme) .mobile-meal-card.drag-ready,
body:not(.dark-theme) .meal-card.dragging,
body:not(.dark-theme) .mobile-meal-card.dragging {
  background: #ffffff !important;
  border-color: #ffb392 !important;
  color: #111827 !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18) !important;
}

body:not(.dark-theme) .details-tag-pill {
  background: #fff1e9;
  border-color: #ffc4aa;
  color: #b63f16;
}

body:not(.dark-theme) .undo-snackbar,
body:not(.dark-theme) .mobile-toast-snackbar {
  background: #fffaf7;
  border-color: #ffc4aa;
  box-shadow: 0 10px 28px rgba(87, 45, 25, 0.18);
  color: #1f2937;
}

body:not(.dark-theme) .undo-snackbar span {
  color: #1f2937;
}

body:not(.dark-theme) .shopping-hide-completed-btn {
  background: #fff1e9;
  border-color: #ffb392;
  color: #9a3412;
}

body:not(.dark-theme) .shopping-hide-completed-btn:active {
  background: #ffe2d5;
}

body:not(.dark-theme) .week-selector-pill.past {
  background: #ffffff;
  border: 1px solid #d7dce3;
  color: #64748b;
}

body:not(.dark-theme) .week-selector-pill.current {
  background: #ff6f3c;
  border: 1px solid #ff6f3c;
  color: #111827;
}

body:not(.dark-theme) .week-selector-pill.upcoming {
  background: #ffe2d5;
  border: 1px solid #ffb392;
  color: #9a3412;
}

body:not(.dark-theme) .mobile-week-status-pill.status-past {
  background: #ffffff;
  border-color: #d7dce3;
  color: #64748b;
}

body:not(.dark-theme) .mobile-week-status-pill.status-current {
  background: #ff6f3c;
  border-color: #ff6f3c;
  color: #111827;
  box-shadow: none;
}

body:not(.dark-theme) .mobile-week-status-pill.status-upcoming {
  background: #ffe2d5;
  border-color: #ffb392;
  color: #9a3412;
}

body:not(.dark-theme) .batch-actions button {
  background: #fff1e9 !important;
  border: 1px solid #ffb392 !important;
  color: #9a3412 !important;
}

body:not(.dark-theme) .batch-actions button:active {
  background: #ffe2d5 !important;
}

body:not(.dark-theme) .batch-actions button:last-child {
  background: #fff7ed !important;
  border-color: #ff9b73 !important;
  color: #c2410c !important;
}

body:not(.dark-theme) .batch-actions button:last-child:active {
  background: #ffedd5 !important;
}

.week-selector-pill.upcoming,
.mobile-week-status-pill.status-upcoming {
  background: #ffe2d5;
  border-color: #ffb392;
  color: #9a3412;
}

body:not(.dark-theme) .mobile-cooking-overlay {
  background-color: #f8fafc;
}

body:not(.dark-theme) .cook-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

body:not(.dark-theme) .cook-header-title {
  color: #0f172a;
}

body:not(.dark-theme) .cook-header-close {
  color: #64748b;
}

body:not(.dark-theme) .cook-header-close:active {
  color: #0f172a;
}

body:not(.dark-theme) .cook-meta-bar {
  background-color: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

body:not(.dark-theme) .cook-specs span {
  background-color: #e2e8f0;
  color: #334155;
}

body:not(.dark-theme) .cook-tab-bar {
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

body:not(.dark-theme) .cook-tab-btn {
  color: #64748b;
}

body:not(.dark-theme) .cook-tab-btn.active {
  color: #ff6f3c;
  border-bottom-color: #ff6f3c;
  background-color: rgba(255, 111, 60, 0.05);
}

body:not(.dark-theme) .cook-check-item {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
}

body:not(.dark-theme) .cook-check-item.checked {
  background-color: #f8fafc;
  border-color: #e2e8f0;
  opacity: 0.5;
}

body:not(.dark-theme) .cook-check-item.checked .cook-check-text {
  color: #94a3b8;
}

body:not(.dark-theme) .cook-check-text {
  color: #334155;
}

body:not(.dark-theme) .cook-check-item input[type="checkbox"] {
  background: #ffffff !important;
  border: 2px solid #cbd5e1 !important;
}

body:not(.dark-theme) .cook-check-item input[type="checkbox"]:checked {
  background: #ff6f3c !important;
  border-color: #ff6f3c !important;
}

/* Custom meals */
.browse-search-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.browse-search-row .mobile-search-input {
  flex: 1 1 auto;
  min-width: 0;
}

.browse-scope-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.browse-scope-btn {
  min-height: 34px;
  border: 1px solid #34343c;
  border-radius: 7px;
  background: #202026;
  color: #a7a7ae;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
}

.browse-scope-btn.active {
  border-color: #ff8255;
  background: #33221d;
  color: #ff8255;
}

.browse-scope-btn span {
  opacity: 0.72;
}

.recipe-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recipe-title-wrap .recipe-title-text {
  flex: 1 1 auto;
}

.custom-recipe-badge {
  flex: 0 0 auto;
  border: 1px solid #8e4934;
  border-radius: 999px;
  background: #33221d;
  color: #ff9a76;
  padding: 3px 6px;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.browse-add-meal-btn,
.desktop-add-custom-meal,
.subpage-header-action,
.recipe-edit-meal-btn {
  border: 1px solid #ff8d63;
  background: #ff6f3c;
  color: #111217;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.browse-add-meal-btn {
  flex: 0 0 auto;
  padding: 0 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.desktop-add-custom-meal {
  margin: 10px 0;
  padding: 9px 14px;
  border-radius: 6px;
}

.recipe-edit-meal-btn {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  border-radius: 8px;
}

.subpage-header-action {
  padding: 7px 10px;
  border-radius: 7px;
}

.my-meal-row {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-bottom: 1px solid #2b2b31;
  background: transparent;
  color: #f7f7f8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  font: inherit;
  font-weight: 750;
  text-align: left;
}

.custom-meal-editor {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #101012;
  color: #f7f7f8;
}

.custom-meal-editor-header {
  flex: 0 0 auto;
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(70px, 1fr) auto minmax(70px, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-bottom: 1px solid #2b2b31;
  background: #17171b;
}

.custom-meal-editor-header h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0;
  text-align: center;
}

.custom-meal-editor-header button {
  border: 0;
  background: transparent;
  color: #ff8255;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.custom-meal-editor-header button:first-child {
  justify-self: start;
}

.custom-meal-editor-header button:last-child {
  justify-self: end;
}

.custom-meal-form {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 18px calc(34px + env(safe-area-inset-bottom));
}

.custom-meal-form label {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  color: #ff8255;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.custom-meal-form small {
  color: #8f9099;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: none;
}

.custom-meal-form input,
.custom-meal-form select,
.custom-meal-form textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #34343c;
  border-radius: 8px;
  background: #202026;
  color: #f7f7f8;
  padding: 12px;
  font: inherit;
  font-weight: 650;
  text-transform: none;
  resize: vertical;
}

.custom-meal-form input:focus,
.custom-meal-form select:focus,
.custom-meal-form textarea:focus {
  outline: 2px solid rgba(255, 111, 60, 0.45);
  border-color: #ff6f3c;
}

.custom-meal-number-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

.custom-meal-delete {
  width: 100%;
  min-height: 48px;
  border: 1px solid #80343b;
  border-radius: 8px;
  background: #321d22;
  color: #ff727b;
  font: inherit;
  font-weight: 800;
}

body:not(.dark-theme) .custom-meal-editor {
  background: #f8fafc;
  color: #111827;
}

body:not(.dark-theme) .custom-meal-editor-header {
  background: #ffffff;
  border-bottom-color: #e5e7eb;
}

body:not(.dark-theme) .custom-meal-form input,
body:not(.dark-theme) .custom-meal-form select,
body:not(.dark-theme) .custom-meal-form textarea {
  background: #ffffff;
  border-color: #d7dce3;
  color: #111827;
}

body:not(.dark-theme) .my-meal-row {
  border-bottom-color: #e5e7eb;
  color: #111827;
}

body:not(.dark-theme) .browse-scope-btn {
  background: #ffffff;
  border-color: #d7dce3;
  color: #64748b;
}

body:not(.dark-theme) .browse-scope-btn.active,
body:not(.dark-theme) .custom-recipe-badge {
  background: #fff1e9;
  border-color: #ffb392;
  color: #9a3412;
}

.household-link-panel {
  display: grid;
  gap: 12px;
}

.household-role-summary {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid #573326;
  border-radius: 8px;
  background: #291c18;
}

.household-role-summary strong {
  color: #f7f7f8;
}

.household-role-summary span,
.household-member-list {
  color: #a7a7ae;
  font-size: 0.78rem;
}

.household-member-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid #34343c;
  border-radius: 8px;
}

.household-member-list div {
  padding: 10px 12px;
  background: #202026;
}

.household-full-btn {
  width: 100%;
  min-height: 44px;
}

body:not(.dark-theme) .household-role-summary {
  border-color: #ffb392;
  background: #fff1e9;
}

body:not(.dark-theme) .household-role-summary strong {
  color: #111827;
}

body:not(.dark-theme) .household-role-summary span,
body:not(.dark-theme) .household-member-list {
  color: #64748b;
}

body:not(.dark-theme) .household-member-list {
  border-color: #e5e7eb;
}

body:not(.dark-theme) .household-member-list div {
  background: #ffffff;
}

@media (max-width: 430px) {
  .browse-add-meal-btn {
    padding-inline: 9px;
    font-size: 0.76rem;
  }
}

@media (min-width: 769px) {
  .desktop-add-custom-meal {
    margin: 0;
    padding: 9px 14px;
    border: 1px solid rgba(255, 111, 60, .45);
    border-radius: 8px;
    background: transparent;
    color: inherit;
  }

  .desktop-add-custom-meal:hover {
    border-color: #ff6f3c;
    background: rgba(255, 111, 60, .08);
    color: #ff8255;
  }

  .custom-meal-editor {
    inset: 5vh auto;
    left: 50%;
    width: min(680px, calc(100vw - 40px));
    height: 90vh;
    transform: translateX(-50%);
    border: 1px solid #34343c;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  }
}
/* Custom meal and settings management enhancements */
.custom-tag-suggestions,
.tag-library-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.custom-tag-suggestion,
.tag-library-pill {
  border: 1px solid rgba(255, 111, 60, 0.45);
  border-radius: 999px;
  background: rgba(255, 111, 60, 0.1);
  color: #ff8a64;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.custom-tag-suggestion.selected {
  background: #ff6f3c;
  border-color: #ff6f3c;
  color: #111217;
}

.custom-ingredient-rows {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}

/* === Custom Meal Editor Estimates Display & Overrides === */
.custom-estimates-display {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 16px;
  background: #18181c;
  border: 1px solid #282830;
  border-radius: 8px;
  padding: 12px;
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
}

body:not(.dark-theme) .custom-estimates-display {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.estimate-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.estimate-label {
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  color: #8f9099;
}

body:not(.dark-theme) .estimate-label {
  color: #64748b;
}

.estimate-value {
  font-size: 1.15rem;
  font-weight: 850;
  color: #ff8255;
}

body:not(.dark-theme) .estimate-value {
  color: #b7431e;
}

.custom-meal-overrides-wrapper {
  grid-column: 1 / -1;
  display: block;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease-out, margin-bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 0;
}

.custom-meal-overrides-wrapper.expanded {
  max-height: 100px;
  opacity: 1;
  margin-bottom: 16px;
}

/* === Override Toggle Row === */
.override-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 16px;
  cursor: pointer;
  user-select: none;
}

.override-label-text {
  font-size: 0.85rem;
  font-weight: 650;
  color: #8f9099;
}

body:not(.dark-theme) .override-label-text {
  color: #4b5563;
}

#custom-meal-override-check {
  display: none !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
  pointer-events: none !important;
}

/* === Ingredient Selector Styling Updates === */
.custom-ingredient-row {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr) minmax(0, 1fr) 38px;
  gap: 7px;
  align-items: center;
  margin-bottom: 4px;
}

.custom-ingredient-row input {
  min-width: 0;
}

.custom-ingredient-name {
  grid-column: 1;
}

.custom-ingredient-unit-label {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #ff8255;
  white-space: nowrap;
  background: transparent;
  border: 1px dotted rgba(255, 111, 60, 0.45);
  border-radius: 6px;
  height: 44px;
  box-sizing: border-box;
  text-align: center;
}

.custom-ingredient-unit-label.placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

body:not(.dark-theme) .custom-ingredient-unit-label {
  color: #b7431e;
  border-color: rgba(255, 111, 60, 0.45);
}

body:not(.dark-theme) .custom-ingredient-unit-label.placeholder {
  color: rgba(0, 0, 0, 0.45) !important;
  border-color: rgba(0, 0, 0, 0.25) !important;
}

.custom-ingredient-quantity {
  grid-column: 3;
  text-align: center;
  font-size: 0.8rem !important;
  padding: 12px 2px !important;
}

.custom-ingredient-remove {
  grid-column: 4;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  padding: 0 !important;
}

/* Ensure uniform heights of inputs and labels in the row */
.custom-ingredient-row input,
.custom-ingredient-row button,
.custom-ingredient-row .custom-ingredient-unit-label {
  height: 44px;
  box-sizing: border-box;
  margin: 0;
}

.custom-ingredient-remove,
.custom-ingredient-add {
  border: 1px solid rgba(255, 111, 60, 0.42);
  background: rgba(255, 111, 60, 0.08);
  color: #ff7650;
  font-weight: 900;
}

.custom-ingredient-remove {
  width: 38px;
  height: 44px;
  border-radius: 6px;
  font-size: 22px;
}

.custom-ingredient-add {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  min-height: 44px;
  border-radius: 6px;
  margin-top: 12px;
}

.settings-instruction-banner {
  margin-bottom: 12px;
  border: 1px solid rgba(255, 111, 60, 0.38);
  border-radius: 8px;
  background: rgba(255, 111, 60, 0.09);
  color: inherit;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
}

.my-meal-row {
  align-items: center;
  gap: 12px;
}

.my-meal-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.my-meal-actions button {
  border: 1px solid rgba(255, 111, 60, 0.35);
  border-radius: 5px;
  background: transparent;
  color: #ff7650;
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 800;
}

.my-meal-actions button.danger {
  color: #ff5b62;
  border-color: rgba(255, 91, 98, 0.38);
}

body:not(.dark-theme) .custom-tag-suggestion,
body:not(.dark-theme) .tag-library-pill,
body:not(.dark-theme) .custom-ingredient-remove,
body:not(.dark-theme) .custom-ingredient-add {
  background: #fff5f0;
  color: #b7431e;
}

@media (max-width: 430px) {
  .custom-ingredient-row {
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr) minmax(0, 1fr) 36px;
    gap: 5px;
  }

  .my-meal-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .my-meal-actions {
    width: 100%;
    margin-left: 0;
  }

  .my-meal-actions button {
    flex: 1;
  }
}

/* Hide number input spinners inside custom meal forms */
.custom-meal-form input[type="number"]::-webkit-outer-spin-button,
.custom-meal-form input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  margin: 0 !important;
}
.custom-meal-form input[type="number"] {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

.override-arrow-icon {
  font-size: 0.85rem;
  font-weight: 800;
  color: #ff6f3c;
  transition: transform 0.2s ease;
  display: inline-block;
  margin-left: 4px;
}

body:not(.dark-theme) .override-arrow-icon {
  color: #b7431e;
}

/* Custom Aisle Reordering Settings */
.aisle-reorder-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.aisle-reorder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #1e1e24;
  border: 1px solid #303038;
  border-radius: 12px;
  color: #ffffff;
}

body:not(.dark-theme) .aisle-reorder-item {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #1e293b;
}

.aisle-reorder-item .aisle-name {
  font-size: 0.88rem;
  font-weight: 800;
}

.aisle-reorder-item .aisle-actions {
  display: flex;
  gap: 6px;
}

.aisle-reorder-item .aisle-move-btn {
  background: #2a2a32;
  border: 1px solid #3f3f46;
  color: #ffffff;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

body:not(.dark-theme) .aisle-reorder-item .aisle-move-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

.aisle-reorder-item .aisle-move-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Browse Only My Meals Toggle Switch */
.browse-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 4px 0;
}

.browse-toggle-row .toggle-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: #e2e8f0;
}

body:not(.dark-theme) .browse-toggle-row .toggle-label {
  color: #1e293b;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #3f3f46;
  transition: .2s;
  border-radius: 24px;
  border: 1px solid #52525b;
}

body:not(.dark-theme) .toggle-slider {
  background-color: #e4e4e7;
  border-color: #d4d4d8;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #a1a1aa;
  transition: .2s;
  border-radius: 50%;
}

body:not(.dark-theme) .toggle-slider:before {
  background-color: #71717a;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #ff6f3c;
  border-color: #ff6f3c;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(18px);
  background-color: #ffffff;
}

/* Redesigned Tag Preferences Controls */
.tag-preferences-list {
  display: grid;
  gap: 12px;
}

.tag-preference-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #1e1e24;
  border: 1px solid #303038;
  border-radius: 12px;
  gap: 10px;
}

body:not(.dark-theme) .tag-preference-row {
  background: #ffffff;
  border-color: #e2e8f0;
}

.tag-preference-row .tag-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
  text-transform: capitalize;
}

body:not(.dark-theme) .tag-preference-row .tag-name {
  color: #1e293b;
}

.tag-segment-control {
  display: flex;
  background: #121214;
  border-radius: 8px;
  padding: 2px;
  border: 1px solid #27272a;
}

body:not(.dark-theme) .tag-segment-control {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.tag-segment-control .segment-btn {
  background: none;
  border: none;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 850;
  color: #a7a7ae;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

body:not(.dark-theme) .tag-segment-control .segment-btn {
  color: #64748b;
}

.tag-segment-control .segment-btn.active {
  background: #ff6f3c;
  color: #ffffff;
}

.tag-segment-control .segment-btn[data-status="avoid"].active {
  background: #ef4444;
  color: #ffffff;
}

.tag-segment-control .segment-btn[data-status="mustHave"].active {
  background: #10b981;
  color: #ffffff;
}

/* Mobile Taste Preferences */
.taste-preferences-content {
  gap: 12px !important;
}

.taste-intro-card {
  background: linear-gradient(145deg, rgba(255, 111, 60, 0.16), rgba(255, 111, 60, 0.035));
  border: 1px solid rgba(255, 111, 60, 0.3);
  border-radius: 16px;
  padding: 18px;
}

.taste-intro-kicker {
  color: #ff8a5b;
  display: block;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.taste-intro-card h2 {
  color: #f8fafc;
  font-size: 1.22rem;
  line-height: 1.2;
  margin: 0 0 7px;
}

.taste-intro-card p,
.taste-card-heading p,
.taste-picker-heading p,
.taste-account-panel p {
  color: #a1a1aa;
  font-size: 0.76rem;
  line-height: 1.45;
  margin: 0;
}

.taste-preference-card {
  background: #1e1e24;
  border: 1px solid #303038;
  border-radius: 15px;
  padding: 14px;
}

.taste-preference-card.taste-mustHave {
  border-color: rgba(16, 185, 129, 0.32);
}

.taste-preference-card.taste-likes {
  border-color: rgba(255, 111, 60, 0.32);
}

.taste-preference-card.taste-avoid {
  border-color: rgba(239, 68, 68, 0.3);
}

.taste-card-heading {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.taste-card-heading h3 {
  color: #f8fafc;
  font-size: 0.95rem;
  margin: 0 0 3px;
}

.taste-count {
  align-items: center;
  background: #29292f;
  border-radius: 999px;
  color: #d4d4d8;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  min-width: 24px;
  padding: 0 7px;
}

.taste-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
  min-height: 28px;
}

.taste-tag-pill {
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  color: #f4f4f5;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 800;
  gap: 7px;
  padding: 7px 9px 7px 11px;
  text-transform: capitalize;
}

.taste-mustHave .taste-tag-pill {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.28);
  color: #6ee7b7;
}

.taste-likes .taste-tag-pill {
  background: rgba(255, 111, 60, 0.1);
  border-color: rgba(255, 111, 60, 0.28);
  color: #ff9b73;
}

.taste-avoid .taste-tag-pill {
  background: rgba(239, 68, 68, 0.09);
  border-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.taste-tag-pill span {
  font-size: 1rem;
  line-height: 0.7;
  opacity: 0.7;
}

.taste-empty {
  color: #71717a;
  font-size: 0.76rem;
  font-style: italic;
  padding: 5px 0;
}

.taste-add-preferences {
  align-items: center;
  background: #ff6f3c;
  border: 0;
  border-radius: 13px;
  color: #111113;
  display: flex;
  font-size: 0.9rem;
  font-weight: 900;
  gap: 7px;
  justify-content: center;
  min-height: 48px;
  width: 100%;
}

.taste-add-preferences span {
  font-size: 1.25rem;
  line-height: 1;
}

.taste-picker-overlay {
  align-items: flex-end;
  background: rgba(0, 0, 0, 0);
  display: flex;
  inset: 0;
  position: fixed;
  transition: background 220ms ease;
  z-index: 300000;
}

.taste-picker-overlay.is-open {
  background: rgba(0, 0, 0, 0.68);
}

.taste-picker-overlay.is-closing {
  background: rgba(0, 0, 0, 0);
}

.taste-picker-sheet,
.taste-assignment-sheet {
  background: #19191d;
  border: 1px solid #303038;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.42);
  box-sizing: border-box;
  max-height: min(78dvh, 680px);
  padding: 9px 16px calc(22px + env(safe-area-inset-bottom));
  transform: translateY(102%);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
  width: 100%;
}

.taste-picker-overlay.is-open .taste-picker-sheet,
.taste-picker-overlay.is-open .taste-assignment-sheet {
  transform: translateY(0);
}

.taste-picker-overlay.is-closing .taste-picker-sheet,
.taste-picker-overlay.is-closing .taste-assignment-sheet {
  transform: translateY(102%);
}

.taste-picker-sheet {
  display: flex;
  flex-direction: column;
  min-height: 62dvh;
}

.taste-sheet-handle {
  background: #52525b;
  border-radius: 999px;
  height: 4px;
  margin: 0 auto 14px;
  width: 38px;
}

.taste-picker-heading {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 13px;
}

.taste-picker-heading h3,
.taste-sheet-title strong {
  color: #f8fafc;
  font-size: 1.05rem;
  margin: 0 0 3px;
}

.taste-picker-close {
  align-items: center;
  background: #29292f;
  border: 0;
  border-radius: 999px;
  color: #d4d4d8;
  display: flex;
  font-size: 1.2rem;
  height: 32px;
  justify-content: center;
  padding: 0;
  width: 32px;
}

.taste-picker-search {
  margin: 0 0 12px !important;
}

.taste-picker-list {
  display: grid;
  flex: 1 1 auto;
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
}

.taste-picker-row {
  align-items: center;
  background: #222228;
  border: 1px solid #303038;
  border-radius: 11px;
  color: #f4f4f5;
  display: flex;
  font-size: 0.86rem;
  font-weight: 800;
  justify-content: space-between;
  min-height: 46px;
  padding: 10px 12px;
  text-align: left;
  text-transform: capitalize;
}

.taste-picker-add {
  color: #ff8a5b;
  font-size: 1.2rem;
}

.taste-status-badge {
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 900;
  padding: 4px 7px;
  text-transform: uppercase;
}

.taste-status-badge.mustHave {
  background: rgba(16, 185, 129, 0.13);
  color: #6ee7b7;
}

.taste-status-badge.likes {
  background: rgba(255, 111, 60, 0.13);
  color: #ff9b73;
}

.taste-status-badge.avoid {
  background: rgba(239, 68, 68, 0.13);
  color: #fca5a5;
}

.taste-picker-empty {
  color: #71717a;
  font-size: 0.82rem;
  padding: 24px 8px;
  text-align: center;
}

.taste-sheet-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 14px;
}

.taste-sheet-title > span {
  color: #a1a1aa;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.taste-assignment-options {
  display: grid;
  gap: 8px;
}

.taste-assignment-options button {
  align-items: center;
  background: #222228;
  border: 1px solid #303038;
  border-radius: 12px;
  color: #f8fafc;
  display: grid;
  gap: 12px;
  grid-template-columns: 12px minmax(0, 1fr);
  min-height: 58px;
  padding: 10px 13px;
  text-align: left;
}

.taste-assignment-options button.active {
  border-color: #ff6f3c;
  box-shadow: inset 0 0 0 1px rgba(255, 111, 60, 0.28);
}

.taste-assignment-options strong,
.taste-assignment-options small {
  display: block;
}

.taste-assignment-options strong {
  font-size: 0.86rem;
}

.taste-assignment-options small {
  color: #a1a1aa;
  font-size: 0.7rem;
  margin-top: 2px;
}

.taste-option-dot {
  background: #71717a;
  border-radius: 50%;
  height: 10px;
  width: 10px;
}

.taste-option-dot.like { background: #ff6f3c; }
.taste-option-dot.require { background: #10b981; }
.taste-option-dot.avoid { background: #ef4444; }

.taste-account-panel .secondary-action-btn {
  margin-top: 12px;
  width: 100%;
}

body:not(.dark-theme) .taste-intro-card {
  background: linear-gradient(145deg, rgba(255, 111, 60, 0.12), rgba(255, 255, 255, 0.96));
}

body:not(.dark-theme) .taste-intro-card h2,
body:not(.dark-theme) .taste-card-heading h3,
body:not(.dark-theme) .taste-picker-heading h3,
body:not(.dark-theme) .taste-sheet-title strong {
  color: #111827;
}

body:not(.dark-theme) .taste-preference-card,
body:not(.dark-theme) .taste-picker-sheet,
body:not(.dark-theme) .taste-assignment-sheet {
  background: #ffffff;
  border-color: #e5e7eb;
}

body:not(.dark-theme) .taste-count,
body:not(.dark-theme) .taste-picker-close {
  background: #f1f5f9;
  color: #475569;
}

body:not(.dark-theme) .taste-tag-pill {
  color: #334155;
}

body:not(.dark-theme) .taste-picker-row,
body:not(.dark-theme) .taste-assignment-options button {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #111827;
}

/* Batch Editor height & scrolling fixes */
.batch-editor-body {
  display: flex !important;
  flex-direction: column !important;
  height: calc(100% - 56px) !important;
  overflow: hidden !important;
  padding: 18px 14px calc(34px + env(safe-area-inset-bottom)) !important;
  gap: 16px !important;
}

.batch-meal-selector {
  display: grid !important;
  gap: 10px !important;
  overflow-y: auto !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

/* Custom recipe badge - display cleanly as borderless icon */
.custom-recipe-badge {
  border: none !important;
  background: none !important;
  padding: 0 !important;
  color: #ff9a76 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  margin-left: 6px !important;
}

body:not(.dark-theme) .custom-recipe-badge {
  color: #ff6f3c !important;
}

/* Empty Meal Card Buttons (FF-UX-001) */
.next-meal-btn-roll,
.next-meal-btn-browse {
  flex: 1;
  height: 38px;
  border-radius: 8px;
  border: none;
  background-color: #ff6f3c;
  color: #111111;
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: opacity 0.15s ease;
  padding: 0 10px;
}

.next-meal-btn-roll:active,
.next-meal-btn-browse:active {
  opacity: 0.9;
}

.next-meal-btn-cook .action-icon,
.next-meal-btn-swap .action-icon,
.next-meal-btn-plan .action-icon,
.next-meal-btn-roll .action-icon,
.next-meal-btn-browse .action-icon,
.next-meal-btn-browse svg {
  width: 14px !important;
  height: 14px !important;
  flex: 0 0 14px !important;
  -webkit-mask-size: 14px 14px !important;
  mask-size: 14px 14px !important;
}

/* Draggable Aisle Reordering Settings (Mobile) */
.aisle-reorder-item.dragging {
  opacity: 0.6;
  background-color: rgba(255, 111, 60, 0.08) !important;
  border-color: #ff6f3c !important;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}
.aisle-drag-handle {
  touch-action: none;
}

/* Mobile Toggle Position Adjustment (FF-BROWSE-001) */
.browse-toggle-row {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  margin-top: 0 !important;
  margin-bottom: 8px !important;
  padding: 4px 0 !important;
}

/* Presence Indicators (FF-HOUSE-001) */
.presence-indicator-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: #34d399; /* Green contrast */
  font-weight: 600;
  width: 100%;
  box-sizing: border-box;
}
body:not(.dark-theme) .presence-indicator-bar {
  color: #059669;
}
.presence-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  animation: pulse-green-mobile 2s infinite;
}
@keyframes pulse-green-mobile {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* --- FF-PRES-002 / FF-PRES-004: Mobile Presence Indicator Collapse & Transition --- */
.presence-indicator-bar {
  transition: max-height 250ms ease-out, opacity 250ms ease-out, padding 250ms ease-out, margin 250ms ease-out, border-color 250ms ease-out !important;
  max-height: 100px;
  overflow: hidden;
}
.presence-indicator-bar.collapsed {
  max-height: 0 !important;
  opacity: 0 !important;
  padding: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  border-top-width: 0 !important;
  border-bottom-width: 0 !important;
  border-color: transparent !important;
  pointer-events: none;
}

/* --- FF-BATCH-001: One Slot Per Row Batch Layout (Mobile) --- */
.batch-meal-selector {
  grid-template-columns: 1fr !important;
}

/* --- FF-SET-001: Standardised Secondary Action Buttons (Mobile) --- */
.secondary-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 111, 60, 0.45) !important;
  background: transparent !important;
  color: #ff6f3c !important;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
  text-decoration: none;
}
.secondary-action-btn:hover {
  background: rgba(255, 111, 60, 0.08) !important;
  border-color: #ff6f3c !important;
  color: #ff6f3c !important;
}
body:not(.dark-theme) .secondary-action-btn {
  border-color: rgba(255, 111, 60, 0.45) !important;
  color: #ff6f3c !important;
}

/* === DARK THEME ORANGE CONTROLS USE BLACK LABELS / ICONS === */
body.dark-theme .action-btn-primary,
body.dark-theme .next-meal-btn-cook,
body.dark-theme .batch-add-btn,
body.dark-theme .mobile-bottom-nav .mobile-nav-btn.active {
  color: #111111 !important;
}
body.dark-theme .action-btn-primary .action-icon,
body.dark-theme .next-meal-btn-cook .action-icon,
body.dark-theme .batch-add-btn .action-icon {
  background-color: #111111 !important;
  color: #111111 !important;
}
body.dark-theme .mobile-bottom-nav .mobile-nav-btn.active .mobile-nav-svg {
  background-color: transparent !important;
  color: #111111 !important;
  stroke: #111111 !important;
}

/* === CONSISTENT MOBILE SQUARE CHECKBOXES === */
#mobile-app input[type="checkbox"]:not(.shopping-checkbox):not(#browse-only-my-meals-toggle):not(#custom-meal-override-check) {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  padding: 0 !important;
  border: 2px solid rgba(255, 255, 255, 0.42) !important;
  border-radius: 5px !important;
  background: #16161a !important;
  display: inline-grid !important;
  place-items: center !important;
  position: relative !important;
  box-sizing: border-box !important;
  flex: 0 0 22px !important;
}

#mobile-app input[type="checkbox"]:not(.shopping-checkbox):not(#browse-only-my-meals-toggle):not(#custom-meal-override-check):checked {
  background: #ff6f3c !important;
  border-color: #ff6f3c !important;
}

#mobile-app input[type="checkbox"]:not(.shopping-checkbox):not(#browse-only-my-meals-toggle):not(#custom-meal-override-check):checked::after {
  content: "" !important;
  width: 6px !important;
  height: 10px !important;
  border: solid #111111 !important;
  border-width: 0 2px 2px 0 !important;
  transform: translateY(-1px) rotate(45deg) !important;
  box-sizing: border-box !important;
}

body:not(.dark-theme) #mobile-app input[type="checkbox"]:not(.shopping-checkbox):not(#browse-only-my-meals-toggle):not(#custom-meal-override-check) {
  background: #ffffff !important;
  border-color: rgba(17, 24, 39, 0.35) !important;
}

body:not(.dark-theme) #mobile-app input[type="checkbox"]:not(.shopping-checkbox):not(#browse-only-my-meals-toggle):not(#custom-meal-override-check):checked {
  background: #ff6f3c !important;
  border-color: #ff6f3c !important;
}

/* Membership cards fit within the settings viewport; remove generic form overscroll. */
.membership-comparison-subpage .subpage-content {
  height: auto !important;
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  padding-bottom: 10px !important;
}

/* === MOBILE MEMBERSHIP THEME PARITY === */
.mobile-membership-title {
  font-size: 1.1rem !important;
  margin: 12px 0 8px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
}
body:not(.dark-theme) .mobile-membership-title {
  color: #1e293b !important;
}

.membership-card-mobile {
  background: #1e1e24 !important;
  border: 1px solid #303038 !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  margin-bottom: 8px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  transition: all 0.2s ease !important;
}
body:not(.dark-theme) .membership-card-mobile {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}
.membership-card-mobile.selected {
  border-color: #ff6f3c !important;
  box-shadow: 0 0 0 1px #ff6f3c, 0 4px 12px rgba(255, 111, 60, 0.08) !important;
}

.membership-card-mobile-title {
  margin: 0 !important;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  color: #ffffff !important;
}
body:not(.dark-theme) .membership-card-mobile-title {
  color: #1e293b !important;
}

.membership-card-mobile-desc {
  margin-top: 4px !important;
  font-size: 0.72rem !important;
  line-height: 1.35 !important;
  color: #a7a7ae !important;
}
body:not(.dark-theme) .membership-card-mobile-desc {
  color: #475569 !important;
}

.membership-card-mobile-subtext {
  font-size: 0.68rem !important;
  color: #a7a7ae !important;
}
body:not(.dark-theme) .membership-card-mobile-subtext {
  color: #64748b !important;
}

/* === COLLAPSIBLE TAGS SUGGESTIONS SECTION === */
.mobile-tags-suggestions {
  margin-top: 20px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding-top: 14px !important;
}
body:not(.dark-theme) .mobile-tags-suggestions {
  border-top-color: #e2e8f0 !important;
}
.mobile-tags-suggestions summary {
  font-weight: 800 !important;
  font-size: 0.88rem !important;
  color: #ff6f3c !important;
  cursor: pointer !important;
  margin-bottom: 12px !important;
  list-style: none !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}
.mobile-tags-suggestions summary::-webkit-details-marker {
  display: none !important;
}
.mobile-tags-suggestions summary::after {
  content: "▼" !important;
  font-size: 0.65rem !important;
  color: #ff6f3c !important;
  transition: transform 0.2s ease !important;
}
.mobile-tags-suggestions[open] summary::after {
  transform: rotate(180deg) !important;
}
.tags-empty-placeholder {
  text-align: center;
  padding: 16px;
  color: #a7a7ae;
  font-size: 0.8rem;
  line-height: 1.4;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}
body:not(.dark-theme) .tags-empty-placeholder {
  color: #64748b;
  border-color: #e2e8f0;
}

