/* Table of Contents
 * 01. Sleep Quality Picker Modal
 * 02. COMPACT ACTIVITY INPUT
 * 03. SKELETON LOADER
 * 04. iOS-style Bottom Sheet Modal (Glassmorphism)
 * 05. Mood Sliders
 * 06. Grams Input Modal
 * 07. Portion Buttons
 */

/* === 01. Sleep Quality Picker Modal === */
.sleep-quality-picker-modal {
  padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 40px);
}

.sleep-quality-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: 4px;
}

.sleep-quality-face-emoji {
  font-size: 56px;
  line-height: 1;
  animation: mood-face-appear 0.4s ease-out;
}

.sleep-quality-face-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-gray-500);
  transition: color 0.2s ease;
}

.sleep-quality-big-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  padding: 8px 0 20px;
}

.sleep-quality-number {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  transition: color 0.2s ease;
}

.sleep-quality-stars {
  font-size: 20px;
  color: var(--v4-warn-soft, #c9922e);
  letter-spacing: -2px;
}

.sleep-quality-of-ten {
  font-size: 24px;
  font-weight: 500;
  color: var(--color-gray-400);
}

.sleep-quality-presets {
  display: flex;
  gap: 10px;
  padding: 0 16px;
  margin-bottom: 16px;
}

.sleep-quality-preset {
  flex: 1;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border-radius: 14px;
  border: 2px solid var(--v4-line, #e5e7eb);
  background: var(--color-white);
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sleep-quality-preset:active {
  opacity: 0.7;
  transition: opacity 120ms ease;
}

.sleep-quality-preset-bad.active {
  background: rgba(239, 68, 68, 0.1);
  color: var(--v4-bad-text, #a83c22);
  border-color: var(--v4-bad-text, #a83c22);
}

.sleep-quality-preset-ok.active {
  background: color-mix(in srgb, var(--v4-warn-soft, #c9922e) 10%, transparent);
  color: var(--v4-warn-text, #a1471c);
  border-color: var(--v4-warn-soft, #c9922e);
}

.sleep-quality-preset-good.active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-emerald-500);
  border-color: var(--color-emerald-500);
}

.sleep-quality-slider-container {
  padding: 0 20px;
  margin-bottom: 16px;
}

.sleep-quality-slider {
  margin-bottom: 8px;
}

.sleep-quality-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  padding: 0 4px;
  opacity: 0.7;
}

/* Резервируем место для comment-prompt чтобы не прыгало */
.sleep-quality-comment-wrapper {
  min-height: 70px;
  margin: 0 16px 16px;
  transition: all 0.3s ease;
}

.sleep-quality-comment-prompt {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(156, 163, 175, 0.08);
  border: 1px solid rgba(156, 163, 175, 0.15);
  border-radius: 14px;
  transition: all 0.3s ease;
}

/* Negative state - плохой сон (1-4) */
.sleep-quality-comment-prompt.negative {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.15);
}

/* Positive state - хороший сон (8-10) */
.sleep-quality-comment-prompt.positive {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.15);
}

/* Neutral state */
.sleep-quality-comment-prompt.neutral {
  background: rgba(156, 163, 175, 0.08);
  border-color: rgba(156, 163, 175, 0.15);
}

/* Общие стили для comment prompt header */
.comment-prompt-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* История комментариев */
.comment-history {
  font-size: 12px;
  color: var(--color-gray-500);
  background: rgba(255, 255, 255, 0.5);
  padding: 8px 10px;
  border-radius: 8px;
  white-space: pre-line;
  line-height: 1.5;
  max-height: 80px;
  overflow-y: auto;
}

.sleep-quality-comment-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.sleep-quality-comment-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-gray-500);
  white-space: nowrap;
}

.sleep-quality-comment-input {
  width: 100%;
  border: none;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  color: #1c1c1e;
  outline: none;
}

.sleep-quality-comment-input::placeholder {
  color: var(--color-gray-400);
}

.sleep-quality-comment-input:focus {
  background: var(--color-white);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.sleep-quality-hours-info {
  margin-top: 16px;
  padding: 10px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--color-gray-500);
}

.sleep-quality-hours-info strong {
  color: var(--v4-water, #3b82f6);
}

/* Dark mode for Sleep Quality */
[data-theme$="dark"] .sleep-quality-picker-modal {
  background: var(--heys-bg-elevated);
  border: 1px solid var(--heys-border-focus);
}

[data-theme$="dark"] .sleep-quality-face-text {
  color: var(--heys-text-secondary);
}

[data-theme$="dark"] .sleep-quality-preset {
  background: var(--heys-bg-card);
  border-color: var(--heys-border-default);
  color: var(--heys-text-primary);
}

@media (hover: hover) {
  [data-theme$="dark"] .sleep-quality-preset:hover {
  background: var(--heys-bg-elevated);
  border-color: var(--heys-border-focus);
}
}

[data-theme$="dark"] .sleep-quality-preset-bad.active {
  background: rgba(248, 113, 113, 0.2);
  border-color: #ef4444;
}

[data-theme$="dark"] .sleep-quality-preset-ok.active {
  background: color-mix(in srgb, var(--v4-warn-soft, #c9922e) 20%, transparent);
  border-color: var(--v4-warn-soft, #c9922e);
}

[data-theme$="dark"] .sleep-quality-preset-good.active {
  background: rgba(52, 211, 153, 0.2);
  border-color: #10b981;
}

[data-theme$="dark"] .sleep-quality-comment-prompt {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

[data-theme$="dark"] .comment-history {
  background: var(--heys-bg-elevated);
  color: var(--heys-text-secondary);
  border: 1px solid var(--heys-border-default);
}

[data-theme$="dark"] .sleep-quality-comment-input {
  background: var(--heys-bg-elevated);
  color: var(--heys-text-primary);
  border: 1px solid var(--heys-border-default);
}

[data-theme$="dark"] .sleep-quality-comment-input::placeholder {
  color: var(--heys-text-muted);
}

[data-theme$="dark"] .sleep-quality-comment-input:focus {
  background: var(--heys-bg-card);
  border-color: var(--heys-border-focus);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

[data-theme$="dark"] .sleep-quality-hours-info {
  color: var(--heys-text-secondary);
}

[data-theme$="dark"] .sleep-quality-hours-info strong {
  color: var(--v4-act-text, #60a5fa);
}

.day-score-auto-info {
  margin: 20px 16px 0;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(139, 92, 246, 0.08));
  border-radius: 12px;
  font-size: 13px;
  color: var(--color-gray-500);
  text-align: center;
}

.day-score-auto-info strong {
  color: var(--v4-water, #3b82f6);
}

/* Wrapper с фиксированной высотой чтобы модалка не прыгала */
.day-score-comment-wrapper {
  min-height: 70px;
  margin: 0 16px 16px;
  transition: all 0.3s ease;
}

/* Prompt для комментария — базовые стили */
.day-score-comment-prompt {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  transition: all 0.3s ease;
}

/* Негативный стиль (плохая оценка 1-4) — красноватый */
.day-score-comment-prompt.negative {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

/* Позитивный стиль (хорошая оценка 7-10) — зеленый */
.day-score-comment-prompt.positive {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

/* Нейтральный стиль (средняя оценка 5-6) — серый */
.day-score-comment-prompt.neutral {
  background: rgba(107, 114, 128, 0.06);
  border: 1px solid rgba(107, 114, 128, 0.12);
}

@keyframes comment-prompt-appear {
  0% {
    opacity: 0;
    transform: translateY(-8px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.day-score-comment-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.day-score-comment-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-gray-500);
  white-space: nowrap;
}

.day-score-comment-input {
  width: 100%;
  border: none;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  color: #1c1c1e;
  outline: none;
}

.day-score-comment-input::placeholder {
  color: var(--color-gray-400);
}

.day-score-comment-input:focus {
  background: var(--color-white);
  box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.2);
}

/* Focus стили для разных состояний */
.day-score-comment-prompt.negative .day-score-comment-input:focus {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.day-score-comment-prompt.positive .day-score-comment-input:focus {
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Цвет текста для разных состояний */
.day-score-comment-prompt.positive .day-score-comment-text {
  color: #059669;
}

.day-score-comment-prompt.negative .day-score-comment-text {
  color: var(--v4-warn-2, #dc2626);
}

.day-score-comment-prompt.neutral .day-score-comment-text {
  color: var(--color-gray-500);
}

/* Legacy (можно удалить) */
.day-score-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--color-white);
  border: 1px solid #fce7f3;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.day-score-btn:active {
  opacity: 0.7;
  transition: opacity 120ms ease;
}

.day-score-label {
  font-size: 13px;
  color: var(--color-gray-400);
}

.day-score-value {
  font-size: 14px;
  font-weight: 600;
  color: #be185d;
}

/* Dark theme for day score */
[data-theme$="dark"] .day-score-display {
  background: linear-gradient(135deg, #3d2a35 0%, #4a2a3a 100%);
}

[data-theme$="dark"] .day-score-value-big {
  color: #f9a8d4;
}

[data-theme$="dark"] .day-score-auto-hint {
  background: rgba(168, 85, 247, 0.2);
  color: #93c5fd;
}

[data-theme$="dark"] .day-score-manual-hint {
  background: rgba(142, 142, 147, 0.2);
  color: #8e8e93;
}

/* Dark theme for sleep quality */
[data-theme$="dark"] .sleep-quality-display {
  background: linear-gradient(135deg, #2e2a3d 0%, #3a2a4a 100%);
}

[data-theme$="dark"] .sleep-quality-value-big {
  color: #93c5fd;
}

[data-theme$="dark"] .sleep-duration-hint {
  background: rgba(139, 92, 246, 0.2);
  color: var(--v4-act-text, #60a5fa);
}

/* Dark theme for sleep time row */
[data-theme$="dark"] .sleep-time-display {
  background: linear-gradient(135deg, #2d1824 0%, #3a1e2e 100%);
  border-color: rgba(244, 114, 182, 0.2);
  color: #f9a8d4;
}

[data-theme$="dark"] .sleep-arrow {
  color: rgba(244, 114, 182, 0.4);
}

/* Dark theme for sleep breakdown items */
[data-theme$="dark"] .sleep-breakdown-item {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

[data-theme$="dark"] button.sleep-breakdown-item:focus-visible {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(148, 163, 184, 0.2);
}

@media (hover: hover) {
  [data-theme$="dark"] button.sleep-breakdown-item:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(148, 163, 184, 0.2);
}
}

[data-theme$="dark"] .sleep-breakdown-item--nap.has-value {
  background: linear-gradient(135deg, #1e1529 0%, #271b3a 100%);
  border-color: rgba(167, 139, 250, 0.3);
  color: #c4b5fd;
}

/* Dark theme for "Добавить доп. сон" CTA button */
[data-theme$="dark"] .sleep-breakdown-cta {
  background: linear-gradient(135deg, #1e1529 0%, #251b35 100%);
  border-color: rgba(167, 139, 250, 0.25);
  color: #c4b5fd;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.08);
}

[data-theme$="dark"] .sleep-breakdown-cta:focus-visible {
  box-shadow: 0 8px 18px rgba(139, 92, 246, 0.12);
}

@media (hover: hover) {
  [data-theme$="dark"] .sleep-breakdown-cta:hover {
  box-shadow: 0 8px 18px rgba(139, 92, 246, 0.12);
}
}

[data-theme$="dark"] .sleep-breakdown-cta.subtle {
  background: linear-gradient(135deg, #1a1a24 0%, #1e1529 100%);
  border-color: rgba(139, 92, 246, 0.18);
  color: #a78bfa;
}

[data-theme$="dark"] .sleep-breakdown-cta.recommended {
  background: linear-gradient(135deg, color-mix(in srgb, var(--v4-warn-text, #a1471c) 90%, #000) 0%, color-mix(in srgb, var(--v4-warn-3, #a1471c) 75%, #000) 100%);
  border-color: color-mix(in srgb, var(--v4-warn-2, #c67139) 35%, transparent);
  color: var(--v4-warn-1, #d99a63);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--v4-warn-2, #c67139) 12%, transparent);
}

[data-theme$="dark"] .sleep-breakdown-cta.has-value {
  background: linear-gradient(135deg, #1e1529 0%, #271b3a 100%);
  border-color: rgba(167, 139, 250, 0.4);
  color: #a78bfa;
}

[data-theme$="dark"] .sleep-breakdown-reason {
  color: var(--v4-warn-1, #d99a63);
}

[data-theme$="dark"] .day-score-face-text {
  color: #a1a1aa;
}

[data-theme$="dark"] .day-score-of-ten {
  color: var(--color-gray-500);
}

[data-theme$="dark"] .day-score-preset {
  background: #2c2c2e;
  border-color: #48484a;
  color: #e5e5ea;
}

[data-theme$="dark"] .day-score-auto-info {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(139, 92, 246, 0.15));
  color: #a1a1aa;
}

[data-theme$="dark"] .day-score-auto-info strong {
  color: var(--v4-act-text, #60a5fa);
}

[data-theme$="dark"] .day-score-comment-prompt {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.25);
}

[data-theme$="dark"] .day-score-comment-text {
  color: #a1a1aa;
}

[data-theme$="dark"] .day-score-comment-input {
  background: rgba(44, 44, 46, 0.8);
  color: var(--v4-ink, #f2f2f7);
}

[data-theme$="dark"] .day-score-comment-input::placeholder {
  color: #636366;
}

[data-theme$="dark"] .day-score-comment-input:focus {
  background: #2c2c2e;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

/* Кнопка качества сна */
.sleep-quality-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 14px;
  background: var(--color-white);
  border: 1px solid #fce7f3;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.sleep-quality-btn:active {
  opacity: 0.7;
  transition: opacity 120ms ease;
}

.sleep-quality-label {
  font-size: 13px;
  color: var(--color-gray-500);
}

.sleep-quality-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--v4-warn-1, #d99a63);
}

/* Настроение — красивые карточки */
.day-mood-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

/* Day insights row (last meal, correlations) */
.day-insights-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  justify-content: center;
}

.day-insight {
  font-size: 11px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 8px;
  color: var(--color-gray-500);
}

.day-insight.correlation {
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
}

/* Smart tips for low scores */
.smart-tip {
  font-size: 12px;
  padding: 8px 12px;
  background: var(--v4-accent-bg, #f0dcc6);
  border-radius: 8px;
  color: var(--v4-act-text, #8a4a20);
  text-align: center;
  margin-bottom: 8px;
  animation: smartTipFade 0.4s ease-out;
}

@keyframes smartTipFade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

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

/* ============================================
   INSULIN WAVE INDICATOR
   Визуальный индикатор инсулиновой волны (WOW VERSION)
   ============================================ */
.insulin-wave-indicator {
  position: relative;
  --iw-bg-from: rgba(239, 246, 255, 0.72);
  --iw-bg-mid: rgba(224, 242, 254, 0.72);
  --iw-bg-to: rgba(186, 230, 253, 0.72);
  background: linear-gradient(135deg, var(--iw-bg-from) 0%, var(--iw-bg-mid) 48%, var(--iw-bg-to) 100%);
  padding: var(--heys-diary-card-padding, 14px 16px);
  margin: 0 0 var(--heys-diary-stack-gap, 12px) 0 !important;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Градиент статуса */
.insulin-wave-indicator.insulin-lipolysis {
  --iw-bg-from: rgba(236, 253, 245, 0.72);
  --iw-bg-mid: rgba(209, 250, 229, 0.72);
  --iw-bg-to: rgba(167, 243, 208, 0.72);
}

.insulin-wave-indicator.insulin-almost {
  --iw-bg-from: rgba(255, 247, 237, 0.72);
  --iw-bg-mid: color-mix(in srgb, var(--v4-accent-bg, #f0dcc6) 72%, transparent);
  --iw-bg-to: color-mix(in srgb, var(--v4-warn-1, #d99a63) 72%, transparent);
}

.insulin-wave-indicator.insulin-soon {
  --iw-bg-from: rgba(254, 252, 232, 0.72);
  --iw-bg-mid: color-mix(in srgb, var(--v4-warn-soft, #c9922e) 72%, transparent);
  --iw-bg-to: color-mix(in srgb, var(--v4-warn-soft, #e2b264) 72%, transparent);
}

.insulin-wave-indicator.insulin-wave-indicator--bare {
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible;
}

/* Статичный фон — без анимации для снижения отвлечения */
.insulin-wave-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0.05) 100%);
  pointer-events: none;
}

.insulin-lipolysis .insulin-wave-bg {
  background: linear-gradient(135deg,
      rgba(34, 197, 94, 0.08) 0%,
      rgba(34, 197, 94, 0.04) 100%);
}

@keyframes waveMove {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(33.33%);
  }
}

.insulin-wave-content {
  position: relative;
  z-index: 1;
}

.insulin-wave-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.insulin-wave-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.insulin-wave-icon {
  font-size: 20px;
  animation: none;
}

.insulin-wave-header:focus-within .insulin-wave-icon {
  animation: floatIcon 0.9s ease-in-out 1;
}

@media (hover: hover) {
  .insulin-wave-header:hover .insulin-wave-icon {
  animation: floatIcon 0.9s ease-in-out 1;
}
}

@keyframes floatIcon {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

.insulin-wave-label {
  font-size: 13px;
  font-weight: 700;
  color: #0369a1;
}

.insulin-lipolysis .insulin-wave-label {
  color: #059669;
}

.insulin-wave-timer {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.lipolysis-pulse {
  display: inline-block;
  font-size: 24px;
  animation: lipolysisPulse 1s ease-in-out infinite;
}

@keyframes lipolysisPulse {

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

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

/* 🔥 Таймер липолиза — огонёк пульсирует */
.lipolysis-fire-icon {
  animation: fireWobble 0.8s ease-in-out infinite;
}

@keyframes fireWobble {

  0%,
  100% {
    transform: scale(1) rotate(-3deg);
  }

  25% {
    transform: scale(1.1) rotate(3deg);
  }

  50% {
    transform: scale(1) rotate(-2deg);
  }

  75% {
    transform: scale(1.05) rotate(2deg);
  }
}

/* Прогресс-бар липолиза — мерцающий градиент */
.lipolysis-progress-fill {
  background: linear-gradient(90deg, #22c55e 0%, #10b981 50%, #059669 100%) !important;
  animation: lipolysisShimmer 2s ease-in-out infinite;
}

@keyframes lipolysisShimmer {

  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.15);
  }
}

.insulin-wave-progress {
  position: relative;
  height: 28px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  overflow: visible;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: height 0.3s ease;
  margin-bottom: 8px;
}

.insulin-wave-impact-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 0 12px;
}

.insulin-wave-impact-chip {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.96);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.insulin-wave-impact-chip__icon {
  font-size: 12px;
  line-height: 1;
}

.insulin-wave-bar {
  height: 100%;
  border-radius: 5px;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.insulin-wave-bar.lipolysis-progress-fill {
  border-radius: 8px;
}

/* Блики на прогресс-баре */
.insulin-wave-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.4) 0%,
      transparent 100%);
  border-radius: 5px 5px 0 0;
}

/* Бегущая анимация на баре — ОТКЛЮЧЕНА для теста */
.insulin-wave-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.5) 50%,
      transparent 100%);
  /* animation: barShine 1.5s ease-in-out infinite; */
  display: none;
  /* ТЕСТ: полностью скрываем */
}

@keyframes barShine {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(200%);
  }
}

.insulin-wave-times {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
}

.insulin-time-start {
  color: var(--v4-ink-2, #64748b);
}

.insulin-time-end {
  color: #0369a1;
}

.insulin-lipolysis .insulin-time-end {
  color: #059669;
}

.insulin-wave-suggestion {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  text-align: center;
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(5px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.insulin-lipolysis .insulin-wave-suggestion {
  background: rgba(34, 197, 94, 0.1);
  color: #047857;
}

.insulin-almost .insulin-wave-suggestion {
  background: color-mix(in srgb, var(--v4-warn-2, #c67139) 10%, transparent);
  color: var(--v4-warn-text, #a1471c);
}

/* === Subtle shake animation — приближение липолиза === */
/* Мягкий периодический shake: 4 сек пауза → 0.8 сек вздрагивание */
.insulin-wave-indicator.shake-subtle {
  animation: insulinShakeSubtle 5s ease-in-out infinite;
  /* Карточка выше родительского overflow */
  z-index: 10;
  overflow: visible;
}

@keyframes insulinShakeSubtle {

  /* 0-84% — неподвижно (4.2 сек) */
  0%,
  84% {
    transform: translateX(0);
  }

  /* 84-100% — мягкий shake (0.8 сек) */
  86% {
    transform: translateX(-2px);
  }

  89% {
    transform: translateX(2px);
  }

  92% {
    transform: translateX(-1px);
  }

  95% {
    transform: translateX(1px);
  }

  98% {
    transform: translateX(-0.5px);
  }

  100% {
    transform: translateX(0);
  }
}

/* === SVG Wave container === */
.insulin-wave-svg-container {
  margin: 8px 0;
  border-radius: 8px;
  overflow: hidden;
}

/* === Live wave animations === */
/* ОТКЛЮЧЕНЫ — создавали эффект тряски карточки */
.wave-layer {
  transform-origin: center;
}

.wave-layer.wave-1 {
  /* animation: waveFloat1 4s ease-in-out infinite; */
}

.wave-layer.wave-2 {
  /* animation: waveFloat2 3s ease-in-out infinite; */
}

.wave-layer.wave-3 {
  /* animation: waveFloat3 2s ease-in-out infinite; */
}

@keyframes waveFloat1 {

  0%,
  100% {
    transform: translateX(0) translateY(0);
  }

  50% {
    transform: translateX(10px) translateY(-2px);
  }
}

@keyframes waveFloat2 {

  0%,
  100% {
    transform: translateX(0) translateY(0);
  }

  50% {
    transform: translateX(-8px) translateY(1px);
  }
}

@keyframes waveFloat3 {

  0%,
  100% {
    transform: translateX(0) translateY(0);
  }

  50% {
    transform: translateX(5px) translateY(-1px);
  }
}

/* === GI Badge in times === */
.insulin-gi-badge {
  flex-shrink: 0;
}

.insulin-wave-times {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  gap: 8px;
}

/* === Expanded section === */
.insulin-wave-expanded {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--v4-bg, #fff);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  animation: expandIn 0.3s ease-out;
}

@keyframes expandIn {
  0% {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }

  100% {
    opacity: 1;
    max-height: 600px;
    transform: translateY(0);
  }
}

/* Убран .insulin-gi-info — используем inline styles в новом минималистичном дизайне */

.insulin-history {
  padding: 8px;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
}

.insulin-history-legend {
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 6px;
}

.day-wave-overview {
  margin: var(--heys-diary-stack-gap, 14px) 0 18px;
  padding: 12px;
  border: 1px solid rgba(29, 112, 183, 0.14);
  border-radius: 14px;
  background:
    radial-gradient(circle at 12% 0%, rgba(226, 236, 242, 0.9) 0%, rgba(226, 236, 242, 0) 42%),
    rgba(248, 250, 252, 0.82);
}

.day-wave-overview--warn {
  border-color: color-mix(in srgb, var(--v4-warn-1, #d99a63) 22%, transparent);
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--v4-accent-bg, #f0dcc6) 82%, transparent) 0%, color-mix(in srgb, var(--v4-accent-bg, #f0dcc6) 0%, transparent) 44%),
    color-mix(in srgb, var(--v4-accent-bg, #f0dcc6) 68%, transparent);
}

.day-wave-overview--soft {
  border-color: rgba(29, 112, 183, 0.18);
  background:
    radial-gradient(circle at 12% 0%, rgba(226, 236, 242, 0.88) 0%, rgba(226, 236, 242, 0) 44%),
    rgba(248, 250, 252, 0.76);
}

.day-wave-overview--high {
  border-color: rgba(239, 68, 68, 0.2);
  background:
    radial-gradient(circle at 12% 0%, rgba(254, 226, 226, 0.9) 0%, rgba(254, 226, 226, 0) 44%),
    rgba(255, 247, 247, 0.72);
}

.day-wave-overview__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.day-wave-overview__title {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: var(--v4-ink, #172033);
  font-size: 13.5px;
  font-weight: 850;
  line-height: 1.15;
}

.day-wave-overview__status {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(29, 112, 183, 0.1);
  color: #1d70b7;
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1;
}

.day-wave-overview--warn .day-wave-overview__status {
  background: color-mix(in srgb, var(--v4-warn-1, #d99a63) 14%, transparent);
  color: var(--v4-warn-text, #a1471c);
}

.day-wave-overview--high .day-wave-overview__status {
  background: rgba(239, 68, 68, 0.12);
  color: var(--v4-warn-2, #dc2626);
}

.day-wave-overview__canvas {
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(241, 245, 249, 0.55) 100%);
}

.day-wave-overview__axis {
  stroke: rgba(148, 163, 184, 0.48);
  stroke-width: 2;
  stroke-linecap: round;
}

.day-wave-overview__lipolysis-zone {
  fill: rgba(34, 197, 94, 0.075);
  stroke: rgba(34, 197, 94, 0.16);
  stroke-width: 1;
}

.day-wave-overview__lipolysis-label {
  fill: rgba(22, 101, 52, 0.58);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0;
}

.day-wave-overview__target-window {
  stroke: rgba(29, 112, 183, 0.42);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 4 4;
}

.day-wave-overview__interaction-zone {
  stroke-width: 1;
}

.day-wave-overview__interaction-zone--overlap {
  fill: rgba(239, 68, 68, 0.11);
  stroke: rgba(239, 68, 68, 0.22);
}

.day-wave-overview__interaction-zone--extension,
.day-wave-overview__interaction-zone--boost {
  fill: color-mix(in srgb, var(--v4-warn-1, #d99a63) 7.5%, transparent);
  stroke: color-mix(in srgb, var(--v4-warn-1, #d99a63) 16%, transparent);
}

.day-wave-overview__interaction-zone--micro {
  fill: rgba(148, 163, 184, 0.08);
  stroke: rgba(148, 163, 184, 0.14);
}

.day-wave-overview__wave {
  opacity: 0.28;
  stroke-width: 1.5;
}

.day-wave-overview__wave.is-active {
  opacity: 0.42;
  stroke-width: 2;
}

.day-wave-overview__meal circle {
  fill: var(--v4-bg, #fff);
  stroke: var(--v4-water, #3b82f6);
  stroke-width: 1.6;
}

.day-wave-overview__meal text {
  font-size: 8px;
  dominant-baseline: middle;
}

.day-wave-overview__time {
  fill: var(--v4-ink-2, #64748b);
  font-size: 8px;
  font-weight: 750;
}

.day-wave-overview__overlaps {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  color: var(--v4-warn-text, #a1471c);
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.25;
}

.day-wave-overview__interaction-label--overlap {
  color: #b91c1c;
}

.day-wave-overview__interaction-label--extension,
.day-wave-overview__interaction-label--boost {
  color: var(--v4-warn-text, #a1471c);
}

.day-wave-overview__interaction-label--micro {
  color: var(--v4-ink-2, #64748b);
}

[data-theme$="dark"] .day-wave-overview {
  border-color: rgba(82, 160, 216, 0.18);
  background:
    radial-gradient(circle at 12% 0%, rgba(29, 112, 183, 0.18) 0%, rgba(29, 112, 183, 0) 44%),
    rgba(15, 23, 42, 0.66);
}

[data-theme$="dark"] .day-wave-overview--warn {
  border-color: color-mix(in srgb, var(--v4-warn-1, #d99a63) 24%, transparent);
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--v4-warn-text, #a1471c) 24%, transparent) 0%, color-mix(in srgb, var(--v4-warn-text, #a1471c) 0%, transparent) 44%),
    rgba(15, 23, 42, 0.68);
}

[data-theme$="dark"] .day-wave-overview--soft {
  border-color: rgba(82, 160, 216, 0.2);
  background:
    radial-gradient(circle at 12% 0%, rgba(29, 112, 183, 0.16) 0%, rgba(29, 112, 183, 0) 44%),
    rgba(15, 23, 42, 0.66);
}

[data-theme$="dark"] .day-wave-overview--high {
  border-color: rgba(239, 68, 68, 0.24);
  background:
    radial-gradient(circle at 12% 0%, rgba(127, 29, 29, 0.24) 0%, rgba(127, 29, 29, 0) 44%),
    rgba(15, 23, 42, 0.68);
}

[data-theme$="dark"] .day-wave-overview__title {
  color: #e5e7eb;
}

[data-theme$="dark"] .day-wave-overview__canvas {
  border-color: rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.62);
  color: var(--v4-ink-2, #94a3b8);
}

[data-theme$="dark"] .day-wave-overview__axis {
  stroke: rgba(148, 163, 184, 0.34);
}

[data-theme$="dark"] .day-wave-overview__lipolysis-zone {
  fill: rgba(34, 197, 94, 0.09);
  stroke: rgba(74, 222, 128, 0.14);
}

[data-theme$="dark"] .day-wave-overview__lipolysis-label {
  fill: rgba(134, 239, 172, 0.5);
}

[data-theme$="dark"] .day-wave-overview__target-window {
  stroke: rgba(147, 197, 253, 0.4);
}

[data-theme$="dark"] .day-wave-overview__interaction-zone--overlap {
  fill: rgba(239, 68, 68, 0.13);
  stroke: rgba(248, 113, 113, 0.2);
}

[data-theme$="dark"] .day-wave-overview__interaction-zone--extension,
[data-theme$="dark"] .day-wave-overview__interaction-zone--boost {
  fill: color-mix(in srgb, var(--v4-warn-1, #d99a63) 10%, transparent);
  stroke: color-mix(in srgb, var(--v4-warn-soft, #c9922e) 16%, transparent);
}

[data-theme$="dark"] .day-wave-overview__interaction-zone--micro {
  fill: rgba(148, 163, 184, 0.09);
  stroke: rgba(203, 213, 225, 0.12);
}

[data-theme$="dark"] .day-wave-overview__meal circle {
  fill: var(--v4-bg, #0f172a);
  stroke: var(--v4-act-text, #60a5fa);
}

[data-theme$="dark"] .day-wave-overview__time {
  fill: var(--v4-ink-2, #94a3b8);
}

[data-theme$="dark"] .day-wave-overview__overlaps {
  color: var(--v4-warn-soft, #c9922e);
}

/* Пульсация активной волны */
@keyframes wave-pulse {

  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 0.8;
  }
}

.wave-active-pulse {
  animation: wave-pulse 1.5s ease-in-out infinite;
}

/* === INSULIN FOCUS OVERLAY === */
.insulin-focus-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99;
  animation: fadeIn 0.2s ease-out;
}

/* Карточка поверх overlay когда раскрыта */
.insulin-wave-indicator.expanded {
  position: relative;
  z-index: 100;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* === FOCUS MODE для Expandable Cards === */
/* Overlay за раскрытой карточкой */
.expand-focus-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.expand-focus-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Карточка в фокусе поднимается над overlay */
.insulin-wave-indicator.expanded,
.expandable-card--expanded {
  position: relative;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transform: scale(1.01);
  transition: all 0.3s ease;
}

/* Анимация появления контента */
@keyframes expandFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

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

.insulin-wave-expanded,
.expandable-card__content {
  animation: expandFadeIn 0.25s ease-out;
}

/* Subtle glow вокруг раскрытой карточки */
.insulin-wave-indicator.expanded::before,
.expandable-card--expanded::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
  z-index: -1;
  opacity: 0.6;
}

.mood-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  background: linear-gradient(135deg, #fef7f9 0%, var(--color-white) 100%);
  border: 1px solid #fce7f3;
  border-radius: 10px;
  transition: all 0.2s;
}

.mood-card:active {
  opacity: 0.7;
  transition: opacity 120ms ease;
}

.mood-card-icon {
  font-size: 22px;
  margin-bottom: 4px;
}

.mood-card-label {
  font-size: 11px;
  color: #374151;
  font-weight: 500;
  margin-bottom: 2px;
}

.mood-card-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--v4-ink, #111827);
}

/* === Mood Sparkline — динамика настроения === */
.mood-sparkline-container {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 10px 0 6px 0;
}

.mood-sparkline-line {
  transition: stroke 0.3s ease;
}

.mood-sparkline-area {
  opacity: 0;
  animation: moodAreaFadeIn 0.5s ease-out 0.2s forwards;
}

@keyframes moodAreaFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.mood-point-best {
  animation: moodBestPulse 2s ease-in-out infinite;
}

@keyframes moodBestPulse {

  0%,
  100% {
    filter: drop-shadow(0 0 2px var(--v4-warn-soft, #c9922e));
  }

  50% {
    filter: drop-shadow(0 0 6px var(--v4-warn-soft, #c9922e));
  }
}

.mood-point-worst {
  animation: moodWorstPulse 2s ease-in-out infinite;
}

@keyframes moodWorstPulse {

  0%,
  100% {
    filter: drop-shadow(0 0 2px #f87171);
  }

  50% {
    filter: drop-shadow(0 0 4px #f87171);
  }
}

/* Dark theme для mood sparkline */
[data-theme$="dark"] .mood-sparkline-container {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
}

/* === 02. COMPACT ACTIVITY INPUT === */
.compact-activity {
  margin-bottom: 8px;
  background: var(--activity-bg);
  border-color: var(--activity-border);
}

.compact-activity.activity-section {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--heys-diary-inner-gap, 12px);
  margin-bottom: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.activity-section .compact-card-header {
  margin: 0;
  padding-inline: var(--heys-diary-section-title-padding-x, 16px);
}

.activity-steps-card {
  background: var(--activity-bg, rgba(255, 255, 255, 0.65));
  border: 1px solid var(--activity-border, rgba(148, 163, 184, 0.35));
  border-radius: 12px;
  padding: 12px var(--heys-diary-card-padding-x, 16px) 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  contain: layout style paint;
}

.activity-section .activity-cards-row,
.activity-section .month-trainings-card {
  margin-top: 0;
  margin-bottom: 0;
}

/* Месячная сводка тренировок под карточкой активности */
.month-trainings-card {
  margin-top: 10px;
  padding: 10px var(--heys-diary-card-padding-x, 16px) 12px;
  border-radius: 12px;
  background: var(--activity-bg, rgba(255, 255, 255, 0.65));
  border: 1px solid var(--activity-border, rgba(148, 163, 184, 0.35));
}

.month-trainings-card-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--heys-diary-card-header-gap, 10px);
}

/* Как «Шаги» / заголовок календаря зарядки (.steps-label, .ma-habit-cal-heading) */
.month-trainings-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-slate-700);
  line-height: 1.3;
}

.month-trainings-empty {
  font-size: 12px;
  color: var(--color-slate-500, #64748b);
  padding: 6px 2px 2px;
}

.month-trainings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}

.month-trainings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) auto auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.25;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.month-trainings-row-date {
  color: var(--color-slate-600, #475569);
  font-weight: 600;
  min-width: 0;
  word-break: break-word;
}

.month-trainings-row-type {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-slate-800, #1e293b);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-trainings-row-corrected {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--v4-tint, rgba(229, 241, 234, 0.95));
  color: var(--v4-act-text, #8a4a20);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.2;
}

.month-trainings-row-kcal {
  flex-shrink: 0;
  white-space: nowrap;
}

.month-trainings-row-open {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--v4-line, rgba(0, 0, 0, 0.1));
  background: var(--v4-bg); /* v4-intentional */
  color: var(--v4-act-text, #8a4a20);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

[data-theme$="dark"] .month-trainings-card {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.28);
}

[data-theme$="dark"] .month-trainings-card-title {
  color: var(--heys-text-secondary);
}

[data-theme$="dark"] .month-trainings-empty {
  color: var(--v4-ink-2, #94a3b8);
}

[data-theme$="dark"] .month-trainings-row {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(148, 163, 184, 0.22);
}

[data-theme$="dark"] .month-trainings-row-date {
  color: var(--v4-ink-2, #94a3b8);
}

[data-theme$="dark"] .month-trainings-row-type {
  color: var(--v4-ink, #f1f5f9);
}

[data-theme$="dark"] .month-trainings-row-open {
  background: var(--v4-bg); /* v4-intentional */
  border-color: var(--v4-line, rgba(255, 255, 255, 0.14));
}

/* Календарь привычки «утренняя зарядка» (модалка + карточка активности) */
.ma-habit-cal-shell {
  margin-top: 10px;
  padding: 10px var(--heys-diary-card-padding-x, 16px) 12px;
  border-radius: 12px;
  background: var(--activity-bg, rgba(255, 255, 255, 0.65));
  border: 1px solid var(--activity-border, rgba(148, 163, 184, 0.35));
}

/* Резервный вопрос после еды — кадр «Рутина · резервный вопрос после еды».
   Числа сняты с кадра: заметка на --gr-bg радиусом 16 полями 12/13, ответы
   тремя пилюлями в ряд высотой 44 зазором 6. Слой, его выезд и затемнение —
   продуктовые (лист StepModal); здесь только содержимое. */
/* Шапка листов рутины — кадры «Рутина · резервный вопрос после еды» и
   «Рутина · причина пропуска»: крест 15 px / 2,75 в цели 44 слева, справа
   колонка заголовка 16/700 и подписи 11,5/500 чернил 56 %, поля карточки
   14/14/16. Общую шапку StepModal не трогаем — так её задают семь других
   канвасов. */
[data-heys-step-id="morning_activation_followup"] .mc-header--nav,
[data-heys-step-id="morning_activation_skip_reason"] .mc-header--nav {
  padding: 14px 14px 0;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
}

/* Крест StepModal — справа (order:3), заголовок и подпись — слева: кадр рисует
   крест в карточке слева, но в шапке листа слева он спорил с колонкой текста. */
[data-heys-step-id="morning_activation_followup"] .mc-header-left {
  order: 3;
}

[data-heys-step-id="morning_activation_followup"] .mc-header-center {
  text-align: left;
}

[data-heys-step-id="morning_activation_followup"] .mc-header-right,
[data-heys-step-id="morning_activation_skip_reason"] .mc-header-right {
  display: none;
}

[data-heys-step-id="morning_activation_followup"] .mc-header-center,
[data-heys-step-id="morning_activation_skip_reason"] .mc-header-center {
  flex: 1;
  align-items: flex-start;
  text-align: left;
  padding-top: 2px;
}

[data-heys-step-id="morning_activation_followup"] .mc-header-center .mc-header-titles,
[data-heys-step-id="morning_activation_skip_reason"] .mc-header-center .mc-header-titles {
  align-items: stretch;
  width: 100%;
  gap: 4px;
}

[data-heys-step-id="morning_activation_followup"] .mc-header-title-container,
[data-heys-step-id="morning_activation_followup"] .mc-header-hint-container,
[data-heys-step-id="morning_activation_skip_reason"] .mc-header-title-container,
[data-heys-step-id="morning_activation_skip_reason"] .mc-header-hint-container {
  justify-content: flex-start !important;
}

[data-heys-step-id="morning_activation_followup"] .mc-header-title,
[data-heys-step-id="morning_activation_skip_reason"] .mc-header-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--v4-ink) /* v4-intentional */;
  white-space: normal;
  text-wrap: pretty;
}

/* Подпись выводит AutoFitText с кеглем 12 прямо в стиле элемента, поэтому
   11,5 из строки контракта держится только с !important. И подпись стоит
   отдельным блоком после заголовка, а не в его колонке, — зазор 4 из кадра
   ставится ей отступом, gap колонки заголовка до неё не доходит. */
[data-heys-step-id="morning_activation_followup"] .mc-header-hint,
[data-heys-step-id="morning_activation_skip_reason"] .mc-header-hint {
  margin-top: 4px;
  font-size: 11.5px !important;
  font-weight: 500;
  line-height: 1.4;
  color: var(--v4-ink-2) /* v4-intentional */;
  white-space: normal;
  text-wrap: pretty;
}

[data-heys-step-id="morning_activation_followup"] .mc-header-btn--close,
[data-heys-step-id="morning_activation_skip_reason"] .mc-header-btn--close {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  margin: -10px 0 -10px -12px;
  padding: 0;
  font-size: 0;
  line-height: 0;
  color: transparent;
}

/* У резервного вопроса крест справа (решение владельца) — зеркально кадру:
   там цель 44 выходит влево за поле на 12, здесь на столько же вправо, и
   крест отстоит от края содержимого так же, как в кадре. Вынос во весь зазор
   (17) прижимал крест к краю вплотную и смотрелся тесно.
   Вынос задан обёртке, а не кнопке: обёртка держит min-width 44, и
   отрицательное поле самой кнопки она поглощала — крест не двигался.
   Шторка причины пропуска держит крест слева, как в кадре, с прежним
   выносом −12. */
[data-heys-step-id="morning_activation_followup"] .mc-header-btn--close {
  margin: -10px 0;
}

[data-heys-step-id="morning_activation_followup"] .mc-header-left {
  margin-right: -12px;
}

[data-heys-step-id="morning_activation_followup"] .mc-header-btn--close::before,
[data-heys-step-id="morning_activation_followup"] .mc-header-btn--close::after,
[data-heys-step-id="morning_activation_skip_reason"] .mc-header-btn--close::before,
[data-heys-step-id="morning_activation_skip_reason"] .mc-header-btn--close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  /* Кадр: SVG 15 px, viewBox 24, штрих 2,75 со скруглением, отрезок 12×12.
     В пикселях это черта 12√2 + 2,75 = 19,7 единицы × 15/24 ≈ 12,3 px
     толщиной 2,75 × 15/24 ≈ 1,7 px, тоном --ink-3. Прежние 19 × 2,75 px
     рисовали крест в полтора раза крупнее и почти вдвое жирнее. */
  width: 12.3px;
  height: 1.72px;
  border-radius: 999px;
  background: var(--v4-ink-3) /* v4-intentional */;
}

[data-heys-step-id="morning_activation_followup"] .mc-header-btn--close::before,
[data-heys-step-id="morning_activation_skip_reason"] .mc-header-btn--close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

[data-heys-step-id="morning_activation_followup"] .mc-header-btn--close::after,
[data-heys-step-id="morning_activation_skip_reason"] .mc-header-btn--close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Зазоры между блоками задают их собственные отступы сверху — 12, 10, 12 и 11,
   как в кадре. Общий gap колонки складывался с ними, и каждый зазор выходил
   вдвое больше: лист рос на 30 px против кадра. */
.ma-followup-step {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ma-followup-note {
  border-radius: 16px;
  background: var(--v4-ok-bg) /* v4-intentional */;
  padding: 12px 13px;
  margin-top: 12px;
}

.ma-followup-note-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: var(--v4-sand-ok-text) /* v4-intentional */;
}

.ma-followup-note-text {
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--v4-ink-2) /* v4-intentional */;
  margin-top: 5px;
  text-wrap: pretty;
}

.ma-followup-answers {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

/* Три ответа стоят в ряд, а не стопкой: строка «резервный вопрос · снято»
   называет стопку на всю ширину среди снятых веток живого экрана. */
.ma-followup-answer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 44px;
  border: none;
  border-radius: 999px;
  /* Пакет 53: невыбранные пилюли на втором тоне поверхности (--c1), а не на
     фоне листа — на --md карточки --bg сливался с ней. */
  background: var(--v4-c1) /* v4-intentional */;
  box-shadow: inset 0 0 0 1.5px rgba(var(--v4-ink-rgb), 0.16);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  color: var(--v4-ink-2) /* v4-intentional */;
  cursor: pointer;
}

.ma-followup-answer--done {
  background: var(--v4-ok-bg) /* v4-intentional */;
  box-shadow: none;
  color: var(--v4-sand-ok-text) /* v4-intentional */;
}

.ma-followup-footnote {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--v4-ink-2) /* v4-intentional */;
  margin-top: 11px;
  text-wrap: pretty;
}

/* Кадр «Рутина · причина пропуска» и строка «вид · причина пропуска»: тот же
   лист, что у резервного вопроса. Прежде экран жил на прежней системе —
   инлайновые #fff, #0f172a, обводка rgba(148,163,184,.45) и радиус 12. */
.ma-skip-reason-stack {
  display: block;
}

/* Элемент 15 кадра: сами строки-ответы, «через 12, зазор 7». */
.ma-skip-reason-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
}

/* Обводки нет — строка контракта называет только заливку --c1. */
.ma-skip-reason-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 14px;
  border: none;
  border-radius: 14px;
  background: var(--v4-c1, #f7efe2);
  color: var(--v4-ink) /* v4-intentional */;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
}

.ma-skip-reason-footnote {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--v4-ink-2) /* v4-intentional */;
  margin-top: 11px;
  text-wrap: pretty;
}

/* Строка счёта под легендой — добавление шторки. */
.ma-habit-cal-tally {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  color: var(--v4-ink-2) /* v4-intentional */;
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
}

/* Кадр «Рутина · резервный вопрос после еды · 23»: заголовок календаря в
   шторке — 700 13px var(--tx), не 10,5/600 activity-v4 по умолчанию. */
.ma-habit-cal--sheet .ma-habit-cal-head-title-group {
  gap: 10px;
}

.ma-habit-cal--sheet .ma-habit-cal-heading {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  color: var(--v4-ink) /* v4-intentional */;
}

.ma-habit-cal-shell.ma-habit-cal--modal {
  margin-top: 0;
}

.ma-habit-cal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px 10px;
  margin-bottom: var(--heys-diary-card-header-gap, 10px);
}

.ma-habit-cal-head-title-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 4px;
  min-width: 0;
  flex: 1 1 auto;
}

/* Как у подписи «Шаги» в блоке активности (.steps-label) */
.ma-habit-cal-heading {
  font-size: 13px;
  font-weight: 600;
  color: var(--v4-ink-2, rgba(0, 0, 0, 0.56));
  line-height: 1.3;
}

.ma-habit-cal-head-dot {
  color: var(--v4-ink-3, #94a3b8);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 0 1px;
  user-select: none;
  flex-shrink: 0;
}

.ma-habit-cal-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--v4-ink-2, rgba(0, 0, 0, 0.56));
  text-transform: capitalize;
  flex: 0 0 auto;
  margin-left: auto;
  text-align: right;
  max-width: 100%;
}

/* Период: под шапкой, над днями недели; стрелки только в режиме «Месяц» */
.ma-habit-cal-period {
  width: min(100%, 252px);
  margin-inline: auto;
  margin-bottom: 12px;
}

.ma-habit-cal-period-mode {
  font: 600 11px/1 Manrope, system-ui, sans-serif;
  color: var(--v4-ink-2, rgba(0, 0, 0, 0.56));
  flex-shrink: 0;
}

.ma-habit-cal-period-nav-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ma-habit-cal-period--month {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.ma-habit-cal-period--28 {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Типографика, не «пилюля» — без рамки и заливки */
.ma-habit-cal-period-nav {
  flex-shrink: 0;
  margin: 0;
  min-height: 44px;
  min-width: 44px;
  padding: 2px 6px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--color-slate-600, #475569);
  font-family: inherit;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .ma-habit-cal-period-nav:hover {
  color: var(--color-slate-800, #1e293b);
}
}

.ma-habit-cal-period-nav:active {
  opacity: 0.7;
  transition: opacity 120ms ease;
}

.ma-habit-cal-period-nav:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.45);
  outline-offset: 2px;
  border-radius: 4px;
}

.ma-habit-cal-period-label {
  min-width: 0;
}

.ma-habit-cal-period-label--month {
  flex: 1 1 auto;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-slate-700);
  line-height: 1.3;
  text-transform: capitalize;
}

.ma-habit-cal-period-label--28 {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-slate-600, #475569);
  line-height: 1.3;
  text-align: center;
  text-transform: none;
}

.ma-habit-cal-mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  background: var(--v4-hero, #f8fafc);
  color: var(--v4-ink-2, rgba(0, 0, 0, 0.56));
  font-size: 10px;
  font-weight: 700;
  padding: 6px 8px;
  cursor: pointer;
}

.ma-habit-cal-mode-btn--inline {
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.25;
  vertical-align: baseline;
}

.ma-habit-cal-mode-btn.is-active {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.1);
  color: var(--v4-act-text, #1d4ed8);
}

/* Сетка календаря уже не на всю ширину карточки — визуально легче */
.ma-habit-cal-matrix {
  width: min(100%, 252px);
  margin-inline: auto;
}

.ma-habit-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  margin-bottom: 5px;
}

.ma-habit-cal-wd {
  font-size: 9px;
  font-weight: 600;
  color: var(--v4-ink-3, #94a3b8);
  text-align: center;
}

.ma-habit-cal-wd--weekend {
  color: var(--v4-warn-2, #dc2626);
}

.ma-habit-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.ma-habit-cal-cell {
  min-height: 24px;
  border-radius: 7px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: var(--v4-hero, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1px 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--v4-ink, #201e1d);
}

.ma-habit-cal-cell.is-neutral.is-weekend {
  color: var(--v4-val-bad, #a8382b);
}

.ma-habit-cal-cell-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.ma-habit-cal-cell--empty {
  min-height: 24px;
  border: none;
  background: transparent;
}

.ma-habit-cal-cell.is-neutral {
  color: var(--v4-ink, #201e1d);
}

.ma-habit-cal-cell.is-today.is-neutral {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.ma-habit-cal-cell.is-done {
  border-color: rgba(16, 185, 129, 0.42);
  background: linear-gradient(145deg, #0d9488 0%, #14b8a6 32%, #2dd4bf 68%, #5eead4 100%);
  color: var(--v4-ok-bg, #f0fdf4);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 1px 2px rgba(13, 148, 136, 0.22);
}

.ma-habit-cal-cell.is-replacement {
  border-color: rgba(37, 99, 235, 0.42);
  background: linear-gradient(145deg, #2563eb 0%, #3b82f6 36%, #60a5fa 72%, #93c5fd 100%);
  color: #eff6ff;
  text-shadow: 0 1px 0 rgba(15, 23, 42, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 1px 2px rgba(37, 99, 235, 0.2);
}

.ma-habit-cal-cell.is-missed {
  border-color: rgba(251, 207, 216, 0.95);
  background: linear-gradient(180deg, #f8f4f5 0%, rgba(252, 231, 243, 0.82) 100%);
  color: var(--v4-ink-2, #64748b);
  text-shadow: none;
  box-shadow: none;
}

.ma-habit-cal-cell.is-today.is-done {
  border-color: rgba(153, 246, 228, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 0 0 1px rgba(45, 212, 191, 0.32);
}

.ma-habit-cal-cell.is-today.is-replacement {
  border-color: rgba(147, 197, 253, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 0 0 1px rgba(59, 130, 246, 0.32);
}

.ma-habit-cal-cell.is-today.is-missed {
  border-color: rgba(249, 168, 212, 0.55);
  background: linear-gradient(180deg, rgba(255, 250, 251, 0.98) 0%, rgba(252, 231, 243, 0.88) 100%);
  box-shadow: 0 0 0 1px rgba(251, 207, 216, 0.35);
}

.ma-habit-cal-daynum {
  line-height: 1;
  min-width: 1.1em;
  text-align: center;
}

.ma-habit-cal-footer {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  color: var(--v4-ink-2, #64748b);
}

/* «Зарядка · 28 дней» в «Ритме» (трекер CHART_REVEAL_ROLLOUT 4.2): когда до
   календаря докрутили, отмеченные точки загораются по датам из цвета дорожки
   (--cr-delay ставит разметка, шаг 30 мс), без перелёта. До появления точка
   стоит дорожкой: сетка не прячется, только ещё не налита. «Не вели» — сама
   дорожка, «сегодня» — обводка: им загораться нечем. Смена дня — без
   появления; «уменьшить движение» — движок сразу даёт конечный вид. */
.ma-habit-cal--activity-v4 .ma-habit-cal-grid--dot.chart-reveal.is-waiting .ma-habit-cal-cell:is(.is-done, .is-replacement, .is-missed) {
  background-color: var(--v4-track, rgba(0, 0, 0, 0.12));
}

.ma-habit-cal--activity-v4 .ma-habit-cal-grid--dot.chart-reveal.is-drawing .ma-habit-cal-cell:is(.is-done, .is-replacement, .is-missed) {
  animation: ma-habit-cal-light-up 420ms ease-out var(--cr-delay, 0ms) backwards;
}

@keyframes ma-habit-cal-light-up {
  from { background-color: var(--v4-track, rgba(0, 0, 0, 0.12)); }
}

[data-theme$="dark"] .ma-habit-cal-shell {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.28);
}

[data-theme$="dark"] .ma-habit-cal-heading {
  color: var(--heys-text-secondary);
}

[data-theme$="dark"] .ma-habit-cal-head-dot {
  color: var(--v4-ink-3, #64748b);
}

[data-theme$="dark"] .ma-habit-cal-subtitle {
  color: var(--heys-text-muted);
}

[data-theme$="dark"] .ma-habit-cal-period-nav {
  background: transparent;
  color: var(--v4-ink-2, #94a3b8);
}

@media (hover: hover) {
  [data-theme$="dark"] .ma-habit-cal-period-nav:hover {
  color: #e2e8f0;
}
}

[data-theme$="dark"] .ma-habit-cal-period-label--month {
  color: var(--heys-text-secondary);
}

[data-theme$="dark"] .ma-habit-cal-period-label--28 {
  color: var(--v4-ink-2, #94a3b8);
}

[data-theme$="dark"] .ma-habit-cal-footer,
[data-theme$="dark"] .ma-habit-cal-wd {
  color: var(--v4-ink-2, #94a3b8);
}

[data-theme$="dark"] .ma-habit-cal-wd--weekend {
  color: #f87171;
}

[data-theme$="dark"] .ma-habit-cal-cell.is-neutral.is-weekend {
  color: #fca5a5;
}

[data-theme$="dark"] .ma-habit-cal-mode-btn {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

[data-theme$="dark"] .ma-habit-cal-mode-btn.is-active {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

[data-theme$="dark"] .ma-habit-cal-cell {
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(30, 41, 59, 0.65);
  color: #e2e8f0;
}

[data-theme$="dark"] .ma-habit-cal-cell.is-neutral {
  color: #e2e8f0;
}

[data-theme$="dark"] .ma-habit-cal-cell.is-today.is-neutral {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.12);
}

[data-theme$="dark"] .ma-habit-cal-cell.is-done {
  border-color: rgba(45, 212, 191, 0.38);
  background: linear-gradient(145deg, #0f766e 0%, #0d9488 38%, #14b8a6 72%, #2dd4bf 100%);
  color: #ecfdf5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 3px rgba(0, 0, 0, 0.28);
}

[data-theme$="dark"] .ma-habit-cal-cell.is-replacement {
  border-color: rgba(96, 165, 250, 0.42);
  background: linear-gradient(145deg, #1d4ed8 0%, #2563eb 38%, #3b82f6 74%, #60a5fa 100%);
  color: #eff6ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 3px rgba(0, 0, 0, 0.28);
}

[data-theme$="dark"] .ma-habit-cal-cell.is-missed {
  border-color: rgba(244, 114, 182, 0.14);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.72) 0%, rgba(58, 40, 50, 0.42) 100%);
  color: #cbd5e1;
  box-shadow: none;
}

[data-theme$="dark"] .ma-habit-cal-cell.is-today.is-done {
  border-color: rgba(94, 234, 212, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 1px rgba(45, 212, 191, 0.28);
}

[data-theme$="dark"] .ma-habit-cal-cell.is-today.is-replacement {
  border-color: rgba(147, 197, 253, 0.54);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 1px rgba(59, 130, 246, 0.28);
}

[data-theme$="dark"] .ma-habit-cal-cell.is-today.is-missed {
  border-color: rgba(96, 165, 250, 0.28);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.75) 0%, rgba(58, 40, 50, 0.48) 100%);
  box-shadow: 0 0 0 1px rgba(244, 114, 182, 0.1);
}

/* Плашка: зарядка не в плане (без тренировки зарядки) */
.ma-skip-notice-card {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(244, 63, 94, 0.06);
  border: 1px solid rgba(244, 63, 94, 0.22);
}

.ma-skip-notice-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ma-skip-notice-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.ma-skip-notice-title {
  font-size: 13px;
  font-weight: 700;
  color: #9f1239;
}

.ma-skip-notice-sub {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--v4-ink-2, #64748b);
}

@media (hover: hover) {
  .ma-skip-reason-option:hover {
    background: var(--v4-chip, #efe3cf);
  }
}

[data-theme$="dark"] .ma-skip-notice-card {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.35);
}

[data-theme$="dark"] .ma-skip-notice-title {
  color: #fda4af;
}

[data-theme$="dark"] .ma-skip-notice-sub {
  color: var(--v4-ink-2, #94a3b8);
}

/* Steps Slider */
.steps-slider-container {
  margin-bottom: 20px;
}

/* Зона без свайпа — увеличенный padding для touch */
.steps-slider-container.no-swipe-zone {
  padding: 50px 0;
  margin: -50px 0 -30px 0;
  /* Компенсируем padding визуально */
}

.steps-motivation {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  animation: fadeInUp 0.3s ease;
}

/* === 03. SKELETON LOADER === */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.skeleton-page {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
}

.skeleton-card {
  background: var(--color-white);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--color-slate-200);
}

.skeleton-header {
  height: 14px;
  width: 120px;
  background: linear-gradient(90deg, var(--color-slate-100) 25%, var(--color-slate-200) 50%, var(--color-slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 12px;
}

.skeleton-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.skeleton-metric {
  height: 64px;
  background: linear-gradient(90deg, var(--color-slate-100) 25%, var(--color-slate-200) 50%, var(--color-slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

.skeleton-sparkline {
  height: 44px;
  background: linear-gradient(90deg, var(--color-slate-100) 25%, var(--color-slate-200) 50%, var(--color-slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
  margin-bottom: 12px;
}

.skeleton-progress {
  height: 48px;
  background: linear-gradient(90deg, var(--color-slate-100) 25%, var(--color-slate-200) 50%, var(--color-slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
  margin-bottom: 12px;
}

.skeleton-macros {
  display: flex;
  justify-content: space-around;
  gap: 16px;
}

.skeleton-ring {
  width: 56px;
  height: 72px;
  background: linear-gradient(90deg, var(--color-slate-100) 25%, var(--color-slate-200) 50%, var(--color-slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

.skeleton-slider {
  height: 40px;
  background: linear-gradient(90deg, var(--color-slate-100) 25%, var(--color-slate-200) 50%, var(--color-slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
  margin-bottom: 12px;
}

.skeleton-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.skeleton-block {
  height: 80px;
  background: linear-gradient(90deg, var(--color-slate-100) 25%, var(--color-slate-200) 50%, var(--color-slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

.skeleton-meal-header {
  height: 20px;
  width: 80px;
  background: linear-gradient(90deg, var(--color-slate-100) 25%, var(--color-slate-200) 50%, var(--color-slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════════════════════════
   APP LOADER — Красивый полноэкранный прелоадер
   ═══════════════════════════════════════════════════════════════════ */

.app-loader {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #f8fafc 0%, var(--color-slate-100) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 24px;
  animation: appLoaderFadeIn 0.3s ease;
}

@keyframes appLoaderFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.app-loader-header {
  text-align: center;
  margin-bottom: 32px;
}

.app-loader-logo {
  font-size: 56px;
  margin-bottom: 16px;
  animation: appLoaderPulse 2s ease-in-out infinite;
}

@keyframes appLoaderPulse {

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

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

.app-loader-title {
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
}

.app-loader-subtitle {
  font-size: 14px;
  color: var(--color-slate-500);
}

.app-loader-skeleton {
  width: 100%;
  max-width: 430px;
  background: var(--color-white);
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.app-loader-skeleton .skeleton-header {
  margin-bottom: 16px;
  height: auto;
  width: auto;
}

.app-loader-skeleton .skeleton-bar {
  height: 8px;
  background: linear-gradient(90deg, var(--color-slate-200) 25%, #cbd5e1 50%, var(--color-slate-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.app-loader-skeleton .skeleton-bar-xp {
  margin-bottom: 12px;
}

.app-loader-skeleton .skeleton-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-loader-skeleton .skeleton-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--color-slate-200) 25%, #cbd5e1 50%, var(--color-slate-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  flex-shrink: 0;
}

.app-loader-skeleton .skeleton-rect {
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--color-slate-200) 25%, #cbd5e1 50%, var(--color-slate-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.app-loader-skeleton .skeleton-client {
  flex: 1;
}

.app-loader-skeleton .skeleton-content {
  margin: 20px 0;
}

.app-loader-skeleton .skeleton-sparkline {
  height: 80px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  padding: 12px;
  background: var(--v4-hero, #f8fafc);
  border-radius: 12px;
  margin-bottom: 16px;
}

.app-loader-skeleton .skeleton-dot {
  flex: 1;
  min-width: 6px;
  background: linear-gradient(180deg, var(--color-blue-500) 0%, #60a5fa 100%);
  border-radius: 3px 3px 0 0;
  opacity: 0.3;
  animation: skeletonDotPulse 1.5s ease-in-out infinite;
}

@keyframes skeletonDotPulse {

  0%,
  100% {
    opacity: 0.2;
  }

  50% {
    opacity: 0.5;
  }
}

.app-loader-skeleton .skeleton-cards {
  display: flex;
  gap: 8px;
}

.app-loader-skeleton .skeleton-card {
  flex: 1;
  height: 60px;
  background: linear-gradient(90deg, var(--color-slate-200) 25%, #cbd5e1 50%, var(--color-slate-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 12px;
  border: none;
  padding: 0;
}

.app-loader-skeleton .skeleton-card-wide {
  flex: 2;
}

.app-loader-skeleton .skeleton-tabs {
  display: flex;
  justify-content: space-around;
  padding-top: 16px;
  border-top: 1px solid var(--color-slate-200);
  margin-top: 16px;
}

.app-loader-skeleton .skeleton-tab {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--color-slate-200) 25%, #cbd5e1 50%, var(--color-slate-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.app-loader-skeleton .skeleton-tab-active {
  background: linear-gradient(90deg, #dbeafe 25%, #bfdbfe 50%, #dbeafe 75%);
  background-size: 200% 100%;
}

.app-loader-spinner {
  margin-top: 24px;
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-slate-200);
  border-top-color: var(--color-blue-500);
  border-radius: 50%;
  animation: appLoaderSpin 0.8s linear infinite;
}

@keyframes appLoaderSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Dark mode */
[data-theme$="dark"] .app-loader {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

[data-theme$="dark"] .app-loader-title {
  /* Заголовок загрузчика в тёмной теме — чернила набора. */
  color: var(--v4-ink, #f2ede6);
}

[data-theme$="dark"] .app-loader-subtitle {
  color: var(--color-slate-400);
}

[data-theme$="dark"] .app-loader-skeleton {
  background: var(--v4-hero, #1e293b);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

[data-theme$="dark"] .app-loader-skeleton .skeleton-bar,
[data-theme$="dark"] .app-loader-skeleton .skeleton-circle,
[data-theme$="dark"] .app-loader-skeleton .skeleton-rect,
[data-theme$="dark"] .app-loader-skeleton .skeleton-card,
[data-theme$="dark"] .app-loader-skeleton .skeleton-tab {
  background: linear-gradient(90deg, var(--color-slate-700) 25%, #475569 50%, var(--color-slate-700) 75%);
  background-size: 200% 100%;
}

[data-theme$="dark"] .app-loader-skeleton .skeleton-sparkline {
  background: var(--v4-bg, #0f172a);
}

[data-theme$="dark"] .app-loader-skeleton .skeleton-tabs {
  border-top-color: var(--color-slate-700);
}

[data-theme$="dark"] .app-loader-spinner {
  border-color: var(--color-slate-700);
  border-top-color: var(--color-blue-500);
}

.skeleton-search {
  height: 40px;
  background: linear-gradient(90deg, var(--color-slate-100) 25%, var(--color-slate-200) 50%, var(--color-slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
  margin-bottom: 12px;
}

.skeleton-item {
  height: 56px;
  background: linear-gradient(90deg, var(--color-slate-100) 25%, var(--color-slate-200) 50%, var(--color-slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
  margin-bottom: 8px;
}

.skeleton-item:last-child {
  margin-bottom: 0;
}

/* Stagger animation delays */
.skeleton-metric:nth-child(1) {
  animation-delay: 0s;
}

.skeleton-metric:nth-child(2) {
  animation-delay: 0.1s;
}

.skeleton-metric:nth-child(3) {
  animation-delay: 0.2s;
}

.skeleton-metric:nth-child(4) {
  animation-delay: 0.3s;
}

.skeleton-ring:nth-child(1) {
  animation-delay: 0s;
}

.skeleton-ring:nth-child(2) {
  animation-delay: 0.15s;
}

.skeleton-ring:nth-child(3) {
  animation-delay: 0.3s;
}

.skeleton-item:nth-child(1) {
  animation-delay: 0s;
}

.skeleton-item:nth-child(2) {
  animation-delay: 0.1s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

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

.steps-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.steps-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-slate-700);
}

.steps-value {
  font-size: 13px;
  color: var(--color-slate-500);
}

.steps-value b {
  color: #0ea5e9;
  font-weight: 700;
}

.steps-value .steps-goal {
  color: var(--success-dark);
  font-weight: 700;
}

.steps-kcal-hint {
  font-size: 11px;
  color: var(--color-slate-400);
  font-weight: 400;
}

.steps-slider {
  position: relative;
  height: 28px;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.steps-slider-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 8px;
  transform: translateY(-50%);
  background: var(--color-slate-200);
  border-radius: 4px;
}

.steps-slider-goal-mark {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 16px;
  transform: translate(-50%, -50%);
  background: var(--success-dark);
  border-radius: 1px;
  z-index: 1;
  opacity: 0.7;
}

.steps-goal-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 500;
  color: var(--color-slate-400);
  white-space: nowrap;
  margin-top: 6px;
}

.steps-slider-fill {
  position: absolute;
  top: 50%;
  left: 0;
  height: 8px;
  transform: translateY(-50%);
  border-radius: 4px;
  transition: width 0.05s ease-out, background 0.15s ease;
}

.steps-slider-thumb {
  position: absolute;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  background: var(--color-white);
  border: 3px solid;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.15s ease;
}

.steps-slider:active .steps-slider-thumb {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (hover: hover) {
  .steps-slider-thumb:hover {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
}

.compact-activity-inputs {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.compact-activity-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.compact-activity-label {
  font-size: 12px;
  color: var(--color-slate-500);
  font-weight: 500;
  min-width: 35px;
}

.compact-activity-field .compact-input {
  width: 70px;
  text-align: center;
  min-height: 36px;
  padding: 6px 8px;
}

.compact-activity-unit {
  font-size: 12px;
  color: var(--color-slate-400);
}

.compact-activity-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--color-slate-500);
  padding: 6px 0;
  /* Отбивка — линия набора, а не ступень прежней системы. */
  border-top: 1px solid var(--v4-line, rgba(0, 0, 0, 0.08));
}

.compact-activity-stats b {
  color: var(--color-slate-700);
  font-weight: 600;
}

.compact-activity-stats.secondary {
  padding-top: 6px;
  border-top: 1px dashed var(--color-slate-200);
  color: var(--color-slate-400);
}

.compact-activity-stats.secondary b {
  color: var(--color-slate-500);
}

/* Transitions для плавных изменений */
.metrics-progress-bar {
  transition: width 0.3s ease, background 0.3s ease;
}

/* Кликабельные карточки */
@media (hover: hover) {
  .metrics-card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
}

.metrics-card-clickable:active {
  transform: translateY(0);
  opacity: 0.7;
  transition: opacity 120ms ease;
}

/* Умная подсказка */
.metrics-hint {
  font-size: 10px;
  color: var(--color-slate-500);
  margin-top: 4px;
  font-weight: 500;
}

/* Тренд веса */
.metrics-trend {
  font-size: 11px;
  color: var(--color-slate-400);
  margin-top: 2px;
  font-weight: 500;
}

/* Визуальные связи (стрелки между карточками) */
.metrics-card:not(:last-child)::after {
  content: '→';
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #cbd5e1;
  pointer-events: none;
}

/* Убираем стрелку после карточки "Съедено" (перед Осталось группа другая) */
.metrics-card:nth-child(3)::after {
  content: '•';
  font-size: 8px;
  color: var(--v4-line, #e5e7eb);
}

/* Mobile responsive для metrics cards */
@media (max-width: 640px) {
  .metrics-cards {
    gap: 6px;
  }

  .metrics-card {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 4px;
  }

  /* Первые 4 карточки в ряд */
  .metrics-card:not(.metrics-card-wide) {
    flex: 1 1 calc(25% - 5px);
  }

  /* Goal progress bar mobile */
  .goal-progress-bar {
    padding: 10px 12px 30px 12px;
  }

  .goal-progress-title {
    font-size: 12px;
  }

  .goal-eaten {
    font-size: 15px;
  }

  .goal-target {
    font-size: 13px;
  }

  .goal-progress-footer {
    font-size: 11px;
  }

  .metrics-icon {
    font-size: 14px;
  }

  .metrics-value {
    font-size: 16px;
  }

  .metrics-label {
    font-size: 8px;
    letter-spacing: 0;
  }

  /* Убираем стрелки на мобильных */
  .metrics-card::after {
    display: none;
  }

  /* Скрываем тренд и подсказки на маленьких экранах */
  .metrics-trend,
  .metrics-hint {
    display: none;
  }

  .compact-activity-inputs {
    gap: 12px;
  }

  .compact-activity-field {
    flex: 1 1 calc(50% - 6px);
  }

  .compact-activity-field .compact-input {
    width: 60px;
  }

  .compact-activity-stats {
    gap: 12px;
    font-size: 11px;
  }
}

@media (max-width: 400px) {
  .tab {
    padding: 8px 10px;
    font-size: 12px;
  }

  .btn {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* Desktop: hide mobile cards */
@media (min-width: 641px) {
  .mobile-products-list {
    display: none;
  }

  .mobile-daily-summary {
    display: none;
  }

  .mobile-only {
    display: none;
  }
}

/* Mobile Daily Summary - table layout для синхронизации ширины столбцов */
.mobile-daily-summary {
  display: none;
  background: var(--v4-bg, #fefcff);
  border-radius: 8px;
  padding: 4px 2px;
  margin-top: 8px;
  font-size: 11px;
  overflow-x: auto;
}

/* Включаем table display только когда виден */
@media (max-width: 640px) {
  .mobile-daily-summary {
    display: table;
    width: 100%;
    border-collapse: collapse;
  }
}

.mds-header,
.mds-row {
  display: table-row;
}

/* Zebra striping для столбцов */
.mds-header>span,
.mds-row>span {
  display: table-cell;
  padding: 1px 3px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

/* Чётные столбцы (2, 4, 6, 8, 10) - затемнённые */
.mds-header>span:nth-child(even),
.mds-row>span:nth-child(even) {
  background: rgba(237, 233, 254, 0.5);
}

/* Нечётные столбцы - светлые (по умолчанию) */
.mds-header>span:nth-child(odd),
.mds-row>span:nth-child(odd) {
  background: transparent;
}

/* Первый столбец (метка) - без фона */
.mds-header>span:first-child,
.mds-row>span:first-child {
  background: transparent;
  text-align: left;
  padding-right: 6px;
}

.mds-header {
  font-weight: 600;
  color: #60a5fa;
  font-size: 10px;
}

.mds-label {
  font-weight: 600;
  text-align: left;
  color: #60a5fa;
}

.mds-dim {
  color: var(--color-gray-400);
  font-size: 10px;
}

.mds-dev {
  font-size: 9px;
}

.mds-dev span {
  font-weight: 500;
}

/* Smaller font for slash-separated percentages in dev row */
.mds-dev .mds-dim {
  font-size: 8px;
}

@media (max-width: 640px) {
  .daily-summary {
    display: none;
  }
}

/* === 04. iOS-style Bottom Sheet Modal (Glassmorphism) === */
.time-picker-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  overscroll-behavior: contain;
  animation: fadeIn 0.2s ease;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.time-picker-modal {
  background: rgba(242, 242, 247, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-radius: 14px 14px 0 0;
  width: 100%;
  max-width: 500px;
  padding-bottom: env(safe-area-inset-bottom, 20px);
  animation: slideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  touch-action: none;
  overflow: hidden;
  overscroll-behavior: contain;
  will-change: transform;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
}

/* Bottom sheet handle (ручка для свайпа) */
.bottom-sheet-handle {
  display: flex;
  justify-content: center;
  padding: 10px 0 6px;
}

.bottom-sheet-handle::before {
  content: '';
  width: 36px;
  height: 5px;
  background: #d1d1d6;
  border-radius: 3px;
}

/* Анимация закрытия */
.time-picker-modal.closing {
  animation: slideDown 0.25s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(100%);
  }
}

/* Анимации переходов между шагами */
@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

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

@keyframes slideInFromLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }

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

.time-picker-step {
  animation: slideInFromRight 0.25s ease-out;
}

.time-picker-step.back {
  animation: slideInFromLeft 0.25s ease-out;
}

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

.time-picker-title {
  font-size: 17px;
  font-weight: 600;
  color: #000;
}

.time-picker-cancel,
.time-picker-confirm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  background: none;
  border: none;
  font-size: 17px;
  padding: 8px 4px;
  cursor: pointer;
}

.time-picker-cancel {
  color: var(--color-blue-ios);
}

.time-picker-confirm {
  color: var(--color-blue-ios);
  font-weight: 600;
}

.time-picker-confirm.disabled,
.time-picker-confirm:disabled {
  color: #c7c7cc;
  cursor: not-allowed;
  opacity: 0.5;
}

.time-picker-wheels {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  gap: 0;
}

/* Night time hint for meals 00:00-02:59 */
.night-time-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  margin: -8px 20px 12px;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border-radius: 12px;
  color: #e0e7ff;
  font-size: 13px;
  animation: fadeInHint 0.3s ease-out;
}

.night-time-hint .night-time-icon {
  font-size: 16px;
}

.night-time-hint .night-time-text {
  color: #c7d2fe;
}

.night-time-hint .night-time-text b {
  color: var(--color-white);
  font-weight: 600;
}

@keyframes fadeInHint {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

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

.time-picker-wheels.mood-wheels {
  gap: 16px;
  padding-bottom: 40px;
}

.time-picker-wheels.mood-wheels .wheel-column {
  width: 70px;
}

.mood-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mood-emoji {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 8px;
}

.mood-label {
  font-size: 12px;
  color: #3c3c43;
  text-align: center;
  margin-top: 12px;
  font-weight: 500;
}

/* Подсказка для первого приёма */
.mood-hint-first {
  text-align: center;
  font-size: 13px;
  color: #8e8e93;
  padding: 8px 20px 16px;
  line-height: 1.4;
}

/* Подсказка "изменилось?" для следующих приёмов */
.mood-hint-change {
  font-size: 11px;
  color: var(--color-blue-ios);
  text-align: center;
  margin-top: 4px;
  font-style: italic;
}

/* === 05. Mood Sliders === */
.mood-sliders {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 16px 24px 32px;
}

.mood-slider-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mood-slider-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mood-slider-emoji {
  font-size: 24px;
}

.mood-slider-label {
  font-size: 15px;
  font-weight: 500;
  color: #1c1c1e;
  flex: 1;
}

.mood-slider-value {
  font-size: 20px;
  font-weight: 600;
  min-width: 32px;
  text-align: right;
  color: var(--color-blue-ios);
  transition: color 0.2s ease;
}

/* Dynamic emoji animation */
.mood-emoji-dynamic {
  transition: transform 0.15s ease;
  display: inline-block;
}

.mood-slider-row:active .mood-emoji-dynamic {
  transform: scale(1.2);
}

/* Emoji bounce animation on value change */
@keyframes emoji-bounce {

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

  25% {
    transform: scale(1.25) rotate(-5deg);
  }

  50% {
    transform: scale(1.15) rotate(5deg);
  }

  75% {
    transform: scale(1.2) rotate(-3deg);
  }
}

@keyframes emoji-shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-4px) rotate(-5deg);
  }

  40% {
    transform: translateX(4px) rotate(5deg);
  }

  60% {
    transform: translateX(-3px) rotate(-3deg);
  }

  80% {
    transform: translateX(3px) rotate(3deg);
  }
}

.mood-emoji-dynamic.animate-bounce {
  animation: emoji-bounce 0.4s ease-out;
}

.mood-emoji-dynamic.animate-shake {
  animation: emoji-shake 0.4s ease-out;
}

/* Progress dots indicator */
.rating-progress-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 4px;
}

.rating-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--v4-line, #e5e7eb);
  transition: all 0.2s ease;
}

.rating-progress-dot.filled {
  background: var(--color-emerald-500);
  transform: scale(1.1);
}

.rating-progress-dot.partial {
  background: var(--v4-warn-soft, #c9922e);
}

/* Quick suggestion chips */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding: 0 4px;
}

.quick-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-gray-500);
  background: rgba(107, 114, 128, 0.1);
  border: 1px solid rgba(107, 114, 128, 0.15);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.quick-chip:active {
  opacity: 0.7;
  transition: opacity 120ms ease;
}

.quick-chip.selected {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #059669;
}

.quick-chips.negative .quick-chip {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.15);
  color: var(--v4-warn-2, #dc2626);
}

.quick-chips.positive .quick-chip {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.15);
  color: #059669;
}

/* ⏰ Meal timer hint */
.meal-timer-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin: 0 16px 8px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  animation: fade-in-up 0.3s ease;
}

.meal-timer-hint.ok {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #059669;
}

.meal-timer-hint.warning {
  background: color-mix(in srgb, var(--v4-warn-1, #d99a63) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--v4-warn-1, #d99a63) 20%, transparent);
  color: var(--v4-warn-text, #a1471c);
}

.meal-timer-icon {
  font-size: 16px;
}

.meal-timer-text {
  flex: 1;
}

.meal-timer-wave {
  font-size: 11px;
  opacity: 0.8;
}

/* 🎉 Confetti animation (Mood sliders) */
.mood-confetti {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  overflow: hidden;
  pointer-events: none;
  z-index: 10;
}

.mood-confetti .confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
  border-radius: 2px;
  animation: confetti-fall-inline 2s ease-out forwards;
}

@keyframes confetti-fall-inline {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
    opacity: 1;
  }

  100% {
    transform: translateY(250px) rotate(720deg) scale(0.5);
    opacity: 0;
  }
}

/* Celebrate emoji animation */
.mood-face-emoji.celebrate {
  animation: celebrate-bounce 0.6s ease-out;
}

@keyframes celebrate-bounce {

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

  20% {
    transform: scale(1.3) rotate(-10deg);
  }

  40% {
    transform: scale(1.2) rotate(10deg);
  }

  60% {
    transform: scale(1.25) rotate(-5deg);
  }

  80% {
    transform: scale(1.15) rotate(5deg);
  }
}

/* Correlation hint */
.correlation-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin: 8px 16px 0;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 12px;
  font-size: 12px;
  color: var(--color-blue-500);
  animation: fade-in-up 0.3s ease;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

.correlation-hint-icon {
  font-size: 16px;
}

.correlation-hint-text {
  flex: 1;
  line-height: 1.4;
}

/* Difference indicator */
.mood-diff {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  margin-left: 6px;
}

.mood-diff.diff-up {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-emerald-500);
}

.mood-diff.diff-down {
  background: rgba(239, 68, 68, 0.15);
  color: var(--v4-bad-text, #a83c22);
}

.mood-diff.diff-same {
  background: rgba(107, 114, 128, 0.15);
  color: var(--color-gray-500);
}

/* Quick preset buttons */
.mood-presets {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.mood-preset {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 4px;
  border-radius: 12px;
  border: 1.5px solid var(--v4-line, #e5e7eb);
  background: var(--color-white);
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mood-preset:active {
  opacity: 0.7;
  transition: opacity 120ms ease;
}

.mood-preset.active {
  border-color: transparent;
}

.mood-preset-bad.active {
  background: rgba(239, 68, 68, 0.15);
  color: var(--v4-bad-text, #a83c22);
  border-color: var(--v4-bad-text, #a83c22);
}

.mood-preset-ok.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-blue-500);
  border-color: var(--color-blue-500);
}

.mood-preset-good.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-emerald-500);
  border-color: var(--color-emerald-500);
}

/* Mood Face Avatar */
.mood-face-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 12px;
  gap: 4px;
}

.mood-face-emoji {
  font-size: 48px;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: mood-face-appear 0.4s ease-out;
}

@keyframes mood-face-appear {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  60% {
    transform: scale(1.1);
  }

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

.mood-face-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-gray-500);
  transition: color 0.2s ease;
}

/* Time context hint */
.mood-time-hint {
  text-align: center;
  font-size: 14px;
  color: var(--color-gray-500);
  padding: 4px 0 8px;
}

/* AI Insight */
.mood-ai-insight {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin: 0 0 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
  border-radius: 12px;
  font-size: 13px;
  color: var(--v4-water, #3b82f6);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.mood-ai-insight span:first-child {
  font-size: 18px;
}

/* Slider track with yesterday mark */
.mood-slider-track {
  position: relative;
  width: 100%;
}

.yesterday-mark {
  position: absolute;
  top: -14px;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--color-gray-400);
  opacity: 0.7;
  pointer-events: none;
}

/* Pulse animation for value change */
.mood-slider-value.pulse {
  animation: value-pulse 0.3s ease;
}

@keyframes value-pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }

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

/* Mood Journal Wrapper - фиксированная высота чтобы не прыгало */
.mood-journal-wrapper {
  min-height: 60px;
  margin: 0 16px 16px;
  transition: all 0.3s ease;
}

/* Mood Journal Prompt — базовые стили */
.mood-journal-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  transition: all 0.3s ease;
}

/* Негативный стиль — красноватый */
.mood-journal-prompt.negative {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

/* Позитивный стиль — зеленый */
.mood-journal-prompt.positive {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

/* Нейтральный стиль — серый */
.mood-journal-prompt.neutral {
  background: rgba(156, 163, 175, 0.08);
  border: 1px solid rgba(156, 163, 175, 0.15);
}

.mood-journal-prompt.positive .mood-journal-text {
  color: #059669;
}

.mood-journal-prompt.negative .mood-journal-text {
  color: var(--v4-warn-2, #dc2626);
}

.mood-journal-prompt.neutral .mood-journal-text {
  color: var(--color-gray-500);
}

.mood-journal-icon {
  font-size: 20px;
}

.mood-journal-text {
  flex: 1;
  font-size: 13px;
  color: var(--color-gray-500);
}

.mood-journal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 14px;
  background: var(--color-gray-500);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mood-journal-btn.positive {
  background: var(--color-emerald-500);
}

.mood-journal-wrapper.negative .mood-journal-btn {
  background: var(--v4-val-bad, #a8382b);
}

.mood-journal-btn:active {
  opacity: 0.7;
  transition: opacity 120ms ease;
}

/* Journal input field */
.mood-journal-input {
  width: 100%;
  border: none;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: #1c1c1e;
  outline: none;
  margin-top: 8px;
}

.mood-journal-input::placeholder {
  color: var(--color-gray-400);
}

.mood-journal-input:focus {
  background: var(--color-white);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.mood-journal-prompt.positive .mood-journal-input:focus {
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.mood-journal-prompt.negative .mood-journal-input:focus {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* Slider footer with sparkline */
.mood-slider-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.mood-sparkline {
  opacity: 0.8;
}

.mood-slider-footer .mood-hint-change {
  font-size: 11px;
  color: var(--color-gray-400);
  margin: 0;
}

/* Range slider styling */
.mood-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  background: transparent;
}

.mood-slider-positive,
.mood-slider-negative {
  background: transparent;
}

.mood-slider::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.18), 0 1px 2px rgba(15, 23, 42, 0.08);
}

.mood-slider-positive::-webkit-slider-runnable-track {
  background: linear-gradient(90deg,
      var(--v4-warn-1, #ef4444) 0%,
      var(--v4-warn-2, #c67139) 18%,
      var(--v4-warn-1, #d99a63) 34%,
      var(--v4-water, #3b82f6) 52%,
      var(--v4-ok-fill, #22c55e) 76%,
      #10b981 100%);
}

.mood-slider-negative::-webkit-slider-runnable-track {
  background: linear-gradient(90deg,
      #10b981 0%,
      var(--v4-ok-fill, #22c55e) 24%,
      var(--v4-water, #3b82f6) 50%,
      var(--v4-warn-1, #d99a63) 72%,
      var(--v4-warn-2, #c67139) 86%,
      var(--v4-warn-1, #ef4444) 100%);
}

.mood-slider::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.18), 0 1px 2px rgba(15, 23, 42, 0.08);
}

.mood-slider-positive::-moz-range-track {
  background: linear-gradient(90deg,
      var(--v4-warn-1, #ef4444) 0%,
      var(--v4-warn-2, #c67139) 18%,
      var(--v4-warn-1, #d99a63) 34%,
      var(--v4-water, #3b82f6) 52%,
      var(--v4-ok-fill, #22c55e) 76%,
      #10b981 100%);
}

.mood-slider-negative::-moz-range-track {
  background: linear-gradient(90deg,
      #10b981 0%,
      var(--v4-ok-fill, #22c55e) 24%,
      var(--v4-water, #3b82f6) 50%,
      var(--v4-warn-1, #d99a63) 72%,
      var(--v4-warn-2, #c67139) 86%,
      var(--v4-warn-1, #ef4444) 100%);
}

/* Slider thumb */
.mood-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-white);
  border: 2px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.24);
  cursor: pointer;
  transition: transform 0.1s ease;
  margin-top: -10px;
}

.mood-slider::-webkit-slider-thumb:active {
  opacity: 0.7;
  transition: opacity 120ms ease;
}

.mood-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-white);
  border: 2px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.24);
  cursor: pointer;
}

.mood-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  padding: 0 4px;
  opacity: 0.7;
}

.mood-slider-row .mood-hint-change {
  text-align: left;
  margin-top: 2px;
}

.wheel-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 80px;
}

.wheel-label {
  font-size: 13px;
  color: #8e8e93;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wheel-viewport {
  height: 220px;
  overflow: hidden;
  position: relative;
  width: 100%;
  touch-action: none;
  /* Полный контроль над touch */
  -webkit-overflow-scrolling: auto;
  /* Отключаем нативный скролл */
}

.wheel-track {
  will-change: transform;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wheel-item {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #8e8e93;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
  flex-shrink: 0;
  will-change: transform, opacity;
}

.wheel-item.selected {
  color: #000;
  font-weight: 600;
  font-size: 24px;
}

.wheel-highlight {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 44px;
  transform: translateY(-50%);
  background: rgba(120, 120, 128, 0.12);
  border-radius: 8px;
  pointer-events: none;
}

/* === 06. Grams Input Modal === */
.grams-modal {
  padding-bottom: max(env(safe-area-inset-bottom, 20px), 20px);
  transition: transform 0.2s ease-out;
}

.grams-modal.closing {
  transform: translateY(100%);
  opacity: 0.5;
}

.grams-modal-title {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grams-preview {
  display: flex;
  justify-content: center;
  align-items: baseline;
  padding: 20px 16px 16px;
  font-size: 28px;
  font-weight: 600;
}

.grams-preview-value {
  color: var(--color-blue-ios);
}

.grams-preview-separator {
  color: #8e8e93;
  margin: 0 8px;
  font-weight: 400;
}

.grams-preview-kcal {
  color: #000;
  /* Smooth animation on value change */
  transition: transform 0.15s ease-out, color 0.15s ease;
  display: inline-block;
  font-weight: 500;
}

/* === HERO Input граммов (главный элемент) === */
.grams-input-hero {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 16px 8px;
  gap: 12px;
}

.grams-input-hero__field {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.grams-input--hero {
  width: 140px;
  height: 64px;
  font-size: 48px;
  font-weight: 700;
  text-align: center;
  border: none;
  border-bottom: 3px solid var(--color-blue-ios);
  border-radius: 0;
  background: transparent;
  color: var(--color-blue-ios);
  -moz-appearance: textfield;
  padding: 0;
}

.grams-input--hero::-webkit-outer-spin-button,
.grams-input--hero::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.grams-input--hero:focus {
  outline: none;
  border-bottom-color: var(--color-blue-ios);
}

.grams-input-suffix--hero {
  font-size: 32px;
  font-weight: 600;
  color: var(--color-blue-ios);
  margin-left: 2px;
}

.grams-stepper-btn--hero {
  width: 52px;
  height: 52px;
  font-size: 28px;
  border-radius: 50%;
}

/* Калории как вторичная информация */
.grams-kcal-secondary {
  text-align: center;
  padding: 4px 16px 12px;
}

.grams-kcal-secondary__value {
  font-size: 18px;
  font-weight: 500;
  color: #8e8e93;
}

[data-theme$="dark"] .grams-input--hero {
  color: #0a84ff;
  border-bottom-color: #0a84ff;
}

[data-theme$="dark"] .grams-input-suffix--hero {
  color: #0a84ff;
}

[data-theme$="dark"] .grams-kcal-secondary__value {
  color: #98989d;
}

/* Kcal color coding */
.grams-preview-kcal.kcal-low {
  color: #34c759;
}

.grams-preview-kcal.kcal-mid {
  color: var(--v4-act-text, #8a4a20);
}

.grams-preview-kcal.kcal-high {
  color: var(--v4-warn-1, #ff3b30);
}

.grams-preview-kcal.animating {
  animation: kcal-pulse 0.3s ease-out;
}

@keyframes kcal-pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }

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

/* "Обычно вы едите" hint */
.grams-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  text-align: center;
  padding: 8px 16px;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  transition: color 0.15s;
}

@media (hover: hover) {
  .grams-hint:hover {
  color: var(--color-blue-ios);
}
}

.grams-hint:active {
  opacity: 0.7;
  transition: opacity 120ms ease;
}

/* Kcal Calculator */
.kcal-calculator {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
}

.kcal-calc-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-size: 14px;
  padding: 6px 12px;
  border: 1px solid var(--v4-line, #e0e0e0);
  border-radius: 16px;
  background: var(--v4-hero, #f8f8f8);
  color: #666;
  cursor: pointer;
  transition: all 0.15s;
}

@media (hover: hover) {
  .kcal-calc-toggle:hover {
  background: var(--v4-hero, #f0f0f0);
}
}

.kcal-calc-toggle.active {
  background: var(--color-blue-ios);
  border-color: var(--color-blue-ios);
  color: var(--color-white);
}

.kcal-calc-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kcal-calc-input input {
  width: 80px;
  padding: 6px 10px;
  font-size: 16px;
  border: 1px solid var(--v4-line, #e0e0e0);
  border-radius: 8px;
  text-align: center;
  background: var(--color-white);
}

.kcal-calc-input input:focus {
  outline: none;
  border-color: var(--color-blue-ios);
}

.kcal-calc-result {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

/* === 07. Portion Buttons === */
.grams-portions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 0 16px 12px;
}

.grams-portion-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 72px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid var(--v4-line, #e5e5ea);
  background: var(--v4-hero, #f2f2f7);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.grams-portion-btn .portion-name {
  font-size: 15px;
  font-weight: 600;
  color: #000;
}

.grams-portion-btn .portion-grams {
  font-size: 12px;
  color: #8e8e93;
  font-weight: 500;
}

.grams-portion-btn:active {
  opacity: 0.7;
  transition: opacity 120ms ease;
}

@keyframes portion-bounce {
  0% {
    transform: scale(0.96);
  }

  50% {
    transform: scale(1.05);
  }

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

.grams-portion-btn.active {
  background: var(--color-blue-ios);
  border-color: var(--color-blue-ios);
}

.grams-portion-btn.active .portion-name,
.grams-portion-btn.active .portion-grams {
  color: var(--color-white);
}

/* Рекомендованная порция (последняя выбранная) */
.grams-portion-btn.recommended {
  border-color: #34c759;
  box-shadow: 0 0 0 2px rgba(52, 199, 89, 0.2);
  position: relative;
}

.grams-portion-btn__star {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: #34c759;
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grams-portion-btn__star-icon {
  display: block;
}

@media (hover: hover) {
  .grams-portion-btn:not(.active):hover {
  background: #e5e5ea;
}
}

/* Dark mode for portions */
[data-theme$="dark"] .grams-portion-btn {
  background: #2c2c2e;
  border-color: #48484a;
}

[data-theme$="dark"] .grams-portion-btn .portion-name {
  color: var(--color-white);
}

[data-theme$="dark"] .grams-portion-btn .portion-grams {
  color: #8e8e93;
}

[data-theme$="dark"] .grams-portion-btn.active {
  background: var(--v4-act, #0a84ff);
  border-color: #0a84ff;
}

@media (hover: hover) {
  [data-theme$="dark"] .grams-portion-btn:not(.active):hover {
  background: #3a3a3c;
}
}

[data-theme$="dark"] .grams-portion-btn.recommended {
  border-color: #30d158;
  box-shadow: 0 0 0 2px rgba(48, 209, 88, 0.2);
}

[data-theme$="dark"] .grams-portion-btn__star {
  background: #30d158;
}

/* Свайп контейнер для порций */
.grams-portions {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.grams-portions::-webkit-scrollbar {
  display: none;
}

.grams-portion-btn {
  scroll-snap-align: center;
  flex-shrink: 0;
}

.grams-input-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 16px 20px;
  gap: 8px;
}

/* Stepper кнопки +/- */
.grams-stepper-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 500;
  color: var(--color-blue-ios);
  background: var(--v4-hero, #f2f2f7);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

@media (hover: hover) {
  .grams-stepper-btn:hover {
  background: #e5e5ea;
}
}

.grams-stepper-btn:active {
  opacity: 0.7;
  transition: opacity 120ms ease;
}

[data-theme$="dark"] .grams-stepper-btn {
  background: #2c2c2e;
  color: #0a84ff;
}

@media (hover: hover) {
  [data-theme$="dark"] .grams-stepper-btn:hover {
  background: #3a3a3c;
}
}

.grams-input {
  width: 120px;
  height: 48px;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  border: 2px solid #d1d1d6;
  border-radius: 12px;
  background: var(--color-white);
  color: #000;
  outline: none;
  -moz-appearance: textfield;
}

.grams-input::-webkit-outer-spin-button,
.grams-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.grams-input:focus {
  border-color: var(--color-blue-ios);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.grams-input-suffix {
  font-size: 20px;
  color: #8e8e93;
  font-weight: 500;
}

/* Grams Slider (like steps slider) */
.grams-slider-container {
  padding: 0 20px 16px;
}

.grams-slider {
  position: relative;
  height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.grams-slider-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  background: #e5e5ea;
  border-radius: 3px;
}

.grams-slider-fill {
  position: absolute;
  left: 0;
  height: 6px;
  background: linear-gradient(90deg, #34c759 0%, var(--color-blue-ios) 100%);
  border-radius: 3px;
  transition: width 0.15s ease-out;
}

.grams-slider-thumb {
  position: absolute;
  width: 28px;
  height: 28px;
  background: var(--color-white);
  border: 3px solid var(--color-blue-ios);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: left 0.15s ease-out, transform 0.1s ease, box-shadow 0.1s ease;
}

.grams-slider-thumb:active,
.grams-slider:active .grams-slider-thumb {
  transform: translateX(-50%) scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.grams-slider-mark {
  position: absolute;
  width: 2px;
  height: 10px;
  background: #c7c7cc;
  border-radius: 1px;
  transform: translateX(-50%);
  top: 50%;
  margin-top: -5px;
}

.grams-slider-labels {
  display: flex;
  justify-content: space-between;
  padding-top: 4px;
  font-size: 12px;
  color: #8e8e93;
}

/* Grams Presets */
.grams-presets {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 16px 20px;
  flex-wrap: wrap;
}

.grams-preset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 500;
  background: var(--v4-hero, #f2f2f7);
  border: 2px solid transparent;
  border-radius: 20px;
  color: #000;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 60px;
}

.grams-preset:active {
  opacity: 0.7;
  transition: opacity 120ms ease;
}

.grams-preset.active {
  background: var(--color-blue-ios);
  color: var(--color-white);
  border-color: var(--color-blue-ios);
}

@media (hover: hover) {
  .grams-preset:not(.active):hover {
  background: #e5e5ea;
}
}

/* Dark mode support */
[data-theme$="dark"] .grams-modal {
  background: rgba(44, 44, 46, 0.95);
}

[data-theme$="dark"] .grams-preview-value {
  color: #0a84ff;
}

[data-theme$="dark"] .grams-preview-kcal {
  color: var(--color-white);
}

/* Dark theme kcal colors */
[data-theme$="dark"] .grams-preview-kcal.kcal-low {
  color: #30d158;
}

[data-theme$="dark"] .grams-preview-kcal.kcal-mid {
  color: var(--v4-warn-soft, #c9922e);
}

[data-theme$="dark"] .grams-preview-kcal.kcal-high {
  color: #ff453a;
}

[data-theme$="dark"] .grams-hint {
  color: #98989d;
}

@media (hover: hover) {
  [data-theme$="dark"] .grams-hint:hover {
  color: #0a84ff;
}
}

/* Dark theme kcal calculator */
[data-theme$="dark"] .kcal-calc-toggle {
  background: #2c2c2e;
  border-color: #48484a;
  color: #98989d;
}

@media (hover: hover) {
  [data-theme$="dark"] .kcal-calc-toggle:hover {
  background: #3a3a3c;
}
}

[data-theme$="dark"] .kcal-calc-toggle.active {
  background: var(--v4-act, #0a84ff);
  border-color: #0a84ff;
  color: var(--color-white);
}

[data-theme$="dark"] .kcal-calc-input input {
  background: #1c1c1e;
  border-color: #48484a;
  color: var(--color-white);
}

[data-theme$="dark"] .kcal-calc-input input:focus {
  border-color: #0a84ff;
}

[data-theme$="dark"] .kcal-calc-result {
  color: #98989d;
}

[data-theme$="dark"] .grams-input {
  background: #1c1c1e;
  border-color: #48484a;
  color: var(--color-white);
}

[data-theme$="dark"] .grams-input:focus {
  border-color: #0a84ff;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

[data-theme$="dark"] .grams-slider-track {
  background: #48484a;
}

[data-theme$="dark"] .grams-slider-thumb {
  background: #2c2c2e;
  border-color: #0a84ff;
}

[data-theme$="dark"] .grams-preset {
  background: #2c2c2e;
  color: var(--color-white);
}

[data-theme$="dark"] .grams-preset.active {
  background: var(--v4-act, #0a84ff);
}

@media (hover: hover) {
  [data-theme$="dark"] .grams-preset:not(.active):hover {
  background: #3a3a3c;
}
}

/* Pull-to-refresh */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Второй pull-to-refresh снят вместе со своим спиннером: apps/web/heys_pull_refresh.js
   экспортировал HEYS.PullToRefresh, но его никто не монтировал (живой жест —
   HEYS.dayPullRefresh). Это был третий вид ожидания в продукте, контракт
   «Спиннеры» → «форма» знает один. @keyframes spin выше оставлен: тем же именем
   пользуется animate-spin из tailwind.css. */

/* Utility classes для замены inline стилей (modals/day scope) */
.dev-positive {
  color: var(--v4-warn-2, #dc2626);
  font-weight: 600;
}

.dev-negative {
  color: #059669;
  font-weight: 600;
}

.dev-neutral {
  color: var(--color-gray-500);
}

.fw-600 {
  font-weight: 600;
}

.text-right {
  text-align: right;
}

.mt-4 {
  margin-top: 4px;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mb-4 {
  margin-bottom: 4px;
}

.mb-6 {
  margin-bottom: 6px;
}

.w-100 {
  width: 100%;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-x-auto {
  overflow-x: auto;
}

.pos-relative {
  position: relative;
}

/* Muted text helper */
.text-muted-small {
  color: var(--muted);
  font-size: 11px;
  margin-left: 8px;
  font-weight: normal;
}

/* Table column widths */
.col-40 {
  width: 40%;
}

.col-20 {
  width: 20%;
}

.col-15 {
  width: 15%;
}

/* Deficit input styling */
.input-deficit {
  width: 60px;
  text-align: center;
  font-weight: 600;
}

/* Result cell styling */
.result-good {
  background: var(--v4-ok-bg, #dcfce7);
  color: #166534;
  font-weight: 700;
  border: 1px solid #86efac;
}

.result-bad {
  background: #fee2e2;
  color: #991b1b;
  font-weight: 700;
  border: 1px solid #fecaca;
}

/* Divider row in table */
.table-divider {
  height: 4px;
  background: #d1d5db;
  border-radius: 6px;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════
   🎬 ANIMATIONS & TRANSITIONS
   ═══════════════════════════════════════════════════════════════════ */

/* --- Keyframes --- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {

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

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

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

  50% {
    transform: scale(1.3);
  }

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

/* --- Meal Cards Animation --- */
/* ОТКЛЮЧЕНО: вызывает мерцание при cloud sync ререндерах */
/* .meal-card {
  animation: fadeInUp 0.25s ease-out;
} */

/* Stagger animation for multiple cards */
/* .meal-card:nth-child(1) { animation-delay: 0ms; }
.meal-card:nth-child(2) { animation-delay: 50ms; }
.meal-card:nth-child(3) { animation-delay: 100ms; }
.meal-card:nth-child(4) { animation-delay: 150ms; }
.meal-card:nth-child(5) { animation-delay: 200ms; } */

/* --- Product Row Animation (slide-in when added) --- */
.meals-table tbody tr {
  animation: slideInRight 0.2s ease-out;
}

/* --- Suggest Dropdown Animation --- */
.suggest-list,
.suggest-list-portal {
  animation: scaleIn 0.15s ease-out;
  transform-origin: top center;
}

.suggest-list-portal {
  /* duplicate intentional: layout (fixed/z-index) in 000 module, animation here */
}

.suggest-item {
  transition: background-color 0.12s ease, transform 0.1s ease;
}

.suggest-item:active {
  opacity: 0.7;
  transition: opacity 120ms ease;
}

/* --- Button Micro-interactions --- */
.btn {
  transition: transform 0.1s ease, opacity 0.1s ease, box-shadow 0.15s ease;
}

@media (hover: hover) {
  .btn:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
}

.btn:active {
  opacity: 0.7;
  transition: opacity 120ms ease;
}

@media (hover: hover) {
  .btn.acc:hover {
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
}

/* --- Favorite Star Animation --- */
.favorite-btn {
  transition: opacity 0.15s ease, transform 0.15s ease;
}

@media (hover: hover) {
  .favorite-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}
}

.favorite-btn:active {
  opacity: 0.7;
  transition: opacity 120ms ease;
}

/* --- Card Hover Effects (desktop) --- */
@media (hover: hover) {
  .card {
    transition: box-shadow 0.2s ease, transform 0.15s ease;
  }

  .card.clickable:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
  }
}

/* --- Input Focus Animation --- */
input,
textarea,
select {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* --- Tab Switching --- */
.tab {
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

/* --- Modal Backdrop Animation --- */
.modal-backdrop {
  animation: fadeIn 0.15s ease-out;
}

.modal {
  animation: scaleIn 0.2s ease-out;
}

/* --- Reduce motion for accessibility --- */
/* Исключаем .animate-always — графики всегда анимируются (это часть UX) */
@media (prefers-reduced-motion: reduce) {

  *:not(.animate-always):not(.animate-always *),
  *:not(.animate-always):not(.animate-always *)::before,
  *:not(.animate-always):not(.animate-always *)::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* MODULE 04 — Modals & Day UI
 * Scope: day score/sleep pickers, modals/bottom-sheets, forms, loaders.
 */

/* ══════════════════════════════════════════════════════════════
 * DARK MODE — Mood Cards & Day Insights (Module 04)
 * ══════════════════════════════════════════════════════════════ */
[data-theme$="dark"] .mood-card {
  background: linear-gradient(135deg, var(--heys-bg-elevated) 0%, var(--heys-bg-card) 100%);
  border-color: var(--heys-border-default);
}

[data-theme$="dark"] .mood-card-label {
  color: var(--heys-text-secondary);
}

[data-theme$="dark"] .mood-card-value {
  color: var(--heys-text-primary);
}

[data-theme$="dark"] .day-insight {
  background: rgba(148, 163, 184, 0.12);
  color: var(--heys-text-muted);
}

[data-theme$="dark"] .day-insight.correlation {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

[data-theme$="dark"] .smart-tip {
  background: linear-gradient(135deg, color-mix(in srgb, var(--v4-warn-soft, #c9922e) 15%, transparent), color-mix(in srgb, var(--v4-warn-1, #d99a63) 15%, transparent));
  color: var(--v4-warn-soft, #c9922e);
}

/* ══════════════════════════════════════════════════════════════
 * DARK MODE — Mood Sliders & Presets
 * ══════════════════════════════════════════════════════════════ */
[data-theme$="dark"] .mood-preset {
  background: var(--heys-bg-card);
  border-color: var(--heys-border-default);
  color: var(--heys-text-primary);
}

[data-theme$="dark"] .mood-preset-bad.active {
  background: rgba(248, 113, 113, 0.2);
  border-color: #ef4444;
}

[data-theme$="dark"] .mood-preset-ok.active {
  background: rgba(96, 165, 250, 0.2);
  border-color: var(--v4-act, #3b82f6);
}

[data-theme$="dark"] .mood-preset-good.active {
  background: rgba(74, 222, 128, 0.2);
  border-color: var(--v4-ok-fill, #22c55e);
}

[data-theme$="dark"] .mood-face-text {
  color: var(--heys-text-muted);
}

[data-theme$="dark"] .mood-slider-label {
  color: var(--heys-text-primary);
}

[data-theme$="dark"] .mood-slider-value {
  color: var(--v4-act-text, #60a5fa);
}

[data-theme$="dark"] .mood-slider::-webkit-slider-runnable-track,
[data-theme$="dark"] .mood-slider::-moz-range-track {
  border-color: rgba(148, 163, 184, 0.3);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.06), 0 1px 3px rgba(2, 6, 23, 0.45);
}

[data-theme$="dark"] .mood-slider::-webkit-slider-thumb,
[data-theme$="dark"] .mood-slider::-moz-range-thumb {
  background: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

[data-theme$="dark"] .mood-time-hint {
  color: var(--heys-text-muted);
}

[data-theme$="dark"] .mood-ai-insight {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
  color: #93c5fd;
  border-color: rgba(99, 102, 241, 0.3);
}

[data-theme$="dark"] .mood-journal-prompt {
  border-color: var(--heys-border-default);
}

[data-theme$="dark"] .mood-journal-prompt.negative {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

[data-theme$="dark"] .mood-journal-prompt.positive {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme$="dark"] .mood-journal-prompt.neutral {
  background: rgba(148, 163, 184, 0.1);
  border-color: var(--heys-border-default);
}

[data-theme$="dark"] .mood-journal-text {
  color: var(--heys-text-muted);
}

[data-theme$="dark"] .mood-journal-input {
  background: var(--heys-bg-elevated);
  color: var(--heys-text-primary);
  border: 1px solid var(--heys-border-default);
}

[data-theme$="dark"] .mood-journal-input::placeholder {
  color: var(--heys-text-muted);
}

[data-theme$="dark"] .mood-journal-input:focus {
  background: var(--heys-bg-card);
  border-color: var(--heys-border-focus);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

[data-theme$="dark"] .correlation-hint {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.25);
  color: #93c5fd;
}

[data-theme$="dark"] .quick-chip {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.2);
  color: var(--heys-text-secondary);
}

[data-theme$="dark"] .quick-chip.selected {
  background: rgba(74, 222, 128, 0.2);
  border-color: rgba(74, 222, 128, 0.35);
  color: #86efac;
}

[data-theme$="dark"] .rating-progress-dot {
  background: var(--heys-bg-elevated);
}

[data-theme$="dark"] .rating-progress-dot.filled {
  background: var(--v4-ok-text, #4ade80);
}

[data-theme$="dark"] .rating-progress-dot.partial {
  background: var(--v4-warn-soft, #c9922e);
}

/* ══════════════════════════════════════════════════════════════
 * DARK MODE — Time Picker / Wheel
 * ══════════════════════════════════════════════════════════════ */
[data-theme$="dark"] .time-picker-separator {
  color: var(--heys-text-primary);
}

[data-theme$="dark"] .wheel-label {
  color: var(--heys-text-muted);
}

[data-theme$="dark"] .wheel-item {
  color: var(--heys-text-muted);
}

[data-theme$="dark"] .wheel-item.selected {
  color: var(--heys-text-primary);
}

[data-theme$="dark"] .wheel-highlight {
  background: rgba(148, 163, 184, 0.15);
}

[data-theme$="dark"] .bottom-sheet-handle::before {
  background: var(--heys-border-default);
}

[data-theme$="dark"] .time-picker-header {
  border-bottom-color: var(--heys-border-default);
}

[data-theme$="dark"] .time-picker-title {
  color: var(--heys-text-primary);
}

[data-theme$="dark"] .time-picker-confirm.disabled,
[data-theme$="dark"] .time-picker-confirm:disabled {
  color: var(--heys-text-muted);
}

/* ══════════════════════════════════════════════════════════════
 * DARK MODE — Meal Timer Hint
 * ══════════════════════════════════════════════════════════════ */
[data-theme$="dark"] .meal-timer-hint.ok {
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.3);
  color: #86efac;
}

[data-theme$="dark"] .meal-timer-hint.warning {
  background: color-mix(in srgb, var(--v4-warn-soft, #c9922e) 15%, transparent);
  border-color: color-mix(in srgb, var(--v4-warn-soft, #c9922e) 30%, transparent);
  color: var(--v4-warn-soft, #c9922e);
}

/* ══════════════════════════════════════════════════════════════
 * DARK MODE — Steps Slider
 * ══════════════════════════════════════════════════════════════ */
[data-theme$="dark"] .steps-label {
  color: var(--heys-text-secondary);
}

[data-theme$="dark"] .steps-value {
  color: var(--heys-text-muted);
}

[data-theme$="dark"] .steps-value b {
  color: var(--v4-act-text, #60a5fa);
}

[data-theme$="dark"] .steps-kcal-hint {
  color: var(--heys-text-muted);
}

[data-theme$="dark"] .steps-slider-track {
  background: var(--heys-bg-elevated);
}

[data-theme$="dark"] .steps-slider-thumb {
  background: var(--heys-bg-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme$="dark"] .steps-motivation {
  background: rgba(148, 163, 184, 0.08);
}

/* ══════════════════════════════════════════════════════════════
 * DARK MODE — Compact Activity
 * ══════════════════════════════════════════════════════════════ */
[data-theme$="dark"] .compact-activity-label {
  color: var(--heys-text-muted);
}

[data-theme$="dark"] .compact-activity-unit {
  color: var(--heys-text-muted);
}

[data-theme$="dark"] .compact-activity-stats {
  color: var(--heys-text-muted);
  border-top-color: var(--heys-border-subtle);
}

[data-theme$="dark"] .compact-activity-stats b {
  color: var(--heys-text-secondary);
}

[data-theme$="dark"] .compact-activity-stats.secondary {
  border-top-color: var(--heys-border-subtle);
  color: var(--heys-text-muted);
}

/* ══════════════════════════════════════════════════════════════
 * DARK MODE — Skeleton Loader
 * ══════════════════════════════════════════════════════════════ */
[data-theme$="dark"] .skeleton-card {
  background: var(--heys-bg-card);
  border-color: var(--heys-border-default);
}

[data-theme$="dark"] .skeleton-header,
[data-theme$="dark"] .skeleton-metric,
[data-theme$="dark"] .skeleton-sparkline,
[data-theme$="dark"] .skeleton-progress,
[data-theme$="dark"] .skeleton-ring,
[data-theme$="dark"] .skeleton-slider,
[data-theme$="dark"] .skeleton-block,
[data-theme$="dark"] .skeleton-meal-header,
[data-theme$="dark"] .skeleton-search {
  background: linear-gradient(90deg, var(--heys-bg-elevated) 25%, #475569 50%, var(--heys-bg-elevated) 75%);
  background-size: 200% 100%;
}

/* ══════════════════════════════════════════════════════════════
 * DARK MODE — Mobile Daily Summary
 * ══════════════════════════════════════════════════════════════ */
[data-theme$="dark"] .mobile-daily-summary {
  background: var(--heys-bg-card);
}

[data-theme$="dark"] .mds-header>span:nth-child(even),
[data-theme$="dark"] .mds-row>span:nth-child(even) {
  background: rgba(99, 102, 241, 0.08);
}

[data-theme$="dark"] .mds-header {
  color: var(--v4-act-text, #60a5fa);
}

[data-theme$="dark"] .mds-label {
  color: var(--v4-act-text, #60a5fa);
}

[data-theme$="dark"] .mds-dim {
  color: var(--heys-text-muted);
}

/* ══════════════════════════════════════════════════════════════
 * DARK MODE — Day Score Legacy Buttons
 * ══════════════════════════════════════════════════════════════ */
[data-theme$="dark"] .day-score-btn {
  background: var(--heys-bg-card);
  border-color: var(--heys-border-default);
}

[data-theme$="dark"] .day-score-label {
  color: var(--heys-text-muted);
}

[data-theme$="dark"] .day-score-value {
  color: #f9a8d4;
}

[data-theme$="dark"] .sleep-quality-btn {
  background: var(--heys-bg-card);
  border-color: var(--heys-border-default);
}

[data-theme$="dark"] .sleep-quality-label {
  color: var(--heys-text-muted);
}

[data-theme$="dark"] .sleep-quality-value {
  color: var(--v4-warn-soft, #c9922e);
}

/* ══════════════════════════════════════════════════════════════
 * DARK MODE — Mood Diff
 * ══════════════════════════════════════════════════════════════ */
[data-theme$="dark"] .mood-diff.diff-up {
  background: rgba(74, 222, 128, 0.2);
  color: #86efac;
}

[data-theme$="dark"] .mood-diff.diff-down {
  background: rgba(248, 113, 113, 0.2);
  color: #fca5a5;
}

[data-theme$="dark"] .mood-diff.diff-same {
  background: rgba(148, 163, 184, 0.15);
  color: var(--heys-text-muted);
}

/* ══════════════════════════════════════════════════════════════
 * DARK MODE — Grams Input Modal (already mostly done)
 * Missing pieces
 * ══════════════════════════════════════════════════════════════ */
[data-theme$="dark"] .grams-preview-separator {
  color: var(--heys-text-muted);
}

[data-theme$="dark"] .grams-input-suffix {
  color: var(--heys-text-muted);
}

[data-theme$="dark"] .grams-slider-mark {
  background: var(--heys-border-default);
}

[data-theme$="dark"] .grams-slider-labels {
  color: var(--heys-text-muted);
}

[data-theme$="dark"] .grams-portion-btn .portion-name {
  color: var(--heys-text-primary);
}

/* ══════════════════════════════════════════════════════════════
 * DARK MODE — Result cells
 * ══════════════════════════════════════════════════════════════ */
[data-theme$="dark"] .result-good {
  background: rgba(74, 222, 128, 0.15);
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.3);
}

[data-theme$="dark"] .result-bad {
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.3);
}

[data-theme$="dark"] .table-divider {
  background: var(--heys-border-default);
}
