/* ===================================================================
   PEACHY PANTRY - KITCHEN MANAGEMENT APP
   Organized CSS Structure
   =================================================================== */

/* @import MUST come before all other rules per CSS spec */
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Lato:wght@400;500;600&family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Crimson+Pro:ital,wght@0,400;0,600;1,400&family=Caveat:wght@600&family=Space+Mono&display=swap');

/* -------------------------------------------------------------------
   1. RESET & GLOBAL STYLES
   ------------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Lato", -apple-system,   BlinkMacSystemFont, sans-serif;
  /* Green and white gingham background */
  background-color: var(--parchment);
            /* Refined Gingham Weave */
            background-image:
                linear-gradient(90deg, rgba(139, 168, 142, 0.15) 50%, transparent 50%),
                linear-gradient(rgba(139, 168, 142, 0.15) 50%, transparent 50%);
            background-size: 70px 70px;
  color: var(--ink);
  line-height: 1.65;
  margin: 0;
  padding: 0;
  display: flex;
  min-height: 100vh;
  padding-top: 70px;

}

/* Global Focus Styles for Accessibility */
*:focus-visible {
  outline: 3px solid var(--color-accent-olive, #8B9376);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Remove default focus outline for mouse users */
*:focus:not(:focus-visible) {
  outline: none;
}


/* -------------------------------------------------------------------
   2. CSS VARIABLES
   ------------------------------------------------------------------- */
:root {
  /* Layout - Default (comfortable) */
  --layout-max-width: 1000px;
  --layout-max-width-wide: 1100px;
  --layout-max-width-narrow: 700px;
  --layout-padding: 1.5rem;
  --layout-gap: 1rem;

  /* Primary Colors */
  --color-header-purple: #7D667A;
  --gingham-green: #2d8a4e;
  --gingham-white: #ffffff;
  --gingham-light: #8ecb9e;
  --color-card-bg: #FFFEF9;
  --color-accent-olive: #8B9376;
  --color-text-primary: #3a3a3a;
  --color-text-secondary: #6b6b6b;
  --sage-dark: #7a947d;
  --sage-mid: #8ba88e;
  --sage-light: #b2c4b5;
  --cream-bg: #f5f5f0;
  --ink: #3a473b;
  --parchment: #f9f9f2;
  --clay: #d17a5d;
  --tape: rgba(209, 122, 93, 0.4);

  /* Pantry Table Colors */
  --color-pantry-header: #5a4a3a;
  --color-pantry-row: #FAF8F5;
  --color-pantry-hover: #f0ebe3;

  /* Recipe Card Colors - Updated to match reference */
  --buttermilk: #fdfaf1;
  --forest: #3d5a44;
  --clay-warm: #a6634b;
  --linen-texture: rgba(0, 0, 0, 0.03);
  --color-recipe-border: #e8e2d0;
  --color-recipe-accent: #8B9376;

  /* Button Colors */
  --btn-primary: #8B9376;
  --btn-primary-hover: #7A8268;
  --btn-danger: #C86B6B;
  --btn-edit: #7D667A;
}

/* Compact display mode */
body.compact {
  --layout-max-width: 900px;
  --layout-max-width-wide: 1000px;
  --layout-max-width-narrow: 600px;
  --layout-padding: 1rem;
  --layout-gap: 0.75rem;
}


/* -------------------------------------------------------------------
   3. OFFLINE INDICATOR BANNER
   ------------------------------------------------------------------- */
.offline-banner {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: #B36A5E;
  color: white;
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 199;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* -------------------------------------------------------------------
   4. HEADER (Fixed Purple Bar)
   ------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--color-header-purple);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

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

.header-brand {
  font-size: 2rem;
  font-family: "Caveat", cursive;
  color: #FCEBD4;
  margin: 0;
  letter-spacing: 1px;
  font-weight: 600;
  position: relative;
  display: inline-block;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.header-brand-underline {
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 3px;
  background: #F1C338;
  border-radius: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header-datetime {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.datetime-separator {
  opacity: 0.5;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-header-icon {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  padding: 0.5rem;
  font-size: 1.3rem;
  cursor: pointer !important;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  transition: all 0.2s;
  pointer-events: auto !important;
  opacity: 1 !important;
}

.btn-header-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  transform: translateY(-2px);
}


/* -------------------------------------------------------------------
   4. LAYOUT (Navigation + Main Content)
   ------------------------------------------------------------------- */

/* Hidden radio inputs for CSS-only navigation */
.section-nav-input {
  display: none;
}

/* LEFT SIDEBAR NAVIGATION (Desktop) */
.sidebar-nav {
  position: fixed;
  left: 0;
  top: 70px;
  width: 80px;
  height: calc(100vh - 70px);
  background: var(--color-header-purple);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  z-index: 150;
  box-shadow: 2px 0 12px rgba(0,0,0,0.15);
}

/* BOTTOM NAVIGATION (Mobile) - Hidden on desktop */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--color-header-purple);
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  z-index: 150;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
}

/* Navigation Button Styling */
.nav-btn {
  font-size: 2rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.2s;
  background: transparent;
  opacity: 0.6;
}

.nav-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

/* Keyboard focus indicator */
.nav-btn:focus-visible {
  opacity: 1;
  background: rgba(139, 168, 142, 0.25);
  outline: 3px solid var(--color-accent-olive);
  outline-offset: 3px;
}

/* Active state - multi-page nav uses .active class on <a> links */
.nav-btn.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.15);
}

/* Main content - adjusted for left nav */
.main-content {
  margin-left: 80px;
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
  padding: 0;
  overflow-x: hidden; /* Prevent horizontal bleed from wide grids */
}

/* Section visibility — multi-page architecture */
/* Each section page has data-section on body; sections are shown there */
.main-content > section {
  display: none;
}

body[data-section] .main-content > section {
  display: flex;
}

/* Landing page: hide sections, show landing */
.landing-page { display: none; }
body:not([data-section]) .landing-page { display: block; }


/* -------------------------------------------------------------------
   5. SHOPPING LIST — Styles moved to shopping/shopping.css
   ------------------------------------------------------------------- */


/* -------------------------------------------------------------------
   6. PANTRY LEDGER — Styles moved to pantry/pantry.css (mobile-first)
   ------------------------------------------------------------------- */


/* -------------------------------------------------------------------
   7. RECIPES SECTION — Styles moved to recipes/recipes.css
   ------------------------------------------------------------------- */


/* -------------------------------------------------------------------
   8. BUTTONS (Global)
   ------------------------------------------------------------------- */
.btn {
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  cursor: pointer !important;
  font-weight: 600;
  border: none;
  font-family: "Lato", sans-serif;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
  pointer-events: auto !important;
  opacity: 1 !important;
}

.btn:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--btn-primary);
  color: white;
  border: none;
}

.btn-primary:hover {
  background: var(--btn-primary-hover);
}

.btn-loading,
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-secondary {
  background: white;
  color: var(--color-text-primary);
  border: 2px solid var(--color-accent-olive);
}

.btn-secondary:hover {
  background: var(--color-accent-olive);
  border-color: var(--color-accent-olive);
  color: white;
}

.btn-danger {
  background: white;
  color: var(--btn-danger);
  border: 2px solid var(--btn-danger);
}

.btn-danger:hover {
  background: var(--btn-danger);
  color: white;
}

.btn-block {
  width: 100%;
}


/* -------------------------------------------------------------------
   7.5 VINTAGE RECIPE CARD MODAL — Styles moved to recipes/recipes.css
   ------------------------------------------------------------------- */

/* -------------------------------------------------------------------
   9. MODALS (Global)
   ------------------------------------------------------------------- */
#modal-root {
  position: relative;
  z-index: 1000;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10001; /* Higher than landing page (10000) */
}

/* Modal Card */
.modal-card {
  background: var(--color-card-bg);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  min-height: 300px;
  padding: 1.25rem 1.5rem;
  border: 2px solid #B8E3E9;
  box-shadow: 0 12px 32px rgba(156,175,136,0.2);
  position: relative;
  box-sizing: border-box;
  max-height: 100vh;
  overflow-y: auto;
}

/* Modal Close Button */
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.75rem;
  cursor: pointer;
  opacity: 0.5;
  color: #9CAF88;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
}

.modal-close:hover {
  opacity: 1;
  background: rgba(212,165,165,0.15);
}

/* Modal Title */
.modal-card-title {
  font-family: "Lato", sans-serif;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  color: #6a4f35;
}

.modal-card-subtitle {
  font-size: 0.875rem;
  opacity: 0.7;
  margin-bottom: 0.75rem;
}

/* Modal Divider */
.modal-divider {
  width: 100%;
  height: 1px;
  background: rgba(120, 94, 60, 0.25);
  margin: 0.75rem 0;
}

/* Modal Fields */
.modal-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin-top: 0.75rem;
}

.modal-fields-full {
  display: block;
  margin-top: 0.75rem;
}

.modal-field {
  display: flex;
  flex-direction: column;
}

.modal-field label {
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: #2F3E46;
  font-weight: 600;
}

.modal-field input,
.modal-field select,
.modal-field textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.25);
  background: #fff;
  font-size: 0.95rem;
  font-family: inherit;
}

.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus {
  border-color: #F1C338;
  box-shadow: 0 0 0 2px rgba(241,195,56,0.25);
  outline: none;
}

.modal-field textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.4;
}

/* Modal Actions */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.modal-actions .btn {
  padding: 0.6rem 1.5rem;
  font-size: 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.modal-actions .btn-primary {
  background: #F1C338;
  color: #fff;
  border: none;
}

.modal-actions .btn-primary:hover {
  background: #e0b530;
}

.modal-actions .btn-secondary {
  background: transparent;
  color: #8A9A5B;
  border: 2px solid #8A9A5B;
}

.modal-actions .btn-secondary:hover {
  background: rgba(138,154,91,0.1);
}

/* Ingredient/Location Rows */
.modal-ingredient-row,
.modal-location-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.modal-ingredient-row input,
.modal-location-row select,
.modal-location-row input {
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  box-sizing: border-box;
}

.modal-ingredient-row input:focus,
.modal-location-row input:focus {
  outline: none;
  border-color: #F1C338;
  box-shadow: 0 0 0 2px rgba(241,195,56,0.1);
}

.modal-ingredient-row input.ing-name {
  font-weight: 500;
  flex: 1;
  min-width: 0;
}

.modal-ingredient-row input.ing-qty {
  text-align: right;
  width: 70px;
  flex-shrink: 0;
}

.modal-ingredient-row input.ing-unit {
  width: 90px;
  flex-shrink: 0;
}

.modal-location-row select {
  flex: 1;
  min-width: 0;
}

.modal-location-row input[type="number"] {
  width: 70px;
  flex-shrink: 0;
}

.modal-location-row input[type="date"],
.modal-location-row input[type="text"]:last-of-type {
  width: 140px;
  flex-shrink: 0;
}

/* Remove Row Button */
.modal-remove-row {
  background: rgba(179,106,94,0.1);
  border: 1px solid rgba(179,106,94,0.3);
  color: #B36A5E;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}

.modal-remove-row:hover {
  background: rgba(179,106,94,0.2);
  border-color: rgba(179,106,94,0.5);
}

/* Add Row Button */
.modal-add-row {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: #8A9A5B;
  border: none;
  background: transparent;
  padding: 0.25rem 0;
  text-align: left;
}

.modal-add-row:hover {
  text-decoration: underline;
}

/* Checkout Item Cards */
.checkout-item-card {
  background: var(--color-card-bg);
  border: 2px solid rgba(197, 184, 165, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.checkout-item-header {
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(197, 184, 165, 0.2);
}

.checkout-item-header strong {
  font-size: 1rem;
  color: var(--color-pantry-header);
  font-family: "Libre Baskerville", Georgia, serif;
}

.checkout-item-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.checkout-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.checkout-field label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
}

.checkout-field input,
.checkout-field select {
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  box-sizing: border-box;
}

.checkout-field input:focus,
.checkout-field select:focus {
  outline: none;
  border-color: #F1C338;
  box-shadow: 0 0 0 2px rgba(241,195,56,0.1);
}

/* Mobile Checkout Responsive */
@media (max-width: 768px) {
  .checkout-item-fields {
    grid-template-columns: 1fr;
  }

  .checkout-item-card {
    padding: 0.75rem;
  }
}


/* -------------------------------------------------------------------
   10. FLOATING ACTION BUTTON (Context-Aware)
   ------------------------------------------------------------------- */
.floating-action-menu {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  z-index: 1001;
  display: none; /* Hidden by default */
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
}

/* Show FAB on section pages (each page only includes its own FAB) */
body[data-section] .floating-action-menu {
  display: flex;
}

.floating-action-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--color-recipe-accent);
  border: 3px solid white;
  font-size: 2.5rem;
  font-weight: 300;
  line-height: 1;
  color: white;
  cursor: pointer !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  pointer-events: auto !important;
  opacity: 1 !important;
  z-index: 9999;
}

.floating-action-btn:hover {
  background: var(--btn-primary);
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

.floating-action-btn.active {
  background: var(--btn-primary);
  transform: rotate(45deg);
}

.floating-action-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  opacity: 0;
  pointer-events: none;
}

.floating-action-options.active {
  opacity: 1;
  pointer-events: all;
}

.floating-action-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: white;
  border: 2px solid var(--color-accent-olive);
  border-radius: 24px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-primary);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  white-space: nowrap;
  transition: all 0.2s;
}

.floating-action-option:hover {
  background: var(--btn-primary);
  border-color: var(--btn-primary);
  color: white;
  transform: translateX(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}


/* -------------------------------------------------------------------
   6.5 MEAL PLANNING SECTION (Main Content)
   ------------------------------------------------------------------- */
.meal-planning-section {
  min-height: 100dvh;
  flex-direction: column;
  padding: var(--layout-padding);
  max-width: var(--layout-max-width);
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.meal-planning-header {
  margin-bottom: 1.5rem;
}

.meal-planning-header h2 {
  font-size: 1.75rem;
  color: var(--color-text-primary);
  font-family: "Libre Baskerville", Georgia, serif;
  margin: 0;
}

.meal-planning-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Calendar Navigation */
.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-recipe-border);
}

.btn-calendar-nav {
  background: var(--btn-primary);
  color: white;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-calendar-nav:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 147, 118, 0.3);
}

.calendar-period-label {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.4rem;
  color: var(--color-pantry-header);
  margin: 0;
}

/* Calendar Container - Desktop Month View */
.calendar-container {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.75rem;
  margin-bottom: 2rem;
}

/* Calendar Day Cell */
.calendar-day {
  background: var(--color-card-bg);
  border: 2px solid var(--color-recipe-border);
  border-radius: 8px;
  padding: 0.75rem;
  min-height: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.calendar-day:hover {
  border-color: var(--color-accent-olive);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.calendar-day.disabled {
  background: rgba(0, 0, 0, 0.02);
  cursor: not-allowed;
  opacity: 0.4;
}

.calendar-day.disabled:hover {
  transform: none;
  border-color: var(--color-recipe-border);
  box-shadow: none;
}

.calendar-day.today {
  border-color: var(--color-accent-olive);
  background: rgba(139, 147, 118, 0.1);
  box-shadow: 0 0 0 2px rgba(139, 147, 118, 0.2);
}

.calendar-day.past {
  background: rgba(0, 0, 0, 0.02);
  opacity: 0.5;
}

.calendar-day.has-meal {
  border-color: var(--btn-primary);
  background: rgba(139, 147, 118, 0.05);
}

.calendar-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.calendar-day-number {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-pantry-header);
}

.calendar-day-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-day-meals {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.calendar-meal-item {
  font-size: 0.8rem;
  color: var(--color-accent-olive);
  background: rgba(139, 147, 118, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day-empty {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  opacity: 0.5;
  font-style: italic;
}

/* Scheduled Recipes Section */
.scheduled-recipes-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--color-recipe-border);
}

.scheduled-recipes-section h3 {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.4rem;
  color: var(--color-pantry-header);
  margin-bottom: 1.5rem;
}

.scheduled-recipes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.scheduled-recipe-card {
  background: var(--color-card-bg);
  border: 2px solid var(--color-recipe-border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s;
}

.scheduled-recipe-card:hover {
  border-color: var(--color-accent-olive);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.scheduled-recipe-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.scheduled-recipe-emoji {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f0e8 0%, #e8dcc8 100%);
  border-radius: 8px;
  border: 2px solid var(--color-recipe-border);
}

.scheduled-recipe-details {
  flex: 1;
}

.scheduled-recipe-name {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-pantry-header);
  margin-bottom: 0.25rem;
}

.scheduled-recipe-date {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.scheduled-recipe-date.past-date {
  color: #B36A5E;
  font-weight: 600;
}

.btn-cook-now {
  background: var(--btn-primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-cook-now:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 147, 118, 0.3);
}

.btn-cook-now:disabled {
  background: rgba(139, 147, 118, 0.3);
  cursor: not-allowed;
  transform: none;
}

.scheduled-recipes-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--color-text-secondary);
  opacity: 0.6;
  font-style: italic;
}

/* -------------------------------------------------------------------
   11.5 MEAL PLANNER / CALENDAR
   ------------------------------------------------------------------- */
.planner-modal-content {
  width: 100%;
}

.planner-header-row {
  margin-bottom: 1.5rem;
  text-align: center;
}

.planner-month-label {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-pantry-header);
  font-family: "Libre Baskerville", Georgia, serif;
}

.planner-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  width: 100%;
}

.planner-day {
  background: var(--color-card-bg);
  border: 2px solid var(--color-recipe-border);
  border-radius: 8px;
  padding: 0.75rem;
  min-height: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.planner-day:hover {
  border-color: var(--color-accent-olive);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.planner-day.empty {
  background: transparent;
  border: none;
  cursor: default;
}

.planner-day.empty:hover {
  transform: none;
  box-shadow: none;
}

.planner-day-number {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-pantry-header);
  margin-bottom: 0.5rem;
}

.planner-day-content {
  font-size: 0.85rem;
  line-height: 1.4;
}

.planner-empty {
  color: var(--color-text-secondary);
  opacity: 0.6;
  font-style: italic;
}

.planner-recipe {
  color: var(--color-accent-olive);
  font-weight: 500;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* -------------------------------------------------------------------
   11.6 READY TO COOK RECIPES (Home Section)
   ------------------------------------------------------------------- */
#ready-recipes-section {
  margin-bottom: 2rem;
}

#ready-recipes-section h3 {
  font-family: "Libre Baskerville", Georgia, serif;
  color: var(--color-pantry-header);
}

.ready-recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.ready-recipe-card {
  background: var(--color-card-bg);
  border: 2px solid var(--color-recipe-border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ready-recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-color: var(--color-accent-olive);
}

.ready-recipe-photo {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: #f5f0e8;
}

.ready-recipe-photo-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #f5f0e8 0%, #e8dcc8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.ready-recipe-content {
  padding: 1.25rem;
}

.ready-recipe-content h4 {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.25rem;
  color: var(--color-pantry-header);
  margin-bottom: 0.75rem;
}

.ready-recipe-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
}

.btn-cook-ready {
  width: 100%;
  padding: 0.75rem;
  background: var(--btn-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cook-ready:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 147, 118, 0.3);
}


/* -------------------------------------------------------------------
   11.7 STACKED RECIPE CARDS (Front Page Visual Effect)
   ------------------------------------------------------------------- */
.recipe-stack-container {
  position: relative;
  perspective: 1000px;
  margin: 2rem auto;
  max-width: 850px;
}

.recipe-stack-back-cards {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  z-index: 1;
  pointer-events: none;
}

.recipe-stack-card {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 40px;
  background: var(--color-card-bg);
  border: 2px solid var(--color-recipe-border);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.recipe-stack-card.card-1 {
  top: -12px;
  width: 96%;
  opacity: 0.6;
}

.recipe-stack-card.card-2 {
  top: -24px;
  width: 92%;
  opacity: 0.4;
}

.recipe-front-card {
  position: relative;
  z-index: 10;
  max-width: 750px;
  margin: 0 auto;
}


/* -------------------------------------------------------------------
   12. RESPONSIVE (Mobile & Tablet)
   ------------------------------------------------------------------- */

/* Tablet */
@media (max-width: 1024px) {
  body {
    flex-direction: column;
    padding-top: 70px;
  }

  /* Keep sidebar nav on tablet */
  .sidebar-nav {
    width: 70px;
  }

  .main-content {
    margin-left: 70px;
  }

  .nav-btn {
    font-size: 1.8rem;
    width: 55px;
    height: 55px;
  }

  .site-header {
    height: auto;
    min-height: 70px;
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
  }

  .header-brand {
    font-size: 1.5rem;
  }

  .header-right {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .header-datetime {
    display: none; /* Phone has a clock — reclaim header space */
  }

  .header-nav {
    gap: 0.25rem;
  }

  .btn-header-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .main-content {
    margin-left: 70px;
  }

  .recipes-section,
  .pantry-section,
  .shopping-section,
  .meal-planning-section {
    padding: 1.5rem 1rem;
    margin: 1rem auto;
    max-width: 95%;
  }

  .floating-action-menu {
    bottom: 1.5rem;
    right: 1.5rem;
  }

  .floating-action-btn {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  body {
    padding-top: 70px; /* Compact single-row header */
    padding-bottom: 70px; /* Space for bottom nav */
  }

  /* Hide sidebar nav, show bottom nav */
  .sidebar-nav {
    display: none;
  }

  .bottom-nav {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    margin-bottom: 0;
  }

  .nav-btn {
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
  }

  .site-header {
    padding: 0.5rem 0.75rem;
    flex-wrap: nowrap; /* Single-row header now that datetime is hidden */
  }

  .header-brand {
    font-size: 1.25rem;
    margin-right: 0.5rem; /* Add spacing */
  }

  .header-nav {
    gap: 0.5rem; /* Increased spacing between buttons */
  }

  .btn-header-icon {
    width: 36px; /* Increased for better touch target */
    height: 36px;
    font-size: 1.1rem;
  }

  /* Main Content Sections - Mobile */
  .recipes-section,
  .pantry-section,
  .shopping-section,
  .meal-planning-section {
    padding: 1.5rem 1rem;
    margin: 1rem auto;
    max-width: 95%;
    width: 95%;
  }

  /* Recipe mobile styles moved to recipes/recipes.css */
  /* Ledger/pantry mobile styles moved to pantry/pantry.css */

  /* Shopping touch targets moved to shopping/shopping.css */

  .btn-header-icon {
    width: 44px;
    height: 44px;
  }

  /* Pantry controls mobile styles moved to pantry/pantry.css */

  /* Modal Responsive - Center on viewport */
  .modal-overlay {
    align-items: center;
    padding: 1rem;
  }

  .modal-card {
    width: 95%;
    max-width: 95%;
    border-radius: 16px;
    max-height: 90vh;
    padding: 1.5rem 1rem;
  }

  .modal-fields {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .modal-actions {
    flex-direction: column-reverse;
    gap: 0.5rem;
    margin-top: 1rem;
  }

  .modal-actions .btn {
    width: 100%;
    padding: 0.75rem;
  }

  .floating-action-btn {
    width: 60px; /* Increased for better touch target */
    height: 60px;
    font-size: 1.75rem;
  }

  .floating-action-menu {
    bottom: 5.5rem; /* Raised to clear bottom nav (70px + 1rem) */
    right: 1rem;
  }

  /* Optimize gingham background for small screens */
  body {
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
  }

  /* Touch targets */
  .btn,
  button {
    min-height: 44px;
  }

  .btn-add-icon {
    width: 44px; /* Increased for better touch target */
    height: 44px;
    font-size: 1.25rem;
  }

  /* Calendar/meal mobile styles now in meals/meals.css (mobile-first) */
}

/* Onboarding/bulk-entry styles moved to pantry/pantry.css */

/* Recipe Detail Modal - Mobile Styles */
@media (max-width: 768px) {
  .recipe-detail-modal {
    padding: 1rem;
    align-items: flex-start;
  }

  .recipe-detail-modal-content {
    max-height: 95vh;
    width: 100%;
  }

  .recipe-vintage-card {
    padding: 1.5rem;
    margin-bottom: 10px;
    margin-right: 10px;
  }

  .recipe-vintage-card::after {
    box-shadow:
      3px 3px 0 -1px var(--buttermilk), 3px 3px 0 0 var(--color-recipe-border),
      6px 6px 0 -2px var(--buttermilk), 6px 6px 0 -1px var(--color-recipe-border);
  }

  .recipe-vintage-card-title {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .recipe-vintage-card-meta {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .recipe-modal-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  .recipe-vintage-card-columns {
    flex-direction: column;
    gap: 1.5rem;
  }

  .recipe-vintage-card-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .recipe-vintage-card-actions .btn {
    width: 100%;
  }
}

/* Very Small Screens - Enhanced Mobile Optimization */
@media (max-width: 400px) {
  /* Header DateTime - Hide on very small screens */
  .header-datetime {
    display: none;
  }

  /* Modal Ingredient/Location Rows - Stack vertically */
  .modal-ingredient-row,
  .modal-location-row {
    flex-wrap: wrap;
  }

  .modal-ingredient-row input.ing-name,
  .modal-location-row select {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .modal-ingredient-row input.ing-qty,
  .modal-ingredient-row input.ing-unit {
    flex: 1 1 calc(50% - 0.25rem);
    width: auto;
  }

  /* Onboarding/bulk-entry 400px styles moved to pantry/pantry.css */
}

/* -------------------------------------------------------------------
   10. NEW MODAL STYLES (for app.js modals)
   ------------------------------------------------------------------- */

/* Modal Content - Alternative to modal-card */
.modal-content {
  background: var(--color-card-bg, #FFF8F0);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  padding: 1.5rem 2rem;
  border: 2px solid #B8E3E9;
  box-shadow: 0 12px 32px rgba(156,175,136,0.2);
  position: relative;
  box-sizing: border-box;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  font-family: "Lato", sans-serif;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #6a4f35;
}

.modal-content h3 {
  font-size: 1.1rem;
  margin: 1rem 0 0.5rem;
  color: #6a4f35;
}

/* Form Groups */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: #2F3E46;
  font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.25);
  background: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #F1C338;
  box-shadow: 0 0 0 2px rgba(241,195,56,0.25);
  outline: none;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.4;
}

/* Form Row - Horizontal layout */
.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 100px;
}

/* Form Actions */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(120, 94, 60, 0.15);
}

/* Location and Ingredient Rows */
.location-row,
.ingredient-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.location-row input,
.ingredient-row input {
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  box-sizing: border-box;
}

.location-row input:focus,
.ingredient-row input:focus {
  outline: none;
  border-color: #F1C338;
  box-shadow: 0 0 0 2px rgba(241,195,56,0.1);
}

.location-row .loc-name,
.ingredient-row .ing-name {
  flex: 2;
}

.location-row .loc-qty,
.ingredient-row .ing-qty {
  flex: 0.7;
  max-width: 80px;
}

.location-row .loc-expiry,
.ingredient-row .ing-unit {
  flex: 1;
}

/* Scheduled Meal Row */
.scheduled-meal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* Small button variant */
.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

/* Danger button */
.btn-danger {
  background: #d9534f;
  color: white;
  border: none;
}

.btn-danger:hover {
  background: #c9302c;
}

/* Quick use modal */
.quick-use-modal {
  max-width: 400px;
}

.quick-use-modal p {
  margin: 0.5rem 0 1rem;
  color: #666;
}

/* Cook modal */
.cook-modal ul {
  margin: 0.5rem 0 1rem 1rem;
  padding: 0;
}

.cook-modal li {
  margin-bottom: 0.25rem;
}

/* Day modal */
.day-modal .scheduled-meals {
  margin: 1rem 0;
}

.day-modal hr {
  margin: 1rem 0;
  border: none;
  border-top: 1px solid rgba(0,0,0,0.1);
}

/* Mobile responsive modals */
@media (max-width: 480px) {
  .modal-content {
    width: 95%;
    padding: 1rem;
    max-height: 85vh;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .location-row,
  .ingredient-row {
    flex-wrap: wrap;
  }

  .location-row input,
  .ingredient-row input {
    flex: 1 1 calc(50% - 0.25rem);
  }

  .location-row .loc-name,
  .ingredient-row .ing-name {
    flex: 1 1 100%;
  }
}

/* -------------------------------------------------------------------
   11. ACCOUNT & SETTINGS MODALS
   ------------------------------------------------------------------- */

/* Account Modal */
.account-modal {
  max-width: 500px;
}

.account-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.account-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.account-section h3 {
  font-size: 1.1rem;
  color: #6a4f35;
  margin-bottom: 0.75rem;
}

.account-info p {
  margin: 0.5rem 0;
  color: #555;
}

.account-info strong {
  color: #333;
}

.help-text {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 1rem;
}

.household-actions,
.data-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.household-actions .btn,
.data-actions .btn {
  flex: 1;
  min-width: 120px;
}

/* Account Profile Header */
.account-profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.account-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #8B9376;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  flex-shrink: 0;
}

.account-profile-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.account-email {
  margin: 0;
  font-size: 0.95rem;
  color: #555;
  word-break: break-all;
}

.account-role-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  width: fit-content;
}

.role-owner {
  background: rgba(241,195,56,0.2);
  color: #8a6d00;
}

.role-member {
  background: rgba(139,147,118,0.15);
  color: #5a6148;
}

/* Account Cards */
.account-card {
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.account-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.account-card-icon {
  font-size: 1.1rem;
}

.account-card-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #6a4f35;
}

/* Household Name Editing */
.household-name-editable {
  cursor: pointer;
  border-bottom: 1px dashed rgba(0,0,0,0.2);
  padding-bottom: 2px;
}

.household-name-editable:hover {
  border-bottom-color: #8B9376;
}

.household-name-edit-icon {
  font-size: 0.8rem;
  opacity: 0.4;
  margin-left: 0.25rem;
}

.household-name-editable:hover .household-name-edit-icon {
  opacity: 0.7;
}

.household-name-edit {
  margin-bottom: 0.75rem;
}

.household-name-edit-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  justify-content: flex-end;
}

/* Members List */
.members-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

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

.member-row-loading {
  opacity: 0.6;
}

.member-avatar-sm {
  font-size: 1rem;
  flex-shrink: 0;
}

.member-name {
  flex: 1;
  font-size: 0.9rem;
  color: #444;
}

.member-you-tag {
  display: inline-block;
  font-size: 0.7rem;
  background: rgba(139,147,118,0.15);
  color: #5a6148;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  margin-left: 0.35rem;
  vertical-align: middle;
}

/* Household Switcher Pills */
.household-switcher-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.household-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.household-pill:hover {
  background: rgba(139,147,118,0.1);
}

.household-pill-active {
  background: #8B9376;
  color: #fff;
  border-color: #8B9376;
}

.household-pill-active:hover {
  background: #7A8268;
}

.household-pill-name {
  font-weight: 500;
}

.household-pill-role {
  font-size: 0.7rem;
  opacity: 0.7;
  text-transform: capitalize;
}

/* Account Access Option Buttons (Household Share / Quick Access) */
.account-access-options {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.account-access-btn {
  flex: 1;
  padding: 0.75rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.3px;
  border: 2px solid var(--color-accent-olive);
  border-radius: 10px;
  cursor: pointer;
  background: white;
  color: var(--color-accent-olive);
  transition: all 0.2s ease;
}

.account-access-btn.active,
.account-access-btn:hover {
  background: var(--color-accent-olive);
  color: white;
}

.access-panel {
  padding-top: 0.25rem;
  animation: fadeIn 0.15s ease;
}

/* QA code tap-to-reveal area */
.qa-code-tap-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(139,147,118,0.08);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  margin-bottom: 0.75rem;
  transition: background 0.15s ease;
  user-select: none;
}

.qa-code-tap-area:hover {
  background: rgba(139,147,118,0.15);
}

.quick-access-code-display {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: #333;
  flex: 1;
  text-align: center;
}

.qa-code-tap-hint {
  font-size: 0.75rem;
  color: #999;
  white-space: nowrap;
}

/* Join / Leave kitchen section */
.account-join-section {
  padding: 0.75rem 0 0;
}

.account-join-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  margin: 0 0 0.6rem;
}

.invite-panel {
  padding-top: 0.25rem;
}

/* Invite Code Display */
.invite-code-card {
  background: rgba(139,147,118,0.08);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.invite-code-label {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: #777;
}

.invite-code-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 4px;
  margin: 0 0 0.35rem;
  color: #333;
}

.invite-code-expires {
  margin: 0;
  font-size: 0.8rem;
  color: #999;
}

.invite-code-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.join-input-row {
  display: flex;
  gap: 0.5rem;
}

.invite-code-input {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  font-weight: 600;
}

.invite-error {
  color: var(--danger-color, red);
  font-size: 0.85rem;
  margin: 0.5rem 0 0;
}

.invite-success {
  color: var(--success-color, #4ade80);
  font-size: 0.85rem;
  margin: 0.5rem 0 0;
}

.invite-status-msg {
  font-size: 0.85rem;
  color: #777;
  margin: 0.5rem 0 0;
}

/* Account Footer Actions */
.account-footer-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn-footer-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

/* Button helpers */
.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.btn-icon-label {
  font-size: 0.85rem;
}

/* Account Loading State */
.account-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  gap: 1rem;
}

.account-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(139,147,118,0.2);
  border-top-color: #8B9376;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.account-loading p {
  margin: 0;
  font-size: 0.9rem;
  color: #777;
}

/* Settings Modal */
.settings-modal {
  max-width: 500px;
}

.settings-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.settings-section:last-of-type {
  border-bottom: none;
}

.settings-section h3 {
  font-size: 1.1rem;
  color: #6a4f35;
  margin-bottom: 1rem;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  margin: 0;
}

/* Dark Theme Support (for settings toggle) */
body.dark-theme {
  --color-card-bg: #2a2a2a;
  --color-text: #e0e0e0;
  background: #1a1a1a;
  color: #e0e0e0;
}

body.dark-theme .modal-content {
  background: #2a2a2a;
  color: #e0e0e0;
}

body.dark-theme .modal-content h2,
body.dark-theme .modal-content h3 {
  color: #f0f0f0;
}

body.dark-theme .form-group input,
body.dark-theme .form-group select,
body.dark-theme .form-group textarea {
  background: #3a3a3a;
  color: #e0e0e0;
  border-color: #555;
}

/* Mobile responsive for account/settings */
@media (max-width: 480px) {
  .account-modal,
  .settings-modal {
    max-width: 95%;
  }

  .household-actions,
  .data-actions {
    flex-direction: column;
  }

  .household-actions .btn,
  .data-actions .btn {
    width: 100%;
  }

  .account-footer-actions {
    flex-direction: column;
  }

  .household-switcher-pills {
    flex-direction: column;
  }

  .household-pill {
    justify-content: center;
  }

  .join-input-row {
    flex-direction: column;
  }
}

/* -------------------------------------------------------------------
   12. CHECKOUT MODAL
   ------------------------------------------------------------------- */

.checkout-modal {
  max-width: 600px;
  max-height: 85vh;
}

.checkout-items {
  max-height: 50vh;
  overflow-y: auto;
  margin: 1rem 0;
}

.checkout-item {
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.checkout-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.checkout-item-header strong {
  color: #6a4f35;
  font-size: 1.1rem;
}

.checkout-item-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.checkout-field {
  display: flex;
  flex-direction: column;
}

.checkout-field label {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.checkout-field input,
.checkout-field select {
  padding: 0.5rem;
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fff;
}

.checkout-field input:focus,
.checkout-field select:focus {
  border-color: #F1C338;
  outline: none;
  box-shadow: 0 0 0 2px rgba(241,195,56,0.2);
}

/* -------------------------------------------------------------------
   13. SETTINGS LIST (Categories & Locations)
   ------------------------------------------------------------------- */

.settings-list {
  margin: 0.75rem 0;
}

.setting-item {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.setting-item input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 6px;
  font-size: 0.9rem;
}

.setting-item input:focus {
  border-color: #F1C338;
  outline: none;
}

.btn-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f8d7da;
  border: none;
  color: #c00;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-remove:hover {
  background: #f1b0b7;
}

/* Emoji picker for category icons */
.btn-emoji-pick {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.15);
  background: #f9f9f9;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
}

.btn-emoji-pick:hover {
  border-color: #F1C338;
  background: #fff8e1;
}

.emoji-picker-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 0.5rem;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  width: 280px;
  margin-top: 4px;
}

.emoji-option {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.emoji-option:hover {
  background: #fff3cd;
}

/* Account Status Badge */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-connected {
  background: #d4edda;
  color: #155724;
}

.status-disconnected {
  background: #f8d7da;
  color: #721c24;
}

.small-text {
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.25rem;
}

/* Mobile responsive for checkout */
@media (max-width: 480px) {
  .checkout-modal {
    max-width: 95%;
    padding: 1rem;
  }

  .checkout-item-fields {
    grid-template-columns: 1fr;
  }

  .checkout-items {
    max-height: 40vh;
  }
}

/* -------------------------------------------------------------------
   14. SHOPPING LIST IMPROVEMENTS — Styles moved to shopping/shopping.css
   ------------------------------------------------------------------- */

/* -------------------------------------------------------------------
   15. RECIPE MODAL SIZE FIX
   ------------------------------------------------------------------- */

/* Overlay must fill viewport — constraints go on the content, not the overlay */
.recipe-detail-modal-content {
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
}

/* Pantry location row improvements */
.location-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.location-row select,
.location-row input {
  padding: 0.5rem;
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 6px;
  font-size: 0.9rem;
}

.location-row select.loc-name {
  flex: 2;
  min-width: 100px;
}

.location-row input.loc-qty {
  flex: 1;
  max-width: 80px;
}

.location-row input.loc-expiry {
  flex: 1.5;
}

.location-row .btn-remove {
  flex-shrink: 0;
}

/* Mobile responsive */
@media (max-width: 600px) {
  .recipe-detail-modal {
    padding: 0.5rem !important;
  }

  .recipe-detail-modal-content {
    max-width: 95vw;
    max-height: 85vh;
  }

  .location-row {
    flex-wrap: wrap;
  }

  .location-row select.loc-name {
    flex: 1 1 100%;
    margin-bottom: 0.25rem;
  }

  .location-row input.loc-qty,
  .location-row input.loc-expiry {
    flex: 1;
  }
}

/* ===================================================================
   TOAST NOTIFICATIONS
   =================================================================== */

#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 360px;
}

.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 0.9rem 0.85rem 1.1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.08);
  pointer-events: auto;
  cursor: pointer;
  overflow: hidden;
  opacity: 0;
  transform: translateX(calc(100% + 1rem));
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast-show {
  opacity: 1;
  transform: translateX(0);
}

.toast-hide {
  opacity: 0;
  transform: translateX(calc(100% + 1rem));
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-icon {
  font-size: 1rem;
  font-style: normal;
  font-weight: 700;
  flex-shrink: 0;
}

.toast-msg {
  flex: 1;
  min-width: 0;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.45;
  padding: 0 0.1rem 0 0.2rem;
  color: inherit;
  transition: opacity 0.15s;
}

.toast-close:hover {
  opacity: 1;
}

/* Progress bar — shrinks from full width to 0 over the toast duration */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  border-radius: 0 0 12px 12px;
  background: currentColor;
  opacity: 0.22;
  transform-origin: left;
  animation: toast-progress-shrink linear forwards;
}

@keyframes toast-progress-shrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

.toast:hover .toast-progress {
  animation-play-state: paused;
}

/* Color themes matching app palette */
.toast-success {
  background: #eaf2eb;
  color: #2d4a30;
  border-left: 4px solid #7a947d;
}

.toast-error {
  background: #faeae8;
  color: #6b2b27;
  border-left: 4px solid #c86b6b;
}

.toast-info {
  background: #ede9f0;
  color: #3e2f42;
  border-left: 4px solid #7d667a;
}

.toast-sync {
  background: #f0ede3;
  color: #4a3f2d;
  border-left: 4px solid #8b9376;
}

@media (max-width: 480px) {
  #toast-container {
    top: auto;
    bottom: 1rem;
    left: 0.75rem;
    right: 0.75rem;
    max-width: 100%;
  }

  .toast {
    transform: translateY(calc(100% + 1rem));
  }

  .toast-show {
    transform: translateY(0);
  }

  .toast-hide {
    transform: translateY(calc(100% + 1rem));
  }
}


/* ===================================================================
   APP BETA STRIP
   Injected below the fixed site-header on all app pages via app.js
   =================================================================== */

.app-beta-strip {
  position: sticky;
  top: 70px; /* flush below the fixed 70px site-header */
  z-index: 199;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.45rem 1rem;
  background: rgba(58, 48, 38, 0.9);
  backdrop-filter: blur(6px);
  font-size: 0.78rem;
  color: rgba(255, 252, 245, 0.9);
  text-align: center;
}

.app-beta-badge {
  background: #d4a96a;
  color: #3a2a14;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.12rem 0.5rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.app-beta-msg {
  opacity: 0.82;
}

.app-beta-link {
  color: #f0d5a0;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.app-beta-link:hover { opacity: 0.7; }

@media (max-width: 480px) {
  .app-beta-msg { display: none; }
  .app-beta-strip { top: 60px; } /* mobile header is shorter */
}

/* ===================================================================
   UPDATE AVAILABLE BANNER
   Shown at the bottom of the screen when a new SW version is ready
   =================================================================== */

.update-banner {
  position: fixed;
  bottom: 80px; /* above the bottom nav on mobile */
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--color-header-purple, #7d667a);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  font-size: 0.9rem;
  max-width: calc(100vw - 2rem);
  animation: update-banner-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.update-banner-hiding {
  animation: update-banner-out 0.3s ease forwards;
}

@keyframes update-banner-in {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes update-banner-out {
  to { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

.update-banner-msg {
  flex: 1;
  white-space: normal;
}

.update-banner-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  padding: 0.4rem 0.9rem;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.update-banner-btn:hover { background: rgba(255, 255, 255, 0.35); }

.update-banner-dismiss {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}
.update-banner-dismiss:hover { color: #fff; }

@media (max-width: 480px) {
  .update-banner {
    bottom: 72px;
    border-radius: 10px;
    font-size: 0.85rem;
    white-space: normal;
    flex-wrap: wrap;
  }
}

@media (min-width: 769px) {
  .update-banner {
    bottom: 2rem; /* no bottom nav on desktop */
  }
}
