:root {
  --ff-canvas: #dfe8e3;
  --ff-page: #eef4f0;
  --ff-surface: rgba(255, 255, 255, 0.78);
  --ff-surface-strong: rgba(255, 255, 255, 0.9);
  --ff-ink: #17211d;
  --ff-muted: #627069;
  --ff-green: #0b7a5a;
  --ff-green-dark: #075a43;
  --ff-green-soft: #dff1e9;
  --ff-coral: #d6674f;
  --ff-gold: #b8892e;
  --ff-blue: #287c93;
  --ff-line: rgba(55, 82, 70, 0.13);
  --ff-glass-line: rgba(255, 255, 255, 0.84);
  --ff-glass-shadow: 0 12px 30px rgba(27, 65, 50, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  --ff-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  background: var(--ff-canvas);
}

body {
  background-color: var(--ff-canvas) !important;
  background-image:
    linear-gradient(rgba(20, 80, 58, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 80, 58, 0.035) 1px, transparent 1px) !important;
  background-size: 48px 48px !important;
  color: var(--ff-ink);
}

.app-shell,
body[data-current-view="progress"] .app-shell {
  min-height: 100dvh;
  background-color: var(--ff-page) !important;
  background-image:
    linear-gradient(rgba(11, 122, 90, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 122, 90, 0.025) 1px, transparent 1px) !important;
  background-size: 28px 28px !important;
  box-shadow: 0 28px 90px rgba(27, 56, 44, 0.16) !important;
}

.top-bar {
  position: relative;
  z-index: 20;
}

.brand-mark,
body[data-current-view="progress"] .brand-mark {
  border: 1px solid var(--ff-glass-line) !important;
  background: rgba(255, 255, 255, 0.72) !important;
  color: var(--ff-green-dark) !important;
  box-shadow: var(--ff-glass-shadow) !important;
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.date-picker,
body[data-current-view="progress"] .date-picker {
  border: 1px solid var(--ff-glass-line) !important;
  border-bottom-color: rgba(86, 116, 102, 0.34) !important;
  background: rgba(255, 255, 255, 0.7) !important;
  color: var(--ff-green-dark) !important;
  box-shadow: var(--ff-glass-shadow) !important;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.date-picker::before,
.date-picker::after {
  display: none !important;
}

.date-picker svg {
  position: absolute;
  inset: 0;
  width: 20px;
  height: 20px;
  margin: auto;
  pointer-events: none;
}

.top-bar h1,
.brand-block h1,
body[data-current-view="progress"] .top-bar h1,
body[data-current-view="progress"] .brand-block h1 {
  color: var(--ff-ink) !important;
}

.eyebrow,
body[data-current-view="progress"] .eyebrow {
  color: var(--ff-muted) !important;
}

.panel,
.profile-panel,
.quick-panel,
.today-list,
.coach-strip,
.hero-balance,
.estimate-box,
.estimate-preview,
.meal-plan-panel,
.plan-hero,
.plan-focus-card,
.week-overview,
.goal-roadmap,
.plan-insight-grid > article,
.profile-hero,
.guide-card {
  border-color: var(--ff-glass-line) !important;
  background: var(--ff-surface) !important;
  box-shadow: 0 10px 28px rgba(27, 65, 50, 0.075), inset 0 1px 0 #ffffff !important;
}

.hero-balance {
  background-color: rgba(255, 255, 255, 0.72) !important;
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
}

.metric-row {
  overflow: hidden;
  border: 1px solid var(--ff-glass-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 9px 24px rgba(27, 65, 50, 0.065), inset 0 1px 0 #ffffff;
}

.metric-row article {
  border-color: var(--ff-line) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.coach-strip .signal-dot {
  background: var(--ff-green) !important;
  box-shadow: 0 0 0 4px rgba(11, 122, 90, 0.08) !important;
}

input,
select,
textarea {
  min-height: 44px;
  border-color: rgba(57, 82, 71, 0.2) !important;
  background: rgba(255, 255, 255, 0.86) !important;
  box-shadow: inset 0 1px 0 #ffffff !important;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
.file-button:focus-within {
  outline: 3px solid rgba(40, 124, 147, 0.25) !important;
  outline-offset: 2px;
  border-color: var(--ff-blue) !important;
}

.primary-action,
.text-button:not(.secondary),
#estimateMealButton,
.plan-complete-button {
  min-height: 48px;
  border: 1px solid rgba(178, 244, 218, 0.66) !important;
  border-bottom: 3px solid #054934 !important;
  background: rgba(5, 108, 77, 0.9) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 26px rgba(5, 88, 63, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.58), inset 0 -8px 18px rgba(0, 52, 36, 0.18) !important;
  text-shadow: 0 1px 2px rgba(0, 45, 31, 0.28) !important;
}

.primary-action:hover,
.text-button:not(.secondary):hover,
#estimateMealButton:hover,
.plan-complete-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(5, 88, 63, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.64), inset 0 -8px 18px rgba(0, 52, 36, 0.16) !important;
}

.primary-action:active,
.text-button:not(.secondary):active,
#estimateMealButton:active,
.plan-complete-button:active {
  transform: translateY(1px) scale(0.99) !important;
  border-bottom-width: 2px !important;
  box-shadow: 0 5px 14px rgba(5, 88, 63, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.42) !important;
}

.primary-action::after,
.text-button::after,
#estimateMealButton::after,
.plan-complete-button::after,
.small-button::after,
.icon-button::after,
.danger-button::after,
.date-picker::after,
.file-button::after {
  transition: none !important;
}

.primary-action .plus-glyph {
  border: 1px solid rgba(255, 255, 255, 0.38) !important;
  background: rgba(255, 255, 255, 0.16) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42) !important;
}

.dashboard-actions .primary-action {
  border-color: var(--ff-glass-line) !important;
  border-bottom-color: rgba(90, 112, 102, 0.3) !important;
  background: rgba(255, 255, 255, 0.66) !important;
  color: var(--ff-ink) !important;
  box-shadow: 0 9px 22px rgba(27, 65, 50, 0.08), inset 0 1px 0 #ffffff !important;
  text-shadow: none !important;
}

.dashboard-actions .primary-action:nth-child(1) {
  background-color: rgba(248, 242, 218, 0.76) !important;
  color: #7b5914 !important;
}

.dashboard-actions .primary-action:nth-child(2) {
  background-color: rgba(248, 230, 224, 0.74) !important;
  color: #944635 !important;
}

.dashboard-actions .primary-action:nth-child(3) {
  background-color: rgba(222, 239, 242, 0.78) !important;
  color: #176277 !important;
}

.dashboard-actions .primary-action .plus-glyph {
  border-color: currentColor !important;
  background: rgba(255, 255, 255, 0.38) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72) !important;
}

.dashboard-actions .primary-action:hover {
  box-shadow: 0 12px 28px rgba(27, 65, 50, 0.11), inset 0 1px 0 #ffffff !important;
}

.dashboard-actions .primary-action:active {
  box-shadow: 0 4px 12px rgba(27, 65, 50, 0.08), inset 0 1px 0 #ffffff !important;
}

.text-button.secondary,
.file-button,
.small-button:not(#estimateMealButton),
.icon-button,
.plan-edit-button,
.estimate-metrics-button,
.dialog-close-button {
  min-height: 44px;
  border: 1px solid var(--ff-glass-line) !important;
  border-bottom-color: rgba(86, 116, 102, 0.32) !important;
  background: rgba(255, 255, 255, 0.68) !important;
  color: #21483b !important;
  box-shadow: 0 9px 22px rgba(27, 65, 50, 0.08), inset 0 1px 0 #ffffff !important;
  text-shadow: none !important;
}

.text-button.secondary:active,
.file-button:active,
.small-button:active,
.icon-button:active,
.plan-edit-button:active,
.estimate-metrics-button:active,
.dialog-close-button:active {
  transform: translateY(1px) scale(0.98) !important;
  box-shadow: 0 4px 12px rgba(27, 65, 50, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

.smart-entry-button {
  min-height: 68px;
  border: 1px solid var(--ff-glass-line) !important;
  background: rgba(255, 255, 255, 0.66) !important;
  box-shadow: 0 9px 22px rgba(27, 65, 50, 0.07), inset 0 1px 0 #ffffff !important;
}

.smart-entry-button.photo {
  background-color: rgba(225, 242, 235, 0.72) !important;
}

.smart-entry-button.voice {
  background-color: rgba(248, 241, 218, 0.72) !important;
}

.smart-entry-button.barcode {
  background-color: rgba(234, 229, 246, 0.72) !important;
}

.smart-entry-button:hover {
  border-color: rgba(11, 122, 90, 0.34) !important;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(27, 65, 50, 0.1), inset 0 1px 0 #ffffff !important;
}

.danger-button {
  min-height: 46px;
  border: 1px solid rgba(255, 218, 207, 0.7) !important;
  border-bottom: 3px solid #8b3324 !important;
  background: rgba(190, 67, 47, 0.9) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(146, 54, 38, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
}

.bottom-nav,
body[data-current-view="progress"] .bottom-nav {
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.92) !important;
  background: rgba(247, 251, 248, 0.74) !important;
  box-shadow: 0 14px 36px rgba(25, 58, 45, 0.14), inset 0 1px 0 #ffffff !important;
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.bottom-nav .nav-tab,
body[data-current-view="progress"] .bottom-nav .nav-tab {
  min-height: 58px;
  overflow: hidden;
  border: 1px solid transparent !important;
  border-radius: 8px;
  background: transparent !important;
  color: #6d7a73 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

.bottom-nav .nav-tab::after {
  display: none !important;
}

.bottom-nav .nav-tab::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 26px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: transparent;
  transform: translateX(-50%);
}

.bottom-nav .nav-tab.active,
.bottom-nav .nav-tab:hover,
body[data-current-view="progress"] .bottom-nav .nav-tab.active,
body[data-current-view="progress"] .bottom-nav .nav-tab:hover {
  border-color: rgba(255, 255, 255, 0.84) !important;
  background: rgba(255, 255, 255, 0.56) !important;
  color: var(--ff-green-dark) !important;
  box-shadow: 0 7px 18px rgba(27, 65, 50, 0.08), inset 0 1px 0 #ffffff !important;
}

.bottom-nav .nav-tab.active::before {
  background: var(--ff-green);
}

.tab-icon,
.bottom-nav .nav-tab:nth-child(n) .tab-icon,
body[data-current-view="progress"] .bottom-nav .nav-tab:not(.active) .tab-icon,
.bottom-nav .nav-tab.active .tab-icon,
.bottom-nav .nav-tab:hover .tab-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.82) !important;
  border-radius: 7px !important;
  background: rgba(255, 255, 255, 0.42) !important;
  color: currentColor !important;
  box-shadow: inset 0 1px 0 #ffffff !important;
}

.tab-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
}

.bottom-nav .nav-tab.active .tab-icon {
  background: rgba(11, 122, 90, 0.1) !important;
}

.ff-optical {
  isolation: isolate;
}

.ff-optical::after {
  display: block !important;
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  border-radius: inherit !important;
  background: radial-gradient(130px circle at var(--ff-light-x, 24%) var(--ff-light-y, 10%), rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.07) 38%, transparent 66%) !important;
  box-shadow: inset 1px 0 0 rgba(110, 219, 255, 0.17), inset -1px 0 0 rgba(255, 145, 192, 0.1) !important;
  opacity: 0.72 !important;
  transform: none !important;
  pointer-events: none;
  mix-blend-mode: screen;
}

.ff-optical > * {
  position: relative;
  z-index: 1;
}

.ff-optical[data-refraction="optical"] {
  border-color: rgba(226, 255, 245, 0.72) !important;
}

.ff-optical[data-refraction="frosted"] {
  backdrop-filter: blur(15px) saturate(135%);
  -webkit-backdrop-filter: blur(15px) saturate(135%);
}

body[data-current-view="progress"],
body[data-current-view="progress"] .app-shell {
  color: var(--ff-ink);
}

body[data-current-view="progress"] .growth-screen {
  width: 100%;
  margin-inline: 0 !important;
  color: var(--ff-ink);
}

body[data-current-view="progress"] .growth-hero {
  border-color: rgba(255, 255, 255, 0.12) !important;
  background-color: #13271f !important;
  background-image: repeating-linear-gradient(122deg, rgba(116, 222, 175, 0.045) 0 1px, transparent 1px 18px) !important;
  box-shadow: 0 18px 42px rgba(16, 39, 29, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  color: #ffffff;
}

body[data-current-view="progress"] .growth-hero h3 {
  color: #ffffff !important;
}

body[data-current-view="progress"] .growth-avatar-stage {
  border-color: rgba(255, 255, 255, 0.12) !important;
  background-color: #10231b !important;
  background-image:
    linear-gradient(rgba(111, 220, 171, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 220, 171, 0.045) 1px, transparent 1px) !important;
  background-size: 30px 30px !important;
}

body[data-current-view="progress"] .xp-panel,
body[data-current-view="progress"] .body-load-panel,
body[data-current-view="progress"] .mission-panel,
body[data-current-view="progress"] .growth-panel {
  border-color: var(--ff-glass-line) !important;
  background: rgba(255, 255, 255, 0.78) !important;
  box-shadow: 0 10px 28px rgba(27, 65, 50, 0.075), inset 0 1px 0 #ffffff !important;
  color: var(--ff-ink);
}

body[data-current-view="progress"] .xp-panel .row-between,
body[data-current-view="progress"] .xp-panel strong,
body[data-current-view="progress"] .body-load-panel .section-title h3,
body[data-current-view="progress"] .mission-panel .section-title h3,
body[data-current-view="progress"] .growth-panel .section-header h3,
body[data-current-view="progress"] .body-load-grid strong,
body[data-current-view="progress"] .morph-goal strong,
body[data-current-view="progress"] .attribute-top strong {
  color: var(--ff-ink) !important;
}

body[data-current-view="progress"] .xp-panel p,
body[data-current-view="progress"] .body-load-panel .section-title span,
body[data-current-view="progress"] .mission-panel .section-title span,
body[data-current-view="progress"] .growth-panel .meta-text,
body[data-current-view="progress"] .body-load-grid span,
body[data-current-view="progress"] .morph-goal small {
  color: var(--ff-muted) !important;
}

body[data-current-view="progress"] .body-load-grid article,
body[data-current-view="progress"] .chart-metric,
body[data-current-view="progress"] .capacity-summary {
  border-color: var(--ff-line) !important;
  background: rgba(245, 249, 246, 0.86) !important;
  box-shadow: inset 0 1px 0 #ffffff !important;
}

body[data-current-view="progress"] .chart-metric span,
body[data-current-view="progress"] .chart-metric small,
body[data-current-view="progress"] .capacity-summary span,
body[data-current-view="progress"] .capacity-summary small,
body[data-current-view="progress"] .capacity-label small {
  color: var(--ff-muted) !important;
}

body[data-current-view="progress"] .chart-metric strong,
body[data-current-view="progress"] .capacity-summary strong,
body[data-current-view="progress"] .capacity-label strong,
body[data-current-view="progress"] .capacity-row > b {
  color: var(--ff-ink) !important;
}

body[data-current-view="progress"] .trend-chart-frame {
  border-color: var(--ff-line) !important;
  background: rgba(248, 251, 249, 0.9) !important;
  box-shadow: inset 0 1px 0 #ffffff !important;
}

body[data-current-view="progress"] .chart-grid-line {
  stroke: rgba(23, 33, 29, 0.1);
}

body[data-current-view="progress"] .chart-axis-label,
body[data-current-view="progress"] .chart-date-label {
  fill: #718079;
}

body[data-current-view="progress"] .chart-point {
  stroke: #f7faf8;
}

body[data-current-view="progress"] .chart-empty-state {
  color: var(--ff-muted);
}

body[data-current-view="progress"] .chart-empty-state strong {
  color: var(--ff-ink);
}

body[data-current-view="progress"] .capacity-track {
  background: rgba(23, 33, 29, 0.09);
  box-shadow: inset 0 1px 2px rgba(23, 33, 29, 0.08);
}

body[data-current-view="progress"] .capacity-target {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

body[data-current-view="progress"] .badge-item {
  background-color: rgba(255, 255, 255, 0.68) !important;
}

body[data-current-view="progress"] .badge-copy strong {
  color: var(--ff-ink) !important;
}

@media (hover: none) {
  .primary-action:hover,
  .text-button:hover,
  .small-button:hover,
  .icon-button:hover,
  .plan-edit-button:hover,
  .smart-entry-button:hover,
  .bottom-nav .nav-tab:hover {
    transform: none;
  }
}

@media (max-width: 380px) {
  .bottom-nav {
    width: calc(100% - 18px) !important;
    padding-inline: 5px !important;
  }

  .bottom-nav .nav-tab {
    font-size: 0.69rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .primary-action,
  .text-button,
  .small-button,
  .icon-button,
  .plan-edit-button,
  .smart-entry-button,
  .bottom-nav .nav-tab {
    transition: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .brand-mark,
  .date-picker,
  .hero-balance,
  .bottom-nav,
  .panel,
  .quick-panel,
  .today-list,
  .coach-strip {
    background-color: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .brand-mark,
  .date-picker,
  .hero-balance,
  .bottom-nav {
    background-color: rgba(255, 255, 255, 0.96) !important;
  }
}

/* Progress V2: a unified performance lab instead of mixed game and dashboard cards. */
body[data-current-view="progress"],
body[data-current-view="progress"] .app-shell {
  background-color: #f4f6f2 !important;
  background-image:
    linear-gradient(rgba(47, 143, 111, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 143, 111, 0.035) 1px, transparent 1px) !important;
  background-size: 28px 28px !important;
  color: #17211d;
}

body[data-current-view="progress"] .top-bar h1,
body[data-current-view="progress"] .brand-block h1 {
  color: #17211d !important;
}

body[data-current-view="progress"] .eyebrow {
  color: #68716b !important;
}

body[data-current-view="progress"] .brand-mark,
body[data-current-view="progress"] .date-picker {
  border-color: rgba(31, 49, 43, 0.12) !important;
  border-bottom-color: rgba(31, 49, 43, 0.18) !important;
  background: rgba(255, 255, 255, 0.78) !important;
  color: #0b6f53 !important;
  box-shadow: 0 10px 26px rgba(27, 65, 50, 0.08), inset 0 1px 0 #ffffff !important;
}

body[data-current-view="progress"] .bottom-nav {
  border-color: rgba(255, 255, 255, 0.92) !important;
  background: rgba(247, 251, 248, 0.78) !important;
  box-shadow: 0 14px 36px rgba(25, 58, 45, 0.14), inset 0 1px 0 #ffffff !important;
}

body[data-current-view="progress"] .bottom-nav .nav-tab {
  color: #6d7a73 !important;
}

body[data-current-view="progress"] .bottom-nav .nav-tab.active {
  background: rgba(255, 255, 255, 0.62) !important;
  color: #0b6f53 !important;
}

body[data-current-view="progress"] .bottom-nav .nav-tab:not(.active) .tab-icon,
body[data-current-view="progress"] .bottom-nav .nav-tab.active .tab-icon {
  border-color: rgba(255, 255, 255, 0.82) !important;
  background: rgba(255, 255, 255, 0.46) !important;
  color: currentColor !important;
  box-shadow: inset 0 1px 0 #ffffff !important;
}

.performance-screen {
  gap: 14px;
  padding-bottom: 18px;
  color: #17211d;
}

.progress-view-tabs {
  position: sticky;
  top: 10px;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(31, 49, 43, 0.12);
  border-radius: var(--radius);
  background: rgba(248, 251, 248, 0.88);
  box-shadow: 0 10px 28px rgba(27, 65, 50, 0.08), inset 0 1px 0 #ffffff;
  backdrop-filter: blur(20px) saturate(140%);
}

.progress-view-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #64716a;
  font-size: 0.82rem;
  font-weight: 750;
}

.progress-view-tabs button.active {
  border-color: rgba(11, 122, 90, 0.17);
  background: #173f33;
  color: #ffffff;
  box-shadow: 0 7px 16px rgba(19, 68, 51, 0.2);
}

.progress-view-tabs svg {
  width: 18px;
  height: 18px;
}

.progress-view-panel {
  display: grid;
  gap: 12px;
}

.performance-hero {
  overflow: hidden;
  border: 1px solid rgba(201, 228, 216, 0.13);
  border-radius: 8px;
  background: #111714;
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.performance-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
}

.performance-kicker,
.performance-section-title > div > span,
.xp-readout > span {
  display: block;
  color: #9ee8c1;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0;
}

.performance-hero-head h3 {
  margin: 5px 0 0;
  color: #f7faf8;
  font-size: 1.65rem;
  line-height: 1.05;
}

.performance-hero-head p {
  margin: 7px 0 0;
  color: #899991;
  font-size: 0.75rem;
}

.progress-level-dial {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 1px solid rgba(207, 241, 225, 0.28);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #151e1a 0 62%, transparent 64%),
    conic-gradient(#7df0b5 0 var(--level-progress), rgba(212, 235, 224, 0.12) var(--level-progress) 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.progress-level-dial span {
  color: #789087;
  font-family: var(--font-number);
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0;
}

.progress-level-dial strong {
  margin-top: 1px;
  color: #effaf4;
  font-family: var(--font-number);
  font-size: 1.08rem;
  line-height: 1;
}

.performance-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 362px;
  overflow: hidden;
  border-block: 1px solid rgba(201, 228, 216, 0.1);
  background-color: #0d1310;
  background-image:
    linear-gradient(rgba(139, 240, 188, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 240, 188, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
}

.performance-stage::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(188, 223, 206, 0.1);
  border-radius: 50% 50% 44% 44% / 40% 40% 58% 58%;
  box-shadow: inset 0 0 65px rgba(68, 220, 141, 0.045);
}

.stage-axis {
  position: absolute;
  z-index: 0;
  background: rgba(125, 240, 181, 0.13);
}

.stage-axis.vertical {
  top: 16px;
  bottom: 16px;
  left: 50%;
  width: 1px;
}

.stage-axis.horizontal {
  top: 49%;
  left: 18px;
  right: 18px;
  height: 1px;
}

.stage-readout {
  position: absolute;
  z-index: 3;
  display: grid;
  min-width: 68px;
  padding: 8px 9px;
  border: 1px solid rgba(160, 235, 198, 0.2);
  border-left: 2px solid #78ebb1;
  background: rgba(9, 15, 12, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.stage-readout span {
  color: #b7c8c0;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
}

.stage-readout strong {
  margin-top: 3px;
  color: #ffffff;
  font-family: var(--font-number);
  font-size: 1.04rem;
}

.stage-readout.upper { left: 12px; top: 42px; }
.stage-readout.core { right: 12px; top: 162px; }
.stage-readout.lower { left: 12px; bottom: 58px; }

.stage-status {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: 7px auto;
  column-gap: 6px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid rgba(186, 226, 207, 0.12);
  background: rgba(10, 15, 13, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.stage-status i {
  grid-row: 1 / span 2;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7df0b5;
  box-shadow: 0 0 12px rgba(125, 240, 181, 0.8);
}

.stage-status span {
  color: #adc0b7;
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0;
}

.stage-status strong {
  color: #ffffff;
  font-size: 0.72rem;
}

.performance-avatar {
  position: relative;
  z-index: 2;
  width: min(68%, 236px) !important;
  height: 350px;
  max-height: none !important;
  filter: drop-shadow(0 22px 26px rgba(0, 0, 0, 0.48)) !important;
}

.portrait-avatar {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.portrait-avatar img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter:
    saturate(calc(0.92 + var(--avatar-growth) * 0.0025))
    brightness(calc(0.93 + var(--avatar-growth) * 0.0012))
    drop-shadow(0 18px 24px rgba(0, 0, 0, 0.45));
  transform: scale(calc(1 + var(--avatar-growth) * 0.00035));
  transform-origin: center bottom;
}

.portrait-avatar::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  height: 18%;
  background: linear-gradient(transparent, #0d1310 92%);
  pointer-events: none;
}

.portrait-aura {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(125, 240, 181, 0.42);
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(125, 240, 181, 0.22), inset 0 0 18px rgba(125, 240, 181, 0.08);
  pointer-events: none;
}

.portrait-aura.upper {
  left: 50%;
  top: 34%;
  width: 145px;
  height: 66px;
  opacity: calc(0.08 + var(--upper-signal) * 0.006);
  transform: translate(-50%, -50%);
}

.portrait-aura.core {
  left: 50%;
  top: 57%;
  width: 60px;
  height: 92px;
  opacity: calc(0.08 + var(--core-signal) * 0.006);
  transform: translate(-50%, -50%);
}

.portrait-aura.lower {
  left: 50%;
  top: 84%;
  width: 105px;
  height: 54px;
  opacity: calc(0.08 + var(--lower-signal) * 0.006);
  transform: translate(-50%, -50%);
}

.avatar-scan-halo {
  fill: rgba(85, 221, 151, 0.045);
  stroke: rgba(125, 240, 181, 0.12);
}

.avatar-scan-ring {
  fill: none;
  stroke: rgba(125, 240, 181, 0.12);
  stroke-width: 1;
  stroke-dasharray: 3 8;
}

.avatar-scan-ring.ring-two {
  stroke-dasharray: 1 10;
  opacity: 0.65;
}

.avatar-scan-sweep {
  fill: none;
  stroke: rgba(125, 240, 181, 0.16);
  stroke-width: 1;
  filter: url(#avatarGlow);
}

.performance-avatar .avatar-ground {
  fill: rgba(91, 231, 159, 0.16);
  filter: url(#avatarGlow);
}

.performance-avatar .avatar-limb {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.performance-avatar .avatar-leg-outline,
.performance-avatar .avatar-arm-outline {
  stroke: #050806;
}

.performance-avatar .avatar-leg,
.performance-avatar .avatar-arm {
  stroke: url(#avatarShell);
}

.performance-avatar .avatar-torso,
.performance-avatar .avatar-neck,
.performance-avatar .avatar-head {
  fill: url(#avatarShell);
  stroke: #050806;
  stroke-width: 3;
}

.performance-avatar .avatar-chest-panel {
  fill: url(#avatarPanel);
}

.performance-avatar .avatar-core-panel {
  fill: #3d5e50;
}

.performance-avatar .avatar-center-line,
.performance-avatar .avatar-collar,
.performance-avatar .avatar-jaw {
  fill: none;
  stroke: rgba(222, 240, 232, 0.48);
  stroke-width: 1.6;
}

.performance-avatar .avatar-shoulder-signal,
.performance-avatar .avatar-leg-signal {
  fill: none;
  stroke: #7df0b5;
  stroke-width: 4;
  stroke-linecap: round;
  filter: url(#avatarGlow);
}

.performance-avatar .avatar-core-signal {
  fill: url(#avatarCore);
  stroke: #bff8db;
  stroke-width: 1.5;
  filter: drop-shadow(0 0 7px rgba(125, 240, 181, 0.55));
}

.performance-avatar .avatar-head-shell {
  fill: #0a0f0d;
  stroke: rgba(225, 238, 232, 0.12);
}

.performance-avatar .avatar-visor {
  fill: url(#avatarVisor);
  stroke: rgba(226, 248, 237, 0.52);
  stroke-width: 1;
}

.performance-avatar .avatar-hand,
.performance-avatar .avatar-foot {
  fill: #101815;
  stroke: #050806;
  stroke-width: 3;
}

.performance-avatar .avatar-node {
  fill: #d9ffec;
  stroke: #55d896;
  stroke-width: 2;
  filter: drop-shadow(0 0 7px rgba(125, 240, 181, 0.8));
}

.evolution-stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(201, 228, 216, 0.08);
}

.evolution-stages article {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 62px;
  padding: 10px;
  border-right: 1px solid rgba(201, 228, 216, 0.08);
}

.evolution-stages article:last-child { border-right: 0; }

.evolution-stages article > span {
  color: #58665f;
  font-family: var(--font-number);
  font-size: 0.72rem;
  font-weight: 800;
}

.evolution-stages small,
.evolution-stages strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evolution-stages small {
  color: #91a198;
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0;
}

.evolution-stages strong {
  margin-top: 3px;
  color: #c0cbc6;
  font-size: 0.72rem;
}

.evolution-stages article.active {
  background: #18231e;
  box-shadow: inset 0 2px 0 #7df0b5;
}

.evolution-stages article.active > span,
.evolution-stages article.active small { color: #75dba6; }
.evolution-stages article.active strong { color: #eef9f3; }

.evolution-command {
  display: grid;
  gap: 14px;
  padding: 17px 18px;
  border: 1px solid #8deec0;
  border-radius: 8px;
  background: #8deec0;
  color: #0a2117;
  box-shadow: 0 15px 34px rgba(48, 168, 110, 0.18);
}

.evolution-command-copy > span {
  font-family: var(--font-number);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0;
  opacity: 0.62;
}

.evolution-command h3 {
  margin: 5px 0 0;
  color: #071b12;
  font-size: 1.12rem;
}

.evolution-command p {
  margin: 6px 0 0;
  color: rgba(7, 27, 18, 0.68);
  font-size: 0.72rem;
  line-height: 1.5;
}

.evolution-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.68rem;
}

.evolution-progress-label span { color: rgba(7, 27, 18, 0.62); }

.evolution-track {
  position: relative;
  height: 5px;
  margin-top: 8px;
  background: rgba(7, 27, 18, 0.16);
}

.evolution-track i {
  display: block;
  height: 100%;
  background: #0a2117;
}

.evolution-track b {
  position: absolute;
  left: 75%;
  top: -4px;
  width: 1px;
  height: 13px;
  background: #0a2117;
  opacity: 0.52;
}

body[data-current-view="progress"] .performance-xp,
body[data-current-view="progress"] .performance-body-panel,
body[data-current-view="progress"] .growth-panel {
  border: 1px solid rgba(201, 228, 216, 0.11) !important;
  border-radius: 8px !important;
  background: #121916 !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
  color: #f3f7f5 !important;
}

.performance-xp {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr);
  align-items: center;
  gap: 12px 16px;
  padding: 16px !important;
}

.xp-readout strong {
  display: block;
  margin-top: 5px;
  color: #f4f9f6 !important;
  font-family: var(--font-number);
  font-size: 1.26rem;
  line-height: 1;
}

.xp-readout strong small {
  color: #6f7e76;
  font-size: 0.65rem;
}

.xp-rail {
  height: 6px;
  overflow: hidden;
  background: #26302b;
}

.xp-rail i {
  display: block;
  height: 100%;
  background: #79eeb3;
  box-shadow: 0 0 14px rgba(121, 238, 179, 0.38);
}

.performance-xp p {
  grid-column: 1 / -1;
  margin: 0 !important;
  padding-top: 10px;
  border-top: 1px solid rgba(201, 228, 216, 0.09);
  color: #829088 !important;
  font-size: 0.72rem !important;
}

.performance-body-panel,
.growth-panel {
  padding: 16px !important;
}

.performance-section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.performance-section-title h3 {
  margin: 4px 0 0;
  color: #f3f7f5 !important;
  font-size: 1.02rem;
}

.performance-section-title > small {
  flex: 0 0 auto;
  color: #77867e !important;
  font-size: 0.65rem;
}

.performance-body-panel .body-load-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0;
  border-top: 1px solid rgba(201, 228, 216, 0.09);
}

body[data-current-view="progress"] .performance-body-panel .body-load-grid .body-zone-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 3px 10px;
  align-items: center;
  min-height: 72px;
  padding: 11px 0;
  border: 0 !important;
  border-bottom: 1px solid rgba(201, 228, 216, 0.09) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-current-view="progress"] .performance-body-panel .body-zone-index {
  color: #7f9087 !important;
  font-family: var(--font-number);
  font-size: 0.68rem !important;
  font-weight: 800;
}

body[data-current-view="progress"] .performance-body-panel .body-zone-copy > span {
  color: #a8b8b0 !important;
  font-size: 0.68rem !important;
}

body[data-current-view="progress"] .performance-body-panel .body-zone-copy > strong {
  margin-top: 3px !important;
  color: #f5faf7 !important;
  font-size: 0.88rem !important;
}

.body-zone-score {
  color: #9ef4c8;
  font-family: var(--font-number);
  white-space: nowrap;
}

body[data-current-view="progress"] .performance-body-panel .body-zone-score strong {
  display: inline !important;
  color: #9ef4c8 !important;
  font-size: 1.08rem !important;
}

body[data-current-view="progress"] .performance-body-panel .body-zone-score small {
  margin-left: 2px;
  color: #93a49b !important;
  font-size: 0.62rem;
}

.body-zone-track {
  grid-column: 2 / -1;
  position: relative;
  height: 4px;
  margin-top: 6px;
  background: #27312c;
}

.body-zone-track i {
  display: block;
  height: 100%;
  background: #7df0b5;
  box-shadow: 0 0 10px rgba(125, 240, 181, 0.3);
}

.body-zone-track b {
  position: absolute;
  left: 75%;
  top: -3px;
  width: 1px;
  height: 10px;
  background: rgba(227, 240, 234, 0.42);
}

body[data-current-view="progress"] .chart-metric,
body[data-current-view="progress"] .capacity-summary {
  border-color: rgba(201, 228, 216, 0.1) !important;
  background: #171f1b !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

body[data-current-view="progress"] .chart-metric strong,
body[data-current-view="progress"] .capacity-summary strong,
body[data-current-view="progress"] .capacity-label strong,
body[data-current-view="progress"] .capacity-row > b,
body[data-current-view="progress"] .attribute-top strong,
body[data-current-view="progress"] .badge-copy strong {
  color: #eef6f2 !important;
}

body[data-current-view="progress"] .chart-metric span,
body[data-current-view="progress"] .chart-metric small,
body[data-current-view="progress"] .capacity-summary span,
body[data-current-view="progress"] .capacity-summary small,
body[data-current-view="progress"] .capacity-label small,
body[data-current-view="progress"] .growth-panel .meta-text {
  color: #73827a !important;
}

body[data-current-view="progress"] .trend-chart-frame {
  border-color: rgba(201, 228, 216, 0.1) !important;
  background: #0e1411 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025) !important;
}

body[data-current-view="progress"] .chart-grid-line { stroke: rgba(201, 228, 216, 0.1); }
body[data-current-view="progress"] .chart-axis-label,
body[data-current-view="progress"] .chart-date-label { fill: #637169; }
body[data-current-view="progress"] .chart-point { stroke: #0e1411; }
body[data-current-view="progress"] .chart-empty-state { color: #6f7d75; }
body[data-current-view="progress"] .chart-empty-state strong { color: #dfe9e4; }
body[data-current-view="progress"] .capacity-track { background: #26302b; box-shadow: none; }
body[data-current-view="progress"] .capacity-target { box-shadow: 0 0 0 2px #121916; }

body[data-current-view="progress"] .attribute-track {
  background: #28322d;
}

body[data-current-view="progress"] .growth-panel .habit-cell {
  border-color: rgba(201, 228, 216, 0.07);
  background: #262d29;
}

body[data-current-view="progress"] .growth-panel .habit-cell.low { background: #254235; }
body[data-current-view="progress"] .growth-panel .habit-cell.mid { background: #397759; }
body[data-current-view="progress"] .growth-panel .habit-cell.high { background: #78eeb3; }

body[data-current-view="progress"] .badge-item {
  border-color: rgba(201, 228, 216, 0.1) !important;
  background: #171e1a !important;
  box-shadow: none !important;
}

body[data-current-view="progress"] .badge-item.unlocked {
  border-color: rgba(125, 240, 181, 0.25) !important;
}

@media (max-width: 380px) {
  .performance-hero-head { padding-inline: 14px; }
  .performance-stage { min-height: 344px; }
  .performance-avatar { width: min(72%, 224px) !important; height: 334px; }
  .stage-readout { min-width: 55px; padding: 6px; }
  .stage-readout.upper { top: 36px; }
  .stage-readout.core { top: 148px; }
  .evolution-stages article { grid-template-columns: 1fr; gap: 3px; }
  .evolution-stages article > span { font-size: 0.58rem; }
  .performance-section-title { align-items: flex-start; }
}

@media (prefers-reduced-motion: no-preference) {
  .performance-avatar .avatar-scan-sweep {
    animation: body-scan 4.8s ease-in-out infinite;
  }

  .performance-avatar .avatar-node {
    animation: body-signal 2.4s ease-in-out infinite;
  }
}

@keyframes body-scan {
  0%, 100% { transform: translateY(-96px); opacity: 0; }
  15%, 85% { opacity: 0.8; }
  50% { transform: translateY(104px); opacity: 0.35; }
}

@keyframes body-signal {
  50% { opacity: 0.48; }
}

/* Progress V3: avatar identity, deterministic abilities, and earned equipment. */
body[data-current-view="progress"] .performance-screen {
  --avatar-accent: #78eeb3;
  --avatar-accent-soft: rgba(120, 238, 179, 0.13);
  gap: 12px;
}

body[data-current-view="progress"] .performance-hero {
  border-color: rgba(195, 225, 211, 0.16);
  background: #101714;
}

body[data-current-view="progress"] .performance-hero-head {
  align-items: center;
  padding: 17px 16px 15px;
}

body[data-current-view="progress"] .performance-hero-head h3 {
  max-width: 260px;
  margin-top: 6px;
  font-size: 1.48rem;
  line-height: 1.12;
}

body[data-current-view="progress"] .performance-hero-head p {
  margin-top: 6px;
  color: #9ba9a2;
  font-size: 0.72rem;
}

body[data-current-view="progress"] .performance-stage {
  min-height: 420px;
  isolation: isolate;
  border-color: rgba(195, 225, 211, 0.11);
  background-color: #0b110e;
  background-image:
    linear-gradient(rgba(120, 238, 179, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 238, 179, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
}

body[data-current-view="progress"] .performance-stage::before {
  inset: 64px 58px 24px;
  z-index: 0;
  border: 1px solid rgba(120, 238, 179, 0.16);
  border-radius: 50%;
  background: rgba(36, 92, 66, 0.07);
  box-shadow:
    0 0 0 18px rgba(120, 238, 179, 0.02),
    inset 0 0 70px rgba(120, 238, 179, 0.06);
}

body[data-current-view="progress"] .performance-stage::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  bottom: 34px;
  width: 210px;
  height: 34px;
  border-radius: 50%;
  background: rgba(78, 222, 148, 0.18);
  filter: blur(18px);
  transform: translateX(-50%);
}

.avatar-stage-heading {
  position: absolute;
  z-index: 4;
  top: 14px;
  left: 15px;
  display: grid;
  gap: 3px;
}

.avatar-stage-heading span {
  color: #6f8279;
  font-family: var(--font-number);
  font-size: 0.6rem;
  font-weight: 800;
}

.avatar-stage-heading strong {
  color: #eaf6f0;
  font-size: 0.78rem;
}

.avatar-stage-heading small {
  margin-top: 1px;
  color: #7f9188;
  font-size: 0.58rem;
}

body[data-current-view="progress"] .portrait-avatar img {
  width: 100%;
  height: 100%;
  object-position: center bottom;
  filter: saturate(0.94) contrast(1.02) brightness(0.96);
  transform: none;
}

body[data-current-view="progress"] .stage-1 .portrait-avatar img { filter: saturate(0.82) brightness(0.88); }
body[data-current-view="progress"] .stage-2 .portrait-avatar img { filter: saturate(0.89) brightness(0.92); }
body[data-current-view="progress"] .stage-3 .portrait-avatar img { filter: saturate(0.94) brightness(0.96); }
body[data-current-view="progress"] .stage-4 .portrait-avatar img { filter: saturate(0.99) brightness(0.99); }
body[data-current-view="progress"] .stage-5 .portrait-avatar img { filter: saturate(1.04) brightness(1.01) drop-shadow(0 0 14px rgba(120, 238, 179, 0.08)); }
body[data-current-view="progress"] .stage-6 .portrait-avatar img { filter: saturate(1.09) brightness(1.03) drop-shadow(0 0 18px rgba(120, 238, 179, 0.16)); }

body[data-current-view="progress"] .portrait-avatar::after {
  height: 5%;
  background: linear-gradient(transparent, #0b110e 96%);
}

body[data-current-view="progress"] .portrait-aura {
  border-color: rgba(120, 238, 179, 0.24);
  box-shadow: 0 0 20px rgba(120, 238, 179, 0.14);
}

body[data-current-view="progress"] .stage-readout {
  min-width: 62px;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 1px 5px;
  padding: 7px 8px;
  border: 1px solid rgba(195, 225, 211, 0.17);
  border-radius: 7px;
  background: rgba(11, 18, 15, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 9px 22px rgba(0, 0, 0, 0.2);
}

body[data-current-view="progress"] .stage-readout span {
  color: #7be8af;
  font-family: var(--font-number);
  font-size: 0.58rem;
}

body[data-current-view="progress"] .stage-readout strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  margin: 0;
  font-size: 1rem;
}

body[data-current-view="progress"] .stage-readout small {
  color: #96a69e;
  font-size: 0.61rem;
}

body[data-current-view="progress"] .stage-readout.upper { top: 84px; left: 12px; }
body[data-current-view="progress"] .stage-readout.core { top: 164px; right: 12px; }
body[data-current-view="progress"] .stage-readout.lower { bottom: 84px; left: 12px; }

body[data-current-view="progress"] .stage-status {
  right: 12px;
  bottom: 11px;
  border-radius: 7px;
  background: rgba(9, 15, 12, 0.82);
}

body[data-current-view="progress"] .stage-status strong {
  max-width: 138px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-current-view="progress"] .evolution-stages article {
  min-height: 58px;
}

body[data-current-view="progress"] .evolution-stages article.complete {
  background: rgba(120, 238, 179, 0.045);
}

body[data-current-view="progress"] .evolution-stages article.complete > span,
body[data-current-view="progress"] .evolution-stages article.complete small {
  color: #70c99b;
}

body[data-current-view="progress"] .evolution-stages article.locked {
  opacity: 0.48;
}

body[data-current-view="progress"] .evolution-command {
  border-color: rgba(120, 238, 179, 0.34);
  background: #17231d;
  color: #eef8f3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 14px 32px rgba(0, 0, 0, 0.18);
}

body[data-current-view="progress"] .evolution-command-copy > span,
body[data-current-view="progress"] .evolution-progress-label span {
  color: #83c9a6;
  opacity: 1;
}

body[data-current-view="progress"] .evolution-command h3 {
  color: #f4fbf7;
}

body[data-current-view="progress"] .evolution-command p {
  color: #9eaea6;
}

body[data-current-view="progress"] .evolution-track {
  background: rgba(218, 240, 229, 0.12);
}

body[data-current-view="progress"] .evolution-track i,
body[data-current-view="progress"] .evolution-track b {
  background: var(--avatar-accent);
}

.equipment-rack,
.ability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.equipment-slot {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-items: center;
  min-height: 67px;
  padding: 9px;
  overflow: hidden;
  border: 1px solid rgba(195, 225, 211, 0.11);
  border-radius: 7px;
  background: #171f1b;
}

.equipment-slot.unlocked {
  border-color: rgba(120, 238, 179, 0.24);
  background:
    linear-gradient(120deg, rgba(120, 238, 179, 0.08), transparent 55%),
    #17211c;
}

.equipment-slot.locked {
  opacity: 0.52;
  filter: saturate(0.35);
}

.equipment-icon {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(216, 240, 228, 0.14);
  border-radius: 7px;
  background: #202b25;
  color: #9aaba2;
}

.equipment-slot.unlocked .equipment-icon {
  border-color: rgba(120, 238, 179, 0.28);
  background: #1e372b;
  color: #8df0bd;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.equipment-icon svg {
  width: 20px;
  height: 20px;
}

.equipment-slot strong {
  align-self: end;
  overflow: hidden;
  color: #eff7f3;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipment-slot small {
  align-self: start;
  margin-top: 3px;
  color: #75857d;
  font-size: 0.58rem;
}

.ability-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(195, 225, 211, 0.11);
  border-radius: 7px;
  background: #171f1b;
}

.ability-card-head {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 7px;
}

.ability-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #20332a;
  color: #82e8b3;
}

.ability-icon svg {
  width: 15px;
  height: 15px;
}

.ability-code {
  color: #71837a;
  font-family: var(--font-number);
  font-size: 0.59rem;
  font-weight: 800;
}

.ability-card-head > strong {
  color: #f2faf6;
  font-family: var(--font-number);
  font-size: 1.12rem;
}

.ability-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.ability-name strong {
  color: #e7f1ec;
  font-size: 0.74rem;
}

.ability-name small {
  overflow: hidden;
  color: #708078;
  font-size: 0.58rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ability-track {
  height: 4px;
  overflow: hidden;
  background: #29332e;
}

.ability-track i {
  display: block;
  height: 100%;
  background: var(--avatar-accent);
  box-shadow: 0 0 10px rgba(120, 238, 179, 0.28);
}

@media (max-width: 380px) {
  body[data-current-view="progress"] .performance-stage { min-height: 390px; }
  body[data-current-view="progress"] .performance-hero-head h3 { max-width: 220px; font-size: 1.3rem; }
  body[data-current-view="progress"] .stage-readout { min-width: 56px; padding: 6px; }
  body[data-current-view="progress"] .stage-readout.upper { top: 76px; }
  body[data-current-view="progress"] .stage-readout.core { top: 152px; }
  body[data-current-view="progress"] .stage-readout.lower { bottom: 76px; }
  .equipment-slot { grid-template-columns: 36px minmax(0, 1fr); column-gap: 7px; }
  .equipment-icon { width: 36px; height: 36px; }
}

/* Six-step evolution track keeps frequent progress visible on narrow screens. */
body[data-current-view="progress"] .evolution-stages {
  position: relative;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

body[data-current-view="progress"] .evolution-stages article {
  position: relative;
  grid-template-columns: 1fr;
  place-items: center;
  align-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 64px;
  padding: 7px 2px;
  text-align: center;
}

body[data-current-view="progress"] .evolution-stages article > span {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid rgba(195, 225, 211, 0.15);
  border-radius: 50%;
  background: #17201c;
  font-size: 0.59rem;
}

body[data-current-view="progress"] .evolution-stages article.complete > span {
  border-color: rgba(120, 238, 179, 0.32);
  background: #1b3227;
}

body[data-current-view="progress"] .evolution-stages article.active {
  background: #18231e;
  box-shadow: inset 0 2px 0 var(--avatar-accent);
}

body[data-current-view="progress"] .evolution-stages article.active > span {
  border-color: rgba(120, 238, 179, 0.58);
  background: #234b37;
  color: #dffbed;
  box-shadow: 0 0 13px rgba(120, 238, 179, 0.18);
}

body[data-current-view="progress"] .evolution-stages small {
  display: none;
}

body[data-current-view="progress"] .evolution-stages strong {
  max-width: 100%;
  margin: 0;
  font-size: 0.6rem;
  text-overflow: clip;
}

@media (max-width: 380px) {
  body[data-current-view="progress"] .evolution-stages article { min-height: 60px; }
  body[data-current-view="progress"] .evolution-stages article > span { width: 21px; height: 21px; }
  body[data-current-view="progress"] .evolution-stages strong { font-size: 0.56rem; }
}

/* Next-form briefing makes every unlock condition and reward explicit. */
.next-evolution-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(120, 238, 179, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(rgba(120, 238, 179, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 238, 179, 0.025) 1px, transparent 1px),
    #121c17;
  background-size: 22px 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 16px 34px rgba(0, 0, 0, 0.2);
}

.next-evolution-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.next-evolution-copy > span {
  color: #83d9ac;
  font-size: 0.64rem;
  font-weight: 800;
}

.next-evolution-copy h3 {
  margin: 4px 0 0;
  color: #f3faf6;
  font-size: 1.08rem;
}

.next-evolution-copy p {
  margin: 4px 0 0;
  color: #83938b;
  font-size: 0.67rem;
}

.requirement-count {
  display: grid;
  flex: 0 0 auto;
  color: #e7fff2;
  font-family: var(--font-number);
  font-size: 1rem;
  text-align: right;
}

.requirement-count small {
  margin-top: 3px;
  color: #6f8178;
  font-family: var(--font-sans);
  font-size: 0.55rem;
}

.next-evolution-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: stretch;
}

.next-requirement-list {
  display: grid;
  align-content: start;
  border-top: 1px solid rgba(194, 225, 211, 0.1);
}

.next-requirement {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 4px 8px;
  align-items: center;
  min-height: 49px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(194, 225, 211, 0.1);
}

.requirement-state {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(196, 220, 209, 0.15);
  border-radius: 6px;
  background: #1d2822;
  color: #74847c;
}

.next-requirement.met .requirement-state {
  border-color: rgba(120, 238, 179, 0.35);
  background: #1d3a2c;
  color: #8df0bd;
}

.requirement-state svg {
  width: 13px;
  height: 13px;
}

.next-requirement > div:nth-child(2) {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.next-requirement > div:nth-child(2) > span {
  overflow: hidden;
  color: #9caaa3;
  font-family: var(--font-number);
  font-size: 0.56rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-requirement > div:nth-child(2) > strong {
  color: #edf7f2;
  font-family: var(--font-number);
  font-size: 0.68rem;
  white-space: nowrap;
}

.next-requirement > div:nth-child(2) > strong small {
  color: #728179;
  font-size: 0.52rem;
}

.requirement-track {
  grid-column: 2;
  height: 3px;
  overflow: hidden;
  background: #2a342f;
}

.requirement-track i {
  display: block;
  height: 100%;
  background: #64746c;
}

.next-requirement.met .requirement-track i {
  background: #78eeb3;
  box-shadow: 0 0 9px rgba(120, 238, 179, 0.3);
}

.next-avatar-preview {
  position: relative;
  min-height: 110px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(120, 238, 179, 0.18);
  border-radius: 7px;
  background: #0b110e;
}

.next-avatar-preview::before,
.equipment-slot::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(120, 238, 179, 0.74), transparent);
}

.next-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.48) brightness(0.5) contrast(1.08);
  transform: scale(1.15);
}

.next-avatar-preview > span {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 24px;
  border: 1px solid rgba(120, 238, 179, 0.18);
  border-radius: 5px;
  background: rgba(9, 15, 12, 0.82);
  color: #8ddbb4;
  font-size: 0.55rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.next-avatar-preview > span svg {
  width: 12px;
  height: 12px;
}

.next-unlock-summary {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(120, 238, 179, 0.16);
  border-radius: 7px;
  background: rgba(120, 238, 179, 0.055);
}

.next-unlock-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(120, 238, 179, 0.28);
  border-radius: 7px;
  background: #1c382a;
  color: #8df0bd;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 16px rgba(120, 238, 179, 0.08);
}

.next-unlock-icon svg {
  width: 18px;
  height: 18px;
}

.next-unlock-summary small,
.next-unlock-summary strong,
.next-unlock-summary p {
  display: block;
}

.next-unlock-summary small {
  color: #79b895;
  font-size: 0.55rem;
}

.next-unlock-summary strong {
  margin-top: 3px;
  color: #eff9f4;
  font-size: 0.72rem;
}

.next-unlock-summary p {
  margin: 3px 0 0;
  color: #809087;
  font-size: 0.59rem;
  line-height: 1.4;
}

.next-training-action {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding-top: 2px;
}

.next-training-action > svg {
  width: 18px;
  height: 18px;
  color: #7cd9a8;
}

.next-training-action span,
.next-training-action strong,
.next-training-action small {
  display: block;
}

.next-training-action strong {
  color: #dceae3;
  font-size: 0.66rem;
}

.next-training-action small {
  margin-top: 2px;
  color: #74837b;
  font-size: 0.57rem;
  line-height: 1.4;
}

.equipment-slot {
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: 1fr;
  min-height: 74px;
  border-color: rgba(179, 211, 196, 0.13);
  background:
    linear-gradient(135deg, rgba(196, 225, 212, 0.045), transparent 48%),
    repeating-linear-gradient(90deg, transparent 0 12px, rgba(206, 235, 221, 0.018) 12px 13px),
    #151e1a;
}

.equipment-slot.unlocked {
  border-color: rgba(120, 238, 179, 0.3);
  background:
    linear-gradient(135deg, rgba(120, 238, 179, 0.105), transparent 52%),
    repeating-linear-gradient(90deg, transparent 0 12px, rgba(120, 238, 179, 0.025) 12px 13px),
    #16231d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 8px 22px rgba(0, 0, 0, 0.16);
}

.equipment-slot.locked {
  opacity: 0.66;
  filter: saturate(0.25);
}

.equipment-icon,
.equipment-slot.unlocked .equipment-icon {
  grid-row: 1;
  border: 0;
  border-radius: 0;
  clip-path: polygon(17% 0, 83% 0, 100% 17%, 100% 83%, 83% 100%, 17% 100%, 0 83%, 0 17%);
  background: linear-gradient(145deg, #35443d, #17211c 58%, #2a3932);
  color: #aebdb5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.equipment-slot.unlocked .equipment-icon {
  background: linear-gradient(145deg, #356d52, #172b21 58%, #244c39);
  color: #9ff4c7;
}

.equipment-copy {
  display: grid;
  align-content: center;
  min-width: 0;
  padding-right: 34px;
}

.equipment-copy > span {
  color: #6e887b;
  font-family: var(--font-number);
  font-size: 0.5rem;
  font-weight: 800;
}

.equipment-slot .equipment-copy strong {
  margin-top: 2px;
  font-size: 0.7rem;
}

.equipment-slot .equipment-copy small {
  margin-top: 3px;
  font-size: 0.53rem;
}

.equipment-slot > b {
  position: absolute;
  top: 9px;
  right: 7px;
  color: #596860;
  font-family: var(--font-number);
  font-size: 0.43rem;
}

.equipment-slot.unlocked > b {
  color: #77d6a6;
  text-shadow: 0 0 8px rgba(120, 238, 179, 0.24);
}

@media (max-width: 380px) {
  .next-evolution-layout { grid-template-columns: minmax(0, 1fr) 78px; }
  .next-avatar-preview { min-height: 106px; }
  .equipment-slot { grid-template-columns: 36px minmax(0, 1fr); }
  .equipment-copy { padding-right: 29px; }
  .equipment-slot > b { font-size: 0.39rem; }
}

/* Final system pass: readable type, compact profile metrics, and one shared shell. */
body[data-current-view="progress"] .performance-screen small,
body[data-current-view="progress"] .performance-kicker,
body[data-current-view="progress"] .avatar-stage-heading span,
body[data-current-view="progress"] .avatar-stage-heading small,
body[data-current-view="progress"] .stage-readout span,
body[data-current-view="progress"] .stage-readout small,
body[data-current-view="progress"] .next-evolution-copy > span,
body[data-current-view="progress"] .next-requirement span,
body[data-current-view="progress"] .next-unlock-summary small,
body[data-current-view="progress"] .next-training-action small,
body[data-current-view="progress"] .equipment-copy > span,
body[data-current-view="progress"] .equipment-copy small,
body[data-current-view="progress"] .ability-code,
body[data-current-view="progress"] .ability-name small,
body[data-current-view="progress"] .performance-section-title > div > span,
body[data-current-view="progress"] .body-zone-index,
body[data-current-view="progress"] .body-zone-copy > span {
  font-size: 0.75rem !important;
  line-height: 1.4;
}

body[data-current-view="progress"] .equipment-slot > b,
body[data-current-view="progress"] .progress-level-dial span {
  font-size: 0.62rem !important;
}

body[data-current-view="progress"] .evolution-stages article > span,
body[data-current-view="progress"] .evolution-stages strong {
  font-size: 0.75rem !important;
}

body[data-current-view="progress"] .performance-hero-head p,
body[data-current-view="progress"] .stage-status span,
body[data-current-view="progress"] .stage-status strong {
  font-size: 0.75rem !important;
}

.plan-screen .micro-label,
.plan-screen small,
.plan-screen .goal-roadmap p,
.plan-screen .plan-insight-grid p,
.plan-screen .week-day > span {
  font-size: 0.75rem;
  line-height: 1.42;
}

.plan-screen .plan-progress-ring span,
.plan-screen .goal-phase-grid article > span,
.plan-screen .plan-balance-panel p,
.plan-screen .plan-balance-panel li,
.plan-screen .plan-coverage-list span,
.plan-screen .plan-coverage-list small {
  font-size: 0.75rem !important;
}

.smart-entry-button small,
.diary-screen .micro-label,
.diary-screen .section-eyebrow,
.plan-edit-button,
.exercise-guide-button span,
.exercise-guide-button small {
  font-size: 0.75rem !important;
}

.icon-button[data-delete-log],
.estimate-metrics-button {
  min-width: 44px !important;
  min-height: 44px !important;
}

@media (max-width: 560px) {
  .profile-hero .mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .profile-hero .mini-card {
    min-height: 94px;
    padding: 13px;
  }

  .profile-hero .mini-card h3,
  .profile-hero .health-metric > span,
  .profile-hero .health-metric small {
    font-size: 0.75rem;
  }
}

/* Diary: one clear recording flow instead of four competing cards. */
.diary-screen .wide-grid {
  gap: 12px;
}

.meal-record-studio {
  gap: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.86) !important;
  box-shadow: 0 18px 42px rgba(20, 54, 42, 0.1), inset 0 1px 0 #ffffff !important;
}

.meal-record-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  padding: 18px 18px 12px;
}

.meal-record-summary h3 {
  margin: 4px 0 0;
  color: var(--ff-ink);
  font-size: 1.2rem;
  line-height: 1.15;
}

.meal-record-summary p {
  margin: 5px 0 0;
  color: var(--ff-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.meal-budget-readout {
  min-width: 122px;
  text-align: right;
}

.meal-budget-readout span,
.meal-budget-readout small {
  display: block;
  color: var(--ff-muted);
  font-size: 0.75rem;
  line-height: 1.25;
}

.meal-budget-readout strong {
  display: inline-block;
  margin: 2px 2px 0 0;
  color: var(--ff-green-dark);
  font-family: var(--font-number);
  font-size: 1.55rem;
  line-height: 1;
}

.meal-budget-readout small {
  display: inline-block;
}

.meal-budget-track {
  height: 4px;
  margin: 0 18px;
  overflow: hidden;
  border-radius: 4px;
  background: #e3ebe7;
}

.meal-budget-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #087552;
  box-shadow: 0 0 8px rgba(8, 117, 82, 0.2);
}

.meal-budget-status {
  padding: 7px 18px 0;
  color: #087552;
  font-size: 0.75rem;
  font-weight: 750;
  line-height: 1.3;
  text-align: right;
}

.meal-budget-status.over {
  color: #ad4c3d;
}

.meal-record-studio .meal-entry-console {
  gap: 0;
  margin: 12px 14px 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.meal-entry-methods {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  overflow: hidden;
  border: 1px solid rgba(11, 77, 57, 0.18);
  border-radius: 8px;
  background: rgba(221, 233, 227, 0.78);
  box-shadow: inset 0 2px 5px rgba(15, 59, 44, 0.08), 0 1px 0 rgba(255, 255, 255, 0.9);
}

.meal-entry-methods::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 4px;
  left: 4px;
  width: calc((100% - 20px) / 4);
  height: calc(100% - 8px);
  border: 1px solid rgba(193, 246, 224, 0.42);
  border-bottom-color: rgba(3, 59, 42, 0.74);
  border-radius: 6px;
  background: #0b7354;
  box-shadow: 0 7px 16px rgba(3, 74, 51, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -8px 14px rgba(0, 50, 35, 0.18);
  transform: translate3d(var(--active-x, 0%), 0, 0);
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 180ms ease;
}

.meal-entry-methods .smart-entry-button,
.meal-entry-methods .smart-entry-button.text,
.meal-entry-methods .smart-entry-button.photo,
.meal-entry-methods .smart-entry-button.barcode,
.meal-entry-methods .smart-entry-button.voice {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 62px;
  padding: 6px 3px;
  border: 1px solid transparent !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: #51665d !important;
  box-shadow: none !important;
  grid-column: auto !important;
  overflow: hidden;
  position: relative;
  z-index: 1;
  text-align: center;
  transition: color 220ms ease, transform 150ms ease !important;
}

.meal-entry-methods .smart-entry-button.active,
.meal-entry-methods .smart-entry-button[aria-pressed="true"] {
  border-color: transparent !important;
  background: transparent !important;
  color: #ffffff !important;
  box-shadow: none !important;
  transform: none;
}

.meal-entry-methods .smart-entry-button:hover {
  color: #0b644b !important;
  transform: translateY(-1px);
}

.meal-entry-methods .smart-entry-button.active:hover,
.meal-entry-methods .smart-entry-button[aria-pressed="true"]:hover {
  color: #ffffff !important;
}

.meal-entry-methods .smart-entry-button:active {
  transform: translateY(1px) scale(0.96) !important;
}

.meal-entry-methods .smart-entry-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(34, 85, 66, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.62) !important;
  color: inherit !important;
  box-shadow: inset 0 1px 0 #ffffff, 0 3px 8px rgba(22, 68, 51, 0.07);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), background 220ms ease, box-shadow 220ms ease;
}

.meal-entry-methods .smart-entry-icon svg {
  width: 17px;
  height: 17px;
}

.meal-entry-methods .smart-entry-button.active .smart-entry-icon,
.meal-entry-methods .smart-entry-button[aria-pressed="true"] .smart-entry-icon {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 0 4px rgba(158, 238, 203, 0.08);
  transform: translateY(-1px) scale(1.04);
}

.meal-entry-methods .smart-entry-button.active::before,
.meal-entry-methods .smart-entry-button[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  inset: -20% -80%;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.2) 50%, transparent 62%);
  transform: translateX(-55%);
  animation: meal-mode-sheen 3.4s ease-in-out infinite;
}

.meal-entry-methods .smart-entry-button strong {
  overflow: hidden;
  font-size: 0.75rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes meal-mode-sheen {
  0%, 58% { transform: translateX(-55%); }
  82%, 100% { transform: translateX(55%); }
}

.meal-description-field {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.meal-description-field > span {
  color: var(--ff-ink);
  font-size: 0.8rem;
  font-weight: 750;
}

.meal-record-studio .meal-description-field textarea {
  min-height: 96px;
  padding: 13px;
  border-radius: 7px !important;
  background: rgba(255, 255, 255, 0.88) !important;
}

.meal-entry-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}

.meal-entry-action > span {
  color: var(--ff-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.meal-entry-action #estimateMealButton {
  width: auto;
  min-width: 138px;
  min-height: 44px;
  padding-inline: 14px;
}

.meal-record-studio .estimate-preview {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(16, 117, 82, 0.16) !important;
  border-radius: 7px !important;
  background: rgba(240, 248, 244, 0.88) !important;
  box-shadow: none !important;
}

.meal-record-studio .smart-entry-result,
.meal-record-studio .barcode-review,
.meal-record-studio .nutrition-label-fallback {
  margin-top: 12px;
}

.meal-manual-details {
  margin: 12px 14px 0;
  border-top: 1px solid rgba(35, 79, 63, 0.12);
  border-bottom: 1px solid rgba(35, 79, 63, 0.12);
}

.meal-manual-details summary {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px;
  color: var(--ff-ink);
  cursor: pointer;
  list-style: none;
}

.meal-manual-details summary::-webkit-details-marker {
  display: none;
}

.meal-manual-details summary span,
.meal-manual-details summary strong,
.meal-manual-details summary small {
  display: block;
}

.meal-manual-details summary strong {
  font-size: 0.82rem;
  line-height: 1.3;
}

.meal-manual-details summary small {
  margin-top: 2px;
  color: var(--ff-muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.meal-manual-details summary i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-right: 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.meal-manual-details[open] summary i {
  margin-top: 6px;
  transform: rotate(225deg);
}

.meal-manual-fields {
  display: grid;
  gap: 12px;
  padding: 4px 0 14px;
}

.meal-manual-fields .form-grid {
  gap: 10px;
}

.meal-save-button {
  width: calc(100% - 28px);
  min-height: 48px;
  margin: 12px 14px 16px;
}

.diary-screen .panel + .panel,
.diary-screen .wide-grid + .wide-grid {
  margin-top: 0;
}

.diary-disclosure {
  padding: 0 !important;
  overflow: hidden;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.82) !important;
}

.diary-disclosure-summary {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 10px 14px;
  color: var(--ff-ink);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.diary-disclosure-summary::-webkit-details-marker {
  display: none;
}

.diary-disclosure-summary:focus-visible {
  outline: 3px solid rgba(40, 124, 147, 0.25);
  outline-offset: -3px;
}

.diary-disclosure-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(25, 83, 62, 0.13);
  border-radius: 8px;
  background: rgba(232, 242, 237, 0.8);
  color: #087052;
  box-shadow: inset 0 1px 0 #ffffff, 0 5px 12px rgba(20, 70, 51, 0.07);
}

.diary-disclosure-icon.recovery {
  background: rgba(235, 240, 246, 0.88);
  color: #35667c;
}

.diary-disclosure-icon.workout {
  background: rgba(246, 238, 220, 0.86);
  color: #90691e;
}

.diary-disclosure-icon.logs {
  background: rgba(239, 235, 246, 0.86);
  color: #6f5491;
}

.diary-disclosure-icon svg {
  width: 20px;
  height: 20px;
}

.diary-disclosure-copy,
.diary-disclosure-copy strong,
.diary-disclosure-copy small,
.diary-disclosure-value,
.diary-disclosure-value strong,
.diary-disclosure-value small {
  display: block;
  min-width: 0;
}

.diary-disclosure-copy strong {
  font-size: 0.9rem;
  line-height: 1.3;
}

.diary-disclosure-copy small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ff-muted);
  font-size: 0.75rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diary-disclosure-value {
  min-width: 60px;
  text-align: right;
}

.diary-disclosure-value strong {
  color: var(--ff-green-dark);
  font-family: var(--font-number);
  font-size: 0.9rem;
  line-height: 1.2;
}

.diary-disclosure-value small {
  margin-top: 2px;
  color: var(--ff-muted);
  font-size: 0.75rem;
  line-height: 1.2;
}

.diary-disclosure-value.compact {
  min-width: 48px;
}

.diary-chevron {
  width: 18px;
  height: 18px;
  color: #63756d;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.diary-disclosure[open] .diary-chevron {
  transform: rotate(180deg);
}

.diary-disclosure[open] .diary-disclosure-summary {
  background: rgba(244, 248, 246, 0.72);
}

.diary-disclosure-content {
  border-top: 1px solid rgba(35, 79, 63, 0.11);
  animation: diary-disclosure-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.diary-form-content,
.diary-log-content,
.meal-plan-content {
  padding: 14px;
}

.diary-form-content {
  display: grid;
  gap: 12px;
}

.diary-log-content .log-list {
  margin-top: 0;
}

.meal-plan-explainer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.meal-plan-explainer span {
  flex: 0 0 auto;
  color: var(--ff-green-dark);
  font-size: 0.78rem;
  font-weight: 750;
}

.meal-plan-explainer p {
  max-width: 270px;
  margin: 0;
  color: var(--ff-muted);
  font-size: 0.75rem;
  line-height: 1.45;
  text-align: right;
}

.meal-timeline {
  gap: 0 !important;
  margin-top: 0 !important;
}

.meal-allocation-track {
  display: flex !important;
  gap: 2px !important;
  width: 100%;
  height: 28px;
  overflow: hidden;
  border-radius: 7px;
  background: #e7eeea;
}

.meal-allocation-track > span {
  display: grid;
  min-width: 0;
  height: 100%;
  place-items: center;
  background: #0b7354;
}

.meal-allocation-track > span:nth-child(2) { background: #25866a; }
.meal-allocation-track > span:nth-child(3) { background: #53a58a; }
.meal-allocation-track > span:nth-child(4) { background: #91c9b6; }

.meal-allocation-track b {
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #ffffff;
  font-family: var(--font-number);
  font-size: 0.75rem;
  line-height: 1;
}

.meal-allocation-track b::after {
  content: none !important;
}

.meal-allocation-labels {
  display: grid !important;
  grid-template-columns: 25fr 35fr 30fr 10fr !important;
  gap: 2px !important;
  margin-top: 5px;
  color: var(--ff-muted);
  font-size: 0.75rem;
  line-height: 1.2;
  text-align: center;
}

.meal-timeline .meal-budget-list {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 0 !important;
  margin-top: 14px;
  border-top: 1px solid rgba(35, 79, 63, 0.1);
}

.meal-budget-row {
  display: grid !important;
  grid-template-columns: 24px minmax(0, 1fr) auto !important;
  gap: 2px 10px !important;
  align-items: center;
  min-height: 64px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(35, 79, 63, 0.1);
}

.meal-budget-index {
  grid-row: 1 / 3;
  color: #8b9993;
  font-family: var(--font-number);
  font-size: 0.75rem;
}

.meal-budget-name strong,
.meal-budget-name small,
.meal-budget-value strong,
.meal-budget-value small {
  display: block;
}

.meal-budget-name strong {
  color: var(--ff-ink);
  font-size: 0.82rem;
  text-align: left !important;
}

.meal-budget-name small,
.meal-budget-value small {
  margin-top: 2px;
  color: var(--ff-muted);
  font-size: 0.75rem;
}

.meal-budget-value {
  text-align: right;
}

.meal-budget-value strong {
  color: var(--ff-green-dark);
  font-family: var(--font-number);
  font-size: 0.84rem;
  text-align: right !important;
}

.meal-budget-recorded {
  grid-column: 2 / 4;
  color: #89958f;
  font-size: 0.75rem;
  line-height: 1.25;
}

.meal-budget-recorded.filled {
  color: #087052;
  font-weight: 700;
}

@keyframes diary-disclosure-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 380px) {
  .meal-record-summary {
    gap: 10px;
    padding-inline: 14px;
  }

  .meal-budget-readout {
    min-width: 108px;
  }

  .meal-entry-action {
    grid-template-columns: 1fr;
  }

  .meal-entry-action #estimateMealButton {
    width: 100%;
  }

  .diary-disclosure-summary {
    grid-template-columns: 36px minmax(0, 1fr) auto 16px;
    gap: 8px;
    padding-inline: 10px;
  }

  .diary-disclosure-icon {
    width: 36px;
    height: 36px;
  }

  .diary-disclosure-copy small {
    max-width: 150px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .meal-entry-methods::before,
  .meal-entry-methods .smart-entry-button,
  .meal-entry-methods .smart-entry-icon,
  .diary-chevron,
  .diary-disclosure-content {
    animation: none !important;
    transition: none !important;
  }
}
