/*
 * GymDiet Master reference shell
 * A single visual layer for every native screen.  It deliberately contains
 * no layout-specific markup assumptions, so new product screens inherit the
 * same compact dark mobile appearance as the dashboard, diary and scanner.
 */
:root,
:root[data-theme='dark'],
:root[data-theme='light'] {
  --gd-ref-bg: #080d12;
  --gd-ref-surface: #141a1a;
  --gd-ref-surface-raised: #1a2020;
  --gd-ref-border: rgba(255, 255, 255, 0.09);
  --gd-ref-text: #f4f7f4;
  --gd-ref-muted: #9aa69d;
  --gd-ref-green: #00ed76;
  --gd-ref-green-deep: #00c960;
}

html,
body {
  min-height: 100%;
  background: #060b12 !important;
}

body {
  color: var(--gd-ref-text) !important;
  font-family: Inter, Manrope, Arial, sans-serif !important;
}

#app {
  width: min(100%, 480px) !important;
  min-height: 100vh;
  margin: 0 auto !important;
  overflow: hidden;
  background: var(--gd-ref-bg) !important;
  border-color: rgba(255, 255, 255, 0.045) !important;
  box-shadow: 0 0 48px rgba(0, 0, 0, 0.66) !important;
}

.screen,
.screen .main-content,
#screen-main,
#screen-profile,
#screen-finance,
#screen-analysis,
#screen-menu,
#screen-my-menu,
#screen-workout,
#screen-more {
  background: var(--gd-ref-bg) !important;
}

.header,
#screen-main > .header,
:is(#screen-profile, #screen-finance) > .header {
  min-height: 64px;
  background: rgba(8, 13, 18, 0.94) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055) !important;
  box-shadow: none !important;
}

.card,
.glass-card,
.diary-card,
.workout-card,
.section-tile,
.section-tile-featured {
  background: var(--gd-ref-surface) !important;
  border: 1px solid var(--gd-ref-border) !important;
  border-radius: 17px !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16) !important;
}

input,
textarea,
select,
.gd-input {
  color: var(--gd-ref-text) !important;
  background: rgba(255, 255, 255, 0.035) !important;
  border-color: rgba(255, 255, 255, 0.13) !important;
  border-radius: 10px !important;
}

input::placeholder,
textarea::placeholder {
  color: #69746d !important;
}

.gd-btn--primary,
.btn-primary,
button.primary,
button.bg-\[\#00f076\],
.bg-\[\#00f076\] {
  color: #031109 !important;
  background: linear-gradient(135deg, var(--gd-ref-green), var(--gd-ref-green-deep)) !important;
  border-color: transparent !important;
  box-shadow: 0 8px 22px rgba(0, 237, 118, 0.23) !important;
}

.bottom-nav,
#bottom-nav,
:root .bottom-nav,
:root[data-theme] .bottom-nav,
body .bottom-nav {
  width: min(100%, 480px) !important;
  min-height: 82px !important;
  left: 50% !important;
  right: auto !important;
  inset: auto auto 0 50% !important;
  transform: translateX(-50%) !important;
  padding: 9px 10px calc(9px + env(safe-area-inset-bottom, 0px)) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-bottom: 0 !important;
  border-radius: 25px 25px 0 0 !important;
  background: #06101e !important;
  box-shadow: 0 -8px 26px rgba(0, 0, 0, 0.38) !important;
}

.bottom-nav .nav-item,
.bottom-nav .nav-item:hover {
  color: var(--gd-ref-muted) !important;
}

.bottom-nav .nav-item.active,
.bottom-nav .nav-item[aria-current='page'] {
  color: var(--gd-ref-green) !important;
}

.bottom-nav .nav-item.active .nav-icon,
.bottom-nav .nav-item[aria-current='page'] .nav-icon {
  filter: drop-shadow(0 0 5px rgba(0, 237, 118, 0.25));
}

/* Diary: these components have legacy, screen-scoped skins. */
#screen-diary .diary-insight,
#screen-diary .diary-entry,
#screen-diary .diary-entry-empty {
  color: var(--gd-ref-text) !important;
  background: var(--gd-ref-surface) !important;
  background-image: none !important;
  border-color: var(--gd-ref-border) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16) !important;
}

#screen-diary .diary-insight *,
#screen-diary .diary-entry * {
  color: inherit;
}

#screen-diary .diary-insight-kicker,
#screen-diary .diary-insight-refresh,
#screen-diary .sum-val {
  color: var(--gd-ref-green) !important;
  -webkit-text-fill-color: var(--gd-ref-green) !important;
}

#screen-diary .entry-macros,
#screen-diary .diary-insight-empty,
#screen-diary .sum-lbl {
  color: var(--gd-ref-muted) !important;
}

/* Menu preferences modal: keep form surfaces dark even when utility styles
   are injected by the Tailwind CDN after the static CSS files. */
.menu-preview-backdrop {
  background: rgba(0, 0, 0, 0.72) !important;
}

.menu-preview-sheet,
.menu-preferences-modal .menu-preview-sheet {
  color: var(--gd-ref-text) !important;
  background: #101617 !important;
  background-image: none !important;
  border-color: var(--gd-ref-border) !important;
}

.menu-preferences-card,
.menu-preferences-modal .menu-preferences-card {
  background: var(--gd-ref-surface) !important;
  border-color: var(--gd-ref-border) !important;
}

.menu-preview-sheet .food-input,
.menu-preferences-card .food-input {
  color: var(--gd-ref-text) !important;
  background: #0d1314 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.menu-preview-sheet .input-label {
  color: #b7c9b9 !important;
}

/* Workout player: the reference uses a compact square timer panel, not a
   circular dial.  The existing countdown DOM and its progress CSS variable
   remain unchanged, so pausing, resuming and restoring a workout still work. */
#screen-workout .workout-session-sequence-timer-wrap {
  margin: 14px auto 16px !important;
}

#screen-workout .workout-session-timer-ring,
#screen-workout .workout-session-timer-ring-lg {
  position: relative !important;
  display: grid !important;
  place-items: center !important;
  width: min(43vw, 142px) !important;
  height: min(43vw, 142px) !important;
  margin: 0 auto !important;
  padding: 22px !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  border-radius: 18px !important;
  background: #141a1a !important;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34) !important;
}

#screen-workout .workout-session-timer-ring::before,
#screen-workout .workout-session-timer-ring-lg::before {
  content: '' !important;
  position: absolute !important;
  top: 13px !important;
  right: 13px !important;
  left: 13px !important;
  height: 6px !important;
  border-radius: 999px !important;
  background: linear-gradient(
    90deg,
    var(--gd-ref-green) 0 var(--workout-session-ring-progress, 0%),
    rgba(255, 255, 255, 0.08) var(--workout-session-ring-progress, 0%) 100%
  ) !important;
  box-shadow: 0 0 10px rgba(0, 237, 118, 0.26) !important;
}

#screen-workout .workout-session-timer-ring::after,
#screen-workout .workout-session-timer-ring-lg::after {
  display: none !important;
}

#screen-workout .workout-session-timer-ring-inner {
  position: relative !important;
  z-index: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  gap: 6px !important;
}

#screen-workout .workout-session-timer-caption {
  color: var(--gd-ref-muted) !important;
}

#screen-workout .workout-session-sequence-main .workout-session-timer,
#screen-workout .workout-session-player-v3 .workout-session-timer {
  color: #fff !important;
  background: none !important;
  -webkit-text-fill-color: #fff !important;
  font-size: clamp(1.9rem, 9.5vw, 2.55rem) !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: visible !important;
}

#screen-workout .workout-session-timer-setlabel {
  color: var(--gd-ref-green) !important;
}

#screen-workout .workout-session-ring-toggle {
  width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  margin-top: 0 !important;
  border-radius: 10px !important;
  color: #031109 !important;
  background: var(--gd-ref-green) !important;
  border: 0 !important;
  box-shadow: 0 6px 16px rgba(0, 237, 118, 0.22) !important;
}
#screen-workout .workout-session-ring-toggle svg { width: 15px !important; height: 15px !important; }
#screen-workout .workout-session-timer-ring { padding: 17px 14px 12px !important; }
#screen-workout .workout-session-timer-ring-inner { gap: 3px !important; }
#screen-workout .workout-session-timer-caption { font-size: 10px !important; line-height: 1.1 !important; }
#screen-workout .workout-session-timer-setlabel { font-size: 10px !important; line-height: 1.1 !important; }

/* Workout session surfaces — these selectors cover the dynamically rendered
   prepare, exercise, rest and finish states. */
#screen-workout [data-workout-execution-screen] .card,
#screen-workout .workout-active-exercise-card,
#screen-workout .workout-session-card,
#screen-workout .workout-session-transition-shell,
#screen-workout .workout-rest-controls,
#screen-workout .workout-rest-suggestion,
#screen-workout .workout-session-finish-card,
#screen-workout .workout-complete-card {
  color: var(--gd-ref-text) !important;
  background: #141a1a !important;
  background-image: none !important;
  border-color: var(--gd-ref-border) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25) !important;
}

#screen-workout .workout-complete-card h2,
#screen-workout .workout-complete-card p,
#screen-workout .workout-complete-card strong {
  color: var(--gd-ref-text) !important;
}

#screen-workout .workout-complete-card .workout-complete-stat {
  background: var(--gd-ref-surface-raised) !important;
  border-color: var(--gd-ref-border) !important;
}

#screen-workout .workout-complete-card .workout-complete-stat span {
  color: var(--gd-ref-muted) !important;
}

/* Last line of defence for dynamically rendered workout states.  Legacy
   completion templates occasionally carry a white surface utility class. */
#screen-workout .workout-complete-main .card,
#screen-workout .workout-complete-main [class*='card'],
#screen-workout .workout-complete-main [class*='stat'],
#screen-workout .workout-session-main .card,
#screen-workout .workout-session-main [class*='card'] {
  background-color: #141a1a !important;
  background-image: none !important;
  border-color: var(--gd-ref-border) !important;
}

#screen-workout .workout-session-main .workout-next-exercise {
  background: linear-gradient(135deg, #00ed76, #00c960) !important;
  border-color: transparent !important;
}

/* One consistent back control across every screen. */
.back-btn,
button.back-btn,
#app .back-btn {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  display: inline-grid !important;
  place-items: center !important;
  padding: 0 !important;
  color: #edf2ee !important;
  background: #141a1a !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 15px !important;
  box-shadow: none !important;
}

.back-btn svg {
  width: 22px !important;
  height: 22px !important;
  stroke: currentColor !important;
}

/* Bottom quick access — flat dark bar, neutral icons, green only for active. */
.bottom-nav,
#bottom-nav,
:root .bottom-nav,
body .bottom-nav {
  min-height: 74px !important;
  border: 0 !important;
  border-top: 1px solid rgba(255,255,255,.06) !important;
  border-radius: 0 !important;
  background: #101415 !important;
  box-shadow: none !important;
}
.bottom-nav .nav-item,
.bottom-nav .nav-item:hover,
.bottom-nav .nav-item .nav-icon,
.bottom-nav .nav-item .nav-label,
.bottom-nav .nav-item .nav-icon svg {
  color: #9aa69d !important;
  stroke: currentColor !important;
  fill: none !important;
}
.bottom-nav .nav-item.active,
.bottom-nav .nav-item.active .nav-icon,
.bottom-nav .nav-item.active .nav-label,
.bottom-nav .nav-item[aria-current='page'],
.bottom-nav .nav-item[aria-current='page'] .nav-icon,
.bottom-nav .nav-item[aria-current='page'] .nav-label {
  color: #00ed76 !important;
}

#screen-workout .workout-next-exercise {
  color: #02150a !important;
  background: linear-gradient(135deg, #00ed76, #00c960) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

#screen-workout .workout-next-exercise strong,
#screen-workout .workout-next-exercise p,
#screen-workout .workout-next-exercise span {
  color: #02150a !important;
}

/* Remove remaining light surfaces from recipe, reminder and workout screens. */
#app [class*='bg-white'],
#app .empty-state,
#app .reminder-empty,
#app .reminders-empty-state,
#app .menu-config-card,
#app .menu-goal-card,
#app .recipe-goal-card,
#app .workout-plan-summary,
#app .workout-plan-progress {
  background-color: #141a1a !important;
  background-image: none !important;
  border-color: rgba(255,255,255,.09) !important;
}

#screen-menu textarea,
#screen-menu .food-input,
#screen-menu .menu-config-card textarea,
#screen-menu .menu-goal-card,
#screen-more .empty-state,
#screen-reminders .empty-state {
  color: #f4f7f4 !important;
  background: #141a1a !important;
  border-color: rgba(255,255,255,.10) !important;
}

/* Rest controls: green accent instead of the legacy violet palette. */
#screen-workout .workout-rest-pill,
#screen-workout .workout-rest-quick-btn,
#screen-workout .workout-rest-extend-btn {
  color: #c7d1c9 !important;
  background: #141a1a !important;
  border-color: rgba(0,237,118,.28) !important;
  box-shadow: none !important;
}
#screen-workout .workout-rest-quick-btn {
  color: #031109 !important;
  background: #00ed76 !important;
  border-color: transparent !important;
}
#screen-workout .workout-rest-quick-label,
#screen-workout .workout-rest-controls > span,
#screen-workout .workout-rest-controls p {
  color: #9aa69d !important;
  opacity: 1 !important;
}

/* Dark transient forms, alerts and legacy workout builder surfaces. */
#screen-workout .workout-diary-sheet,
#screen-workout .workout-diary-modal .workout-diary-sheet,
#screen-workout .workout-diary-modal .workout-set-field input,
#screen-workout .workout-diary-modal textarea,
#screen-workout .workout-plan-builder input,
#screen-workout .workout-plan-builder select,
#screen-workout .workout-plan-builder textarea,
.toast, .app-toast, .notification, [role='alert'] {
  color: #f4f7f4 !important;
  background: #141a1a !important;
  background-image: none !important;
  border-color: rgba(255,255,255,.12) !important;
}
#screen-workout .workout-diary-sheet .workout-diary-save { color: #031109 !important; background: #00ed76 !important; }
#screen-workout .workout-rest-suggestion { display: none !important; }
#screen-workout .workout-plan-builder,
#screen-workout .workout-plan-builder *,
#screen-workout .workout-plan-summary-card,
#screen-workout .workout-plan-progress-card { color: #f4f7f4 !important; }
#screen-workout .workout-plan-builder .btn,
#screen-workout .workout-plan-builder button:not(.is-selected) { background-color: #141a1a !important; border-color: rgba(255,255,255,.13) !important; }

/* Workout constructor: the generated donor components use their own palette,
   so lock every readable text and panel to the dark product scheme. */
#screen-workout .workout-plan-onboarding-screen,
#screen-workout .workout-plan-onboarding-shell,
#screen-workout .workout-plan-onboarding-grid,
#screen-workout .workout-donor-main,
#screen-workout .workout-donor-shell,
#screen-workout .workout-donor-muscle-panel,
#screen-workout .workout-donor-muscle-illustration,
#screen-workout .workout-donor-intro-panel,
#screen-workout .workout-muscle-list-card,
#screen-workout .workout-step-card,
#screen-workout .workout-plan-section,
#screen-workout .workout-plan-inline-status,
#screen-workout .workout-plan-ai-reco,
#screen-workout .workout-plan-effectiveness,
#screen-workout .workout-plan-hero-block,
#screen-workout .workout-my-plan-hero,
#screen-workout .workout-my-plan-summary,
#screen-workout .workout-plan-summary,
#screen-workout .workout-plan-progress {
  color: #f4f7f4 !important;
  background: #141a1a !important;
  background-image: none !important;
  border-color: rgba(255,255,255,.12) !important;
}
#screen-workout .workout-plan-onboarding-screen h1,
#screen-workout .workout-plan-onboarding-screen h2,
#screen-workout .workout-plan-onboarding-screen h3,
#screen-workout .workout-plan-onboarding-screen strong,
#screen-workout .workout-donor-muscle-panel h3,
#screen-workout .workout-donor-muscle-panel span,
#screen-workout .workout-donor-muscle-button,
#screen-workout .workout-muscle-list-card h3,
#screen-workout .workout-muscle-chip-copy span,
#screen-workout .workout-muscle-chip,
#screen-workout .workout-my-plan-hero h1,
#screen-workout .workout-my-plan-hero h2,
#screen-workout .workout-my-plan-summary h1,
#screen-workout .workout-my-plan-summary h2 {
  color: #f4f7f4 !important;
  -webkit-text-fill-color: #f4f7f4 !important;
  opacity: 1 !important;
}
#screen-workout .workout-plan-onboarding-screen p,
#screen-workout .workout-donor-muscle-panel p,
#screen-workout .workout-muscle-list-head p,
#screen-workout .workout-plan-bottom-note {
  color: #aeb9b0 !important;
  -webkit-text-fill-color: #aeb9b0 !important;
  opacity: 1 !important;
}
#screen-workout .workout-donor-muscle-button,
#screen-workout .workout-muscle-chip,
#screen-workout .workout-plan-location-card,
#screen-workout .workout-plan-frequency-chip,
#screen-workout .workout-plan-program-card {
  color: #f4f7f4 !important;
  background: #141a1a !important;
  background-image: none !important;
  border-color: rgba(255,255,255,.14) !important;
}
#screen-workout .workout-plan-bottom-secondary,
#screen-workout .eq-footer-btn--back {
  color: #f4f7f4 !important;
  background: #141a1a !important;
  border-color: rgba(255,255,255,.18) !important;
}
#screen-workout .workout-plan-bottom-primary,
#screen-workout .eq-footer-btn--next:not(:disabled) {
  color: #031109 !important;
  background: #00ed76 !important;
  border-color: transparent !important;
}
#screen-workout .workout-plan-bottom-primary:disabled,
#screen-workout .eq-footer-btn--next:disabled {
  color: #718078 !important;
  background: #1b2220 !important;
  border-color: rgba(255,255,255,.08) !important;
}

/* Final constructor contrast pass. */
#screen-workout .workout-plan-bottom-bar {
  background: #141a1a !important;
  border: 1px solid rgba(255,255,255,.10) !important;
}
#screen-workout .workout-plan-bottom-secondary {
  color: #f4f7f4 !important;
  background: #121819 !important;
  background-image: none !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  opacity: 1 !important;
}
#screen-workout .workout-plan-bottom-primary:not(:disabled) {
  color: #031109 !important;
  background: #00ed76 !important;
  background-image: none !important;
  border-color: transparent !important;
  opacity: 1 !important;
}
#screen-workout .workout-plan-location-card,
#screen-workout .workout-plan-location-card *,
#screen-workout .workout-plan-inline-status,
#screen-workout .workout-plan-inline-status *,
#screen-workout .workout-plan-ai-reco,
#screen-workout .workout-plan-ai-reco *,
#screen-workout .workout-donor-muscle-panel,
#screen-workout .workout-donor-muscle-panel *,
#screen-workout .workout-muscle-list-card,
#screen-workout .workout-muscle-list-card *,
#screen-workout .workout-muscle-chip,
#screen-workout .workout-muscle-chip * {
  color: #f4f7f4 !important;
  -webkit-text-fill-color: #f4f7f4 !important;
  opacity: 1 !important;
}
#screen-workout .workout-plan-location-card,
#screen-workout .workout-plan-inline-status,
#screen-workout .workout-plan-ai-reco,
#screen-workout .workout-donor-muscle-panel,
#screen-workout .workout-muscle-list-card,
#screen-workout .workout-muscle-chip {
  background: #141a1a !important;
  background-image: none !important;
  border-color: rgba(255,255,255,.14) !important;
  box-shadow: none !important;
}
#screen-workout .workout-plan-location-copy small,
#screen-workout .workout-plan-inline-status small,
#screen-workout .workout-plan-ai-reco p,
#screen-workout .workout-donor-muscle-panel p,
#screen-workout .workout-muscle-list-head p {
  color: #aeb9b0 !important;
  -webkit-text-fill-color: #aeb9b0 !important;
}
/* The day detail header must never inherit a light utility background. */
#screen-workout .workout-my-plan-hero-card,
#screen-workout .workout-my-plan-summary-card,
#screen-workout .workout-planv2-summary,
#screen-workout .workout-planv2-result > section:first-child,
#screen-workout [data-workout-plan-day-preview],
#screen-workout .wmp-hero-card,
#screen-workout .wmp-day-card,
#screen-workout .workout-planv2-intro,
#screen-workout .workout-step-header-card {
  color: #f4f7f4 !important;
  background: #141a1a !important;
  background-image: none !important;
  border-color: rgba(255,255,255,.12) !important;
}
#screen-workout .workout-my-plan-hero-card *,
#screen-workout .workout-my-plan-summary-card *,
#screen-workout .workout-planv2-summary *,
#screen-workout [data-workout-plan-day-preview] *,
#screen-workout .wmp-hero-card *,
#screen-workout .wmp-day-card *,
#screen-workout .workout-planv2-intro *,
#screen-workout .workout-step-header-card * {
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
}

/* Pre-start workout preview (Full Body A and progress) uses a separate WDP
   component, so style it explicitly instead of relying on generic cards. */
#screen-workout .wdp-hero-card,
#screen-workout .wdp-progress-card {
  color: #f4f7f4 !important;
  background: #141a1a !important;
  background-image: none !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  box-shadow: none !important;
}
#screen-workout .wdp-hero-card .wdp-hero-title,
#screen-workout .wdp-hero-card .wdp-tag,
#screen-workout .wdp-hero-card .wdp-hero-meta,
#screen-workout .wdp-progress-card .wdp-progress-title,
#screen-workout .wdp-progress-card .wdp-progress-meta {
  color: #f4f7f4 !important;
  -webkit-text-fill-color: #f4f7f4 !important;
  opacity: 1 !important;
}
#screen-workout .wdp-progress-card .wdp-progress-value,
#screen-workout .wdp-hero-card .wdp-hero-badge { color: #00ed76 !important; }

@media (max-width: 480px) {
  #app { border: 0 !important; }
  .bottom-nav, #bottom-nav { border-radius: 0 !important; }
}

/* Final dark-surface pass for the utility screens.  These sections still
   carried legacy light cards from the first interface implementation. */
#screen-water .card,
#screen-water .water-log,
#screen-recipes .card,
#screen-recipes .recipe-goal-card,
#screen-recipes textarea,
#screen-daily-plans .daily-plan-summary,
#screen-daily-plans .daily-task-composer,
#screen-daily-plans .daily-task-empty,
#screen-menu .menu-day-card,
#screen-menu .menu-target-summary,
#screen-menu .week-day-meal,
#screen-menu .menu-meal-card,
#screen-reminders .reminder-empty,
#screen-reminders .reminders-empty-state,
#screen-reminders #reminders-list > div {
  color: #f4f7f4 !important;
  background: #141a1a !important;
  background-image: none !important;
  border-color: rgba(255,255,255,.12) !important;
  box-shadow: none !important;
}

#screen-water .water-log *,
#screen-recipes .recipe-goal-card *,
#screen-daily-plans .daily-plan-summary *,
#screen-daily-plans .daily-task-composer *,
#screen-daily-plans .daily-task-empty *,
#screen-menu .menu-day-card *,
#screen-reminders .reminder-empty *,
#screen-reminders .reminders-empty-state * {
  color: inherit;
  -webkit-text-fill-color: currentColor;
  opacity: 1 !important;
}

#screen-water .water-log .water-log-status,
#screen-water .water-log .water-log-empty,
#screen-water .water-log .log-item,
#screen-recipes textarea::placeholder,
#screen-daily-plans .daily-plan-caption,
#screen-daily-plans .daily-task-composer-hint,
#screen-daily-plans .daily-task-empty-copy,
#screen-menu .menu-day-calories,
#screen-menu .menu-day-kcal,
#screen-reminders .reminder-empty p,
#screen-reminders .reminders-empty-state p {
  color: #aeb9b0 !important;
  -webkit-text-fill-color: #aeb9b0 !important;
}

/* The numeric water readout must stay inside the ring at small widths. */
#screen-water .water-progress-card .water-value,
#screen-water .water-progress-card .water-current,
#screen-water .water-progress-card .water-goal-value,
#screen-water .water-progress-card .water-amount {
  font-size: clamp(22px, 7vw, 30px) !important;
  letter-spacing: -.04em;
}

#screen-profile .profile-modal-sheet,
#screen-profile .profile-modal-field input,
#screen-profile .profile-modal-field select,
#profile-edit-modal .profile-modal-sheet,
#profile-edit-modal .profile-modal-field input,
#profile-edit-modal .profile-modal-field select {
  color: #f4f7f4 !important;
  background: #141a1a !important;
  border-color: rgba(255,255,255,.14) !important;
}
#profile-edit-modal .profile-modal-field span,
#profile-edit-modal .profile-modal-copy h2 { color:#f4f7f4 !important; }

/* Achievements is a reading surface, not a glass overlay. */
#achievements-modal .profile-modal-backdrop {
  background: rgba(2, 7, 8, 0.90) !important;
}
#achievements-modal .profile-modal-sheet {
  background: #141a1a !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}
#referral-modal .profile-modal-backdrop {
  background: rgba(2, 7, 8, 0.90) !important;
}
#referral-modal .profile-modal-sheet {
  background: #141a1a !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}
#app-notifications-modal .profile-modal-backdrop {
  background: rgba(2, 7, 8, 0.90) !important;
}
#app-notifications-modal .profile-modal-sheet {
  background: #141a1a !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}
.app-notifications-badge {
  position: absolute;
  top: 4px;
  right: 3px;
  min-width: 8px;
  height: 8px;
  border: 2px solid #080d0e;
  border-radius: 50%;
  background: #00f076;
}
#app-notifications-button {
  position: relative;
  padding: 6px !important;
  pointer-events: auto !important;
  cursor: pointer;
}
#app-notifications-button > svg,
#app-notifications-button > .material-symbols-outlined {
  width: 18px !important;
  height: 18px !important;
  font-size: 18px !important;
}

#app-notifications-button {
  visibility: visible;
  pointer-events: auto !important;
}
/* Notifications are available from the main dashboard only. */
body.onboarding-active #app-notifications-button {
  display: none !important;
}
#app-notifications-modal {
  z-index: 20060 !important;
}
.profile-metric {
  min-width: 0;
  align-items: center;
  text-align: center;
}
.profile-metric-label,
.profile-metric-value {
  display: block;
  width: 100%;
  text-align: center;
}
.profile-metric-value {
  white-space: nowrap;
}
.profile-metric-gender {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  line-height: 1.35;
}
.app-notifications-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-notifications-mark-read {
  border: 0;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 240, 118, 0.12);
  color: #00f076;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.app-notifications-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 76px;
}
.app-notification-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  background: #101516;
}
.app-notification-item.is-unread {
  border-color: rgba(0, 240, 118, 0.32);
}
.app-notification-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 240, 118, 0.12);
  font-size: 16px;
}
.app-notification-copy { min-width: 0; }
.app-notification-title { color: #f4f7f4; font-size: 13px; font-weight: 800; }
.app-notification-body { margin-top: 3px; color: #bacbb8; font-size: 12px; line-height: 1.35; }
.app-notification-time { display: block; margin-top: 5px; color: #718078; font-size: 11px; }
.app-notification-action {
  margin-top: 9px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(0, 240, 118, 0.52);
  border-radius: 9px;
  background: rgba(0, 240, 118, 0.13);
  color: #00f076;
  font: 700 12px/1 Manrope, sans-serif;
  cursor: pointer;
}
.app-notifications-empty { margin: auto 0; color: #bacbb8; font-size: 13px; text-align: center; }

/* Compact edit affordance and a neutral white profile avatar. */
#screen-profile .profile-edit-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  color: #f4f7f4;
  background: #141a1a;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 0;
}
#screen-profile .profile-edit-icon svg { width:18px; height:18px; }
#screen-profile .profile-avatar-shell {
  background: #ffffff !important;
  box-shadow: none !important;
}
#screen-profile #profile-avatar,
#screen-profile #profile-avatar.has-image,
#screen-profile #profile-avatar:not(.has-image) {
  position: relative;
  color: transparent !important;
  background: #d3d3d3 !important;
}
#screen-profile #profile-avatar.has-image {
  background: transparent !important;
}
#screen-profile #profile-avatar.has-image img {
  display: block !important;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#screen-profile #profile-avatar.has-image::before,
#screen-profile #profile-avatar.has-image::after {
  display: none;
}
#screen-profile #profile-avatar > * {
  display: none !important;
}
#screen-profile #profile-avatar::before,
#screen-profile #profile-avatar::after {
  content: '';
  position: absolute;
  display: block;
  background: #9f9f9f;
}
#screen-profile #profile-avatar::before {
  width: 32%;
  height: 32%;
  top: 20%;
  left: 34%;
  border-radius: 50%;
}
#screen-profile #profile-avatar::after {
  width: 76%;
  height: 43%;
  left: 12%;
  bottom: -17%;
  border-radius: 50% 50% 0 0;
}

/* Text must stay crisp while controls are pressed in mobile WebView. Scaling
   an interactive layer makes its glyphs rasterize and look blurry. */
button,
button:hover,
button:active,
.nav-item,
.nav-item:hover,
.nav-item:active {
  filter: none !important;
  text-shadow: none !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
button:hover,
button:active,
.nav-item:hover,
.nav-item:active {
  transform: none !important;
}

/* The profile editor must fit a narrow phone viewport. */
#profile-edit-modal {
  align-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
}
#profile-edit-modal .profile-modal-sheet {
  box-sizing: border-box;
  width: min(420px, 100%);
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  padding: 20px;
  gap: 16px;
}
#profile-edit-modal .profile-modal-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
#profile-edit-modal .profile-modal-field {
  min-width: 0;
}
#profile-edit-modal .profile-modal-field input,
#profile-edit-modal .profile-modal-field select {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
}
#profile-edit-modal .profile-modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#profile-edit-modal .profile-modal-actions .btn {
  min-width: 0;
  padding-inline: 12px;
}
@media (max-width: 360px) {
  #profile-edit-modal .profile-modal-grid,
  #profile-edit-modal .profile-modal-actions {
    grid-template-columns: 1fr;
  }
}

/* Keep the quick water actions visible over the dark water tracker card. */
#screen-water .water-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  color: #f4f7f4 !important;
  -webkit-text-fill-color: #f4f7f4 !important;
  background: rgba(255, 255, 255, 0.015) !important;
  border: 1px solid rgba(186, 203, 184, 0.18) !important;
  opacity: 1 !important;
}
#screen-water .water-btn:active {
  background: rgba(255, 255, 255, 0.07) !important;
}

/* A first-time visitor must finish onboarding before the app navigation is
   available. It is restored automatically when onboarding-active is removed. */
body.onboarding-active .bottom-nav,
body.onboarding-active #bottom-nav {
  display: none !important;
}

/* The public app must never expose the administration UI, including stale
   markup that might still be present in a browser's cached document. */
#screen-admin,
#screen-more [data-screen="admin"],
#admin-menu-entry,
#admin-more-entry {
  display: none !important;
}

/* The menu preference sheet must remain usable above the fixed mobile nav.
   The sheet itself scrolls, so its confirmation button can always be reached. */
.menu-preferences-modal.open {
  z-index: 1000 !important;
  align-items: flex-start !important;
  overflow-y: auto !important;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)) !important;
}

.menu-preferences-modal.open .menu-preview-sheet {
  width: calc(100% - 24px) !important;
  max-height: calc(100dvh - 24px) !important;
  margin: auto 0 !important;
  padding-bottom: max(24px, env(safe-area-inset-bottom, 0px)) !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Quick-access editor in Settings. */
#screen-quick-access .quick-access-intro,
#screen-quick-access .profile-menu-option {
  border: 1px solid rgba(177, 205, 190, .16);
  background: #141b18;
  box-shadow: none;
}
#screen-quick-access .quick-access-intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  color: #f4f7f4;
}
#screen-quick-access .quick-access-intro-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: #00e686;
  border-radius: 11px;
  background: rgba(0, 230, 134, .11);
  font-size: 20px;
}
#screen-quick-access .quick-access-intro strong { display: block; font-size: 14px; }
#screen-quick-access .quick-access-intro p { margin: 4px 0 0; color: #aebbb4; font-size: 12px; line-height: 1.45; }
#screen-quick-access .quick-access-heading { display: flex; justify-content: space-between; align-items: center; margin: 4px 2px 10px; color: #f4f7f4; font-weight: 700; }
#screen-quick-access #profile-menu-selection-count { color: #00e686; font-size: 13px; }
#screen-quick-access .profile-menu-settings-list { display: grid; gap: 9px; }
#screen-quick-access .profile-menu-option { display: flex; align-items: center; gap: 10px; min-height: 68px; padding: 10px; border-radius: 15px; }
#screen-quick-access .profile-menu-option.is-selected { border-color: rgba(0, 230, 134, .58); background: #10251c; }
#screen-quick-access .profile-menu-option.is-disabled { opacity: .55; }
#screen-quick-access .profile-menu-drag-handle { width: 24px; color: #8a9b92; border: 0; background: transparent; font-size: 18px; cursor: grab; }
#screen-quick-access .profile-menu-option-main { display: flex; flex: 1; min-width: 0; align-items: center; gap: 10px; }
#screen-quick-access .profile-menu-option-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: rgba(0, 230, 134, .1); font-size: 18px; }
#screen-quick-access .profile-menu-option-copy { display: grid; gap: 2px; }
#screen-quick-access .profile-menu-option-title { color: #f7faf7; font-size: 14px; }
#screen-quick-access .profile-menu-option-caption { color: #99aaa1; font-size: 11px; }
#screen-quick-access .profile-menu-option-toggle { width: 19px; height: 19px; accent-color: #00df7f; }
#screen-quick-access .quick-access-actions { display: flex; gap: 10px; margin: 22px 0 calc(20px + env(safe-area-inset-bottom)); }
#screen-quick-access .quick-access-actions .btn { flex: 1; min-height: 48px; }
