/* ============================================================================
   BentoBoard Pro — UI/UX Pro Max Edition
   Aesthetic: "The Daily Bento" (Warm Cedarwood, Natural Sand & Tactile Bays)
   Engineered for Tablet-First Kitchen Planning & One-Handed Smartphone Workflows
   Accessibility: WCAG 2.1 AA Compliant (Contrast >= 4.5:1, Tap Targets >= 48px)
   ============================================================================ */

/* ----------------------------------------------------------------------------
   DESIGN TOKENS (CSS CUSTOM PROPERTIES)
   ---------------------------------------------------------------------------- */
:root {
  /* Color Palette — Soft Sage, Buttercream Yellow & Fresh Bento Tones */
  --bg-app: #FAF8F1;
  --bg-surface: #FFFFFF;
  --bg-surface-alt: #F2EFE4;
  --bg-surface-elevated: #FFFFFF;
  --bg-hover: #EAE5D6;

  /* Inks & Contrast (All validated WCAG 2.1 AA / AAA) */
  --text-main: #252A24;        /* Contrast 12.1:1 on #FAF8F1 */
  --text-secondary: #535A51;   /* Contrast 6.2:1 on #FFFFFF */
  --text-muted: #676D63;       /* Contrast 5.1:1 on #FFFFFF / >=4.5:1 on #F2EFE4 */
  --border-subtle: #E5E0CE;
  --border-strong: #D0C9B2;
  --focus-ring: rgba(61, 122, 90, 0.38);

  /* Primary Brand (Soft Herb Sage) */
  --primary: #3D7A5A;
  --primary-hover: #33694D;
  --primary-active: #2A5740;
  --primary-soft: #ECF6F0;
  --primary-border: #C4E2D0;

  /* Bento Compartment Colorways */
  --breakfast-bg: #FFFBEB;
  --breakfast-border: #FDE68A;
  --breakfast-text: #B45309;
  --breakfast-tag: #FEF3C7;

  --snack-bg: #FFF1F2;
  --snack-border: #FECDD3;
  --snack-text: #BE123C;
  --snack-tag: #FFE4E6;

  --lunch-bg: #F0FDFA;
  --lunch-border: #99F6E4;
  --lunch-text: #0F766E;
  --lunch-tag: #CCFBF1;

  /* Accents */
  --fav-gold: #D97706;
  --fav-bg: #FFFBEB;
  --fav-border: #FCD34D;
  --gcal-blue: #1D4ED8;
  --gcal-soft: #EFF6FF;
  --danger-red: #DC2626;
  --danger-soft: #FEE2E2;

  /* Elevation & Shadows (Offset + Soft Blur) */
  --shadow-xs: 0 1px 2px rgba(42, 37, 33, 0.04);
  --shadow-sm: 0 2px 6px -1px rgba(42, 37, 33, 0.07), 0 1px 3px rgba(42, 37, 33, 0.04);
  --shadow-md: 0 6px 16px -2px rgba(42, 37, 33, 0.09), 0 2px 6px -1px rgba(42, 37, 33, 0.05);
  --shadow-lg: 0 18px 36px -4px rgba(42, 37, 33, 0.14), 0 4px 12px -2px rgba(42, 37, 33, 0.06);

  /* Border Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Layout Metrics */
  --header-height: 72px;
  --sidebar-width: 340px;
  --mobile-nav-height: 64px;

  /* Typography */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', 'Plus Jakarta Sans', sans-serif;
}

/* ----------------------------------------------------------------------------
   BASE RESET & ACCESSIBILITY DEFAULTS
   ---------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) var(--bg-surface-alt);
}

::selection {
  background: #ECF6F0;
  color: #252A24;
}

[data-theme="dark"] ::selection {
  background: rgba(77, 154, 114, 0.35);
  color: #EFF3EE;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-surface-alt);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 2px solid var(--bg-surface-alt);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  caret-color: var(--primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: clip;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  caret-color: var(--primary);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ----------------------------------------------------------------------------
   TOP APP BAR (Tablet & Desktop Kitchen Header)
   ---------------------------------------------------------------------------- */
.pro-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.brand-badge:hover {
  transform: scale(1.03);
}

.brand-info h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

.kid-name-pill {
  font-family: var(--font-family);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 2px 9px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.kid-name-pill:hover {
  background: var(--primary);
  color: #FFFFFF;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
  gap: 0 !important;
}

.brand-subtitle > * {
  margin-right: 10px;
}

.brand-subtitle > *:last-child {
  margin-right: 0;
}

/* Week Navigator (Segmented Kitchen Pill) */
.week-navigator-pro {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  padding: 4px 8px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.week-navigator-pro > * + * {
  margin-left: 6px;
}

.week-nav-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.week-nav-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--primary);
}

.week-nav-label-box {
  position: relative;
  padding: 4px 10px;
  text-align: center;
  min-width: 145px;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.week-nav-label-box:hover,
.week-nav-label-box[aria-expanded="true"] {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}

.week-select-caret {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 2px;
}

/* Custom Bento Week Selector Popover */
.week-selector-popover {
  position: fixed;
  z-index: 180;
  width: 300px;
  max-width: calc(100vw - 24px);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.week-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-surface-alt);
  border-bottom: 1px solid var(--border-subtle);
}

.week-popover-title {
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text-main);
}

.week-popover-today-btn {
  padding: 4px 10px;
  min-height: 30px;
  border-radius: var(--radius-full);
  border: 1px solid var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.week-popover-today-btn:hover {
  background: var(--primary);
  color: #FFFFFF;
}

.week-popover-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.week-popover-list > * + * {
  margin-top: 4px;
}

.week-popover-option {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
  font-size: 0.84rem;
  font-weight: 700;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.week-popover-option:hover {
  background: var(--bg-surface-alt);
  border-color: var(--border-subtle);
}

.week-popover-option.is-selected {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--primary);
}

.week-popover-option-tag {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.week-popover-option.is-current .week-popover-option-tag {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.week-popover-option.is-selected .week-popover-option-tag {
  background: var(--bg-surface);
  color: var(--primary);
  border-color: var(--primary-border);
}

.week-range-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.week-status-chip {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: #DCFCE7;
  color: #15803D;
}

.week-status-chip.past {
  background: #F1F5F9;
  color: #64748B;
}

.week-status-chip.future {
  background: #E0F2FE;
  color: #0369A1;
}

.week-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.week-today-jump-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 32px;
  white-space: nowrap;
}

.week-today-jump-btn:hover {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--primary);
}

/* Header Action Controls */
.header-actions-pro {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-utility-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
}

.header-utility-group .btn-header-pro {
  background: transparent;
  border-color: transparent;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
}

.header-utility-group .btn-header-pro.btn-icon-only {
  min-width: 32px;
  padding: 6px;
}

.header-utility-group .btn-header-pro:hover {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}

.btn-header-pro {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  min-height: 40px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-header-pro.btn-icon-only {
  padding: 8px;
  min-width: 40px;
}

.btn-header-pro:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-header-pro.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

.btn-header-pro.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(61, 122, 90, 0.28);
}

.btn-header-pro.primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(61, 122, 90, 0.35);
}

/* ----------------------------------------------------------------------------
   MAIN WORKSPACE CONTAINER (Tablet Dual-Pane)
   ---------------------------------------------------------------------------- */
.pro-workspace {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-height));
  position: relative;
  transition: grid-template-columns 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pro-workspace.sidebar-hidden {
  grid-template-columns: minmax(0, 1fr);
}

/* ----------------------------------------------------------------------------
   LEFT PANTRY & MEAL LIBRARY DRAWER (Tablet/Desktop)
   ---------------------------------------------------------------------------- */
.pantry-sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.pro-workspace.sidebar-hidden .pantry-sidebar {
  display: none !important;
}

.pantry-top-panel {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-surface);
}

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

.pantry-title-row h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.meal-count-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg-surface-alt);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.pantry-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.pantry-search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.pantry-search-input {
  width: 100%;
  padding: 10px 32px 10px 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-alt);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.15s ease;
}

.pantry-search-input:focus {
  background: var(--bg-surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.pantry-search-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  display: none;
}

/* Category Filter Chips */
.pantry-filter-pills {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.pantry-pill {
  padding: 6px 4px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.pantry-pill:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}

.pantry-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
}

.pantry-pill[data-filter="favorites"].active {
  background: var(--fav-gold);
  border-color: #B45309;
  color: #FFFFFF;
}

.drag-tip-bar {
  font-size: 0.74rem;
  color: var(--text-muted);
  background: var(--bg-surface-alt);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px dashed var(--border-subtle);
}

/* Scrollable Meal Cards List in Pantry */
.pantry-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Draggable Meal Card (Pantry Item) */
.pantry-meal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-xs);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pantry-meal-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}

.pantry-meal-card:active {
  cursor: grabbing;
  opacity: 0.75;
  transform: scale(0.99);
}

.pantry-meal-card.is-favorite {
  border-color: var(--fav-border);
  background: linear-gradient(135deg, var(--fav-bg) 0%, var(--bg-surface) 50%);
}

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

.meal-title-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.card-food-icon {
  font-size: 1.25rem;
  line-height: 1.1;
  flex-shrink: 0;
}

.card-meal-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.card-meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.slot-tag {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
}

.slot-tag.Breakfast {
  background: var(--breakfast-bg);
  color: var(--breakfast-text);
  border: 1px solid var(--breakfast-border);
}

.slot-tag.Snack {
  background: var(--snack-bg);
  color: var(--snack-text);
  border: 1px solid var(--snack-border);
}

.slot-tag.Lunch {
  background: var(--lunch-bg);
  color: var(--lunch-text);
  border: 1px solid var(--lunch-border);
}

.slot-tag.Any {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.fav-badge-chip {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--fav-gold);
  background: var(--fav-bg);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.card-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-subtle);
}

.btn-pantry-action {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-pantry-action:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}

/* ----------------------------------------------------------------------------
   CENTER CALENDAR STAGE (Kitchen 5-Day Bento Board)
   ---------------------------------------------------------------------------- */
.calendar-stage-pro {
  padding: 24px 28px 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  background-color: var(--bg-app);
}

/* Top Day Filter & Quick Stats */
.stage-control-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  box-shadow: var(--shadow-xs);
}

.day-filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip-btn {
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  min-height: 36px;
}

.filter-chip-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-chip-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(61, 122, 90, 0.28);
}

.filter-chip-btn.today-highlight {
  border-color: rgba(61, 122, 90, 0.35);
  color: var(--primary);
  background: var(--primary-soft);
}

.filter-chip-btn.today-highlight.active {
  background: var(--primary);
  color: #FFFFFF;
}

.stage-stats-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-pill {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stat-pill strong {
  color: var(--text-main);
  font-weight: 800;
}

/* Weekly 5-Day Bento Board */
.bento-board-table {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.bento-header-row {
  display: grid;
  grid-template-columns: 88px repeat(3, minmax(0, 1fr)) minmax(200px, 0.95fr);
  background: var(--bg-surface-alt);
  border-bottom: 2px solid var(--border-subtle);
}

.bento-col-header {
  padding: 14px 16px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-right: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.bento-col-header:last-child {
  border-right: none;
}

.bento-col-header.col-breakfast {
  color: var(--breakfast-text);
  background: var(--breakfast-bg);
}

.bento-col-header.col-snack {
  color: var(--snack-text);
  background: var(--snack-bg);
}

.bento-col-header.col-lunch {
  color: var(--lunch-text);
  background: var(--lunch-bg);
}

.slot-time-badge {
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.85;
  text-transform: none;
}

/* Day Rows in Bento Board */
.bento-day-row {
  display: grid;
  grid-template-columns: 88px repeat(3, minmax(0, 1fr)) minmax(200px, 0.95fr);
  border-bottom: 1px solid var(--border-subtle);
  min-height: 120px;
  transition: background-color 0.15s ease;
}

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

.bento-day-row.is-today {
  background: rgba(234, 179, 8, 0.06);
  box-shadow: inset 0 0 0 1.5px rgba(234, 179, 8, 0.32);
}

.bento-day-row.is-collapsed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 6px 14px;
  background: var(--bg-surface-alt);
}

.bento-day-row.is-past-day.is-collapsed {
  opacity: 0.78;
}

.bento-day-row.is-past-day.is-collapsed:hover {
  opacity: 1;
}

.bento-day-row.is-collapsed .bento-bay-cell,
.bento-day-row.is-collapsed .day-notes-cell-pro,
.bento-day-row.is-collapsed .day-header-events,
.bento-day-row.is-collapsed .btn-day-add-event {
  display: none;
}

.bento-day-row.is-collapsed .day-block-cell {
  width: 100%;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border-right: none;
  border-bottom: none;
  padding: 0;
  background: transparent;
  gap: 12px;
}

.bento-day-row.is-collapsed .day-badge-stack {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.day-past-summary {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 12px;
  margin-right: auto;
}

.btn-toggle-past-day {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-toggle-past-day:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

/* Day Column Badge (Stacked MON / Date / Today) */
.day-block-cell {
  padding: 12px 8px;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-alt);
  min-width: 0;
}

.bento-day-row.is-today .day-block-cell {
  border-left: 4px solid var(--primary);
  background: #FDF5F0;
}

.day-badge-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
}

.day-letter-box {
  width: 54px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #ECE5DA;
  border: 1px solid #DCD3C5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-main);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6), var(--shadow-xs);
  flex-shrink: 0;
}

.bento-day-row.is-today .day-letter-box {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(61, 122, 90, 0.35);
}

.day-text-stack {
  display: flex;
  flex-direction: column;
}

.day-name-heading {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.day-date-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}

.today-indicator-pill {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #FFFFFF;
  width: fit-content;
}

.day-cell-sync-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  min-height: 28px;
  margin-top: 10px;
}

.day-cell-sync-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}

.day-cell-sync-btn.synced {
  background: #DCFCE7;
  border-color: #86EFAC;
  color: #166534;
}

/* Bento Compartment Cell (Breakfast / Snack / Lunch) */
.bento-bay-cell {
  padding: 10px 10px;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  min-width: 0;
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.bento-bay-cell > * + * {
  margin-top: 8px;
}

.bento-bay-cell[data-slot="Breakfast"] {
  background: var(--breakfast-bg);
}

.bento-bay-cell[data-slot="Snack"] {
  background: var(--snack-bg);
}

.bento-bay-cell[data-slot="Lunch"] {
  background: var(--lunch-bg);
}

.bento-bay-cell.drag-over {
  background: var(--primary-soft) !important;
  box-shadow: inset 0 0 0 2px var(--primary);
  border-radius: var(--radius-sm);
}

/* Placed Meal Card in Bento Bay */
.placed-bento-card {
  background: var(--bg-surface);
  border: 1px solid rgba(42, 37, 33, 0.12);
  border-radius: var(--radius-md);
  padding: 10px 10px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0;
  cursor: grab;
  position: relative;
  min-width: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.placed-bento-card > * + * {
  margin-top: 5px;
}

.placed-bento-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.placed-bento-card.is-favorite {
  background: linear-gradient(135deg, var(--fav-bg) 0%, var(--bg-surface) 60%);
  border-color: var(--fav-border);
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.12);
}

.placed-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0;
  min-width: 0;
}

.placed-card-header > * + * {
  margin-left: 4px;
}

.placed-card-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  display: flex;
  align-items: flex-start;
  gap: 0;
  flex: 1;
  min-width: 0;
  word-break: normal;
  overflow-wrap: break-word;
}

.placed-card-title > * + * {
  margin-left: 5px;
}

.placed-controls-bar {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.placed-controls-bar > * + * {
  margin-left: 2px;
}

.btn-card-ctrl {
  background: transparent;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-card-ctrl:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.btn-card-ctrl.fav-star.active {
  color: var(--fav-gold);
}

.btn-card-ctrl.remove:hover {
  background: var(--danger-soft);
  color: var(--danger-red);
}

.placed-card-subtext {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Empty Drop Target Prompt */
.empty-slot-placeholder {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  transition: all 0.15s ease;
}

.empty-slot-placeholder:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(61, 122, 90, 0.05);
}

/* Day Notes & Prep Instructions Cell */
.day-notes-cell-pro {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-surface);
  min-width: 0;
  overflow: hidden;
}

.day-notes-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 110px;
}

.day-note-bubble {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.day-note-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.day-note-quick-field {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  background: var(--bg-surface-alt);
  outline: none;
}

.day-note-quick-field:focus {
  background: var(--bg-surface);
  border-color: var(--primary);
}

.btn-add-quick-note {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ----------------------------------------------------------------------------
   MOBILE BOTTOM NAVIGATION & ON-THE-GO CONTROLS (< 768px)
   ---------------------------------------------------------------------------- */
.mobile-nav-bar-pro {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  z-index: 60;
  align-items: center;
  justify-content: space-around;
  padding: 0 12px env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 16px rgba(42, 37, 33, 0.08);
}

.mobile-nav-item-btn {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  min-height: 48px;
  min-width: 54px;
  transition: all 0.15s ease;
}

.mobile-nav-item-btn.active {
  color: var(--primary);
}

.mobile-fab-add {
  display: none;
  position: fixed;
  right: 16px;
  bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 14px);
  z-index: 65;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(61, 122, 90, 0.38);
  cursor: pointer;
  border: 2px solid var(--bg-surface);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mobile-fab-add:active {
  transform: scale(0.95);
}

/* Mobile Sticky Weekday Pill Strip */
.mobile-day-selector-strip {
  display: none;
  padding: 10px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  gap: 8px;
  overflow-x: auto;
  position: sticky;
  top: var(--header-height);
  z-index: 40;
  -webkit-overflow-scrolling: touch;
}

.mobile-day-pill-card {
  flex: 1;
  min-width: 58px;
  text-align: center;
  padding: 8px 4px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  min-height: 48px;
}

.mobile-day-pill-card.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(61, 122, 90, 0.3);
}

.mobile-day-pill-card.active .mobile-pill-date {
  color: rgba(255, 255, 255, 0.85);
}

.mobile-pill-name {
  font-size: 0.82rem;
  font-weight: 800;
}

.mobile-pill-date {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ----------------------------------------------------------------------------
   RESPONSIVE MEDIA QUERIES (TABLET & SMARTPHONE)
   ---------------------------------------------------------------------------- */

/* Compact Kiosk & Tablet Widths (<= 1180px) */
@media (max-width: 1180px) {
  .brand-subtitle,
  .week-status-chip {
    display: none;
  }

  .pro-header {
    padding: 6px 10px;
    gap: 6px;
  }

  .brand-section {
    gap: 8px;
  }

  .brand-badge {
    width: 34px;
    height: 34px;
  }

  .brand-info h1 {
    font-size: 0.96rem;
    gap: 6px;
  }

  .kid-name-pill {
    font-size: 0.68rem;
    padding: 2px 7px;
  }

  .workspace-tabs-pill {
    padding: 3px;
    gap: 2px;
  }

  .workspace-tab-btn,
  .btn-header-pro {
    padding: 5px 8px;
    font-size: 0.75rem;
    min-height: 34px;
    gap: 4px;
  }

  .btn-header-pro.btn-icon-only {
    padding: 5px;
    min-width: 34px;
  }

  .week-navigator-pro {
    padding: 3px 5px;
    gap: 3px;
  }

  .week-nav-btn {
    width: 30px;
    height: 30px;
  }

  .week-today-jump-btn {
    padding: 4px 8px;
    font-size: 0.74rem;
    min-height: 30px;
  }

  .week-nav-label-box {
    min-width: 82px;
    padding: 0 3px;
  }

  .week-range-title {
    font-size: 0.78rem;
  }
}

/* Tablet Landscape & Portrait (768px – 1024px) */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 280px;
  }

  .bento-header-row,
  .bento-day-row {
    grid-template-columns: 78px repeat(3, minmax(0, 1fr)) minmax(185px, 0.95fr);
  }

  .calendar-stage-pro {
    padding: 14px 16px 80px;
  }
}

/* Smartphone Mode (< 768px) */
@media (max-width: 768px) {
  .pro-header {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    max-width: 100vw;
  }

  .brand-section {
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .brand-badge {
    width: 36px;
    height: 36px;
  }

  .brand-info h1 {
    font-size: 1.05rem;
    flex-wrap: wrap;
    gap: 6px;
  }

  .brand-subtitle-text {
    display: none;
  }

  .header-actions-pro {
    flex-shrink: 0;
  }

  .week-navigator-pro {
    display: none; /* Mobile uses the day pill strip instead */
  }

  #events-cal-header-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    padding: 3px 6px;
  }

  .header-actions-pro .btn-header-pro:not(.primary):not(#btn-pin-lock-toggle),
  .header-actions-pro .btn-header-pro.primary {
    display: none;
  }

  .header-utility-group {
    background: transparent;
    border: none;
    padding: 0;
  }

  .events-hero-actions {
    width: 100%;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .events-hero-actions .btn-header-pro {
    flex: 1 1 0;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-day-selector-strip {
    display: flex;
  }

  .mobile-nav-bar-pro {
    display: flex;
  }

  .mobile-fab-add {
    display: flex;
  }

  body.mobile-meals-open .mobile-day-selector-strip {
    display: none;
  }

  .pro-workspace,
  .pro-workspace.sidebar-hidden {
    grid-template-columns: 1fr;
  }

  .goals-right-sidebar {
    display: none !important;
  }

  .pantry-sidebar {
    position: fixed;
    inset: var(--header-height) 0 calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px)) 0;
    z-index: 55;
    height: auto;
    border-right: none;
    display: none;
  }

  .pantry-sidebar.mobile-open,
  .pro-workspace.sidebar-hidden .pantry-sidebar.mobile-open {
    display: flex !important;
  }

  .calendar-stage-pro {
    padding: 12px 14px calc(var(--mobile-nav-height) + 40px);
  }

  .stage-control-strip {
    display: none;
  }

  .bento-header-row {
    display: none;
  }

  /* Single Day Stack on Phone */
  .bento-day-row {
    grid-template-columns: 1fr;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }

  .day-block-cell {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 14px;
  }

  .day-header-events {
    width: auto;
    flex: 1;
    min-width: 150px;
  }

  .day-cell-sync-btn {
    margin-top: 0;
  }

  .bento-bay-cell {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 14px;
  }

  .bento-bay-cell::before {
    content: attr(data-slot-label);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 4px;
  }

  .day-notes-cell-pro {
    padding: 14px;
  }
}

/* Modals & Dialogs */
.pro-modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  background: rgba(42, 37, 33, 0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pro-modal-backdrop.open {
  display: flex;
}

.pro-modal-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.pro-modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pro-modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.pro-modal-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pro-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-alt);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.pro-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.pro-form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pro-form-input,
.pro-form-select,
.pro-form-textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-alt);
  font-size: 0.94rem;
  line-height: 1.4;
  color: var(--text-main);
  outline: none;
  transition: all 0.15s ease;
  min-height: 46px;
  box-sizing: border-box;
}

.pro-form-textarea {
  min-height: 88px;
  resize: vertical;
}

.pro-form-input:focus,
.pro-form-select:focus,
.pro-form-textarea:focus {
  background: var(--bg-surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.pro-form-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 14px;
}

@media (max-width: 480px) {
  .pro-form-row {
    grid-template-columns: 1fr;
  }
}

.checkbox-label-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}

.checkbox-label-row:hover {
  background: var(--fav-bg);
  border-color: var(--fav-border);
}

.checkbox-label-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--fav-gold);
  cursor: pointer;
}

.btn-modal-cancel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 40px;
}

.btn-modal-cancel:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.btn-modal-save {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #FFFFFF;
  padding: 8px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(61, 122, 90, 0.28);
  min-height: 40px;
}

.btn-modal-save:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(61, 122, 90, 0.35);
}

/* ----------------------------------------------------------------------------
   TAP-TO-PLACE ACTIVE FLOATING BANNER
   ---------------------------------------------------------------------------- */
.placing-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #FEF3C7;
  border: 1.5px solid #F59E0B;
  color: #92400E;
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: pulseBanner 2s infinite ease-in-out;
}

@keyframes pulseBanner {
  0%, 100% { box-shadow: 0 2px 10px rgba(245, 158, 11, 0.2); }
  50% { box-shadow: 0 4px 18px rgba(245, 158, 11, 0.4); }
}

.placing-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 700;
}

.placing-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #D97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.3);
  animation: pingDot 1.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes pingDot {
  75%, 100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.btn-cancel-placing {
  background: rgba(146, 64, 14, 0.12);
  border: 1px solid rgba(146, 64, 14, 0.25);
  color: #92400E;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-cancel-placing:hover {
  background: rgba(146, 64, 14, 0.2);
}

/* ----------------------------------------------------------------------------
   DARK MODE THEME ("Warm Cedar Night")
   ---------------------------------------------------------------------------- */
[data-theme="dark"] {
  --bg-app: #121512;
  --bg-surface: #1A1E1A;
  --bg-surface-alt: #222721;
  --bg-surface-elevated: #272D26;
  --bg-hover: #2E362C;

  --text-main: #EFF3EE;
  --text-secondary: #C2CBC0;
  --text-muted: #ABB5A8;
  --border-subtle: #313930;
  --border-strong: #444F42;
  --focus-ring: rgba(77, 154, 114, 0.45);

  --primary: #4D9A72;
  --primary-hover: #5CAD83;
  --primary-active: #3D7A5A;
  --primary-soft: rgba(77, 154, 114, 0.18);
  --primary-border: rgba(77, 154, 114, 0.4);

  --breakfast-bg: #262216;
  --breakfast-border: #5E4E22;
  --breakfast-text: #FCD34D;
  --breakfast-tag: #3F3618;

  --snack-bg: #29181D;
  --snack-border: #6B283A;
  --snack-text: #FDA4AF;
  --snack-tag: #421C27;

  --lunch-bg: #152524;
  --lunch-border: #23534F;
  --lunch-text: #5EEAD4;
  --lunch-tag: #183C39;

  --fav-gold: #FBBF24;
  --fav-bg: #2A2213;
  --fav-border: #785A1D;
  --gcal-blue: #60A5FA;
  --gcal-soft: rgba(59, 130, 246, 0.15);
  --danger-red: #F87171;
  --danger-soft: rgba(239, 68, 68, 0.16);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 6px -1px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 16px -2px rgba(0, 0, 0, 0.55), 0 2px 6px -1px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 36px -4px rgba(0, 0, 0, 0.7), 0 4px 12px -2px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .day-letter-box {
  background: #332C26;
  border-color: #4A4037;
  box-shadow: none;
}

[data-theme="dark"] .bento-day-row.is-today {
  background: rgba(234, 179, 8, 0.06);
  box-shadow: inset 0 0 0 1.5px rgba(234, 179, 8, 0.35);
}

[data-theme="dark"] .bento-day-row.is-today .day-block-cell {
  background: #252418;
}

[data-theme="dark"] .week-status-chip {
  background: rgba(34, 197, 94, 0.18);
  color: #86EFAC;
}

[data-theme="dark"] .week-status-chip.past {
  background: rgba(148, 163, 184, 0.16);
  color: #CBD5E1;
}

[data-theme="dark"] .week-status-chip.future {
  background: rgba(56, 189, 248, 0.18);
  color: #7DD3FC;
}

[data-theme="dark"] .placed-bento-card {
  border-color: var(--border-subtle);
}

[data-theme="dark"] .placing-banner {
  background: #362812;
  border-color: #D97706;
  color: #FDE68A;
}

[data-theme="dark"] .btn-cancel-placing {
  background: rgba(253, 230, 138, 0.12);
  border-color: rgba(253, 230, 138, 0.3);
  color: #FDE68A;
}

/* ----------------------------------------------------------------------------
   WORKSPACE MODE SWITCHER (Meal Planner vs Family Events)
   ---------------------------------------------------------------------------- */
.workspace-tabs-pill {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 4px;
  gap: 0;
}

.workspace-tabs-pill > * + * {
  margin-left: 4px;
}

.workspace-tab-btn {
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: 36px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.workspace-tab-btn > * + * {
  margin-left: 6px;
}

.workspace-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.workspace-tab-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

/* ----------------------------------------------------------------------------
   FOCUS MODE (Kitchen Counter Distraction-Free View)
   ---------------------------------------------------------------------------- */
body.focus-mode .pro-header,
body.focus-mode .pantry-sidebar,
body.focus-mode:not(.focus-events-mode) .goals-right-sidebar,
body.focus-mode .stage-control-strip,
body.focus-mode .mobile-day-selector-strip,
body.focus-mode .mobile-nav-bar-pro,
body.focus-mode .mobile-fab-add {
  display: none !important;
}

body.focus-mode .pro-workspace {
  grid-template-columns: minmax(0, 1fr) !important;
  min-height: 100vh;
}

body.focus-mode .calendar-stage-pro {
  padding-top: 16px;
}

body.focus-mode .bento-col-header {
  padding: 16px 18px;
  font-size: 0.94rem;
}

.bento-col-header-events {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

body.focus-mode .bento-header-row {
  grid-template-columns: 96px repeat(3, minmax(0, 1fr));
}

body.focus-mode .bento-header-row .bento-col-header:last-child {
  display: none;
}

body.focus-mode .bento-day-row {
  grid-template-columns: 96px repeat(3, minmax(0, 1fr));
  min-height: 220px;
}

body.focus-mode .day-letter-box {
  width: 68px;
  height: 40px;
  font-size: 1.08rem;
}

body.focus-mode .day-date-sub {
  font-size: 0.88rem;
  font-weight: 700;
}

body.focus-mode .today-indicator-pill {
  font-size: 0.76rem;
  padding: 4px 10px;
}

body.focus-mode .bento-bay-cell {
  padding: 14px;
  gap: 0;
}

body.focus-mode .bento-bay-cell > * + * {
  margin-top: 10px;
}

body.focus-mode .placed-bento-card {
  padding: 14px 16px;
}

body.focus-mode .placed-card-emoji {
  font-size: 1.5rem;
}

body.focus-mode .placed-card-name {
  font-size: 1.04rem;
}

body.focus-mode .placed-card-note {
  font-size: 0.86rem;
}

body.focus-mode .btn-card-ctrl {
  width: 36px;
  height: 36px;
}

body.focus-mode .btn-assign-slot,
body.focus-mode .empty-bay-btn,
body.focus-mode .btn-slot-add-more,
body.focus-mode .btn-slot-copy {
  min-height: 44px;
  padding: 10px 14px;
  font-size: 0.9rem;
}

body.focus-mode .day-notes-cell-pro {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border-subtle);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px 20px;
  align-items: start;
}

body.focus-mode .day-events-cell-group {
  grid-column: 1;
  grid-row: 1 / span 2;
}

body.focus-mode .day-notes-feed {
  grid-column: 2;
  max-height: none;
}

body.focus-mode .day-note-input-row {
  grid-column: 2;
}

body.focus-mode .day-header-events {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}

@media (max-width: 768px) {
  body.focus-mode .bento-day-row {
    grid-template-columns: 1fr;
  }

  body.focus-mode .day-notes-cell-pro {
    grid-template-columns: 1fr;
  }

  body.focus-mode .day-events-cell-group,
  body.focus-mode .day-notes-feed,
  body.focus-mode .day-note-input-row {
    grid-column: 1;
    grid-row: auto;
  }
}

body.focus-mode .day-event-pill {
  padding: 10px 12px;
  font-size: 0.96rem;
}

body.focus-mode .day-event-badge {
  font-size: 0.82rem;
}

body.focus-mode .day-event-title {
  font-size: 0.98rem;
}

body.focus-mode .btn-day-add-event {
  min-height: 42px;
  padding: 8px 14px;
  font-size: 0.84rem;
}

body.focus-mode .day-note-bubble {
  padding: 10px 12px;
  font-size: 0.88rem;
}

body.focus-mode .day-note-quick-field {
  min-height: 44px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

body.focus-mode .btn-add-quick-note {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 0.88rem;
}

@media (min-width: 769px) and (max-width: 1440px) {
  .pro-header {
    padding: 6px 12px;
    gap: 6px;
    flex-wrap: wrap;
  }

  .brand-section {
    flex-shrink: 0;
    gap: 8px;
  }

  .brand-badge {
    width: 36px;
    height: 36px;
  }

  .brand-info h1 {
    font-size: 1.02rem;
    gap: 5px;
  }

  .kid-name-pill {
    font-size: 0.66rem;
    padding: 2px 6px;
  }

  .brand-subtitle {
    flex-wrap: nowrap !important;
    gap: 5px !important;
  }

  .header-clock-pill,
  .header-weather-pill,
  .header-sync-pill {
    font-size: 0.66rem;
  }

  .workspace-tabs-pill {
    padding: 3px;
    gap: 2px;
  }

  .workspace-tab-btn {
    padding: 5px 8px;
    font-size: 0.75rem;
    gap: 4px;
    min-height: 32px;
  }

  .week-navigator-pro {
    padding: 3px 5px;
    gap: 3px;
  }

  .week-nav-btn {
    width: 30px;
    height: 30px;
  }

  .week-nav-label-box {
    min-width: 96px;
    padding: 0 3px;
  }

  .week-range-title {
    font-size: 0.78rem;
    gap: 4px;
  }

  .week-today-jump-btn {
    padding: 4px 6px;
    font-size: 0.72rem;
    min-height: 28px;
  }

  .header-actions-pro {
    gap: 5px;
  }

  .btn-header-pro {
    padding: 5px 8px;
    font-size: 0.75rem;
    min-height: 34px;
    gap: 4px;
  }
}

/* Tablet Kiosk Ergonomics (768px – 1280px) */
@media (min-width: 768px) and (max-width: 1280px) {
  .bento-day-row {
    min-height: 148px;
  }

  .placed-bento-card {
    padding: 11px 13px;
  }

  .placed-card-name {
    font-size: 0.94rem;
  }

  .btn-card-ctrl {
    width: 32px;
    height: 32px;
  }

  .btn-slot-add-more,
  .btn-slot-copy,
  .btn-assign-slot,
  .empty-bay-btn {
    min-height: 38px;
    font-size: 0.84rem;
  }

  .day-note-quick-field,
  .btn-add-quick-note {
    min-height: 38px;
    font-size: 0.84rem;
  }

  .btn-day-add-event {
    min-height: 38px;
    font-size: 0.8rem;
  }
}

#focus-mode-floating-bar {
  display: none;
  position: sticky;
  top: 12px;
  margin: 14px auto 0;
  width: fit-content;
  max-width: calc(100vw - 24px);
  z-index: 90;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  padding: 6px 10px 6px 16px;
  box-shadow: var(--shadow-lg);
  align-items: center;
  gap: 10px;
}

body.focus-mode #focus-mode-floating-bar {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
}

/* Events Focus Mode */
.focus-events-view-pills {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px;
  gap: 0;
}

.focus-events-view-pills > * + * {
  margin-left: 2px;
}

.focus-events-view-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.focus-events-view-btn.active {
  background: var(--primary);
  color: #ffffff;
}

body.focus-mode.focus-events-mode .family-events-stage {
  padding-top: 14px;
  max-width: 1440px;
}

body.focus-mode.focus-events-mode .events-hero-bar,
body.focus-mode.focus-events-mode .events-cal-toolbar {
  display: none !important;
}

body.focus-mode.focus-events-mode .events-layout-grid,
body.focus-mode.focus-events-mode .events-layout-grid.calendar-expanded {
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

body.focus-mode.focus-events-mode .events-feed-card {
  padding: 18px 20px;
}

body.focus-mode.focus-events-mode .events-week-col {
  min-height: 210px;
  padding: 12px 13px;
}

body.focus-mode.focus-events-mode .events-week-col.is-today {
  border-width: 2px;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

body.focus-mode.focus-events-mode .events-cal-chip {
  font-size: 0.84rem;
  padding: 6px 8px;
}

body.focus-mode.focus-events-mode .events-month-cell {
  min-height: 120px;
}

@media (max-width: 767px) {
  body.focus-mode #focus-mode-floating-bar {
    flex-wrap: wrap;
    border-radius: var(--radius-lg);
    padding: 8px 12px;
  }
}

.focus-bar-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-right: 8px;
  border-right: 1px solid var(--border-subtle);
}

.focus-bar-clock {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
}

.focus-bar-weather {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.focus-bar-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.focus-bar-day-label {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--primary);
  padding: 0 6px;
  white-space: nowrap;
}

/* ----------------------------------------------------------------------------
   FAMILY EVENTS VIEW (Separate Calendar Event Creator)
   ---------------------------------------------------------------------------- */
.family-events-stage {
  display: none;
  flex: 1;
  padding: 24px 28px 96px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.family-events-stage.active {
  display: block;
}

.events-hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.events-hero-bar h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}

.events-hero-bar p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.events-layout-grid {
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.events-layout-grid.calendar-expanded {
  grid-template-columns: minmax(0, 6fr) minmax(240px, 2fr);
  gap: 20px;
  align-items: start;
}

.events-layout-grid.calendar-expanded .events-feed-card {
  order: 0;
}

@media (max-width: 900px) {
  .events-layout-grid,
  .events-layout-grid.calendar-expanded {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .family-events-stage {
    padding: 16px 14px calc(var(--mobile-nav-height) + 40px);
  }
  .workspace-tabs-pill {
    display: none;
  }
}

.event-composer-card,
.events-feed-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  width: 100%;
}

.event-composer-card h3,
.events-feed-card h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.events-cal-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.events-cal-title-row,
.events-cal-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.events-cal-nav-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-cal-nav,
.btn-cal-today {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-alt);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-cal-nav:hover,
.btn-cal-today:hover {
  background: var(--bg-hover);
}

.events-cal-range-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  min-width: 120px;
  text-align: center;
}

.events-cal-view-pills {
  display: inline-flex;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.events-view-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.events-view-btn.active {
  background: var(--primary);
  color: #fff;
}

.events-calendar-mount {
  margin-bottom: 16px;
}

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

@media (max-width: 680px) {
  .events-week-grid {
    grid-template-columns: 1fr;
  }
}

.events-week-col {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 6px;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.events-week-col:hover,
.events-month-cell:hover {
  border-color: var(--primary);
}

.events-week-col.is-selected,
.events-month-cell.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.events-week-col.is-today,
.events-month-cell.is-today {
  background: var(--primary-soft);
}

.events-week-col-head {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-secondary);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
}

.events-week-col-head strong {
  font-size: 0.92rem;
  color: var(--text-main);
}

.events-cell-add-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.events-cell-add-btn:hover {
  opacity: 1;
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
}

.events-month-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.events-month-head-row .events-cell-add-btn {
  position: static;
  width: 20px;
  height: 20px;
  font-size: 0.85rem;
}

.event-span-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  font-size: 0.68rem;
  font-weight: 700;
}

.events-chip-span-badge {
  font-weight: 800;
  opacity: 0.85;
  margin-right: 4px;
}

.events-month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 4px;
}

.events-month-weekday {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 4px 0;
}

.events-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.events-month-cell {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 4px;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  min-width: 0;
}

.events-month-cell.is-outside {
  opacity: 0.45;
}

.events-month-day-num {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-main);
}

.events-month-dots {
  display: none;
}

.events-month-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

@media (max-width: 640px) {
  .events-week-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .events-week-col {
    min-height: auto;
    padding: 10px 12px;
    gap: 6px;
  }

  .events-week-col-head {
    flex-direction: row;
    justify-content: flex-start;
    gap: 8px;
    font-size: 0.82rem;
    padding-bottom: 6px;
  }

  .events-month-cell {
    min-height: 48px;
    align-items: center;
    padding: 6px 2px;
  }

  .events-month-cell .events-cal-chip,
  .events-month-cell .events-month-extra {
    display: none;
  }

  .events-month-cell .events-month-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    margin-top: 2px;
  }
}

.events-cal-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 0.84rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.events-day-selected-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.quick-template-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.quick-tpl-btn {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 34px;
}

.quick-tpl-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.event-form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.event-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.event-submit-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.event-secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.events-list-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.events-list-stack > * + * {
  margin-top: 12px;
}

.event-item-card {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color 0.15s ease;
}

.event-item-card > * + * {
  margin-top: 8px;
}

.event-item-card:hover {
  border-color: var(--border-strong);
}

.event-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0;
}

.event-item-top > * + * {
  margin-left: 10px;
}

.event-item-title {
  font-size: 1.06rem;
  font-weight: 800;
  color: var(--text-main);
}

.event-item-meta {
  font-size: 0.86rem;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: center;
  margin-top: 4px;
}

.event-item-meta > span {
  margin-right: 12px;
  margin-bottom: 2px;
}

.event-tag-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.event-sync-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--lunch-bg);
  color: var(--lunch-text);
  border: 1px solid var(--lunch-border);
}

.event-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
}

.event-item-actions > * {
  margin-right: 8px;
  margin-bottom: 4px;
}

.event-item-actions > *:last-child {
  margin-right: 0;
}

/* ----------------------------------------------------------------------------
   SETTINGS, INTEGRATIONS & TOASTS
   ---------------------------------------------------------------------------- */
.pro-modal-card.wide {
  max-width: 620px;
}

.settings-section-card {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-section-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.settings-helper-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.code-snippet-box {
  background: #18181B;
  color: #E4E4E7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  max-height: 170px;
  border: 1px solid #3F3F46;
}

.sync-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  display: inline-block;
}

.bento-toast-container {
  position: fixed;
  bottom: calc(var(--mobile-nav-height) + 20px);
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.bento-toast {
  pointer-events: auto;
  background: var(--text-main);
  color: var(--bg-app);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastSlideIn 0.2s ease-out;
}

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

/* ----------------------------------------------------------------------------
   QUICK ASSIGN MEAL MODAL
   ---------------------------------------------------------------------------- */
.assign-modal-card {
  max-width: 520px;
}

.assign-modal-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 600;
}

.assign-modal-body {
  gap: 12px;
}

.assign-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assign-filter-pills .pantry-pill {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.assign-meal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

.assign-meal-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.assign-meal-row .assign-meal-option {
  flex: 1;
  min-width: 0;
}

.assign-meal-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.btn-assign-row-ctrl {
  width: 42px;
  min-height: 44px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.14s ease;
}

.btn-assign-row-ctrl:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.btn-assign-row-ctrl.fav-star.active {
  color: var(--fav-gold);
  border-color: var(--fav-border);
  background: var(--fav-bg);
}

.btn-assign-row-ctrl.danger:hover {
  border-color: var(--danger-red);
  background: var(--danger-soft);
  color: var(--danger-red);
}

.placed-bento-card {
  cursor: pointer;
}

.assign-meal-option {
  width: 100%;
  text-align: left;
  background: var(--bg-surface-alt);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: all 0.14s ease;
  color: var(--text-main);
  font-family: inherit;
}

.assign-meal-option:hover,
.assign-meal-option:focus-visible {
  border-color: var(--accent-coral);
  background: var(--accent-coral-soft);
  transform: translateY(-1px);
  outline: none;
}

.assign-meal-option-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.assign-meal-emoji {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}

.assign-meal-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.assign-meal-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  overflow-wrap: break-word;
}

.assign-meal-note {
  font-size: 0.74rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assign-meal-option-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.assign-meal-cat-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.assign-meal-fav {
  color: #F59E0B;
  font-size: 0.9rem;
  line-height: 1;
}

.assign-empty-state {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.assign-modal-footer {
  justify-content: space-between;
}

.btn-assign-create {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--accent-coral);
  background: var(--accent-coral-soft);
  color: var(--accent-coral-dark);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-assign-create:hover {
  background: var(--accent-coral);
  color: #FFFFFF;
}

[data-theme="dark"] .btn-assign-create {
  color: #FDBA74;
}

[data-theme="dark"] .btn-assign-create:hover {
  color: #18181B;
}

/* ----------------------------------------------------------------------------
   EMPTY SLOT COPY BUTTON & COPY MODAL
   ---------------------------------------------------------------------------- */
.empty-slot-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.empty-slot-actions .empty-slot-placeholder {
  flex: 1;
  min-height: 40px;
  padding: 8px;
}

.btn-slot-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.14s ease;
}

.btn-slot-copy:hover {
  border-color: var(--accent-coral);
  color: var(--accent-coral-dark);
  background: var(--accent-coral-soft);
}

[data-theme="dark"] .btn-slot-copy:hover {
  color: #FDBA74;
}

.workspace-tabs-pill.copy-source-tabs {
  display: flex;
  width: 100%;
  padding: 4px;
}

.workspace-tabs-pill.copy-source-tabs .workspace-tab-btn {
  flex: 1;
  justify-content: center;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.slot-tag.Side {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

[data-theme="dark"] .slot-tag.Side {
  background: rgba(16, 185, 129, 0.2);
  color: #6EE7B7;
}

.btn-slot-add-more {
  margin-top: 6px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.14s ease;
}

.btn-slot-add-more:hover {
  border-color: var(--accent-coral);
  color: var(--accent-coral-dark);
  background: var(--accent-coral-soft);
}

[data-theme="dark"] .btn-slot-add-more:hover {
  color: #FDBA74;
}

/* ----------------------------------------------------------------------------
   MOBILE ADD TO DAY & COMPARTMENT MODAL
   ---------------------------------------------------------------------------- */
.place-day-section-label {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.place-day-pills {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.place-day-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-surface-alt);
  color: var(--text-main);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.14s ease;
}

.place-day-pill-name {
  font-size: 0.78rem;
  font-weight: 800;
}

.place-day-pill-date {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.place-day-pill.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #FFFFFF;
}

.place-day-pill.active .place-day-pill-date {
  color: rgba(255, 255, 255, 0.9);
}

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

.place-slot-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-surface-alt);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.14s ease;
}

.place-slot-btn:hover,
.place-slot-btn:active {
  border-color: var(--primary);
  background: var(--accent-coral-soft);
  color: var(--accent-coral-dark);
}

[data-theme="dark"] .place-slot-btn:hover,
[data-theme="dark"] .place-slot-btn:active {
  color: #FDBA74;
}

.place-slot-icon {
  font-size: 1.4rem;
  line-height: 1;
}

/* ----------------------------------------------------------------------------
   CALENDAR DAY EVENT PILLS
   ---------------------------------------------------------------------------- */
.day-event-pill {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.1);
  border-left: 3px solid #6366F1;
  font-size: 0.84rem;
  color: var(--text-main);
}

[data-theme="dark"] .day-event-pill {
  background: rgba(129, 140, 248, 0.16);
  border-left-color: #818CF8;
}

.day-event-badge {
  font-size: 0.76rem;
  font-weight: 800;
  color: #4F46E5;
}

[data-theme="dark"] .day-event-badge {
  color: #A5B4FC;
}

.day-event-title {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.day-header-events {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.events-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn-day-add-event {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  min-height: 36px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.14s ease;
}

.btn-day-add-event:hover {
  border-color: #6366F1;
  color: #4F46E5;
  background: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .btn-day-add-event:hover {
  border-color: #818CF8;
  color: #A5B4FC;
  background: rgba(129, 140, 248, 0.16);
}

/* Kiosk Read-Only Visual Cue */
body.is-pin-locked .btn-slot-add-more,
body.is-pin-locked .btn-slot-copy,
body.is-pin-locked .btn-assign-create,
body.is-pin-locked .btn-day-add-event,
body.is-pin-locked .day-note-input-row,
body.is-pin-locked .btn-note-del,
body.is-pin-locked #btn-pro-add-meal,
body.is-pin-locked #btn-pro-add-event,
body.is-pin-locked #mobile-fab-add,
body.is-pin-locked .btn-card-ctrl,
body.is-pin-locked .event-composer-card,
body.is-pin-locked .event-item-actions,
body.is-pin-locked .events-cal-chip-del,
body.is-pin-locked #btn-delete-event-detail,
body.is-pin-locked #btn-edit-event-detail {
  display: none !important;
}

.header-clock-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
}

.header-weather-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Header Sync Status Indicator (Quiet inline dot + text, clickable manual sync) */
.header-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.header-sync-pill:hover {
  background: var(--bg-hover);
}

.header-sync-pill:disabled {
  cursor: default;
  opacity: 0.75;
}

.header-sync-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.header-sync-pill.syncing {
  color: var(--primary);
}

.header-sync-pill.synced {
  color: #15803D;
}

[data-theme="dark"] .header-sync-pill.synced {
  color: #86EFAC;
}

.header-sync-pill.error {
  color: var(--danger-red);
}

.header-sync-pill.offline,
.header-sync-pill.pending {
  color: #B45309;
  background: rgba(251, 191, 36, 0.16);
  padding: 2px 7px;
}

[data-theme="dark"] .header-sync-pill.offline,
[data-theme="dark"] .header-sync-pill.pending {
  color: #FCD34D;
  background: rgba(251, 191, 36, 0.14);
}

.settings-digest-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-subtle);
}

.settings-digest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 8px;
}

.settings-digest-actions > * {
  margin-right: 8px;
  margin-bottom: 6px;
}

/* Collapsible Developer Setup Disclosure */
.apps-script-disclosure {
  margin-top: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface-alt);
  padding: 8px 12px;
}

.apps-script-disclosure summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  user-select: none;
}

.apps-script-disclosure[open] summary {
  margin-bottom: 8px;
}

/* Inline Form Errors & Toast Undo */
.inline-form-error {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger-red);
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 6px;
}

.toast-undo-btn {
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
}

.toast-undo-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Dark Mode Placeholder & Badge Contrast */
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #A89F95;
  opacity: 1;
}

[data-theme="dark"] .event-source-pill.gcal,
[data-theme="dark"] .day-event-badge {
  background: rgba(96, 165, 250, 0.22);
  color: #BFDBFE;
  border-color: rgba(96, 165, 250, 0.45);
}

button.day-event-pill {
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: transform 0.12s ease, filter 0.12s ease;
}

button.day-event-pill:hover {
  filter: brightness(0.96);
}

.event-detail-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-detail-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
}

.event-detail-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.event-detail-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-word;
}

.events-cal-chip {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
}

.events-cal-chip-main {
  flex: 1 1 0;
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.events-month-cell .events-cal-chip-main {
  -webkit-line-clamp: 2;
}

.events-cal-chip-del {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.72;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
  padding: 0;
}

.events-cal-chip-del:hover {
  opacity: 1;
  background: var(--danger-soft);
  color: var(--danger-red);
}

/* Work Calendar (visual-only, distinct red color + compact footprint + toggle button) */
.events-work-toggle-btn {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.events-work-toggle-btn:hover {
  background: #fee2e2;
}
.events-work-toggle-btn.is-hidden {
  border-color: var(--border-subtle);
  background: var(--bg-surface-alt);
  color: var(--text-muted);
}
.events-work-toggle-compact {
  padding: 2px 8px;
  font-size: 0.7rem;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}
[data-theme="dark"] .events-work-toggle-btn {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}
[data-theme="dark"] .events-work-toggle-btn.is-hidden {
  border-color: var(--border-subtle);
  background: var(--bg-surface-alt);
  color: var(--text-muted);
}

.events-cal-chip.is-work {
  border-left-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.72rem;
  line-height: 1.15;
  padding: 2px 5px;
}
.events-cal-chip.is-work .events-cal-chip-main {
  -webkit-line-clamp: 1;
}
[data-theme="dark"] .events-cal-chip.is-work {
  border-left-color: #f87171;
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

.event-item-card.is-work {
  border-left: 4px solid #ef4444;
  background: rgba(239, 68, 68, 0.05);
  padding: 9px 12px;
  gap: 5px;
}
.event-item-card.is-work .event-item-title {
  font-size: 0.88rem;
}
.event-item-card.is-work .event-item-meta {
  font-size: 0.76rem;
}
[data-theme="dark"] .event-item-card.is-work {
  border-left-color: #f87171;
  background: rgba(239, 68, 68, 0.12);
}

.event-tag-pill.is-work {
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.7rem;
  padding: 2px 7px;
}
[data-theme="dark"] .event-tag-pill.is-work {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.day-event-pill.is-work {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.7rem;
  padding: 2px 6px;
}
.day-event-pill.is-work .day-event-badge {
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.66rem;
  padding: 1px 4px;
}
[data-theme="dark"] .day-event-pill.is-work {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}
[data-theme="dark"] .day-event-pill.is-work .day-event-badge {
  background: rgba(239, 68, 68, 0.28);
  color: #fca5a5;
}



body.is-pin-locked #btn-pin-lock-toggle {
  border-color: var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
}

/* Browser Surface Theming */
::selection {
  background: #ECF6F0;
  color: #252A24;
}

[data-theme="dark"] ::selection {
  background: rgba(77, 154, 114, 0.35);
  color: #EFF3EE;
}

input,
textarea {
  caret-color: var(--primary);
}

body[data-workspace-tab="goals"] #mobile-fab-add {
  display: none !important;
}

/* ============================================================================
   WEEKLY FAMILY GOALS & TASK TRACKER (Board Widget + Dedicated Workspace)
   ============================================================================ */

/* Header Tab Badge */
.tab-goals-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  font-size: 0.68rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.workspace-tab-btn.active .tab-goals-badge {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

/* Weekly Family Goals styles moved to css/features/goals.css */

/* Custom Lists & Notes styles moved to css/features/lists.css */

@media (max-width: 768px) {
  .mobile-nav-item-btn {
    padding: 6px 4px;
    min-width: 44px;
  }
}

/* ============================================================================
   NO SCHOOL / DAY OFF MODE
   ============================================================================ */
.btn-toggle-no-school {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  min-height: 28px;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-toggle-no-school:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.btn-toggle-no-school.active {
  background: #FFFBEB;
  border-color: #FCD34D;
  color: #B45309;
}

[data-theme="dark"] .btn-toggle-no-school.active {
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.45);
  color: #FCD34D;
}

.day-holiday-hint-pill {
  font-size: 0.66rem;
  font-weight: 700;
  color: #0F766E;
  background: #F0FDFA;
  border: 1px solid #99F6E4;
  border-radius: var(--radius-full);
  padding: 2px 7px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-theme="dark"] .day-holiday-hint-pill {
  background: rgba(20, 184, 166, 0.14);
  border-color: rgba(45, 212, 191, 0.35);
  color: #5EEAD4;
}

.bento-day-row.is-no-school {
  background: rgba(242, 239, 228, 0.55);
}

[data-theme="dark"] .bento-day-row.is-no-school {
  background: rgba(34, 39, 33, 0.65);
}

.bento-day-row.is-no-school.is-collapsed .no-school-banner-cell {
  display: none;
}

.no-school-banner-cell {
  grid-column: 2 / span 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-right: 1px solid var(--border-subtle);
  background: repeating-linear-gradient(
    -45deg,
    rgba(251, 191, 36, 0.05),
    rgba(251, 191, 36, 0.05) 10px,
    transparent 10px,
    transparent 20px
  );
}

body.focus-mode .no-school-banner-cell {
  border-right: none;
}

.no-school-banner-info {
  display: flex;
  flex-direction: column;
  margin-right: 12px;
}

.no-school-banner-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 800;
  color: #B45309;
  display: flex;
  align-items: center;
}

[data-theme="dark"] .no-school-banner-title {
  color: #FCD34D;
}

.no-school-banner-reason {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

.no-school-banner-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 6px;
}

.no-school-banner-actions > * + * {
  margin-left: 8px;
}

.mobile-day-pill-card.is-no-school {
  border-style: dashed;
  opacity: 0.82;
}

@media (max-width: 768px) {
  .no-school-banner-cell {
    grid-column: 1 / -1;
    border-right: none;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
  }
}

/* ============================================================================
   ADDITIONAL CALENDAR OVERLAYS & EVENT SEARCH
   ============================================================================ */
.events-cal-toggle-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

.events-cal-toggle-group > * {
  margin-right: 6px;
  margin-bottom: 4px;
}

.events-extra-toggle-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  min-height: 34px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.events-extra-toggle-btn.is-hidden {
  opacity: 0.55;
  text-decoration: line-through;
}

.events-extra-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}

.events-extra-dot[data-cal-color="amber"] { background: #D97706; }
.events-extra-dot[data-cal-color="purple"] { background: #7C3AED; }
.events-extra-dot[data-cal-color="teal"] { background: #0D9488; }
.events-extra-dot[data-cal-color="rose"] { background: #E11D48; }

.events-cal-chip.is-extra[data-cal-color="amber"] {
  border-left-color: #D97706;
  background: #FFFBEB;
  color: #92400E;
}
.events-cal-chip.is-extra[data-cal-color="purple"] {
  border-left-color: #7C3AED;
  background: #F5F3FF;
  color: #5B21B6;
}
.events-cal-chip.is-extra[data-cal-color="teal"] {
  border-left-color: #0D9488;
  background: #F0FDFA;
  color: #115E59;
}
.events-cal-chip.is-extra[data-cal-color="rose"] {
  border-left-color: #E11D48;
  background: #FFF1F2;
  color: #9F1239;
}

[data-theme="dark"] .events-cal-chip.is-extra[data-cal-color="amber"] {
  border-left-color: #FBBF24;
  background: rgba(217, 119, 6, 0.18);
  color: #FDE68A;
}
[data-theme="dark"] .events-cal-chip.is-extra[data-cal-color="purple"] {
  border-left-color: #A78BFA;
  background: rgba(124, 58, 237, 0.2);
  color: #DDD6FE;
}
[data-theme="dark"] .events-cal-chip.is-extra[data-cal-color="teal"] {
  border-left-color: #2DD4BF;
  background: rgba(13, 148, 136, 0.18);
  color: #99F6E4;
}
[data-theme="dark"] .events-cal-chip.is-extra[data-cal-color="rose"] {
  border-left-color: #FB7185;
  background: rgba(225, 29, 72, 0.18);
  color: #FECDD3;
}

.event-item-card.is-extra[data-cal-color="amber"] { border-left: 4px solid #D97706; }
.event-item-card.is-extra[data-cal-color="purple"] { border-left: 4px solid #7C3AED; }
.event-item-card.is-extra[data-cal-color="teal"] { border-left: 4px solid #0D9488; }
.event-item-card.is-extra[data-cal-color="rose"] { border-left: 4px solid #E11D48; }

.event-tag-pill.is-extra[data-cal-color="amber"] { background: #FEF3C7; color: #92400E; }
.event-tag-pill.is-extra[data-cal-color="purple"] { background: #EDE9FE; color: #5B21B6; }
.event-tag-pill.is-extra[data-cal-color="teal"] { background: #CCFBF1; color: #115E59; }
.event-tag-pill.is-extra[data-cal-color="rose"] { background: #FFE4E6; color: #9F1239; }

[data-theme="dark"] .event-tag-pill.is-extra[data-cal-color="amber"] { background: rgba(217, 119, 6, 0.25); color: #FDE68A; }
[data-theme="dark"] .event-tag-pill.is-extra[data-cal-color="purple"] { background: rgba(124, 58, 237, 0.25); color: #DDD6FE; }
[data-theme="dark"] .event-tag-pill.is-extra[data-cal-color="teal"] { background: rgba(13, 148, 136, 0.25); color: #99F6E4; }
[data-theme="dark"] .event-tag-pill.is-extra[data-cal-color="rose"] { background: rgba(225, 29, 72, 0.25); color: #FECDD3; }

.day-event-pill.is-extra[data-cal-color="amber"] { border-color: #FDE68A; background: #FFFBEB; color: #92400E; }
.day-event-pill.is-extra[data-cal-color="purple"] { border-color: #DDD6FE; background: #F5F3FF; color: #5B21B6; }
.day-event-pill.is-extra[data-cal-color="teal"] { border-color: #99F6E4; background: #F0FDFA; color: #115E59; }
.day-event-pill.is-extra[data-cal-color="rose"] { border-color: #FECDD3; background: #FFF1F2; color: #9F1239; }

[data-theme="dark"] .day-event-pill.is-extra[data-cal-color="amber"] { border-color: rgba(251, 191, 36, 0.35); background: rgba(217, 119, 6, 0.16); color: #FDE68A; }
[data-theme="dark"] .day-event-pill.is-extra[data-cal-color="purple"] { border-color: rgba(167, 139, 250, 0.35); background: rgba(124, 58, 237, 0.18); color: #DDD6FE; }
[data-theme="dark"] .day-event-pill.is-extra[data-cal-color="teal"] { border-color: rgba(45, 212, 191, 0.35); background: rgba(13, 148, 136, 0.16); color: #99F6E4; }
[data-theme="dark"] .day-event-pill.is-extra[data-cal-color="rose"] { border-color: rgba(251, 113, 133, 0.35); background: rgba(225, 29, 72, 0.16); color: #FECDD3; }

/* Event Search Bar & Results */
.events-search-row {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 8px;
}

.events-search-icon {
  position: absolute;
  left: 11px;
  color: var(--text-muted);
  pointer-events: none;
}

.events-search-input {
  width: 100%;
  min-height: 38px;
  padding: 6px 34px 6px 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-app);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.84rem;
}

.events-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.events-search-clear-btn {
  position: absolute;
  right: 6px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.events-search-results {
  margin-bottom: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-surface-alt);
  max-height: 280px;
  overflow-y: auto;
}

.events-search-results-head {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.events-search-result-item {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.events-search-result-item:last-child {
  margin-bottom: 0;
}

.events-search-result-item:hover {
  background: var(--bg-hover);
  border-color: var(--primary-border);
}

.events-search-result-main {
  min-width: 0;
  margin-right: 10px;
}

.events-search-result-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.events-search-result-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================================
   SCHEDULED THEME SETTINGS
   ============================================================================ */
.settings-theme-schedule-box {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
}

.settings-theme-schedule-times {
  margin-top: 8px;
  transition: opacity 0.15s ease;
}

.settings-theme-schedule-times.is-disabled {
  opacity: 0.48;
  pointer-events: none;
}

/* ============================================================================
   KIOSK DISPLAY SLEEP / SCREEN-OFF CURTAIN
   ============================================================================ */
.settings-kiosk-sleep-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-subtle);
}

.settings-kiosk-sleep-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
}

.settings-kiosk-sleep-header > .btn-pantry-action {
  margin-left: 8px;
  flex-shrink: 0;
}

.kiosk-sleep-curtain {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000000;
  color: rgba(255, 255, 255, 0.24);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.kiosk-sleep-clock-wrap {
  text-align: center;
  padding: 24px;
  transition: transform 0.6s ease;
}

.kiosk-sleep-clock {
  font-size: clamp(2.8rem, 8vw, 5.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: rgba(255, 255, 255, 0.24);
}

.kiosk-sleep-date {
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.18);
}

.kiosk-sleep-hint {
  margin-top: 22px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.14);
}

/* Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}




