/* Smart Kitchen TMA - Modern Telegram Mini App Styles */
:root {
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --tg-theme-bg-color: #121824;
  --tg-theme-secondary-bg-color: #1c2436;
  --tg-theme-text-color: #f1f5f9;
  --tg-theme-hint-color: #94a3b8;
  --tg-theme-link-color: #38bdf8;
  --tg-theme-button-color: #2563eb;
  --tg-theme-button-text-color: #ffffff;
  --card-bg: rgba(30, 41, 59, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  --accent-calories: #f97316;
  --accent-protein: #38bdf8;
  --accent-fats: #fbbf24;
  --accent-carbs: #34d399;
  --accent-defrost: #67e8f9;
  --status-good: #22c55e;
  --status-warning: #f59e0b;
  --status-danger: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: var(--font-sans);
  background-color: var(--tg-theme-bg-color);
  color: var(--tg-theme-text-color);
  min-height: 100vh;
  padding-bottom: calc(75px + env(safe-area-inset-bottom, 16px));
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Telegram Native Theme Sync */
.tg-app-container {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background-color: rgba(18, 24, 36, 0.85);
  border-bottom: 1px solid var(--card-border);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.brand-badge .icon {
  font-size: 1.3rem;
}

.user-split-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 9999px;
  padding: 3px;
  gap: 2px;
}

.user-split-toggle button {
  border: none;
  background: transparent;
  color: var(--tg-theme-hint-color);
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-split-toggle button.active {
  background: var(--tg-theme-button-color);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* Day Selector (Horizontal Scroll) */
.day-selector {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 12px 16px;
  scrollbar-width: none;
}
.day-selector::-webkit-scrollbar {
  display: none;
}

.day-chip {
  flex: 0 0 calc(14.28% - 7px);
  min-width: 48px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.day-chip:active {
  transform: scale(0.95);
}

.day-chip.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.4), rgba(59, 130, 246, 0.2));
  border-color: #3b82f6;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.day-chip .weekday {
  font-size: 0.7rem;
  color: var(--tg-theme-hint-color);
  font-weight: 600;
  text-transform: uppercase;
}

.day-chip.active .weekday {
  color: #93c5fd;
}

.day-chip .date-num {
  font-size: 1rem;
  font-weight: 700;
}

/* Nutrition Summary Card */
.nutrition-card {
  margin: 0 16px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
}

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

.nutrition-title {
  font-size: 0.85rem;
  color: var(--tg-theme-hint-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nutrition-calories {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-calories);
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.nutrition-calories span {
  font-size: 0.8rem;
  color: var(--tg-theme-hint-color);
  font-weight: 500;
}

.macro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.macro-box {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}

.macro-box .label {
  font-size: 0.7rem;
  color: var(--tg-theme-hint-color);
  margin-bottom: 2px;
}

.macro-box .val {
  font-size: 0.95rem;
  font-weight: 700;
}

.macro-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.macro-progress .bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.bar.protein { background: var(--accent-protein); }
.bar.fats { background: var(--accent-fats); }
.bar.carbs { background: var(--accent-carbs); }
.bar.calories { background: var(--accent-calories); }

/* Meal Slots */
.meal-slot-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 16px;
}

.meal-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.meal-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(30, 41, 59, 0.85);
}

.meal-card:active {
  transform: scale(0.985);
}

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

.slot-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.defrost-badge {
  background: rgba(103, 232, 249, 0.15);
  color: #67e8f9;
  border: 1px solid rgba(103, 232, 249, 0.35);
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

.meal-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.meal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--tg-theme-hint-color);
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.meal-user-portions {
  display: flex;
  gap: 12px;
}

.user-portion {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.adhoc-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.adhoc-btn:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.15);
}

/* Pantry & Freezer Views */
/* Pantry Live Search */
.pantry-search-box {
  display: flex;
  align-items: center;
  position: relative;
  margin: 0 16px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0 12px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.pantry-search-box:focus-within {
  border-color: #38bdf8;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.pantry-search-box .search-icon {
  font-size: 0.95rem;
  margin-right: 8px;
  opacity: 0.7;
  user-select: none;
  display: inline-flex;
  align-items: center;
}

.pantry-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.9rem;
  padding: 10px 0;
  font-family: inherit;
  width: 100%;
}

.pantry-search-input::placeholder {
  color: #94a3b8;
}

.clear-search-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
  user-select: none;
}

.clear-search-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* Pantry Location Badge for Global Search */
.pantry-location-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 7px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.pantry-location-badge.loc-fridge {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.pantry-location-badge.loc-freezer {
  background: rgba(129, 140, 248, 0.15);
  color: #818cf8;
  border: 1px solid rgba(129, 140, 248, 0.3);
}

.pantry-location-badge.loc-pantry {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.tab-pills {
  display: flex;
  margin: 0 16px 14px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 3px;
}

.tab-pill {
  flex: 1;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--tg-theme-hint-color);
  padding: 8px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-pill.active {
  background: var(--tg-theme-secondary-bg-color);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.pantry-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px 20px;
}

.pantry-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  cursor: pointer;
}

.pantry-card:hover {
  border-color: rgba(96, 165, 250, 0.35);
}

.pantry-card:active {
  transform: scale(0.99);
}

.pantry-card.fade-out {
  opacity: 0;
  transform: scale(0.95) translateY(-8px);
  pointer-events: none;
}

.pantry-main-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.pantry-right-col {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pantry-edit-icon {
  font-size: 0.95rem;
  color: var(--tg-theme-hint-color, #94a3b8);
  opacity: 0.65;
  transition: opacity 0.15s, transform 0.15s;
}

.pantry-card:hover .pantry-edit-icon {
  opacity: 1;
  transform: scale(1.1);
}

.freshness-indicator {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.fresh-good { background: var(--status-good); }
.fresh-warning { background: var(--status-warning); }
.fresh-danger { background: var(--status-danger); }

.pantry-info {
  margin-left: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pantry-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.pantry-sub {
  font-size: 0.78rem;
  color: var(--tg-theme-hint-color);
  display: flex;
  gap: 8px;
  transition: color 0.3s ease;
}

.pantry-sub.flash-updated {
  color: #38bdf8;
  font-weight: 600;
}

.pantry-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
}

.badge-fresh-good {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}
.badge-fresh-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}
.badge-fresh-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Quick Consume Chips */
.pantry-consume-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.consume-label {
  font-size: 0.72rem;
  color: var(--tg-theme-hint-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.consume-chip-btn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #fca5a5;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.consume-chip-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.45);
}

.consume-chip-btn:active {
  transform: scale(0.95);
  background: rgba(239, 68, 68, 0.35);
}

.consume-chip-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: calc(75px + env(safe-area-inset-bottom, 0px));
  left: 16px;
  right: 16px;
  max-width: 448px;
  margin: 0 auto;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  background: #1e293b;
  border: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #fff;
  font-size: 0.85rem;
  pointer-events: auto;
  animation: toastSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-item.hide {
  opacity: 0;
  transform: translateY(12px);
}

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

.toast-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.toast-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.toast-btn:hover {
  background: #1d4ed8;
}

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

.toast-close {
  background: transparent;
  border: none;
  color: var(--tg-theme-hint-color);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}

/* Smart Shopping List */
.shopping-section {
  padding: 0 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-group {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px;
}

.category-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--tg-theme-hint-color);
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.shopping-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

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

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

.custom-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.shopping-item.checked .custom-checkbox {
  background: var(--status-good);
  border-color: var(--status-good);
}

.shopping-item.checked .custom-checkbox::after {
  content: '✓';
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.shopping-item.checked .item-name {
  text-decoration: line-through;
  color: var(--tg-theme-hint-color);
}

.item-name {
  font-size: 0.92rem;
  font-weight: 600;
}

.item-amount {
  font-size: 0.8rem;
  color: var(--tg-theme-hint-color);
  font-weight: 600;
}

/* Action Floating & Header Buttons */
.action-banner {
  margin: 0 16px 14px;
  display: flex;
  gap: 8px;
}

.primary-btn {
  flex: 1;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: transform 0.15s ease;
}

.primary-btn:active {
  transform: scale(0.98);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  height: calc(65px + env(safe-area-inset-bottom, 0px));
  background: rgba(18, 24, 36, 0.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: 8px;
  z-index: 50;
}

.nav-item {
  border: none;
  background: transparent;
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--tg-theme-hint-color);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 2px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-item .nav-icon {
  font-size: 1.2rem;
  transition: transform 0.15s ease;
}

.nav-item.active {
  color: var(--tg-theme-link-color);
}

.nav-item.active .nav-icon {
  transform: translateY(-2px);
}

/* Modal & Native Bottom Sheets (Ticket 14) */
.bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0.3s ease;
}

.bottom-sheet.active,
.bottom-sheet.open {
  visibility: visible;
  pointer-events: auto;
}

.bottom-sheet .sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  z-index: 1001;
}

.bottom-sheet.active .sheet-backdrop,
.bottom-sheet.open .sheet-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet .sheet-content {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--tg-theme-secondary-bg-color, var(--bg-secondary, #1e293b));
  color: var(--tg-theme-text-color, var(--text-primary, #f1f5f9));
  border-radius: 20px 20px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  z-index: 1002;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  will-change: transform;
  touch-action: pan-y;
}

.bottom-sheet.active .sheet-content,
.bottom-sheet.open .sheet-content {
  transform: translateY(0);
}

.bottom-sheet .sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  margin: 10px auto 6px auto;
  flex-shrink: 0;
  cursor: grab;
}

.bottom-sheet .sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.bottom-sheet .sheet-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--tg-theme-text-color, var(--text-primary, #ffffff));
  letter-spacing: -0.01em;
}

.bottom-sheet .sheet-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.bottom-sheet .sheet-close:active {
  background: rgba(255, 255, 255, 0.2);
}

.bottom-sheet .sheet-body {
  padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 16px)) 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex-grow: 1;
}

/* Modal Overlay & Legacy Sheet */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  background: #1e293b;
  width: 100%;
  max-width: 480px;
  border-radius: 20px 20px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh;
  overflow-y: auto;
}

.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tg-theme-hint-color);
  margin-bottom: 6px;
}

.form-input, .form-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: #3b82f6;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

/* ==========================================================================
   Ticket 15: Interactive Recipe Bottom Sheet Styles
   ========================================================================== */
.recipe-sheet .sheet-header {
  padding-bottom: 12px;
}

.recipe-slot-chip {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-defrost, #38bdf8);
  margin-bottom: 4px;
}

.recipe-sheet .sheet-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
}

/* Defrost Alert Badge */
.recipe-defrost-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(103, 232, 249, 0.12);
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
  color: #bae6fd;
}

.recipe-defrost-badge .icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.recipe-defrost-badge .defrost-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recipe-defrost-badge .defrost-text strong {
  font-size: 0.85rem;
  color: #e0f2fe;
}

.recipe-defrost-badge .defrost-text span {
  font-size: 0.78rem;
  color: #7dd3fc;
}

/* Common Section Header */
.recipe-cook-section,
.recipe-scale-section,
.recipe-steps-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}

.recipe-section-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.recipe-section-icon {
  font-size: 1.35rem;
  line-height: 1;
  padding-top: 2px;
}

.recipe-section-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recipe-section-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #f8fafc;
}

.recipe-section-subtitle {
  font-size: 0.78rem;
  color: var(--tg-theme-hint-color, #94a3b8);
  line-height: 1.35;
}

/* Ingredients List ("Готовим на двоих") */
.recipe-ingredients-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recipe-ingredient-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  font-size: 0.86rem;
}

.recipe-ingredient-name {
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recipe-ingredient-name::before {
  content: "•";
  color: #38bdf8;
  font-weight: 700;
  font-size: 1.1rem;
}

.recipe-ingredient-amount {
  font-weight: 700;
  color: #38bdf8;
  white-space: nowrap;
}

/* Kitchen Scale Cards ("Раскладка по тарелкам") */
.recipe-scale-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.scale-user-card {
  padding: 12px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease;
}

.scale-user-card.scale-husband {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(14, 165, 233, 0.12));
  border-color: rgba(56, 189, 248, 0.35);
}

.scale-user-card.scale-wife {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.18), rgba(168, 85, 247, 0.12));
  border-color: rgba(244, 114, 182, 0.35);
}

.scale-user-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scale-user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f1f5f9;
}

.scale-user-badge {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 9999px;
  font-weight: 600;
  text-transform: uppercase;
}

.scale-husband .scale-user-badge {
  background: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
}

.scale-wife .scale-user-badge {
  background: rgba(244, 114, 182, 0.25);
  color: #f472b6;
}

.scale-user-weight {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.scale-husband .scale-user-weight {
  color: #7dd3fc;
}

.scale-wife .scale-user-weight {
  color: #fbcfe8;
}

.scale-user-calories {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-calories, #f97316);
}

.scale-user-macros {
  font-size: 0.72rem;
  color: var(--tg-theme-hint-color, #94a3b8);
  line-height: 1.3;
}

.recipe-total-output {
  font-size: 0.78rem;
  text-align: center;
  color: #94a3b8;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}

.recipe-total-output strong {
  color: #f8fafc;
}

/* Cooking Steps */
.recipe-instructions-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recipe-step-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #e2e8f0;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-text {
  flex-grow: 1;
}

/* Recipe Actions */
.recipe-actions {
  margin-top: 16px;
  margin-bottom: 8px;
}

.recipe-adhoc-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(239, 68, 68, 0.14));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 14px;
  padding: 12px 16px;
  color: #fef3c7;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.recipe-adhoc-action-btn:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(239, 68, 68, 0.22));
  border-color: rgba(245, 158, 11, 0.6);
}

.recipe-adhoc-action-btn:active {
  transform: scale(0.98);
}

.recipe-adhoc-action-btn .btn-icon {
  font-size: 1.4rem;
}

.recipe-adhoc-action-btn .btn-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.recipe-adhoc-action-btn .btn-text strong {
  font-size: 0.95rem;
  color: #fff;
}

.recipe-adhoc-action-btn .btn-text small {
  font-size: 0.72rem;
  color: #fcd34d;
}

/* Ticket 24: Interactive Cook Recipe Action */
.recipe-cook-action-container {
  margin-top: 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 16px;
  padding: 14px;
}

.portions-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.portions-stepper .stepper-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e2e8f0;
}

.portions-stepper .stepper-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.portions-stepper .stepper-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(245, 158, 11, 0.5);
}

.portions-stepper .stepper-btn:active {
  transform: scale(0.95);
}

.portions-stepper .stepper-val {
  font-size: 1.3rem;
  font-weight: 800;
  color: #f59e0b;
  min-width: 28px;
  text-align: center;
}

.btn-cook-now {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 13px 18px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-cook-now:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
}

.btn-cook-now:active {
  transform: scale(0.98);
}

.btn-cook-now:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Edit Pantry Bottom Sheet Stepper & Inputs */
.edit-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px 16px;
  margin: 10px 0 16px 0;
}

.stepper-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--tg-theme-text-color, #ffffff);
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.stepper-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.stepper-btn:active {
  transform: scale(0.92);
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.5);
}

.stepper-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--tg-theme-text-color, #f8fafc);
  letter-spacing: -0.02em;
  text-align: center;
  min-width: 120px;
}

.exact-input-group {
  margin-bottom: 20px;
}

.exact-input-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--tg-theme-hint-color, #94a3b8);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-with-unit:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.exact-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 12px 14px;
  outline: none;
  width: 100%;
}

.exact-input::placeholder {
  color: #64748b;
}

.fixed-unit {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.07);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--tg-theme-link-color, #60a5fa);
  font-weight: 700;
  font-size: 0.95rem;
  user-select: none;
}

/* Location chips selector in Edit Pantry Sheet */
.edit-location-group {
  margin-bottom: 20px;
}

.edit-location-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--tg-theme-hint-color, #94a3b8);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.location-chips-selector {
  display: flex;
  gap: 8px;
  width: 100%;
}

.loc-toggle-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border-radius: 12px;
  padding: 10px 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.loc-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.loc-toggle-btn:active {
  transform: scale(0.97);
}

.loc-toggle-btn.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.28) 0%, rgba(37, 99, 235, 0.45) 100%);
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.35);
}

/* Freezer & Meal Prep Card Badges */
.prep-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(147, 51, 234, 0.16);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  width: fit-content;
  margin-bottom: 2px;
}

.prep-portions-btn {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #60a5fa;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
}

.prep-portions-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #60a5fa;
}

.prep-portions-btn:active {
  transform: scale(0.96);
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.sheet-actions .btn {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.sheet-actions .btn-secondary:active {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(0.98);
}

.sheet-actions .btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.sheet-actions .btn-primary:active {
  transform: scale(0.98);
}

/* ========================================================
   FLEXIBLE MEAL SCHEDULE & DYNAMIC SLOTS CONSTRUCTOR
   ======================================================== */

/* Header Schedule Settings Button */
.schedule-settings-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-left: 6px;
}

.schedule-settings-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.25);
  transform: rotate(30deg);
}

.schedule-settings-btn:active {
  transform: scale(0.92);
}

/* Training Days Selector Chips */
.training-days-chips {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.training-day-chip {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #94a3b8;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.training-day-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.training-day-chip.active {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border-color: #60a5fa;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transform: translateY(-2px);
}

.training-day-chip:active {
  transform: scale(0.95);
}

/* Schedule Info Box */
.schedule-info-box {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 10px;
}

.schedule-info-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #60a5fa;
  margin-bottom: 6px;
}

.schedule-info-desc {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.45;
}

/* Add Slot Button in Day Calendar */
.btn-add-meal-slot {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 24px;
}

.btn-add-meal-slot:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: #60a5fa;
  color: #f8fafc;
}

.btn-add-meal-slot:active {
  transform: scale(0.98);
}

/* Slot Preset Chips in Add Sheet */
.slot-type-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.slot-preset-btn {
  padding: 8px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.slot-preset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.slot-preset-btn.active {
  background: #2563eb;
  border-color: #60a5fa;
  color: #ffffff;
  font-weight: 600;
}

/* Slot Delete Button on Meal Card */
.slot-delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 2;
}

.slot-delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
  transform: scale(1.1);
}

.slot-delete-btn:active {
  transform: scale(0.95);
}

/* Meal Card relative positioning for delete button */
.meal-card {
  position: relative;
}

/* Macros Form Row */
.form-row-macros {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

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

.form-label-macro {
  font-size: 0.72rem;
  color: #94a3b8;
  text-align: center;
}

.form-input-macro {
  width: 100%;
  padding: 8px 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  outline: none;
}

.form-input-macro:focus {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}

/* Pantry Macros Badge on Pantry Cards */
.pantry-macros {
  font-size: 0.74rem;
  font-weight: 600;
  color: #38bdf8;
  margin-top: 3px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.pantry-macros.unverified {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.pantry-macros.verified {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #4ade80;
  padding: 3px 8px;
  border-radius: 6px;
}

.kbju-status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.kbju-status-badge.verified {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.kbju-status-badge.unverified {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.macro-per-unit {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 400;
}

/* Native Camera Scan Button in QR & Barcode Modals */
.native-scan-banner {
  margin-bottom: 14px;
}

.native-scan-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.native-scan-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.native-scan-btn:active {
  transform: scale(0.98);
}

.native-scan-btn .scan-icon {
  font-size: 1.6rem;
}

.native-scan-btn .scan-btn-content {
  text-align: left;
  display: flex;
  flex-direction: column;
}

.native-scan-btn .scan-btn-content strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.native-scan-btn .scan-btn-content small {
  font-size: 0.75rem;
  color: #bfdbfe;
}

.qr-separator {
  position: relative;
  text-align: center;
  margin: 16px 0 14px;
}

.qr-separator::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.qr-separator span {
  position: relative;
  background: #181c24;
  padding: 0 10px;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Barcode Scan Action Button */
.barcode-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
}

.barcode-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.edit-kbzhu-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 18px;
}

.barcode-scan-product-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: rgba(96, 165, 250, 0.12);
  border: 1px dashed rgba(96, 165, 250, 0.4);
  border-radius: 10px;
  color: #93c5fd;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.barcode-scan-product-btn:hover {
  background: rgba(96, 165, 250, 0.2);
  border-color: rgba(96, 165, 250, 0.7);
  color: #bfdbfe;
}

.barcode-scan-product-btn:active {
  transform: scale(0.98);
}

.barcode-scan-hint {
  font-size: 0.8rem;
  padding: 6px 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid #60a5fa;
  color: #e2e8f0;
}

/* ==========================================================================
   Camera Barcode Scanner & Viewfinder (html5-qrcode EAN-13)
   ========================================================================== */
.camera-scanner-sheet .sheet-content {
  max-height: 92vh;
}

.scanner-container {
  position: relative;
  width: 100%;
  max-width: 380px;
  min-height: 240px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: #090d16;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

#camera-scanner-reader {
  width: 100%;
  min-height: 240px;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}

#camera-scanner-reader video {
  width: 100% !important;
  height: auto !important;
  border-radius: 16px !important;
  object-fit: cover;
  display: block;
}

/* Hide library's internal extra buttons/info banners if rendered */
#camera-scanner-reader img[alt="Info icon"],
#camera-scanner-reader button {
  display: none !important;
}

/* Animated Red Laser scan line */
.scanner-laser-line {
  position: absolute;
  left: 6%;
  right: 6%;
  height: 2px;
  background: #ef4444;
  box-shadow: 0 0 12px 3px rgba(239, 68, 68, 0.85), 0 0 4px #fca5a5;
  pointer-events: none;
  z-index: 25;
  animation: barcodeLaserScan 2.2s ease-in-out infinite alternate;
}

@keyframes barcodeLaserScan {
  0% {
    top: 15%;
    opacity: 0.8;
  }
  50% {
    top: 85%;
    opacity: 1;
  }
  100% {
    top: 15%;
    opacity: 0.8;
  }
}







/* ==========================================================================
   TICKET 20: Profile Tab & Samsung Health Watch Integration (User Scope)
   ========================================================================== */

.profile-tab-screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 16px 24px;
  animation: fadeIn 0.25s ease-out;
}

/* User Profile Header Card */
.profile-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  flex-shrink: 0;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 1.18rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-meta {
  font-size: 0.84rem;
  color: var(--tg-theme-hint-color);
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-username {
  color: #60a5fa;
  font-weight: 600;
}

.profile-household {
  font-size: 0.8rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.user-scope-pill {
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Profile Section Cards */
.profile-section-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-icon {
  font-size: 1.2rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
}

.action-link-btn {
  background: transparent;
  border: none;
  color: #60a5fa;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.action-link-btn:active {
  background: rgba(96, 165, 250, 0.15);
}

.section-sublabel {
  font-size: 0.82rem;
  color: var(--tg-theme-hint-color);
  margin-bottom: -4px;
}

/* Anthropometry Grid */
.anthropometry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.anthro-item {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.anthro-label {
  font-size: 0.74rem;
  color: #94a3b8;
}

.anthro-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
}

.activity-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.35);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.activity-label {
  color: #94a3b8;
}

.activity-val {
  color: #e2e8f0;
  font-weight: 600;
}

/* Goal Badge & Guardrails */
.goal-badge-wrap {
  display: flex;
  align-items: center;
}

.goal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 12px;
}

.goal-badge.fat-loss {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.goal-badge.maintenance {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.goal-badge.muscle-gain {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.goal-details-card {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goal-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 4px;
}

.goal-stat-row .stat-label {
  color: #94a3b8;
}

.goal-stat-row .stat-value {
  color: #f1f5f9;
  font-weight: 600;
}

.pace-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 10px;
}

.pace-badge.green {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.pace-badge.yellow {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.pace-badge.red {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* TDEE Mode Chips Selector */
.tdee-mode-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tdee-chip {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 8px 6px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s ease;
}

.tdee-chip.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3) 0%, rgba(59, 130, 246, 0.45) 100%);
  border-color: #3b82f6;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Samsung Health Watch Action Card */
.watch-action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  color: inherit;
  box-sizing: border-box;
}

.watch-action-card:hover {
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(30, 41, 59, 0.85);
}

.watch-action-card:active {
  transform: scale(0.99);
}

.watch-action-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.watch-action-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.watch-action-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.watch-action-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.2;
}

.watch-action-subtitle {
  font-size: 0.78rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.watch-action-arrow {
  font-size: 1.4rem;
  color: #64748b;
  font-weight: 300;
  margin-left: 8px;
  flex-shrink: 0;
  line-height: 1;
}

/* Samsung Health Watch Latest Badge */
.watch-latest-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
}

.watch-latest-badge.empty {
  border-color: rgba(255, 255, 255, 0.07);
}

.watch-latest-badge .watch-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.watch-latest-badge .watch-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.82rem;
  color: #94a3b8;
}

.watch-latest-badge .watch-meta strong {
  font-size: 0.88rem;
  color: #f1f5f9;
}

/* KBJU Norm Tiles Grid */
.kbju-norm-card .tdee-pill {
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(249, 115, 22, 0.16);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.35);
  padding: 3px 8px;
  border-radius: 10px;
}

.kbju-tiles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.kbju-tile {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.kbju-tile .tile-icon {
  font-size: 1.4rem;
}

.kbju-tile .tile-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kbju-tile .tile-label {
  font-size: 0.75rem;
  color: #94a3b8;
}

.kbju-tile .tile-value {
  font-size: 1.15rem;
  font-weight: 800;
}

.kbju-tile .tile-value small {
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
}

.calories-tile .tile-value { color: var(--accent-calories); }
.protein-tile .tile-value { color: var(--accent-protein); }
.fat-tile .tile-value { color: var(--accent-fats); }
.carb-tile .tile-value { color: var(--accent-carbs); }

/* Bottom Sheets UI (Watch Sync & Edit Profile) */
.watch-preset-chips,
.gender-chips-selector,
.goal-chips-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.preset-chip,
.gender-chip,
.goal-chip {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 8px 8px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.preset-chip.active,
.gender-chip.active,
.goal-chip.active {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
  color: #ffffff;
}

.watch-calc-preview {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px;
  margin-top: 10px;
}

.watch-calc-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.calc-label {
  font-size: 0.75rem;
  color: #94a3b8;
}

.highlight-tdee {
  color: #38bdf8;
  font-size: 1rem;
}

.pace-eval-box {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.pace-stats-text {
  font-size: 0.82rem;
  color: #cbd5e1;
}

.pace-warning-text {
  font-size: 0.78rem;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  padding: 6px 8px;
  border-radius: 6px;
  border-left: 3px solid #ef4444;
}

/* Стили для чистых блоков профиля и ретроспективной аналитики расхода */
.section-hint-text {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: -4px 0 12px 0;
  line-height: 1.35;
}

.analytics-balance-pill {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.analytics-balance-pill.deficit {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.analytics-balance-pill.surplus {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

.analytics-balance-pill.balance {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.watch-sync-action-btn {
  margin-top: 14px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 12px;
}

/* ==========================================================================
   Ticket 23: Recipes Catalog & Cook Book UI / UX Styles
   ========================================================================== */

.recipes-tab-pane {
  padding-bottom: 80px;
}

/* Recipe Search Box */
.recipe-search-box {
  display: flex;
  align-items: center;
  position: relative;
  margin: 0 16px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0 12px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.recipe-search-box:focus-within {
  border-color: #38bdf8;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.recipe-search-box .search-icon {
  font-size: 0.95rem;
  margin-right: 8px;
  opacity: 0.7;
  user-select: none;
  display: inline-flex;
  align-items: center;
}

.recipe-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.9rem;
  padding: 12px 0;
  font-family: inherit;
}

.recipe-search-input::placeholder {
  color: #64748b;
}

/* Categories Bar (Horizontal Scroll) */
.recipe-categories-bar,
.category-chips-bar {
  display: flex;
  gap: 8px;
  padding: 4px 16px 10px 16px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.recipe-categories-bar::-webkit-scrollbar,
.category-chips-bar::-webkit-scrollbar {
  display: none;
}

.category-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  flex-shrink: 0;
}

.category-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.category-chip.active {
  background: #38bdf8;
  border-color: #38bdf8;
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

.category-chip:active {
  transform: scale(0.96);
}

/* Toggle Filter: Only Available from Pantry */
.available-toggle-row {
  margin: 0 16px 14px 16px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
}

.toggle-switch-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  user-select: none;
  gap: 10px;
}

.toggle-text {
  font-size: 0.86rem;
  font-weight: 600;
  color: #6ee7b7;
}

.toggle-switch-input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch-input:checked + .toggle-slider {
  background-color: #10b981;
}

.toggle-switch-input:checked + .toggle-slider::after {
  transform: translateX(20px);
}

/* Recipes Grid / List Container */
.recipes-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px;
}

/* Recipe Catalog Card */
.recipe-catalog-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  backdrop-filter: blur(10px);
}

.recipe-catalog-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(56, 189, 248, 0.4);
}

.recipe-catalog-card:active {
  transform: scale(0.98);
}

.recipe-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.recipe-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.recipe-card-emoji {
  font-size: 1.3rem;
  line-height: 1;
}

.recipe-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
}

.recipe-card-meta-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.recipe-card-category-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 6px;
}

.recipe-card-time {
  font-size: 0.74rem;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.recipe-card-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-card-macros {
  font-size: 0.8rem;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 6px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Availability Badges */
.availability-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}

.availability-badge.badge-available {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.availability-badge.badge-partial {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.availability-badge.badge-none {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

/* Recipes Empty State */
.recipes-empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #94a3b8;
}

.recipes-empty-state .empty-state-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
}

.recipes-empty-state .empty-state-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 6px;
}

.recipes-empty-state .empty-state-desc {
  font-size: 0.85rem;
  color: #94a3b8;
  max-width: 280px;
  margin: 0 auto;
  line-height: 1.4;
}

/* PIN Login Modal (Ticket 33) */
.pin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.pin-modal-card {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  width: 100%;
  max-width: 420px;
  padding: 28px 24px;
  box-sizing: border-box;
  text-align: center;
  animation: pinModalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pinModalPop {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.pin-modal-header {
  margin-bottom: 24px;
}

.pin-modal-icon {
  font-size: 2.8rem;
  margin-bottom: 10px;
  line-height: 1;
}

.pin-modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 8px 0;
}

.pin-modal-desc {
  font-size: 0.9rem;
  color: #94a3b8;
  margin: 0 auto;
  line-height: 1.45;
  max-width: 300px;
}

.pin-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pin-input-wrap {
  width: 100%;
  box-sizing: border-box;
}

#pin-login-input {
  width: 100%;
  box-sizing: border-box;
  background: #0f172a;
  border: 2px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 0.3em;
  text-align: center;
  color: #38bdf8;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

#pin-login-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
  background: #0b1120;
}

#pin-login-input::placeholder {
  color: #475569;
  letter-spacing: 0.3em;
}

.pin-login-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
}

.btn-pin-submit {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 14px;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-pin-submit:hover:not(:disabled) {
  filter: brightness(1.1);
}

.btn-pin-submit:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-pin-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.pin-modal-footer {
  margin-top: 4px;
}

.btn-pin-bot-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #38bdf8;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.btn-pin-bot-link:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
}

/* Logout action button in Profile */
.btn-logout-action {
  width: 100%;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout-action:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}

/* Responsive adjustments (Samsung Fold 5 / Flip 4) */
@media (max-width: 360px) {
  .pin-modal-card {
    padding: 20px 16px;
  }
  .pin-modal-title {
    font-size: 1.18rem;
  }
  #pin-login-input {
    font-size: 20px;
    letter-spacing: 0.25em;
    padding: 12px 10px;
  }
  .btn-pin-bot-link {
    font-size: 0.8rem;
  }
}

@media (min-width: 600px) {
  .pin-modal-card {
    max-width: 440px;
    padding: 36px 32px;
  }
}
