.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  display: flex;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans, 'Plus Jakarta Sans'), 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.01em;
}

.app-shell .bg-gradient {
  z-index: 0;
}

.app-shell-body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── Top bar ── */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 16, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.app-nav-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.app-nav-menu-btn:active {
  transform: scale(0.96);
}

.app-nav-menu-btn:hover {
  border-color: var(--border-accent);
  background: rgba(255, 246, 0, 0.08);
}

.app-nav-logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.app-nav-spacer {
  flex: 1;
}

.app-nav-logout {
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 107, 107, 0.35);
  background: rgba(255, 107, 107, 0.08);
  color: #ff8a8a;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.app-nav-logout:hover {
  background: rgba(255, 107, 107, 0.16);
}

.app-nav-signin {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-accent);
  background: rgba(255, 246, 0, 0.1);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s;
}

.app-nav-signin:hover {
  background: rgba(255, 246, 0, 0.16);
}

/* ── Sidebar (shared) ── */
.app-sidebar {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  background: rgba(12, 12, 18, 0.98);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.app-sidebar-inner {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
}

.app-sidebar-top {
  grid-row: 1;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 246, 0, 0.07) 0%, rgba(255, 246, 0, 0.02) 42%, transparent 100%),
    rgba(12, 12, 18, 0.98);
}

.app-sidebar-nav {
  grid-row: 2;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  position: relative;
  z-index: 1;
}

.app-sidebar-menu {
  padding: 14px 12px max(16px, env(safe-area-inset-bottom));
}

.app-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: max(18px, env(safe-area-inset-top)) 16px 0;
}

.app-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.app-sidebar-brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, #ffe566 100%);
  color: #111;
  font-weight: 900;
  font-size: 1rem;
  box-shadow: 0 8px 24px rgba(255, 246, 0, 0.22);
  flex-shrink: 0;
}

.app-sidebar-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.app-sidebar-brand-text {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.app-sidebar-brand-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.app-sidebar-close {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.app-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
}

.app-sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.app-sidebar-user-block {
  margin: 0 16px;
}

.app-sidebar-scan {
  margin-top: 10px;
  padding: 0 6px 2px;
}

.app-sidebar-scan-label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.app-sidebar-scan-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.app-sidebar-scan-track.unlimited .app-sidebar-scan-fill {
  opacity: 0.45;
}

.app-sidebar-scan-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 246, 0, 0.85), var(--accent));
  transition: width 0.35s ease;
}

.app-sidebar-avatar {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(255, 246, 0, 0.22), rgba(255, 246, 0, 0.06));
  border: 2px solid rgba(255, 246, 0, 0.35);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.app-sidebar-user-meta {
  flex: 1;
  min-width: 0;
}

.app-sidebar-user-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar-user-email {
  display: block;
  margin-top: 2px;
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar-user-badge {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 246, 0, 0.12);
  border: 1px solid rgba(255, 246, 0, 0.28);
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-sidebar-section {
  margin-bottom: 20px;
}

.app-sidebar-section-title {
  margin: 0 0 8px;
  padding: 0 12px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.app-sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.app-sidebar-link:active {
  transform: scale(0.98);
}

.app-sidebar-link:hover,
.app-sidebar-link.active {
  background: rgba(255, 246, 0, 0.1);
  color: var(--accent);
}

.app-sidebar-link.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.app-sidebar-link-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.15s;
}

.app-sidebar-link.active .app-sidebar-link-icon {
  background: rgba(255, 246, 0, 0.15);
}

.app-sidebar-link-label {
  flex: 1;
}

.app-sidebar-link-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  flex-shrink: 0;
}

.app-sidebar-section-last {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.app-sidebar-link-logout {
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: #ff8a8a;
  -webkit-tap-highlight-color: transparent;
}

.app-sidebar-link-logout .app-sidebar-link-icon {
  background: rgba(255, 107, 107, 0.12);
  color: #ff8a8a;
}

.app-sidebar-link-logout:hover,
.app-sidebar-link-logout:active {
  background: rgba(255, 107, 107, 0.08);
  color: #ffaaaa;
}

/* Slide-in drawer (all screen sizes) */
.app-sidebar-mobile {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  visibility: hidden;
}

.app-shell.menu-open .app-nav,
.app-shell.menu-open .app-bottom-nav {
  visibility: hidden;
}

.app-shell.menu-open .app-shell-body {
  pointer-events: none;
}

.app-sidebar-mobile.open {
  pointer-events: auto;
  visibility: visible;
}

.app-sidebar-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.app-sidebar-mobile.open .app-sidebar-backdrop {
  opacity: 1;
}

.app-sidebar-drawer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100dvh;
  max-height: 100dvh;
  width: min(360px, 92vw);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(-105%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 24px 0 80px rgba(0, 0, 0, 0.5);
}

@media (max-width: 1023px) {
  .app-sidebar-head {
    padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  }

  .app-sidebar-user-block {
    margin: 0 16px;
  }

  .app-sidebar-user {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .app-sidebar-menu {
    padding: 0;
  }

  .app-sidebar-section-title {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (min-width: 1024px) {
  .app-sidebar-drawer {
    width: min(380px, 34vw);
  }

  .app-sidebar-top {
    padding-bottom: 18px;
  }

  .app-sidebar-user-block {
    margin: 0 18px;
  }

  .app-sidebar-user {
    padding: 16px;
  }

  .app-sidebar-menu {
    padding: 16px 14px max(20px, env(safe-area-inset-bottom));
  }
}

.app-sidebar-mobile.open .app-sidebar-drawer {
  transform: translateX(0);
}

/* ── Main content ── */
.app-main {
  flex: 1;
  width: 100%;
  padding: 20px 16px 8px;
}

.app-content {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

@media (max-width: 1023px) {
  .app-nav {
    position: relative;
    padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  }

  .app-nav-menu-btn {
    margin-left: 6px;
    flex-shrink: 0;
  }

  .app-nav-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
  }

  .app-bottom-nav-inner {
    padding: 8px env(safe-area-inset-right, 0) 10px env(safe-area-inset-left, 0);
  }
}

@media (min-width: 1024px) {
  .app-nav {
    padding-left: 24px;
    padding-right: 24px;
  }

  .app-main {
    padding: 24px 24px 8px;
  }
}

/* ── Bottom nav ── */
.app-bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 30;
  border-top: 1px solid var(--border);
  background: rgba(10, 10, 16, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding-bottom: env(safe-area-inset-bottom);
}

.app-bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 20px 10px;
}

.app-bottom-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 52px;
  min-height: 44px;
  padding: 6px 8px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.app-bottom-link.active {
  color: var(--accent);
}

.app-bottom-add {
  margin-top: -28px;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  box-shadow: 0 8px 24px rgba(255, 246, 0, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.app-bottom-add:active {
  transform: scale(0.95);
}

/* ── Content stack & cards ── */
.app-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.app-stack > .app-card,
.app-stack > .app-food-row,
.app-stack > .app-food-card,
.app-stack > .app-alert {
  margin-bottom: 0;
}

.app-page-title {
  font-size: clamp(1.75rem, 4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 8px;
}

.app-page-subtitle {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.app-card {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom: 14px;
}

.app-card:last-child {
  margin-bottom: 0;
}

.app-card-padded {
  padding: 20px;
}

.app-muted {
  color: var(--text-secondary);
}

.app-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.app-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.app-input:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px rgba(255, 246, 0, 0.12);
}

.app-input option {
  background: var(--bg-elevated);
  color: var(--text);
}

.app-input-date {
  color-scheme: dark;
}

.app-field-hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.app-progress-form .app-btn {
  margin-top: 4px;
}

.app-progress-entry {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.app-progress-entry:last-child {
  margin-bottom: 0;
}

.app-progress-date {
  margin: 4px 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.app-progress-date-sub {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.app-upload-zone {
  display: flex;
  aspect-ratio: 1;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.2s;
  margin-bottom: 14px;
}

.app-upload-zone:hover {
  border-color: var(--border-accent);
}

.app-btn-secondary {
  flex: 1;
  padding: 14px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.app-alert {
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 246, 0, 0.25);
  background: rgba(255, 246, 0, 0.08);
  text-align: center;
  margin-bottom: 14px;
}

.app-alert p {
  margin: 0 0 8px;
}

.app-alert small {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.app-chip-grid {
  display: grid;
  gap: 10px;
}

.app-chip-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-chip-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-chip {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.app-chip-block {
  width: 100%;
  text-align: left;
}

.app-chip:hover {
  border-color: var(--border-accent);
}

.app-chip.active {
  background: rgba(255, 246, 0, 0.12);
  border-color: var(--border-accent);
  color: var(--accent);
}

.app-chip-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.75;
}

.app-btn {
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.app-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.app-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.app-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.app-profile-action-btn {
  margin-top: 24px;
}

.app-profile-action-row {
  display: flex;
  gap: 14px;
  margin-top: 24px;
}

.app-btn-outline {
  width: 100%;
  padding: 15px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.app-btn-outline:hover:not(:disabled) {
  border-color: var(--border-accent);
}

.app-btn-outline:active:not(:disabled) {
  transform: scale(0.98);
}

.app-btn-outline:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.app-error {
  color: #ff6b6b;
  font-size: 0.9rem;
}

.app-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.app-day-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.app-day-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.app-day-title {
  font-size: 1.05rem;
  font-weight: 800;
}

.app-day-title-btn {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 12px;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.app-day-title-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.app-date-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.app-date-picker {
  width: min(100%, 360px);
  padding: 18px 16px 16px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(16, 16, 22, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.app-date-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.app-date-picker-month {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.app-date-picker-nav {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}

.app-date-picker-weekdays,
.app-date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.app-date-picker-weekdays {
  margin-bottom: 8px;
}

.app-date-picker-weekdays span {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.app-date-picker-day {
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}

.app-date-picker-day.is-empty {
  background: transparent;
  pointer-events: none;
}

.app-date-picker-day.no-logs {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.38);
}

.app-date-picker-day.has-logs {
  background: rgba(255, 246, 0, 0.18);
  color: var(--accent);
  border-color: rgba(255, 246, 0, 0.24);
}

.app-date-picker-day.is-selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 246, 0, 0.35);
}

.app-date-picker-day.is-today {
  font-weight: 900;
}

.app-date-picker-day:active:not(.is-empty) {
  transform: scale(0.96);
}

.app-date-picker-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 16px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.app-date-picker-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.app-date-picker-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.app-date-picker-dot.has-logs {
  background: rgba(255, 246, 0, 0.75);
}

.app-date-picker-dot.no-logs {
  background: rgba(255, 255, 255, 0.14);
}

.app-macro-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.app-macro-card {
  flex: 1;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.app-macro-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-macro-card-icon--calories {
  color: var(--accent);
}

.app-macro-card-icon--protein {
  color: #ff6b5b;
}

.app-macro-card-icon--carbs {
  color: #34d399;
}

.app-macro-card-icon--fat {
  color: #60a5fa;
}

.app-macro-card span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.app-macro-card p {
  margin: 4px 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
}

.app-macro-card small {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.app-macro-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.app-macro-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.app-meal-title {
  margin: 16px 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.app-meal-title:first-child {
  margin-top: 0;
}

.app-food-row,
.app-food-card {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.app-food-row {
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.app-food-card {
  position: relative;
}

.app-food-card-link {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.app-food-card-link:hover .app-food-name {
  color: var(--accent);
}

.app-food-card--no-thumb {
  padding-left: 14px;
}

.app-food-row:last-child,
.app-food-card:last-child {
  margin-bottom: 0;
}

.app-food-thumb {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.app-food-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding-right: 8px;
}

.app-food-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.app-food-row p,
.app-food-card p {
  margin: 0;
}

.app-food-name {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.app-food-macro-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  max-width: 220px;
}

.app-food-macro-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 34px;
  padding: 3px 2px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.app-food-macro-chip-icon {
  flex-shrink: 0;
  opacity: 0.95;
}

.app-food-macro-chip-value {
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.app-food-macro-chip-label {
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.8;
}

.app-food-macro-chip--protein {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
}

.app-food-macro-chip--carbs {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
}

.app-food-macro-chip--fat {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}

.app-food-kcal {
  font-weight: 800;
  font-size: 0.88rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.app-food-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  flex-shrink: 0;
  align-self: flex-start;
  padding-top: 2px;
}

.app-food-time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1;
  white-space: nowrap;
}

.app-food-delete {
  position: static;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  min-width: 36px;
  min-height: 36px;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.app-food-row .app-food-delete {
  position: static;
}

.app-food-delete:hover {
  color: #ff6b6b;
}

.app-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.app-empty small {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.app-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
}

.app-range {
  width: 100%;
  accent-color: var(--accent);
}

.app-range-value {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.app-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 246, 0, 0.12);
  color: var(--accent);
}

/* ── Pricing ── */
.app-content-wide {
  width: 100%;
  max-width: 100%;
}

.app-content:has(.app-content-wide) {
  max-width: 100%;
}

.app-pricing-intro {
  text-align: center;
  margin-bottom: 8px;
}

.app-pricing-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .app-content:has(.app-content-wide) {
    max-width: 720px;
  }

  .app-pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .app-content:has(.app-content-wide) {
    max-width: 960px;
  }

  .app-content-wide {
    max-width: 960px;
    margin: 0 auto;
  }

  .app-pricing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .app-addon-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.app-pricing-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  padding: 24px 22px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  margin-bottom: 0;
}

.app-pricing-card.featured {
  border-color: rgba(255, 246, 0, 0.35);
  background: rgba(255, 246, 0, 0.06);
  box-shadow: 0 8px 32px rgba(255, 246, 0, 0.08);
}

.app-pricing-badge {
  display: inline-block;
  width: fit-content;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 246, 0, 0.15);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.app-pricing-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.25;
}

.app-pricing-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 12px 0 0;
}

.app-pricing-amount {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.app-pricing-period {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.app-pricing-features {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  flex: 1;
}

.app-pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.app-pricing-features li span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.app-pricing-check {
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.1em;
}

.app-pricing-cta {
  margin-top: auto;
  padding-top: 22px;
  width: 100%;
}

.app-pricing-cta.app-btn-secondary {
  width: 100%;
}

.app-addon-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.app-addon-grid .app-card {
  min-width: 0;
}

.app-addon-grid .app-muted {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.app-section-title {
  margin: 8px 0 0;
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
}

/* ── FAQ (in-app) ── */
.app-faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-faq-item {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.app-faq-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.app-faq-trigger span.chevron {
  color: var(--accent);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.app-faq-item.open .app-faq-trigger span.chevron {
  transform: rotate(90deg);
}

.app-faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 18px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.65;
}

.app-faq-item.open .app-faq-content {
  padding-bottom: 16px;
}

.app-faq-content p {
  margin: 0 0 10px;
}

.app-faq-content a,
.app-faq-link {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Auth card (in-app) ── */
.app-auth-card {
  max-width: 440px;
  margin: 0 auto;
}

.app-auth-card .app-page-title {
  text-align: center;
}

.app-auth-card .app-page-subtitle {
  text-align: center;
  margin-bottom: 28px;
}

.app-auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.app-auth-footer a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.app-auth-footer a:hover {
  text-decoration: underline;
}

.app-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 246, 0, 0.15);
  color: var(--accent);
  font-size: 1.75rem;
  font-weight: 800;
}

.app-success-copy {
  text-align: center;
  max-width: 320px;
  margin: 0 auto;
}

/* ── Meal detail / AI insights ── */
.meal-detail-page {
  margin: -20px -16px 0;
}

.meal-detail {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 24px;
}

.meal-detail-hero {
  position: relative;
  width: 100%;
  min-height: 280px;
  max-height: 42vh;
  overflow: hidden;
}

.meal-detail-hero-photo {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}

.meal-detail-hero-img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  pointer-events: none;
}

.meal-detail-hero-expand {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  pointer-events: none;
}

.meal-photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.meal-photo-lightbox-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.meal-photo-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.meal-detail-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.05) 35%,
    rgba(0, 0, 0, 0.55) 72%,
    rgba(0, 0, 0, 0.98) 100%
  );
  pointer-events: none;
}

.meal-detail-hero-back {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.meal-detail-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 16px;
  margin-top: -28px;
  position: relative;
  z-index: 1;
}

.meal-detail-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
}

.meal-detail-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.meal-detail-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.02em;
}

.meal-detail-header-spacer {
  width: 44px;
}

.meal-detail-photo {
  display: none;
}

.meal-detail-summary {
  padding: 0 2px;
}

.meal-detail-name-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.meal-detail-name {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.meal-detail-name-edit {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-top: 2px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.meal-detail-name-edit:hover {
  color: var(--accent);
  border-color: rgba(255, 246, 0, 0.35);
  background: rgba(255, 246, 0, 0.08);
}

.meal-detail-name-input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(255, 246, 0, 0.45);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  outline: none;
}

.meal-detail-name-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 246, 0, 0.12);
}

.meal-detail-name-input:disabled {
  opacity: 0.65;
}

.meal-detail-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.meal-detail-meta {
  margin: 0;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.55);
}

.meal-detail-meal-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.45);
  background: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
  font-size: 0.78rem;
  font-weight: 700;
}

.meal-detail-nutrition {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meal-detail-calories-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  border-radius: 18px;
  background: #1c1c1e;
  border: none;
}

.meal-detail-calories-copy {
  min-width: 0;
}

.meal-detail-calories-value {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
}

.meal-detail-calories-label {
  margin: 6px 0 0;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
}

.meal-detail-macros-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.meal-detail-macro-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 124px;
  padding: 18px 10px 16px;
  border-radius: 18px;
  background: #1c1c1e;
  border: none;
  text-align: center;
}

.meal-detail-nutrition-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.meal-detail-nutrition-icon--calories {
  color: var(--accent);
}

.meal-detail-nutrition-icon--protein {
  color: #ff6b5b;
}

.meal-detail-nutrition-icon--carbs {
  color: #34d399;
}

.meal-detail-nutrition-icon--fats {
  color: #60a5fa;
}

.meal-detail-macro-value {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.meal-detail-macro-label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}

.meal-detail-fix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 14px rgba(255, 246, 0, 0.22);
}

.meal-detail-fix i {
  font-size: 0.95em;
}

.meal-detail-fix:hover:not(:disabled) {
  background: #fff200;
  border-color: #fff200;
  color: #000;
  box-shadow: 0 6px 18px rgba(255, 246, 0, 0.32);
}

.meal-detail-fix:active:not(:disabled) {
  transform: scale(0.98);
}

.meal-detail-fix:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.meal-detail-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
  padding: 16px 20px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.meal-detail-save:hover:not(:disabled) {
  opacity: 0.92;
}

.meal-detail-save:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.meal-detail-save-note {
  margin: -8px 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.meal-insights-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 72px;
  border-radius: 22px;
  border: 1px solid rgba(255, 246, 0, 0.35);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 246, 0, 0.06);
}

.meal-insights-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.meal-insights-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #000;
  font-size: 0.95rem;
  font-weight: 900;
}

.meal-insights-card-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.meal-insight-block {
  margin-bottom: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.meal-insight-block:last-of-type {
  margin-bottom: 0;
}

.meal-insight-block h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 0.92rem;
  font-weight: 800;
}

.meal-insight-block p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
}

.meal-insight-win h3 {
  color: #34d399;
}

.meal-insight-improve h3 {
  color: #fbbf24;
}

.meal-insight-focus h3 {
  color: #60a5fa;
}

.meal-insights-actions {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.meal-insights-chat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 246, 0, 0.45);
  background: transparent;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s;
}

.meal-insights-chat:hover {
  background: rgba(255, 246, 0, 0.08);
}

.meal-insights-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  box-shadow: 0 8px 24px rgba(255, 246, 0, 0.28);
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
}

.meal-detail-foods {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.meal-detail-foods:hover:not(:disabled) {
  border-color: rgba(255, 246, 0, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

.meal-detail-foods:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.meal-detail-foods-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.meal-detail-foods-copy {
  flex: 1;
  min-width: 0;
}

.meal-detail-foods-copy strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
}

.meal-detail-foods-copy small {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.meal-detail-foods-arrow {
  font-size: 1.35rem;
  color: var(--text-secondary);
  line-height: 1;
}

/* Game Plan / Daily Insights */
.daily-insights-page {
  margin: -20px 0 0;
  padding: 16px 16px 0;
}

.daily-insights-page .meal-detail {
  gap: 20px;
}

.daily-insights-page .game-plan-stats {
  gap: 16px;
}

.daily-insights-page .meal-insights-card {
  gap: 16px;
}

.daily-insights-page .game-plan-foods-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: -8px;
}

.game-plan-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.game-plan-stat {
  padding: 14px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}

.game-plan-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.game-plan-stat-icon--calories {
  color: var(--accent);
}

.game-plan-stat-icon--protein {
  color: #ff6b5b;
}

.app-target-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.app-target-icon--calories {
  color: var(--accent);
}

.app-target-icon--protein {
  color: #ff6b5b;
}

.app-target-icon--carbs {
  color: #34d399;
}

.app-target-icon--fat {
  color: #60a5fa;
}

.game-plan-stat-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.game-plan-stat-label {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.45);
}

.game-plan-stat small {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.game-plan-foods-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Game Plan page */
.gp-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: -12px -4px 0;
  padding-bottom: 12px;
}

.gp-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 2px;
}

.gp-back {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}

.gp-title {
  margin: 4px 0 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.gp-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.gp-priority-card {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 246, 0, 0.22);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 246, 0, 0.16), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.03) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.gp-priority-head,
.gp-recovery-head,
.gp-weekly-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gp-priority-label,
.gp-recovery-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.gp-priority-title {
  margin: 14px 0 8px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.gp-priority-copy,
.gp-recovery-copy {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.gp-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gp-icon-flag {
  background: rgba(255, 246, 0, 0.18);
  color: var(--accent);
}

.gp-icon-calories {
  background: rgba(255, 246, 0, 0.14);
  color: var(--accent);
}

.gp-icon-steps {
  background: rgba(52, 211, 153, 0.18);
  color: #6ee7b7;
}

.gp-icon-trend {
  background: rgba(255, 246, 0, 0.16);
  color: var(--accent);
}

.gp-icon-recovery {
  background: rgba(248, 113, 113, 0.16);
  color: #fca5a5;
}

.gp-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.gp-mini-card {
  position: relative;
  min-height: 148px;
  padding: 16px 14px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.04);
}

.gp-mini-label {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.gp-mini-value {
  margin: 4px 0 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.gp-mini-value span {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
}

.gp-mini-sub {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.42);
}

.gp-mini-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.18);
  color: #ddd6fe;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.gp-weekly-card,
.gp-recovery-card {
  padding: 18px 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.04);
}

.gp-weekly-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gp-trend-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.gp-trend-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.gp-trend-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.gp-trend-icon--calories {
  background: rgba(255, 246, 0, 0.14);
  color: var(--accent);
}

.gp-trend-icon--protein {
  background: rgba(255, 107, 91, 0.16);
  color: #ff6b5b;
}

.gp-trend-icon--trend {
  background: rgba(251, 146, 60, 0.16);
  color: #fb923c;
}

.gp-trend-value {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gp-trend-sub {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.42);
}

.gp-recovery-card {
  margin-bottom: 4px;
}

.gp-recovery-copy {
  margin-top: 12px;
}

/* Nutritionist call */
.nutritionist-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 12px;
}

.nutritionist-card {
  position: relative;
  padding: 22px 20px 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 246, 0, 0.18);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 246, 0, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.03) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nutritionist-card--locked {
  border-color: rgba(255, 255, 255, 0.08);
}

.nutritionist-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.nutritionist-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 246, 0, 0.12);
  border: 1px solid rgba(255, 246, 0, 0.28);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nutritionist-lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.68rem;
  font-weight: 700;
}

.nutritionist-icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 246, 0, 0.12);
  border: 1px solid rgba(255, 246, 0, 0.22);
  color: var(--accent);
  margin-bottom: 14px;
}

.nutritionist-title {
  margin: 0 0 8px;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.nutritionist-copy {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.nutritionist-benefits {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nutritionist-benefits li {
  position: relative;
  padding-left: 22px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.78);
}

.nutritionist-benefits li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 800;
}

.nutritionist-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 20px;
  padding: 15px 18px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.15s;
}

.nutritionist-cta--locked {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.nutritionist-cta:hover:not(:disabled) {
  opacity: 0.92;
}

.nutritionist-cta:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.nutritionist-footnote {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.nutritionist-footnote a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.nutritionist-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.nutritionist-modal {
  width: min(100%, 380px);
  padding: 24px 22px 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #121218;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.nutritionist-modal-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 246, 0, 0.12);
  color: var(--accent);
  font-size: 1.2rem;
}

.nutritionist-modal h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 800;
}

.nutritionist-modal p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.nutritionist-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.nutritionist-modal-upgrade {
  text-decoration: none;
  text-align: center;
}

/* AI Coach chat */
.coach-chat-page {
  margin: -8px -4px 0;
  height: calc(100dvh - 72px);
  max-height: calc(100dvh - 72px);
}

.coach-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.coach-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 2px 12px;
}

.coach-chat-bubble {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 92%;
}

.coach-chat-bubble-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.coach-chat-bubble-assistant {
  align-self: flex-start;
}

.coach-chat-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent);
  color: #000;
  font-size: 0.85rem;
  font-weight: 900;
  flex-shrink: 0;
}

.coach-chat-bubble-body {
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.coach-chat-bubble-assistant .coach-chat-bubble-body {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: rgba(255, 255, 255, 0.92);
  border-bottom-left-radius: 6px;
}

.coach-chat-bubble-user .coach-chat-bubble-body {
  background: rgba(255, 246, 0, 0.14);
  border: 1px solid rgba(255, 246, 0, 0.35);
  color: var(--text);
  border-bottom-right-radius: 6px;
}

.coach-chat-typing {
  color: var(--text-secondary);
  font-style: italic;
}

.coach-chat-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 2px 10px;
}

.coach-chat-prompt {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.coach-chat-prompt:hover {
  border-color: rgba(255, 246, 0, 0.35);
  color: var(--accent);
}

.coach-chat-error {
  margin: 0 0 8px;
}

.coach-chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}

.coach-chat-input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.4;
  resize: none;
  outline: none;
}

.coach-chat-input:focus {
  border-color: rgba(255, 246, 0, 0.45);
}

.coach-chat-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  cursor: pointer;
  flex-shrink: 0;
}

.coach-chat-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
