*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  color: #1a1a1a;
  background: #f4f4f2;
}

.week {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.week__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.week__header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-shrink: 0;
}

.week__auth {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.week__auth[hidden] {
  display: none;
}

.week__auth-email {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  color: #5c5c5c;
}

.week__auth-btn {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.35rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid #c8c8c4;
  border-radius: 6px;
  background: #fff;
  color: #1a1a1a;
  cursor: pointer;
}

.week__auth-btn:hover {
  border-color: #9eb4cc;
  background: #e8eef4;
}

.week__auth-btn--primary {
  border-color: #7a9ab8;
  background: #e8eef4;
  color: #2a4a6e;
}

.week__auth-btn--primary:hover {
  border-color: #5e82a6;
  background: #dce7f2;
}

.auth-form-fields {
  display: grid;
  gap: 0.75rem;
}

.week__header-text {
  min-width: 0;
}

.week__header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.week__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #c8c8c4;
  border-radius: 6px;
  background: #fff;
}

.week__nav-adj {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 1.9rem;
  padding: 0.2rem 0.55rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid #c8c8c4;
  border-radius: 4px;
  background: #fafaf8;
  color: #333;
}

.week__nav-adj:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.04);
}

.week__nav-adj:disabled {
  opacity: 0.45;
  cursor: default;
}

.week__nav-label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-width: 11rem;
  flex: 1 1 auto;
  min-height: 2.4rem;
  padding: 0.25rem 0.55rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  color: #1a1a1a;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
}

.week__nav-label:hover,
.week__nav-label:focus-visible {
  border-color: #3d6b9e;
  background: #f5f8fc;
  outline: none;
}

.week__nav-label--current {
  border-color: #3d6b9e;
  background: #f5f8fc;
  color: #3d6b9e;
}

.week__nav-label--current #week-nav-label-text {
  color: #3d6b9e;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.week__nav-label--current .week__nav-label-hint {
  color: #3d6b9e;
}

.week__nav-label--past {
  border-color: #c4a35a;
  background: #faf4e0;
  color: #8a6d1f;
  font-weight: 500;
}

.week__nav-label--past #week-nav-label-text {
  color: #8a6d1f;
  font-weight: 500;
  text-decoration: none;
}

.week__nav-label--past .week__nav-label-hint {
  color: #a67c2a;
}

.week__nav-label--past:hover,
.week__nav-label--past:focus-visible {
  border-color: #a67c2a;
  background: #f5edd0;
  outline: none;
}

.week__nav-label--future {
  border-color: #e879f9;
  background: #fdf2ff;
  color: #c026d3;
  font-weight: 500;
}

.week__nav-label--future #week-nav-label-text {
  color: #c026d3;
  font-weight: 500;
  text-decoration: none;
}

.week__nav-label--future .week__nav-label-hint {
  color: #e11d8f;
}

.week__nav-label--future:hover,
.week__nav-label--future:focus-visible {
  border-color: #d946ef;
  background: #fae8ff;
  outline: none;
}

.week__nav-label-hint {
  font-size: 0.65rem;
  font-weight: 500;
  color: #6a6a66;
  letter-spacing: 0.02em;
}

.week-jump-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.week-jump-input {
  display: block;
  width: 100%;
  min-height: 2.4rem;
  padding: 0.4rem 0.55rem;
  font: inherit;
  font-size: 0.95rem;
  border: 1px solid #c8c8c4;
  border-radius: 4px;
  background: #fff;
  color: #1a1a1a;
}

.week-jump-preview {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #3d6b9e;
}

.week__nav-this {
  padding: 0.25rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid #3d6b9e;
  border-radius: 4px;
  background: #f5f8fc;
  color: #3d6b9e;
}

.week__nav-this:hover:not(:disabled) {
  background: #eaf1f8;
}

.week__nav-this:disabled {
  opacity: 0.45;
  cursor: default;
}

.week__favorites-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.25rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid #c8c8c4;
  border-radius: 4px;
  background: #fafaf8;
  color: #333;
}

.week__saved-meals-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.25rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid #c8c8c4;
  border-radius: 4px;
  background: #fafaf8;
  color: #333;
}

.week__saved-meals-toggle:hover:not(:disabled),
.week__saved-meals-toggle[aria-expanded="true"] {
  border-color: #3d6b9e;
  background: #eaf1f8;
  color: #3d6b9e;
}

.week__favorites-toggle:hover:not(:disabled),
.week__favorites-toggle[aria-expanded="true"] {
  border-color: #2a7a6e;
  background: #eef7f5;
  color: #1f5c53;
}

.week__days-favorite-week {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 0.55rem 0.65rem 0.5rem;
  border-bottom: 1px solid #ddd9d2;
  background: #f3f2ee;
  gap: 0.4rem;
}

.diary-search-modal__body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem;
  overflow-y: auto;
}

.diary-search-modal__status {
  margin: 0;
  color: #666;
  font-size: 0.8rem;
}

.diary-search-modal__results {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.diary-search-modal__result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid #d8d8d3;
  border-radius: 7px;
  background: #fafaf8;
}

.diary-search-modal__date {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #262626;
}

.diary-search-modal__brief {
  grid-column: 1;
  color: #61615d;
  font-size: 0.8rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.diary-search-modal__expand {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: #315d8b;
  font: inherit;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  cursor: pointer;
}

.diary-search-modal__expand:hover {
  color: #244a70;
}

.diary-search-modal__all-foods {
  margin: 0.1rem 0 0;
  padding-left: 1.15rem;
}

.diary-search-modal__all-foods[hidden] {
  display: none;
}

.diary-search-modal__all-foods li + li {
  margin-top: 0.18rem;
}

.diary-search-modal__result--expanded .diary-search-modal__summary {
  display: none;
}

.diary-search-modal__jump {
  grid-column: 2;
  grid-row: 1 / span 2;
  padding: 0.35rem 0.65rem;
  border: 1px solid #3d6b9e;
  border-radius: 4px;
  background: #f5f8fc;
  color: #315d8b;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.diary-search-modal__jump:hover {
  background: #eaf1f8;
}

.week__days-favorite-week-btn {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  padding: 0.2rem 0.55rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid #c8c8c4;
  border-radius: 4px;
  background: #fff;
  color: #555;
}

.week__days-favorite-week-btn:hover:not(:disabled),
.week__days-favorite-week-btn[aria-pressed="true"] {
  border-color: #2a7a6e;
  background: #eef7f5;
  color: #1f5c53;
}

.favorites-sidebar {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  visibility: hidden;
}

.favorites-sidebar.favorites-sidebar--open {
  pointer-events: auto;
  visibility: visible;
}

.favorites-sidebar__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 28, 0.35);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.favorites-sidebar.favorites-sidebar--open .favorites-sidebar__backdrop {
  opacity: 1;
}

.favorites-sidebar__panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(22rem, 92vw);
  height: 100%;
  background: #fff;
  border-left: 1px solid #c8c8c4;
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.14);
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

.favorites-sidebar.favorites-sidebar--open .favorites-sidebar__panel {
  transform: translateX(0);
}

.favorites-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex: 0 0 auto;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e4e4e0;
}

.favorites-sidebar__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
}

.favorites-sidebar__header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.favorites-sidebar__manage {
  min-height: 1.8rem;
  padding: 0.2rem 0.55rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #c8c8c4;
  border-radius: 4px;
  background: #fafaf8;
  color: #333;
}

.favorites-sidebar__manage:hover,
.favorites-sidebar__manage[aria-pressed="true"] {
  border-color: #2a7a6e;
  background: #eef7f5;
  color: #1f5c53;
}

.favorites-sidebar__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #555;
}

.favorites-sidebar__close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.favorites-sidebar__body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 0.75rem 0.85rem 1.25rem;
}

.favorites-sidebar__hint {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: #6a6a66;
}

.favorites-sidebar__list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.favorites-sidebar__empty {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: #6a6a66;
}

.favorites-sidebar__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #1a1a1a;
}

.favorites-sidebar__item:hover,
.favorites-sidebar__item:focus-visible {
  border-color: #c5ddd8;
  background: #eef7f5;
  outline: none;
}

.favorites-sidebar__item-name {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
}

.favorites-sidebar__item-meta {
  font-size: 0.7rem;
  color: #6a6a66;
  line-height: 1.2;
}

.favorites-sidebar__item-desc {
  font-size: 0.75rem;
  color: #4a4a46;
  line-height: 1.3;
}

.favorite-edit-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.favorites-manage-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.favorites-manage-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: start;
  padding: 0.55rem 0.65rem;
  border: 1px solid #d8d8d4;
  border-radius: 6px;
  background: #fafaf8;
}

.favorites-manage-move {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
}

.favorites-manage-move-btn {
  min-width: 1.7rem;
  min-height: 1.5rem;
  padding: 0;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  border: 1px solid #c8c8c4;
  border-radius: 4px;
  background: #fff;
  color: #333;
}

.favorites-manage-move-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.04);
}

.favorites-manage-move-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.favorites-manage-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.favorites-manage-go {
  display: inline;
  padding: 0;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  color: #1f5c53;
  cursor: pointer;
  border: none;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.favorites-manage-go:hover,
.favorites-manage-go:focus-visible {
  color: #155248;
  outline: none;
}

.favorites-manage-meta {
  font-size: 0.72rem;
  color: #6a6a66;
}

.favorites-manage-desc {
  font-size: 0.8rem;
  color: #444;
  line-height: 1.35;
  white-space: pre-wrap;
}

.favorites-manage-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: flex-end;
}

.favorites-manage-action {
  min-height: 1.7rem;
  padding: 0.15rem 0.45rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #c8c8c4;
  border-radius: 4px;
  background: #fff;
  color: #333;
}

.favorites-manage-action:hover {
  background: rgba(0, 0, 0, 0.04);
}

.favorites-manage-action--danger:hover {
  color: #7a4a4a;
  border-color: #d0a8a8;
  background: #faf2f2;
}

@media (max-width: 640px) {
  .favorites-manage-row {
    grid-template-columns: auto 1fr;
  }

  .favorites-manage-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.week__settings {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding: 0.35rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid #c8c8c4;
  border-radius: 6px;
  background: #fff;
  color: #1a1a1a;
  cursor: pointer;
}

.week__settings:hover {
  border-color: #9eb4cc;
  background: #e8eef4;
}

.week__settings-icon {
  font-size: 1rem;
  line-height: 1;
  color: #3d6b9e;
}

.week__settings-abbr {
  display: none;
  flex-shrink: 0;
  min-width: 1.15rem;
  padding: 0.05rem 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-align: center;
  color: #2a4a6e;
  background: #e8eef4;
  border: 1px solid #9eb4cc;
  border-radius: 4px;
}

.week__settings-label {
  letter-spacing: 0.02em;
}

.week__settings-status {
  font-size: 0.72rem;
  font-weight: 500;
  color: #5c5c5c;
  white-space: nowrap;
}

.week__help {
  flex-shrink: 0;
  padding: 0.35rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid #c8c8c4;
  border-radius: 6px;
  background: #fff;
  color: #1a1a1a;
  cursor: pointer;
}

.week__help:hover {
  border-color: #9eb4cc;
  background: #e8eef4;
}

.logged-out-banner {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid #d4c4a0;
  border-radius: 6px;
  background: #faf6ed;
  color: #5c4a28;
}

.logged-out-banner[hidden] {
  display: none !important;
}

.logged-out-banner__text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
}

.logged-out-banner__link {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: #3d6b9e;
  text-decoration: underline;
  cursor: pointer;
}

.week__meals-more {
  position: relative;
}

.week__meals-more-toggle {
  padding: 0.35rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #c8c8c4;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.week__meals-more-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 10rem;
  padding: 0.25rem;
  border: 1px solid #d4d4d0;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.week__meals-more-menu[hidden] {
  display: none !important;
}

.week__meals-more-menu .week__meals-bulk,
.week__meals-more-menu .week__clear-all {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  border: none;
  border-radius: 4px;
}

@media (max-width: 720px) {
  .week__meals-more-menu {
    right: auto;
    left: 0;
    max-width: calc(100vw - 1.5rem);
  }
}

.week__meals-bulk--primary {
  font-weight: 600;
}

.undo-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: min(92vw, 28rem);
  padding: 0.55rem 0.65rem 0.55rem 0.85rem;
  border: 1px solid #c8c8c4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  transform: translateX(-50%);
}

.save-toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid #9fc9b7;
  border-radius: 7px;
  background: #f0faf5;
  box-shadow: 0 6px 20px rgba(31, 92, 83, 0.14);
  color: #1f5c53;
  font-size: 0.82rem;
  font-weight: 650;
  animation: save-toast-in 140ms ease-out;
}

.save-toast[hidden] {
  display: none !important;
}

.save-toast__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #2a7a6e;
  color: #fff;
  font-size: 0.72rem;
  line-height: 1;
}

@keyframes save-toast-in {
  from {
    opacity: 0;
    transform: translateY(-0.35rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .save-toast {
    animation: none;
  }
}

.undo-toast[hidden] {
  display: none !important;
}

.undo-toast__message {
  flex: 1 1 auto;
  font-size: 0.85rem;
  color: #1a1a1a;
}

.undo-toast__action {
  flex: 0 0 auto;
  padding: 0.25rem 0.55rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #9eb4cc;
  border-radius: 4px;
  background: #e8eef4;
  color: #2a4a6e;
  cursor: pointer;
}

.undo-toast__dismiss {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #8a8a86;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.add-food-modal__empty-library {
  padding: 0.75rem 0;
}

.add-food-modal__empty-library-lead {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: #444;
}

.add-food-modal__empty-library-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.add-food-modal__create-row {
  margin: 0.35rem 0 0;
}

.add-food-modal__create-btn {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  border: 1px dashed #9eb4cc;
  border-radius: 6px;
  background: #f5f8fb;
  color: #2a4a6e;
  cursor: pointer;
}

.day__copy-menu-group {
  margin: 0.35rem 0 0.15rem;
  padding: 0 0.45rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a8a86;
}

.day__copy-menu-group:first-child {
  margin-top: 0;
}

.dashboard__longevity-empty {
  margin: 0.5rem 0 1rem;
  padding: 0.75rem;
  border: 1px solid #d4d4d0;
  border-radius: 6px;
  background: #f7f7f4;
  color: #444;
  font-size: 0.9rem;
}

.week__hint {
  margin: 0;
  color: #5c5c5c;
  font-size: 0.875rem;
}

.dashboard {
  margin-bottom: 1.25rem;
}

.dashboard__header {
  margin-bottom: 0.6rem;
}

.dashboard__header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.dashboard__header-row .dashboard__title {
  margin: 0;
}

.app-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: 0 0 0.85rem;
  padding: 0.45rem 0;
  background: rgba(244, 244, 242, 0.94);
  border-bottom: 1px solid #d4d4d0;
  backdrop-filter: blur(8px);
}

.app-nav__inner {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  max-width: 100%;
  /* Room for .app-nav__shortcut badges (top/right overhang) inside the scrollport */
  padding: 0.4rem 0.4rem 0.05rem;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.app-nav__inner::-webkit-scrollbar {
  display: none;
}

.app-nav__btn,
.dashboard__toggle {
  padding: 0.35rem 0.65rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: #2a4a6e;
  background: #fff;
  border: 1px solid #9eb4cc;
  border-radius: 4px;
  cursor: pointer;
}

.app-nav__btn {
  position: relative;
  flex: 0 0 auto;
}

.app-nav__shortcut {
  display: none !important;
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  z-index: 1;
  box-sizing: border-box;
  width: 1.05rem;
  height: 1.05rem;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #3d6b9e;
  border: 1px solid #2a4a6e;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

body.app-nav-shortcuts-visible [data-app-shortcut] > .app-nav__shortcut {
  display: inline-flex !important;
}

.dashboard__micro-toggle-label[data-app-shortcut] {
  position: relative;
}

.dashboard__micro-condition-toggle[data-app-shortcut],
.dashboard__micro-status-toggle[data-app-shortcut] {
  position: relative;
}

.dashboard__micro-status-toggle > .app-nav__shortcut--cluster {
  top: -0.45rem;
  right: -0.45rem;
  width: auto;
  height: auto;
  gap: 0.12rem;
  padding: 0;
  color: inherit;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.dashboard__micro-status-toggle > .app-nav__shortcut--cluster > span {
  display: inline-flex;
  box-sizing: border-box;
  width: 1.05rem;
  height: 1.05rem;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #3d6b9e;
  border: 1px solid #2a4a6e;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.dashboard__filter-panel-pills .dashboard__sticky-options-check[data-app-shortcut] {
  padding-right: 1.35rem;
}

.dashboard__filter-panel-pills .dashboard__sticky-options-check > .app-nav__shortcut {
  top: -0.25rem;
  right: -0.2rem;
}

.dashboard__sticky-filter-clear[data-app-shortcut] {
  position: relative;
}

.dashboard__nutrient-filter-chips-wrap > .dashboard__sticky-filter-clear[data-app-shortcut] {
  position: absolute;
}

.dashboard__sticky-filter-clear > .app-nav__shortcut--cluster {
  top: -0.5rem;
  left: auto;
  right: -0.2rem;
  width: auto;
  height: auto;
  gap: 0.1rem;
  padding: 0;
  color: inherit;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.dashboard__sticky-filter-clear > .app-nav__shortcut--cluster > span {
  display: inline-flex;
  box-sizing: border-box;
  width: auto;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.18rem;
  align-items: center;
  justify-content: center;
  font-size: 0.52rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #3d6b9e;
  border: 1px solid #2a4a6e;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.app-nav__btn:hover,
.dashboard__toggle:hover {
  background: #e8eef4;
}

.app-nav__btn--open,
.dashboard__toggle--open {
  background: #e8eef4;
  border-color: #3d6b9e;
}

.app-nav__label--short {
  display: none;
}

.app-nav__divider {
  flex: 0 0 auto;
  align-self: stretch;
  width: 1px;
  margin: 0.15rem 0.15rem;
  background: #c8c8c4;
}

#dashboard-grid,
#food-entry,
#food-definitions-heading,
#food-definitions-panel,
#meals-heading,
#meals-panel,
#week-summary,
#week-summary-panel,
#dashboard-macros-condensed,
#dashboard-micro-panel,
#dashboard-longevity-panel {
  scroll-margin-top: 3.5rem;
}

.dashboard > #dashboard-macros-condensed {
  margin-top: 0.85rem;
}

.dashboard > #food-entry {
  margin-top: 0.45rem;
}

.dashboard > .week__days {
  margin-bottom: 1.1rem;
}

.dashboard__macros-condensed {
  margin: 0 0 0.35rem;
  padding: 0.2rem 0 0.35rem;
  border: none;
  border-bottom: 1px solid #e6e6e2;
  border-radius: 0;
  background: transparent;
}

.dashboard__macros-condensed[hidden] {
  display: none;
}

.dashboard__macros-condensed-head {
  display: flex;
  align-items: center;
  margin-bottom: 0.15rem;
}

.dashboard__macros-condensed-title {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a3a39e;
}

.dashboard__macros-condensed-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.15rem 0.35rem;
}

.dashboard__macros-condensed-day {
  min-width: 0;
  box-sizing: border-box;
  padding: 0.28rem 0.4rem 0.32rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  text-align: left;
}

.dashboard__macros-condensed-day--today {
  border: none;
  background: transparent;
}

.dashboard__macros-condensed-label {
  display: block;
  margin: 0;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #9a9a96;
  line-height: 1.2;
}

.dashboard__macros-condensed-day--today .dashboard__macros-condensed-label {
  color: #6a86a4;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

.dashboard__macros-condensed-day--ignored {
  opacity: 0.62;
}

.dashboard__macros-condensed-day--ignored .dashboard__macros-condensed-label {
  color: #8a7a5c;
}

.dashboard__macros-condensed-day--focus {
  background: #eef4fa;
  box-shadow: 0 0 0 1px #3d6b9e;
}

.dashboard__macros-condensed-day--ignored.dashboard__macros-condensed-day--focus {
  background: #f6f1e8;
  box-shadow: 0 0 0 1px #8a7a5c;
  opacity: 1;
}

.dashboard__macros-condensed-cal {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: #7a7a76;
  line-height: 1.25;
}

.dashboard__macros-condensed-macros {
  display: block;
  margin-top: 0;
  font-size: 0.55rem;
  font-variant-numeric: tabular-nums;
  color: #b0b0aa;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard__macros-condensed-unit {
  font-weight: 400;
  letter-spacing: 0.01em;
  color: #b8b8b2;
}

.dashboard__macros-condensed-cal .dashboard__macros-condensed-unit {
  font-size: 0.58rem;
  margin-left: 0.1em;
}

.app-sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
}

.app-sheet[hidden] {
  display: none;
}

.app-sheet__backdrop {
  position: absolute;
  top: var(--app-sheet-top, 3.75rem);
  right: 0;
  bottom: var(--app-sheet-bottom, 0px);
  left: 0;
  background: rgba(20, 24, 28, 0.35);
}

.app-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--app-sheet-top, 3.75rem);
  bottom: var(--app-sheet-bottom, 0px);
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 0;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.14);
  animation: app-sheet-in 0.22s ease;
}

.app-sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.75rem 0.85rem 1.25rem;
}

.app-sheet__panel.dashboard__micro-panel,
.app-sheet__panel.dashboard__longevity-panel {
  padding: 0;
}

@keyframes app-sheet-in {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

html.exclusive-overlay-open,
html.exclusive-overlay-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

body.exclusive-overlay-open .week__header,
body.exclusive-overlay-open .logged-out-banner {
  display: none;
}

body.exclusive-overlay-open .app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 105;
  margin: 0;
  padding-left: 1rem;
  padding-right: 1rem;
  background: #f4f4f2;
  backdrop-filter: none;
}

body.exclusive-overlay-open .starter-guide {
  display: none;
}

body.exclusive-overlay-open::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--app-sheet-top, 3.75rem);
  background: #f4f4f2;
  z-index: 101;
  pointer-events: none;
}

.dashboard__micro-panel {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: none;
  border-radius: 12px 12px 0 0;
  background: #fff;
}

.dashboard__micro-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.dashboard__micro-intro-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1.1rem;
}

.dashboard__micro-toggle-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.dashboard__micro-toggle-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #7a7a7a;
  white-space: nowrap;
}

.dashboard__micro-segmented {
  display: inline-flex;
  border: 1px solid #c8c8c4;
  border-radius: 5px;
  overflow: hidden;
  background: #f4f4f2;
}

.dashboard__micro-segment {
  padding: 0.3rem 0.55rem;
  border: none;
  border-right: 1px solid #c8c8c4;
  background: transparent;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  color: #5c5c5c;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.3;
}

.dashboard__micro-segment:last-child {
  /* border-right: none; */
}

.dashboard__micro-segment--solo {
  border: 1px solid #c8c8c4;
  border-radius: 5px;
  background: #f4f4f2;
}

.dashboard__micro-segment:hover {
  background: #ececea;
  color: #333;
}

.dashboard__micro-segment[aria-pressed="true"] {
  background: #e8eef4;
  color: #2a4a6e;
  font-weight: 600;
}

.dashboard__micro-segment--solo[aria-pressed="true"] {
  border-color: #9eb4cc;
}

.dashboard__micro-segment:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
  z-index: 1;
}

.dashboard__micro-hint-block {
  flex: 1;
  min-width: 0;
}

.dashboard__micro-hint {
  margin: 0;
  font-size: 0.78rem;
  color: #5c5c5c;
  line-height: 1.45;
}

.dashboard__micro-hint-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.4rem;
}

.dashboard__micro-hint-ai {
  margin-left: 0;
  white-space: nowrap;
}

.dashboard__micro-hint-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem 0.5rem;
  border: 1px solid #c8c8c4;
  border-radius: 5px;
  background: #f4f4f2;
  color: #2a4a6e;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}

.dashboard__micro-hint-action-icon {
  flex-shrink: 0;
  font-size: 0.8rem;
  line-height: 1;
}

.dashboard__micro-hint-action-btn:hover,
.dashboard__micro-hint-action-btn:focus-visible {
  background: #e8eef4;
  color: #1a1a1a;
}

.dashboard__micro-hint-action-btn:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.dashboard__micro-condition-wrap {
  position: relative;
}

.dashboard__micro-condition-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.dashboard__micro-condition-controls::-webkit-scrollbar {
  display: none;
}

/* Keep open dropdown menus from being clipped by the horizontal scroller */
.dashboard__micro-condition-controls:has([aria-expanded="true"]) {
  overflow: visible;
}

/* Room for Status 1–4 shortcut cluster overhang (same idea as .app-nav__inner) */
body.app-nav-shortcuts-visible .dashboard__micro-condition-controls {
  overflow: visible;
  padding-top: 0.5rem;
  padding-right: 0.55rem;
  margin-top: -0.5rem;
  margin-right: -0.55rem;
}

body.app-nav-shortcuts-visible .dashboard__micro-status-dropdown {
  overflow: visible;
}

.dashboard__micro-condition-dropdown {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.15rem;
}

.dashboard__micro-condition-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

.dashboard__micro-status-toggle {
  gap: 0.35rem;
}

.dashboard__micro-status-toggle-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: #d4ebd9;
  color: #1a7a36;
  flex-shrink: 0;
}

.dashboard__micro-status-toggle .dashboard__micro-status-toggle-icon {
  display: block;
  opacity: 1;
}

.dashboard__micro-status-toggle--zero .dashboard__micro-status-toggle-badge {
  background: #e8e8e4;
  color: #444;
}

.dashboard__micro-status-toggle--red-zero .dashboard__micro-status-toggle-badge,
.dashboard__micro-status-toggle--excess .dashboard__micro-status-toggle-badge {
  background: #f8d8d6;
  color: #b42318;
}

.dashboard__micro-status-toggle--green .dashboard__micro-status-toggle-badge {
  background: #d4ebd9;
  color: #1a7a36;
}

.dashboard__micro-status-toggle--zero.dashboard__micro-condition-toggle--active {
  background: #ececea;
  border-color: #b0b0ac;
  color: #2a2a28;
}

.dashboard__micro-status-toggle--red-zero.dashboard__micro-condition-toggle--active,
.dashboard__micro-status-toggle--excess.dashboard__micro-condition-toggle--active {
  background: #fce8e8;
  border-color: #e0a8a4;
  color: #8a180f;
}

.dashboard__micro-status-toggle--green.dashboard__micro-condition-toggle--active {
  background: #e5f3ea;
  border-color: #9cc9ab;
  color: #14662c;
}

.dashboard__micro-status-filter {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: 1.7rem;
  padding: 0.22rem;
  border: 1px solid #c8c8c4;
  border-radius: 5px;
  background: #f4f4f2;
  color: #444;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition:
    gap 0.18s ease,
    padding 0.18s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.dashboard__micro-status-filter-icon {
  flex-shrink: 0;
  display: block;
}

.dashboard__micro-status-filter-label {
  max-width: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  transition:
    max-width 0.2s ease,
    opacity 0.15s ease,
    margin 0.18s ease;
}

.dashboard__micro-status-filter:hover,
.dashboard__micro-status-filter:focus-visible,
.dashboard__micro-status-filter[aria-pressed="true"] {
  gap: 0.3rem;
  padding-left: 0.38rem;
  padding-right: 0.5rem;
}

.dashboard__micro-status-filter:hover .dashboard__micro-status-filter-label,
.dashboard__micro-status-filter:focus-visible .dashboard__micro-status-filter-label,
.dashboard__micro-status-filter[aria-pressed="true"] .dashboard__micro-status-filter-label {
  max-width: 7.5rem;
  opacity: 1;
}

.dashboard__micro-status-filter:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.dashboard__micro-status-filter--zero {
  color: #555;
}

.dashboard__micro-status-filter--zero:hover,
.dashboard__micro-status-filter--zero:focus-visible {
  background: #ececea;
  border-color: #b8b8b4;
  color: #222;
}

.dashboard__micro-status-filter--zero[aria-pressed="true"] {
  background: #e8e8e4;
  border-color: #8a8a86;
  color: #1a1a1a;
}

.dashboard__micro-status-filter--red-zero {
  color: #b42318;
}

.dashboard__micro-status-filter--red-zero:hover,
.dashboard__micro-status-filter--red-zero:focus-visible {
  background: #fce8e8;
  border-color: #e8b4b4;
  color: #9a1c12;
}

.dashboard__micro-status-filter--red-zero[aria-pressed="true"] {
  background: #f8d8d6;
  border-color: #d48a84;
  color: #8a180f;
}

.dashboard__micro-status-filter--green {
  color: #1a7a36;
}

.dashboard__micro-status-filter--green:hover,
.dashboard__micro-status-filter--green:focus-visible {
  background: #e5f3ea;
  border-color: #9cc9ab;
  color: #14662c;
}

.dashboard__micro-status-filter--green[aria-pressed="true"] {
  background: #d4ebd9;
  border-color: #6fad82;
  color: #115826;
}

.dashboard__micro-status-filter--excess {
  color: #b42318;
}

.dashboard__micro-status-filter--excess:hover,
.dashboard__micro-status-filter--excess:focus-visible {
  background: #fce8e8;
  border-color: #e8b4b4;
  color: #9a1c12;
}

.dashboard__micro-status-filter--excess[aria-pressed="true"] {
  background: #f8d8d6;
  border-color: #d48a84;
  color: #8a180f;
}

.dashboard__micro-condition-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border: 1px solid #c8c8c4;
  border-radius: 5px;
  background: #f4f4f2;
  color: #666;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.dashboard__micro-condition-clear[hidden] {
  display: none;
}

.dashboard__micro-condition-clear:hover,
.dashboard__micro-condition-clear:focus-visible {
  background: #fce8e8;
  color: #b42318;
  border-color: #e8b4b4;
}

.dashboard__micro-condition-clear:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.dashboard__micro-condition-toggle::after {
  content: "▾";
  font-size: 0.75rem;
  transition: transform 0.15s ease;
}

.dashboard__micro-condition-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.dashboard__micro-condition-toggle--active {
  background: #e8eef4;
  border-color: #9eb4cc;
}

.dashboard__micro-condition-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 2px);
  left: 0;
  min-width: 16rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border: 1px solid #e4e4e0;
  border-radius: 5px;
  background: #fafaf8;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.dashboard__micro-condition-list--fixed {
  position: fixed;
  z-index: 60;
  right: auto;
  /* Inline top from JS; do not inherit absolute % top while fixed. */
  top: auto;
}

.dashboard__micro-condition-list[hidden] {
  display: none;
}

.dashboard__micro-condition-item {
  margin: 0;
}

.dashboard__micro-condition-group-label {
  display: block;
  padding: 0.45rem 0.5rem 0.2rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #888;
}

.dashboard__micro-condition-group:not(:first-child) .dashboard__micro-condition-group-label {
  padding-top: 0.65rem;
  margin-top: 0.15rem;
  border-top: 1px solid #ececea;
}

.dashboard__micro-condition-link {
  display: block;
  width: 100%;
  padding: 0.4rem 0.45rem;
  border: 0;
  border-radius: 4px;
  background: none;
  color: #444;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.dashboard__micro-condition-link:hover {
  background: #eef3f8;
  color: #1a1a1a;
}

.dashboard__micro-condition-link:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: -2px;
}

.dashboard__micro-condition-link--active,
.dashboard__micro-condition-link[aria-selected="true"] {
  background: #e8eef4;
  color: #2a4a6e;
  font-weight: 600;
}

.dashboard__micro-condition-item--clear {
  border-bottom: 1px solid #e8e8e4;
  margin-bottom: 0.2rem;
  padding-bottom: 0.2rem;
}

.dashboard__micro-condition-link--clear {
  color: #666;
  font-weight: 600;
}

.dashboard__micro-condition-link--clear:hover {
  color: #b42318;
}

.dashboard__micro-condition-list.dashboard__micro-status-list {
  right: 0;
  left: auto;
  min-width: 15.5rem;
  padding: 0.4rem;
  border-color: #ddd9d2;
  border-radius: 8px;
  background: #fff;
  box-shadow:
    0 8px 24px rgba(40, 36, 28, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.dashboard__micro-status-list .dashboard__micro-condition-item + .dashboard__micro-condition-item {
  margin-top: 0.15rem;
}

.dashboard__micro-status-list .dashboard__micro-condition-item--clear {
  margin-bottom: 0.3rem;
  padding-bottom: 0.3rem;
  border-bottom-color: #ece8e0;
}

.dashboard__micro-condition-link.dashboard__micro-status-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #fafaf8;
  font-weight: 500;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.dashboard__micro-condition-link.dashboard__micro-status-link:hover {
  background: #f3f1ec;
  border-color: #e4e0d8;
  color: #1a1a1a;
}

.dashboard__micro-condition-link.dashboard__micro-status-link.dashboard__micro-condition-link--active,
.dashboard__micro-condition-link.dashboard__micro-status-link[aria-selected="true"] {
  background: #f0ebe4;
  border-color: #d4c4a8;
  color: #4a3f2e;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(201, 184, 150, 0.25);
}

.dashboard__micro-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.dashboard__micro-status-badge--zero {
  background: #ececea;
  color: #555;
}

.dashboard__micro-status-badge--red-zero,
.dashboard__micro-status-badge--excess {
  background: #fce8e8;
  color: #b42318;
}

.dashboard__micro-status-badge--green {
  background: #e5f3ea;
  color: #1a7a36;
}

.dashboard__micro-status-link .dashboard__micro-status-filter-icon {
  display: block;
  flex-shrink: 0;
}

.dashboard__micro-status-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  min-width: 0;
}

.dashboard__micro-status-name {
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.25;
  color: #2e2e2a;
}

.dashboard__micro-status-desc {
  font-size: 0.66rem;
  font-weight: 500;
  line-height: 1.25;
  color: #8a8a84;
}

.dashboard__micro-status-link:hover .dashboard__micro-status-name,
.dashboard__micro-status-link.dashboard__micro-condition-link--active .dashboard__micro-status-name,
.dashboard__micro-status-link[aria-selected="true"] .dashboard__micro-status-name {
  color: inherit;
}

.dashboard__micro-status-link.dashboard__micro-condition-link--active .dashboard__micro-status-desc,
.dashboard__micro-status-link[aria-selected="true"] .dashboard__micro-status-desc {
  color: #7a6f5c;
}

.dashboard__micro-tip {
  margin: 0 0 0.65rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #444;
  background: #f6f8fa;
  border-left: 3px solid #9eb4cc;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

.dashboard__micro-tip:hover {
  background: #eef2f6;
}

.dashboard__micro-tip[data-tip-collapsed="1"] {
  display: none;
}

.dashboard__micro-tip-text {
  margin: 0;
}

.dashboard__micro-tip-expand {
  display: inline;
  padding: 0;
  margin-left: 0.15rem;
  font: inherit;
  font-weight: 600;
  color: #2a5f9e;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: none;
  cursor: pointer;
}

.dashboard__micro-tip-expand:hover {
  color: #1a4078;
}

.dashboard__tips-reopen {
  display: inline-block;
  margin: 0 0 0.65rem;
  padding: 0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
  color: #2a5f9e;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: none;
  cursor: pointer;
}

.dashboard__tips-reopen:hover {
  color: #1a4078;
}

.dashboard__tips-reopen[hidden] {
  display: none;
}

.micro-tip-modal__body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #333;
}

.micro-tip-modal__body p {
  margin: 0 0 0.85rem;
}

.micro-tip-modal__body p:last-child {
  margin-bottom: 0;
}

.micro-tip-modal__heading {
  margin: 1rem 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #333;
}

.micro-tip-modal__heading:first-child {
  margin-top: 0;
}

.micro-tip-modal__list {
  margin: 0 0 0.85rem;
  padding-left: 1.15rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #333;
}

.micro-tip-modal__list li {
  margin-bottom: 0.45rem;
}

.micro-tip-modal__list li:last-child {
  margin-bottom: 0;
}

.micro-tip-modal__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 0.75rem 0 1rem;
}

.micro-tip-modal__table th,
.micro-tip-modal__table td {
  border: 1px solid #e0e0dc;
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

.micro-tip-modal__table th {
  background: #f5f7fa;
  font-weight: 600;
}

#food-note-modal .modal__panel--wide {
  max-width: min(48rem, calc(100vw - 1.5rem));
}

#food-note-modal-body {
  display: block;
  overflow: auto;
}

#food-note-modal-body .micro-tip-modal__table {
  min-width: 32rem;
}

.macro-split-modal__body > p {
  margin-bottom: 0.85rem;
}

.macro-split-modal__disclaimer {
  margin-top: 0.85rem !important;
  margin-bottom: 0 !important;
  font-size: 0.82rem;
  color: #555;
}

.macro-split-carousel {
  margin-top: 0.35rem;
}

.macro-split-carousel__nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 0.55rem;
}

.macro-split-carousel__adj {
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid #c5d3e0;
  border-radius: 6px;
  background: #f4f7fb;
  color: #2a4a6e;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.macro-split-carousel__adj:hover {
  background: #e8eef6;
  border-color: #9eb4cc;
}

.macro-split-carousel__adj:focus-visible {
  outline: 2px solid #5a8ab8;
  outline-offset: 2px;
}

.macro-split-carousel__current {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  padding: 0.35rem 0.55rem;
  border: 1px solid #9eb4cc;
  border-radius: 6px;
  background: #fff;
  text-align: center;
}

.macro-split-carousel__current-label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a7a7a;
}

.macro-split-carousel__current-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #2a4a6e;
}

.macro-split-carousel__card {
  max-height: min(52vh, 26rem);
  overflow: auto;
  padding: 0.85rem 0.95rem;
  border: 1px solid #c5d3e0;
  border-radius: 8px;
  background: #fff;
}

.macro-split-card__head {
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #e4eaf0;
}

.macro-split-card__title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a1a;
}

.macro-split-card__mix {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  background: #eef3f8;
  border: 1px solid #c5d3e0;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5a7088;
  vertical-align: middle;
}

.macro-split-card__blurb {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #444;
}

.macro-split-card__goals {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.macro-split-card__goal {
  margin: 0;
}

.macro-split-card__goal-title {
  margin: 0 0 0.3rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #2a4a6e;
}

.macro-split-card__recomp-explain {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #555;
}

.macro-split-card__goal p {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #444;
}

.macro-split-card__macros {
  margin-bottom: 0 !important;
  font-size: 0.82rem;
}

.dashboard__micro-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.5rem 1.1rem;
}

.dashboard__micro-list[hidden] {
  display: none;
}

.dashboard__micro-more-wrap {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #d8d8d4;
  text-align: center;
}

.dashboard__micro-more-wrap[hidden] {
  display: none;
}

.dashboard__micro-more-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 1rem;
  border: 1px solid #c8c8c4;
  border-radius: 6px;
  background: #f5f5f2;
  color: #4a4a48;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.dashboard__micro-more-toggle:hover {
  background: #eeeee8;
  border-color: #a8a8a4;
}

.dashboard__micro-more-toggle[aria-expanded="true"] {
  background: #e8e8e4;
  border-color: #999;
}

.dashboard__micro-row {
  display: grid;
  grid-template-rows: auto auto;
  gap: 0.25rem 0;
  padding: 0.5rem 0.6rem;
  border-radius: 5px;
  font-size: 0.8rem;
  line-height: 1.4;
  background: #fafaf8;
  border: 1px solid #e8e8e4;
}

.dashboard__micro-name-wrap {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 0.1rem;
  min-width: 0;
}

.dashboard__micro-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #333;
}

button.dashboard__micro-name {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: #333;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.dashboard__micro-name:hover {
  color: #333;
}

.dashboard__nutrient-form {
  color: #8a8a8a;
  font-weight: 400;
}

.dashboard__micro-name--form,
button.dashboard__micro-name--form {
  color: #6a6a6a;
  font-weight: 500;
}

.dashboard__micro-name--form .dashboard__nutrient-form,
button.dashboard__micro-name--form .dashboard__nutrient-form {
  color: #8a8a8a;
  font-weight: 400;
}

button.dashboard__micro-name:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
  border-radius: 2px;
}

.dashboard__micro-row--clickable:hover {
  background: #f3f3f0;
}

@keyframes food-popover-jump-flash {
  0%,
  100% {
    background: transparent;
  }
  12%,
  55% {
    background: #fff3c4;
  }
}

.dashboard__micro-row--jump-target,
.dashboard__longevity-row--jump-target {
  animation: food-popover-jump-flash 1.6s ease;
}

.dashboard__micro-sources-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid #d8d8d4;
  border-radius: 4px;
  background: #fff;
  color: #5c6b7a;
  cursor: pointer;
}

.dashboard__micro-sources-btn:hover {
  background: #f0f4f8;
  border-color: #b8c6d4;
  color: #2a4a6e;
}

.dashboard__micro-sources-btn:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.dashboard__micro-sources-icon {
  display: block;
  fill: currentColor;
}

.dashboard__micro-daily-intake-btn {
  flex-shrink: 0;
  display: none;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid #d8d8d4;
  border-radius: 4px;
  background: #fff;
  color: #7a6a4a;
  cursor: pointer;
}

body.show-daily-intake-icons .dashboard__micro-daily-intake-btn {
  display: inline-flex;
}

body.highlight-daily-intake-icons .dashboard__micro-daily-intake-btn {
  display: inline-flex;
  color: #b42318;
  border-color: #e8a8a8;
  background: #fdf4f4;
}

body.highlight-daily-intake-icons .dashboard__micro-daily-intake-btn:hover,
body.highlight-daily-intake-icons .dashboard__micro-daily-intake-btn[aria-expanded="true"] {
  background: #fce8e8;
  border-color: #d98a8a;
  color: #8f1a12;
}

.dashboard__micro-daily-intake-btn:hover,
.dashboard__micro-daily-intake-btn[aria-expanded="true"] {
  background: #faf6ef;
  border-color: #c9b896;
  color: #5c4a2a;
}

.dashboard__micro-daily-intake-btn:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.dashboard__micro-daily-intake-icon {
  display: block;
}

.dashboard__micro-daily-intake-popover {
  position: fixed;
  z-index: 120;
  min-width: 12rem;
  max-width: min(18rem, calc(100vw - 2rem));
  padding: 0.6rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #444;
  background: #fff;
  border: 1px solid #d8dce2;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  pointer-events: none;
}

.dashboard__micro-daily-intake-popover[hidden] {
  display: none;
}

.dashboard__micro-daily-intake-popover-text {
  margin: 0;
}

.app-sheet .dashboard__micro-sticky,
.app-sheet .dashboard__longevity-nav {
  position: relative;
  top: auto;
  flex: 0 0 auto;
  z-index: 2;
  margin: 0;
  border-radius: 0;
  background: #f6f6f3;
  backdrop-filter: none;
}

.dashboard__micro-sticky {
  position: sticky;
  top: 2.8rem;
  z-index: 25;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "title options close"
    "actions actions actions"
    "filters filters filters";
  align-items: center;
  column-gap: 0.5rem;
  row-gap: 0.45rem;
  margin: -0.75rem -0.85rem 0.75rem;
  padding: 0.7rem 0.85rem 0.6rem;
  border: none;
  border-bottom: 1px solid #d4d4d0;
  border-radius: 6px 6px 0 0;
  background: rgba(248, 248, 245, 0.97);
  box-shadow: none;
  backdrop-filter: blur(6px);
}

.dashboard__micro-sticky > .dashboard__panel-close {
  grid-area: close;
  align-self: start;
}

.dashboard__panel-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #6a6a66;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.dashboard__panel-close:hover,
.dashboard__panel-close:focus-visible {
  background: #ececea;
  color: #333;
}

.dashboard__panel-close:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.dashboard__micro-sticky-top {
  grid-area: title;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.dashboard__micro-sticky-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #2a2a28;
}

.dashboard__micro-sticky .dashboard__micro-intro-actions {
  grid-area: actions;
  width: 100%;
  justify-content: space-between;
  padding-top: 0.45rem;
  border-top: 1px solid #e8e8e4;
}

.dashboard__micro-sticky-filters,
.dashboard__longevity-sticky-filters {
  --sticky-filter-control-h: 1.7rem;
  grid-area: filters;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.1rem;
  width: 100%;
  padding-top: 0.45rem;
  border-top: 1px solid #e8e8e4;
}

.dashboard__longevity-sticky-filters {
  border-top-color: #e4e8ee;
}

.dashboard__sticky-filters-carousel-nav {
  display: none;
}

.dashboard__sticky-filters-track {
  display: contents;
}

.dashboard__sticky-filter-group {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 0 1 auto;
}

.dashboard__sticky-filter-group:has(.dashboard__nutrient-filter-chips:not(:empty)) {
  align-items: flex-start;
}

.dashboard__sticky-filter-group:has(.dashboard__nutrient-filter-chips:not(:empty))
  .dashboard__sticky-filter-group-label {
  margin-top: calc((var(--sticky-filter-control-h) - 0.68rem) / 2);
}

.dashboard__sticky-filter-group--grow {
  flex: 0 1 auto;
  min-width: 0;
}

.dashboard__sticky-filter-group-label {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #7a7a7a;
  line-height: 1;
  white-space: nowrap;
}

.dashboard__sticky-filter-group-label[data-app-shortcut] {
  position: relative;
}

.dashboard__sticky-filter-group-label > .app-nav__shortcut--cluster {
  top: calc(-0.45rem - 5px);
  right: -0.55rem;
  width: auto;
  height: auto;
  gap: 0.1rem;
  padding: 0;
  color: inherit;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.dashboard__sticky-filter-group-label > .app-nav__shortcut--cluster > span {
  display: inline-flex;
  box-sizing: border-box;
  width: 1.05rem;
  height: 1.05rem;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  text-transform: none;
  letter-spacing: 0;
  color: #fff;
  background: #3d6b9e;
  border: 1px solid #2a4a6e;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.dashboard__filter-panel-section--active .dashboard__sticky-filter-group-label {
  color: #4a3f2e;
}

.dashboard__micro-sticky-filters .dashboard__filter-panel-section--nutrients,
.dashboard__longevity-sticky-filters .dashboard__filter-panel-section--nutrients {
  flex: 1 1 14rem;
  min-width: 12rem;
  max-width: 100%;
  padding-top: 0;
  border-top: none;
}

.dashboard__micro-sticky-filter-icons {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
}

.dashboard__micro-sticky-filters .dashboard__filter-panel-pills .dashboard__sticky-options-check,
.dashboard__longevity-sticky-filters .dashboard__filter-panel-pills .dashboard__sticky-options-check {
  box-sizing: border-box;
  min-height: var(--sticky-filter-control-h);
  padding: 0 0.65rem;
  font-size: 0.72rem;
  line-height: 1.2;
}

.dashboard__micro-sticky-filters .dashboard__nutrient-filter-panel--inline,
.dashboard__longevity-sticky-filters .dashboard__nutrient-filter-panel--inline {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: none;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.dashboard__micro-sticky-filters .dashboard__nutrient-filter-panel--inline .dashboard__nutrient-filter-combobox,
.dashboard__longevity-sticky-filters .dashboard__nutrient-filter-panel--inline .dashboard__nutrient-filter-combobox {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
}

.dashboard__micro-sticky-filters .dashboard__nutrient-filter-panel--inline .dashboard__nutrient-filter-chips-wrap,
.dashboard__longevity-sticky-filters .dashboard__nutrient-filter-panel--inline .dashboard__nutrient-filter-chips-wrap {
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
}

.dashboard__micro-sticky-filters .dashboard__nutrient-filter-panel--inline .dashboard__nutrient-filter-chips,
.dashboard__longevity-sticky-filters .dashboard__nutrient-filter-panel--inline .dashboard__nutrient-filter-chips {
  width: 100%;
  margin: 0;
}

.dashboard__micro-sticky-filters .dashboard__nutrient-filter-panel--inline .dashboard__nutrient-filter-input,
.dashboard__longevity-sticky-filters .dashboard__nutrient-filter-panel--inline .dashboard__nutrient-filter-input {
  box-sizing: border-box;
  height: var(--sticky-filter-control-h);
  min-height: var(--sticky-filter-control-h);
  padding-top: 0;
  padding-bottom: 0;
  font-size: 0.72rem;
  line-height: 1.2;
}

.dashboard__micro-sticky-filters .dashboard__micro-condition-wrap {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  margin-left: 0;
}

.dashboard__micro-sticky-filters .dashboard__micro-condition-controls {
  flex-wrap: nowrap;
}

.dashboard__micro-sticky-filters .dashboard__micro-condition-toggle {
  box-sizing: border-box;
  min-height: var(--sticky-filter-control-h);
  padding-top: 0;
  padding-bottom: 0;
}

.dashboard__micro-sticky-filters .dashboard__micro-status-filters {
  margin-left: 0;
}

.dashboard__micro-sticky-filters .dashboard__sticky-filter-clear,
.dashboard__longevity-sticky-filters .dashboard__sticky-filter-clear {
  align-self: center;
}

.dashboard__micro-sticky .dashboard__sticky-options {
  grid-area: options;
  width: auto;
  max-width: 100%;
  padding-top: 0;
  border-top: none;
  align-items: flex-end;
}

.dashboard__micro-sticky .dashboard__sticky-options-disclosures {
  justify-content: flex-end;
}

.dashboard__micro-sticky .dashboard__sticky-options-panel {
  align-items: flex-end;
}

.dashboard__micro-sticky .dashboard__sticky-options-note {
  text-align: right;
}

.dashboard__micro-sticky .dashboard__sticky-options-checks {
  align-items: flex-end;
}

.dashboard__micro-sticky .dashboard__sticky-options-toggles {
  justify-content: flex-end;
}

.dashboard__sticky-options {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.dashboard__longevity-nav .dashboard__sticky-options {
  grid-area: options;
  width: auto;
  max-width: 100%;
  padding-top: 0;
  border-top: none;
  align-items: flex-end;
}

.dashboard__sticky-options-disclosures {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 0.15rem 0.35rem;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.dashboard__sticky-options-disclosures::-webkit-scrollbar {
  display: none;
}

.dashboard__sticky-options-disclosures > * {
  flex: 0 0 auto;
}

.dashboard__longevity-nav .dashboard__sticky-options-disclosures {
  justify-content: flex-end;
}

.dashboard__longevity-nav .dashboard__sticky-options-panel {
  align-items: flex-end;
}

.dashboard__longevity-nav .dashboard__sticky-options-note {
  text-align: right;
}

.dashboard__longevity-nav .dashboard__sticky-options-checks {
  align-items: flex-end;
}

.dashboard__longevity-nav .dashboard__sticky-options-toggles {
  justify-content: flex-end;
}

.dashboard__longevity-nav .dashboard__nutrient-filter-chips {
  justify-content: flex-start;
}

.dashboard__sticky-filter-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
}

.dashboard__sticky-filter-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: none;
  color: #8a8a86;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.dashboard__sticky-filter-clear[hidden] {
  display: none;
}

.dashboard__sticky-filter-clear:hover,
.dashboard__sticky-filter-clear:focus-visible {
  background: #fce8e8;
  color: #b42318;
}

.dashboard__sticky-filter-clear:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.dashboard__sticky-options-disclosure {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.4rem;
  border: 0;
  border-radius: 4px;
  background: none;
  color: #7a7a76;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
}

.dashboard__sticky-options-disclosure-icon {
  flex-shrink: 0;
  display: block;
  opacity: 0.88;
}

.dashboard__sticky-options-disclosure::after {
  content: "▾";
  font-size: 0.7rem;
  transition: transform 0.15s ease;
}

.dashboard__sticky-options-disclosure[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.dashboard__sticky-options-disclosure:hover,
.dashboard__sticky-options-disclosure:focus-visible {
  background: #f3f3f0;
  color: #555;
}

.dashboard__sticky-options-disclosure:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.dashboard__sticky-options-disclosure--active {
  background: #f0ebe4;
  color: #4a3f2e;
  font-weight: 600;
}

.dashboard__sticky-options-disclosure--active:hover,
.dashboard__sticky-options-disclosure--active:focus-visible {
  background: #e8e0d6;
  color: #3d3428;
}

.dashboard__sticky-options-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  max-width: min(22rem, 100%);
}

.dashboard__sticky-options-panel[hidden] {
  display: none;
}

.dashboard__sticky-options-note {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.4;
  color: #6a6a66;
  text-align: right;
}

.dashboard__sticky-options-toggles {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.dashboard__sticky-options-checks {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}

.dashboard__sticky-options-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.3;
  color: #5a5a56;
  cursor: pointer;
  user-select: none;
}

.dashboard__sticky-options-check input {
  width: 0.9rem;
  height: 0.9rem;
  margin: 0;
  accent-color: #7a6a4a;
  cursor: pointer;
}

.dashboard__sticky-options-check:hover {
  color: #333;
}

.dashboard__sticky-options-panel--filter {
  align-self: stretch;
  width: 100%;
  max-width: min(28rem, 100%);
  align-items: stretch;
}

.dashboard__filter-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd8cf;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #faf8f4 100%);
  box-shadow:
    0 1px 2px rgba(40, 40, 36, 0.05),
    0 8px 20px rgba(40, 40, 36, 0.06);
}

.dashboard__filter-panel-section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dashboard__filter-panel-section--nutrients {
  padding-top: 0.65rem;
  border-top: 1px solid #ece8e0;
}

.dashboard__filter-panel-section--active .dashboard__filter-panel-label {
  color: #4a3f2e;
}

.dashboard__filter-panel-label {
  margin: 0;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a7a76;
}

.dashboard__filter-panel-pills {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.35rem;
}

.dashboard__filter-panel-pills .dashboard__sticky-options-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0.34rem 0.72rem;
  border: 1px solid #d8d8d4;
  border-radius: 999px;
  background: #fff;
  color: #5a5a56;
  font-size: 0.72rem;
  line-height: 1.25;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.dashboard__filter-panel-pills .dashboard__sticky-options-check input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.dashboard__filter-panel-pills .dashboard__sticky-options-check:hover {
  border-color: #c8c8c4;
  background: #f8f8f6;
  color: #333;
}

.dashboard__filter-panel-pills .dashboard__sticky-options-check:has(input:checked) {
  border-color: #c9b896;
  background: #f0ebe4;
  color: #4a3f2e;
  box-shadow: inset 0 0 0 1px rgba(201, 184, 150, 0.35);
}

.dashboard__filter-panel-pills .dashboard__sticky-options-check:has(input:focus-visible) {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
}

.dashboard__filter-panel-pills .dashboard__sticky-options-check:has(input:checked) span {
  font-weight: 600;
}

.dashboard__nutrient-filter-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  width: 100%;
  padding: 0.65rem;
  border: 1px solid #e8e4dc;
  border-radius: 6px;
  background: #fff;
}

.dashboard__nutrient-filter-panel[hidden] {
  display: none;
}

.dashboard__nutrient-filter-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
  padding-top: 0.15rem;
}

.dashboard__nutrient-filter-prefix {
  grid-column: 1 / -1;
  flex: 0 0 auto;
  font-size: 0.64rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8a8a86;
  white-space: nowrap;
}

.dashboard__nutrient-filter-preset {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  width: 100%;
  min-width: 0;
  padding: 0.42rem 0.55rem;
  border: 1px solid #d8d8d4;
  border-radius: 6px;
  background: #fafafa;
  color: #5a5a56;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: visible;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.dashboard__nutrient-filter-preset:hover {
  background: #f5f5f2;
  border-color: #c8c8c4;
  color: #333;
  transform: translateY(-1px);
}

.dashboard__nutrient-filter-preset:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.dashboard__nutrient-filter-preset--active,
.dashboard__nutrient-filter-preset[aria-pressed="true"] {
  background: #f0ebe4;
  border-color: #c9b896;
  color: #4a3f2e;
}

.dashboard__nutrient-filter-preset-title {
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.dashboard__nutrient-filter-preset--active .dashboard__nutrient-filter-preset-title,
.dashboard__nutrient-filter-preset[aria-pressed="true"] .dashboard__nutrient-filter-preset-title {
  font-weight: 600;
}

.dashboard__nutrient-filter-preset-meta {
  font-size: 0.62rem;
  font-weight: 400;
  line-height: 1.25;
  color: #8a8a86;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.dashboard__nutrient-filter-preset--active .dashboard__nutrient-filter-preset-meta,
.dashboard__nutrient-filter-preset[aria-pressed="true"] .dashboard__nutrient-filter-preset-meta {
  color: #7a6a4a;
}

.dashboard__nutrient-filter-combobox {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.dashboard__nutrient-filter-combobox--search {
  display: flex;
  align-items: center;
}

.dashboard__nutrient-filter-search-icon {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9a9a96;
  pointer-events: none;
}

.dashboard__nutrient-filter-combobox--search .dashboard__nutrient-filter-input {
  padding-left: 1.85rem;
}

.dashboard__nutrient-filter-combobox--search:focus-within .dashboard__nutrient-filter-search-icon {
  color: #3d6b9e;
}

.dashboard__nutrient-filter-input {
  box-sizing: border-box;
  width: 100%;
  padding: 0.48rem 0.65rem;
  border: 1px solid #d8d8d4;
  border-radius: 6px;
  background: #fff;
  color: #333;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.3;
}

.dashboard__nutrient-filter-input::placeholder {
  color: #9a9a96;
}

.dashboard__nutrient-filter-input:hover {
  border-color: #c8c8c4;
}

.dashboard__nutrient-filter-input:focus {
  outline: none;
  border-color: #3d6b9e;
  box-shadow: 0 0 0 2px rgba(61, 107, 158, 0.2);
}

.dashboard__nutrient-filter-suggest {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.15rem);
  left: 0;
  right: 0;
  max-height: 10.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.2rem;
  border: 1px solid #d8d8d4;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(40, 40, 36, 0.12);
  scrollbar-width: thin;
}

.dashboard__nutrient-filter-suggest[hidden] {
  display: none;
}

.dashboard__nutrient-filter-suggest-item {
  display: block;
  width: 100%;
  padding: 0.3rem 0.45rem;
  border: 0;
  border-radius: 3px;
  background: none;
  color: #333;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.dashboard__nutrient-filter-suggest-item:hover,
.dashboard__nutrient-filter-suggest-item--active {
  background: #f0ebe4;
  color: #4a3f2e;
}

.dashboard__nutrient-filter-suggest-item:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: -1px;
}

.dashboard__nutrient-filter-suggest-match {
  font-weight: 700;
  color: #3d3428;
}

.dashboard__nutrient-filter-chips-wrap {
  position: relative;
  display: none;
}

.dashboard__nutrient-filter-chips-wrap:has([data-nutrient-filter-chips]:not(:empty)),
.dashboard__nutrient-filter-chips-wrap:has([data-sticky-filter-clear]:not([hidden])) {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.dashboard__nutrient-filter-chips-wrap > .dashboard__sticky-filter-clear {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  z-index: 1;
  margin: 0;
}

.dashboard__nutrient-filter-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.3rem;
  box-sizing: border-box;
  width: 100%;
  min-height: 1.7rem;
  padding: 0.35rem 1.45rem 0.35rem 0.4rem;
  border: 1px solid #d5d0c8;
  border-radius: 6px;
  background: #faf9f7;
}

.dashboard__nutrient-filter-chips:empty {
  display: block;
}

.dashboard__nutrient-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  max-width: 100%;
  padding: 0.22rem 0.25rem 0.22rem 0.55rem;
  border: 1px solid #c9b896;
  border-radius: 999px;
  background: #f0ebe4;
  color: #4a3f2e;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
}

.dashboard__nutrient-filter-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.dashboard__nutrient-filter-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #7a6a4a;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.dashboard__nutrient-filter-chip-remove:hover,
.dashboard__nutrient-filter-chip-remove:focus-visible {
  background: #e8e0d6;
  color: #b42318;
}

.dashboard__nutrient-filter-chip-remove:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.dashboard__micro-sticky .dashboard__sticky-options-panel--filter,
.dashboard__longevity-nav .dashboard__sticky-options-panel--filter {
  align-items: stretch;
}

.dashboard__micro-sticky .dashboard__filter-panel-pills,
.dashboard__longevity-nav .dashboard__filter-panel-pills {
  justify-content: flex-start;
}

.dashboard__micro-sticky .dashboard__nutrient-filter-chips,
.dashboard__longevity-nav .dashboard__nutrient-filter-chips {
  justify-content: flex-start;
}

.dashboard__sticky-options-toggle {
  padding: 0.28rem 0.55rem;
  border: 1px solid #d8d8d4;
  border-radius: 4px;
  background: #fff;
  color: #5a5a56;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.2;
  cursor: pointer;
}

.dashboard__sticky-options-toggle:hover {
  background: #f5f5f2;
  border-color: #c8c8c4;
  color: #333;
}

.dashboard__sticky-options-toggle:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.dashboard__sticky-options-toggle[aria-pressed="true"] {
  background: #f0ebe4;
  border-color: #c9b896;
  color: #4a3f2e;
}

.dashboard__micro-acute-btn {
  position: relative;
  flex-shrink: 0;
  display: none;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid #e2e0dc;
  border-radius: 4px;
  background: #fafafa;
  color: #9a9590;
  cursor: pointer;
}

body.show-acute-side-effects .dashboard__micro-acute-btn--side,
body.show-acute-adverse-effects .dashboard__micro-acute-btn--adverse {
  display: inline-flex;
}

body.highlight-side-effects .dashboard__micro-acute-btn--side,
body.highlight-adverse-effects .dashboard__micro-acute-btn--adverse {
  display: inline-flex;
  color: #b42318;
  border-color: #e8a8a8;
  background: #fdf4f4;
}

body.highlight-side-effects .dashboard__micro-acute-btn--side:hover,
body.highlight-side-effects .dashboard__micro-acute-btn--side[aria-expanded="true"],
body.highlight-adverse-effects .dashboard__micro-acute-btn--adverse:hover,
body.highlight-adverse-effects .dashboard__micro-acute-btn--adverse[aria-expanded="true"] {
  background: #fce8e8;
  border-color: #d98a8a;
  color: #8f1a12;
}

body.highlight-side-effects .dashboard__micro-acute-btn--side .dashboard__micro-acute-badge,
body.highlight-adverse-effects .dashboard__micro-acute-btn--adverse .dashboard__micro-acute-badge {
  color: #b42318;
  border-color: #e8a8a8;
  background: #fdf4f4;
}

.dashboard__micro-acute-btn:hover,
.dashboard__micro-acute-btn[aria-expanded="true"] {
  background: #f5f3f0;
  border-color: #d4d0ca;
  color: #6e6860;
}

.dashboard__micro-acute-btn:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.dashboard__micro-acute-btn--adverse {
  color: #a89890;
}

.dashboard__micro-acute-btn--adverse:hover,
.dashboard__micro-acute-btn--adverse[aria-expanded="true"] {
  color: #7a655c;
}

.dashboard__micro-acute-icon {
  display: block;
}

.dashboard__micro-acute-badge {
  position: absolute;
  right: -2px;
  bottom: -3px;
  padding: 0 2px;
  font-size: 0.48rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.15;
  color: #8a8580;
  background: #f7f6f4;
  border: 1px solid #e4e1dc;
  border-radius: 2px;
  pointer-events: none;
}

.dashboard__micro-acute-btn--adverse .dashboard__micro-acute-badge {
  color: #8a7468;
  border-color: #e0d6d0;
}

.dashboard__micro-acute-popover {
  position: fixed;
  z-index: 120;
  min-width: 12rem;
  max-width: min(18rem, calc(100vw - 2rem));
  padding: 0.6rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #444;
  background: #fff;
  border: 1px solid #d8dce2;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  pointer-events: none;
}

.dashboard__micro-acute-popover[hidden] {
  display: none;
}

.dashboard__micro-acute-popover-text {
  margin: 0;
}

.dashboard__micro-acute-popover-heading {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #6a6560;
}

.dashboard__micro-acute-popover-lead {
  margin: 0.35rem 0 0;
  color: #666;
}

.dashboard__micro-acute-popover-effects {
  margin: 0.4rem 0 0;
  color: #333;
}

.dashboard__target-ref-popover {
  position: fixed;
  z-index: 120;
  min-width: 12rem;
  max-width: min(20rem, calc(100vw - 2rem));
  padding: 0.6rem 0.7rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #444;
  background: #fff;
  border: 1px solid #d8dce2;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  pointer-events: auto;
}

.dashboard__target-ref-popover[hidden] {
  display: none;
}

.dashboard__target-ref-popover-text {
  margin: 0;
}

.dashboard__target-ref-popover-copy {
  margin: 0;
}

.dashboard__target-ref-popover-copy + .dashboard__target-ref-popover-copy {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid #ecece8;
}

.dashboard__target-ref-popover-copy--detail {
  color: #5c5c5c;
}

.dashboard__target-ref-popover-copy a {
  color: #2a5f9e;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.dashboard__target-ref {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 400;
  cursor: pointer;
  text-decoration: underline dotted rgba(138, 138, 134, 0.5);
  text-underline-offset: 0.14em;
}

.dashboard__target-ref:hover,
.dashboard__target-ref:focus-visible {
  color: #6a6a66;
}

.dashboard__target-ref:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
  border-radius: 2px;
}

.dashboard__micro-day-name-wrap {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.dashboard__micro-day-name-wrap .dashboard__micro-day-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.micro-sources-modal__toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #ecece8;
}

.micro-sources-modal__label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #5c5c5c;
}

.micro-sources-modal__select {
  min-width: 8rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  border: 1px solid #d0d0cc;
  border-radius: 4px;
  background: #fff;
  color: #333;
}

.micro-sources-modal__filter {
  flex: 1 1 10rem;
  min-width: 8rem;
  max-width: 18rem;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.8rem;
  border: 1px solid #d0d0cc;
  border-radius: 4px;
  background: #fff;
  color: #333;
}

.micro-sources-modal__filter:focus-visible {
  outline: 2px solid #4a7fd4;
  outline-offset: 1px;
}

.micro-sources-modal__body {
  padding: 0.75rem 1rem 1rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(24rem, 60vh);
}

.micro-sources-modal__reqs {
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #ecece8;
}

.micro-sources-modal__req-note {
  margin: 0;
  font-size: 0.78rem;
  color: #5c5c5c;
}

.micro-sources-modal__req-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

.micro-sources-modal__req-row + .micro-sources-modal__req-row {
  margin-top: 0.25rem;
}

.micro-sources-modal__req-label {
  color: #5c5c5c;
}

.micro-sources-modal__req-val {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.micro-sources-modal__req-sex-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.micro-sources-modal__req-sex {
  padding: 0.55rem 0.6rem;
  border: 1px solid #e8e8e4;
  border-radius: 5px;
  background: #fafaf8;
}

.micro-sources-modal__req-sex--selected {
  border-color: #c8d8ea;
  background: #f5f9fc;
}

.micro-sources-modal__req-sex-title {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #333;
}

.micro-sources-modal__req-profile {
  font-weight: 500;
  color: #5c6b7a;
}

.micro-sources-modal__empty {
  margin: 0;
  font-size: 0.84rem;
  color: #5c5c5c;
}

.micro-sources-modal__list-head {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr) auto;
  gap: 0.35rem 0.75rem;
  align-items: center;
  padding: 0 0 0.35rem;
  margin-bottom: 0.15rem;
  border-bottom: 1px solid #e4e4e0;
}

.micro-sources-modal__sort-btn {
  margin: 0;
  padding: 0.1rem 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #8a8a8a;
  cursor: pointer;
  text-align: inherit;
}

.micro-sources-modal__sort-btn:hover,
.micro-sources-modal__sort-btn:focus-visible {
  color: #333;
}

.micro-sources-modal__sort-btn:focus-visible {
  outline: 2px solid #4a7fd4;
  outline-offset: 1px;
}

.micro-sources-modal__sort-btn.is-active {
  color: #2f5f9f;
}

.micro-sources-modal__sort-arrow {
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.micro-sources-modal__sort-btn--rank {
  text-align: right;
}

.micro-sources-modal__sort-btn--name {
  text-align: left;
}

.micro-sources-modal__sort-btn--amount {
  text-align: right;
  justify-self: end;
}

.micro-sources-modal__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.micro-sources-modal__item {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr) auto;
  gap: 0.35rem 0.75rem;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid #efefec;
  font-size: 0.82rem;
}

.micro-sources-modal__rank {
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  font-weight: 600;
  color: #8a8a8a;
  text-align: right;
}

.micro-sources-modal__name {
  min-width: 0;
  font-weight: 600;
  color: #333;
}

.micro-sources-modal__calc {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.3rem 0.35rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.micro-sources-modal__per {
  color: #5c5c5c;
  white-space: nowrap;
}

.micro-sources-modal__times {
  color: #7a7a7a;
  font-size: 0.78rem;
  white-space: nowrap;
}

.micro-sources-modal__eq {
  color: #9a9a9a;
  white-space: nowrap;
}

.micro-sources-modal__row-total {
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.micro-sources-modal__item:last-child {
  border-bottom: none;
}

.micro-sources-modal__total {
  margin: 0.75rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px solid #e8e8e4;
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #333;
  text-align: right;
}

.food-sources-modal__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #ecece8;
}

.food-sources-modal__body {
  padding: 0 1rem 1rem;
  max-height: min(60vh, 32rem);
  overflow: auto;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-height: 0;
}

.modal--fullscreen .food-sources-modal__body {
  max-height: none;
  flex: 1 1 auto;
}

.food-sources-modal__table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
}

.food-sources-modal__table th,
.food-sources-modal__table td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid #efefec;
  text-align: left;
  vertical-align: top;
}

.food-sources-modal__table th:first-child,
.food-sources-modal__table td:first-child {
  padding-left: 0;
}

.food-sources-modal__table th:last-child,
.food-sources-modal__table td:last-child {
  padding-right: 0;
}

.food-sources-modal__info-col {
  width: 1%;
  padding-left: 0.35rem;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.food-sources-modal__info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #b8b8b2;
  cursor: pointer;
}

.food-sources-modal__info-btn:hover,
.food-sources-modal__info-btn:focus-visible {
  color: #7a7a74;
  background: #f2f2ef;
}

.food-sources-modal__info-btn:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.food-sources-modal__info-icon {
  display: block;
}

.food-sources-modal__table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  border-bottom-color: #e4e4e0;
  box-shadow: 0 1px 0 #e4e4e0;
}

.food-sources-modal__sort-btn {
  margin: 0;
  padding: 0.1rem 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #8a8a8a;
  cursor: pointer;
  text-align: inherit;
}

.food-sources-modal__sort-btn:hover,
.food-sources-modal__sort-btn:focus-visible {
  color: #333;
}

.food-sources-modal__sort-btn:focus-visible {
  outline: 2px solid #4a7fd4;
  outline-offset: 1px;
}

.food-sources-modal__sort-btn.is-active {
  color: #2f5f9f;
}

.food-sources-modal__sort-arrow {
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.food-sources-modal__food {
  min-width: 0;
  font-weight: 600;
  color: #333;
}

.food-sources-modal__nutrient {
  color: #444;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.food-sources-modal__row--unmatched .food-sources-modal__food {
  font-weight: 500;
  color: #5c5c5c;
}

.food-sources-modal__table tbody tr:hover td,
.food-sources-modal__table tbody tr:focus-within td {
  background: #f6f6f3;
}

.food-sources-modal__row[data-food-sources-def] {
  cursor: pointer;
}

.food-sources-modal__row[data-food-sources-def]:hover .food-sources-modal__info-btn,
.food-sources-modal__row[data-food-sources-def]:focus-within .food-sources-modal__info-btn {
  color: #7a7a74;
  background: #f2f2ef;
}

.food-sources-modal__empty,
.food-sources-modal__count {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: #6a6a6a;
}

.food-sources-modal__count {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.micro-sources-modal__gl-compare {
  margin-top: 0.5rem;
  padding-top: 0.35rem;
}

.micro-sources-modal__gl-compare .micro-sources-modal__req-row + .micro-sources-modal__req-row {
  margin-top: 0.35rem;
}

.micro-sources-modal__gl-tier--active .micro-sources-modal__req-label,
.micro-sources-modal__gl-tier--active .micro-sources-modal__req-val {
  font-weight: 600;
}

.micro-sources-modal__gl-tier--favorable.micro-sources-modal__gl-tier--active .micro-sources-modal__req-val {
  color: #1a7a36;
}

.micro-sources-modal__gl-tier--moderate.micro-sources-modal__gl-tier--active .micro-sources-modal__req-val {
  color: #9a7b00;
}

.micro-sources-modal__gl-tier--high.micro-sources-modal__gl-tier--active .micro-sources-modal__req-val {
  color: #b83232;
}

.micro-sources-modal__gi-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  color: #5c5c5c;
}

.micro-sources-modal__gi-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.micro-sources-modal__gi-legend-item::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.micro-sources-modal__gi-legend-item--low::before {
  background: #4a8f5a;
}

.micro-sources-modal__gi-legend-item--med::before {
  background: #c9a227;
}

.micro-sources-modal__gi-legend-item--high::before {
  background: #b45309;
}

.micro-sources-modal__item--gi-low {
  border-left: 3px solid #4a8f5a;
  padding-left: 0.5rem;
}

.micro-sources-modal__item--gi-med {
  border-left: 3px solid #c9a227;
  padding-left: 0.5rem;
}

.micro-sources-modal__item--gi-high {
  border-left: 3px solid #b45309;
  padding-left: 0.5rem;
}

.micro-sources-modal__gi-meta {
  display: block;
  width: 100%;
  font-size: 0.72rem;
  color: #777;
  margin-top: 0.1rem;
}

.micro-sources-modal__item--gi-low .micro-sources-modal__calc,
.micro-sources-modal__item--gi-med .micro-sources-modal__calc,
.micro-sources-modal__item--gi-high .micro-sources-modal__calc {
  flex-direction: column;
  align-items: flex-end;
}

.micro-def__body {
  padding: 0.75rem 1rem 1rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #333;
}

.micro-def__targets {
  flex-shrink: 0;
  padding: 0.45rem 1rem 0.55rem;
  border-bottom: 1px solid #ecece8;
  background: #f8f8f6;
}

.micro-def__targets--limiting {
  background: #fff9f5;
}

.micro-def__targets-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
  font-size: 0.78rem;
  line-height: 1.35;
}

.micro-def__targets-label {
  font-weight: 600;
  color: #5c5c5c;
  white-space: nowrap;
}

.micro-def__targets-amount {
  font-variant-numeric: tabular-nums;
  color: #333;
  white-space: nowrap;
}

.micro-def__targets-kind {
  font-size: 0.56rem;
  line-height: 1.25;
  color: #8a8a86;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.micro-def__section {
  margin: 0 0 1rem;
}

.micro-def__section:last-child {
  margin-bottom: 0;
}

.micro-def__section--warning {
  margin: 0 0 1.15rem;
  padding: 0.9rem 0.95rem;
  border: 1px solid #e0c27a;
  border-left: 4px solid #b8860b;
  border-radius: 6px;
  background: linear-gradient(135deg, #fff8e8 0%, #fffdf5 100%);
  box-shadow: 0 1px 3px rgba(120, 90, 20, 0.08);
}

.micro-def__heading--warning {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: none;
  color: #6b4e00;
}

.micro-def__heading--warning-icon {
  flex-shrink: 0;
  color: #b8860b;
}

.micro-def__section--warning .micro-def__p {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.55;
  color: #5c4500;
}

.micro-def__section--warning .micro-def__p:last-child {
  margin-bottom: 0;
}

.micro-def__section--condition {
  margin: 0 0 1.15rem;
  padding: 0.9rem 0.95rem;
  border: 1px solid #9eb4cc;
  border-left: 4px solid #2a5f9e;
  border-radius: 6px;
  background: linear-gradient(135deg, #e8eef4 0%, #f2f6fa 100%);
  box-shadow: 0 1px 3px rgba(42, 74, 110, 0.08);
}

.micro-def__section--cooking {
  padding: 0.75rem 0.85rem;
  border: 1px solid #ead7a5;
  border-radius: 6px;
  background: #fffaf0;
}

.micro-def__section--cooking .micro-def__heading {
  color: #72520d;
}

.micro-def__heading--condition {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: none;
  color: #1a3a5c;
}

.micro-def__heading--condition-icon {
  flex-shrink: 0;
  color: #2a5f9e;
}

.micro-def__section--condition .micro-def__p {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.55;
  color: #1a3a5c;
}

.micro-def__section--condition .micro-def__p:last-child {
  margin-bottom: 0;
}

.micro-def__heading {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #2a4a6e;
}

.micro-def__p {
  margin: 0 0 0.5rem;
}

.micro-def__p:last-child {
  margin-bottom: 0;
}

.micro-def__list {
  margin: 0;
  padding-left: 1.15rem;
}

.micro-def__list li {
  margin-bottom: 0.35rem;
}

.micro-def__list li:last-child {
  margin-bottom: 0;
}

.micro-def__sources-dock {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
}

.micro-def__sources {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.micro-def__sources-summary {
  margin: 0;
  padding: 0.35rem 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #2a4a6e;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.micro-def__sources-summary::-webkit-details-marker {
  display: none;
}

.micro-def__sources-summary::before {
  content: "▸ ";
  color: #3a5a7e;
}

.micro-def__sources[open] .micro-def__sources-summary::before {
  content: "▾ ";
}

.micro-def__sources-body {
  max-height: min(22vh, 9rem);
  overflow-y: auto;
  padding: 0 0 0.15rem;
}

.micro-def__sources-heading {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #2a4a6e;
}

.micro-def__sources-group + .micro-def__sources-group {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #c5d4e2;
}

.micro-def__sources-subheading {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #3a5a7e;
  line-height: 1.35;
}

.micro-def__sources-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.micro-def__sources-list li {
  margin: 0;
}

.micro-def__source-btn {
  display: block;
  margin: 0;
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  border: 1px solid #b8c8d8;
  background: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: #1a3a5c;
  line-height: 1.35;
  cursor: pointer;
}

.micro-def__source-btn:hover,
.micro-def__source-btn:focus-visible {
  background: #e8eef4;
  border-color: #3d6b9e;
}

.micro-def__source-btn:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.micro-def__sex-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.65rem 0 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #444;
}

.micro-def__sex-label:first-of-type {
  margin-top: 0;
}

.micro-def__sex-icon {
  font-size: 1rem;
  line-height: 1;
  color: #2a4a6e;
}

.micro-def__empty {
  margin: 0;
  color: #5c5c5c;
}

.dashboard__micro-stats {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto;
  gap: 0.05rem 0.65rem;
  align-items: baseline;
}

.dashboard__micro-amt {
  grid-column: 2;
  grid-row: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #5c5c5c;
  font-size: 0.74rem;
  white-space: nowrap;
}

.dashboard__micro-target-kind {
  grid-column: 2;
  grid-row: 2;
  font-size: 0.56rem;
  line-height: 1.25;
  color: #8a8a86;
  letter-spacing: 0.01em;
  text-align: right;
  white-space: nowrap;
}

.dashboard__micro-dv-req {
  grid-column: 2;
  grid-row: 3;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #7a7a7a;
  font-size: 0.68rem;
  white-space: nowrap;
}

.dashboard__micro-pct {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dashboard__micro-pct--amount {
  color: #7a7a7a;
  font-weight: 500;
}

.dashboard__micro-daily-grid {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.75rem;
}

.dashboard__micro-daily-grid[hidden] {
  display: none;
}

.dashboard__micro-day-card {
  padding: 0.65rem 0.7rem;
  line-height: 1.4;
}

.dashboard__micro-day-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dashboard__micro-day-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.4rem 0.1rem;
  font-size: 0.74rem;
  line-height: 1.35;
  border-bottom: 1px solid #efefec;
}

.dashboard__micro-day-row:last-child {
  border-bottom: none;
  padding-bottom: 0.1rem;
}

.dashboard__micro-day-row:first-child {
  padding-top: 0.15rem;
}

.dashboard__micro-day-name {
  min-width: 0;
  font-weight: 600;
  color: #333;
}

button.dashboard__micro-day-name {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: #333;
  text-align: left;
  cursor: pointer;
}

button.dashboard__micro-day-name:hover {
  color: #2a4a6e;
}

.dashboard__micro-day-name--form,
button.dashboard__micro-day-name--form {
  color: #6a6a6a;
  font-weight: 500;
}

.dashboard__micro-day-name--form .dashboard__nutrient-form,
button.dashboard__micro-day-name--form .dashboard__nutrient-form {
  color: #8a8a8a;
  font-weight: 400;
}

button.dashboard__micro-day-name:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
  border-radius: 2px;
}

.dashboard__micro-day-row--clickable:hover {
  background: #f8f8f6;
  border-radius: 3px;
}

.dashboard__micro-day-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto;
  gap: 0.04rem 0.5rem;
  align-items: baseline;
}

.dashboard__micro-day-pct {
  grid-column: 1;
  grid-row: 1;
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.dashboard__micro-day-pct--amount {
  color: #7a7a7a;
  font-weight: 500;
}

.dashboard__micro-day-amt {
  grid-column: 2;
  grid-row: 1;
  font-variant-numeric: tabular-nums;
  color: #5c5c5c;
  font-size: 0.7rem;
  text-align: right;
  white-space: nowrap;
}

.dashboard__micro-day-target-kind {
  grid-column: 2;
  grid-row: 2;
  font-size: 0.54rem;
  line-height: 1.25;
  color: #8a8a86;
  text-align: right;
  white-space: nowrap;
}

.dashboard__micro-day-dv-req {
  grid-column: 2;
  grid-row: 3;
  font-variant-numeric: tabular-nums;
  color: #7a7a7a;
  font-size: 0.66rem;
  text-align: right;
  white-space: nowrap;
}

.dashboard__longevity-panel {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: none;
  border-radius: 12px 12px 0 0;
  background: #fff;
}

.dashboard__longevity-nav {
  position: sticky;
  top: 2.8rem;
  z-index: 25;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "title options close"
    "filters filters filters"
    "track track track"
    "all all all";
  align-items: center;
  column-gap: 0.5rem;
  row-gap: 0.45rem;
  margin: -0.75rem -0.85rem 0.75rem;
  padding: 0.7rem 0.85rem 0.6rem;
  border: none;
  border-bottom: 1px solid #d0d6de;
  border-radius: 6px 6px 0 0;
  background: rgba(246, 248, 250, 0.97);
  box-shadow: none;
  backdrop-filter: blur(6px);
}

.dashboard__longevity-nav > .dashboard__panel-close {
  grid-area: close;
  align-self: start;
}

.dashboard__longevity-nav-top {
  grid-area: title;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.dashboard__longevity-nav-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #1a2a38;
}

.dashboard__longevity-nav-track {
  grid-area: track;
  display: flex;
  gap: 0.35rem 0.5rem;
  align-items: stretch;
  width: 100%;
  padding-top: 0.4rem;
  border-top: 1px solid #e4e8ee;
}

.dashboard__longevity-nav-adj {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
  padding: 0.25rem 0.4rem;
  border: 1px solid #d8dde4;
  border-radius: 5px;
  background: #f8f9fb;
  color: #444;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.dashboard__longevity-nav-adj--next {
  text-align: right;
  align-items: flex-end;
}

.dashboard__longevity-nav-adj:hover {
  background: #eef3f8;
  border-color: #b8c8d8;
  color: #1a1a1a;
}

.dashboard__longevity-nav-adj:focus-visible {
  outline: 2px solid #5a8ab8;
  outline-offset: 2px;
}

.dashboard__longevity-nav-adj-label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #7a7a7a;
}

.dashboard__longevity-nav-adj-title {
  display: block;
  flex: 1;
  min-height: 1.25em;
  font-weight: 600;
  color: #2d4a66;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard__longevity-nav-adj-title:empty::before {
  content: "\00a0";
}

.dashboard__longevity-nav-adj[data-longevity-topic-color] {
  border-color: color-mix(in srgb, var(--longevity-topic-color) 65%, #d8dde4);
  background: color-mix(in srgb, var(--longevity-topic-color) 22%, #f8f9fb);
}

.dashboard__longevity-nav-adj[data-longevity-topic-color]:hover {
  border-color: color-mix(in srgb, var(--longevity-topic-color) 75%, #b8c8d8);
  background: color-mix(in srgb, var(--longevity-topic-color) 28%, #eef3f8);
}

.dashboard__longevity-nav-adj[data-longevity-topic-color] .dashboard__longevity-nav-adj-title {
  color: var(--longevity-topic-color);
}

.dashboard__longevity-nav-current {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
  padding: 0.25rem 0.4rem;
  border: 1px solid #7a9e6a;
  border-radius: 5px;
  background: #f4f7f2;
  text-align: center;
}

.dashboard__longevity-nav-current-label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5a7a4a;
}

.dashboard__longevity-nav-current-title {
  display: block;
  flex: 1;
  min-height: 1.25em;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  color: #2a3a22;
}

.dashboard__longevity-nav-current[data-longevity-topic-color] {
  border-color: color-mix(in srgb, var(--longevity-topic-color) 70%, #7a9e6a);
  background: color-mix(in srgb, var(--longevity-topic-color) 24%, #f4f7f2);
}

.dashboard__longevity-nav-current[data-longevity-topic-color] .dashboard__longevity-nav-current-label {
  color: color-mix(in srgb, var(--longevity-topic-color) 72%, #5a7a4a);
}

.dashboard__longevity-nav-current[data-longevity-topic-color] .dashboard__longevity-nav-current-title {
  color: var(--longevity-topic-color);
}

.dashboard__longevity-nav-all-wrap {
  grid-area: all;
  margin-top: 0;
  text-align: center;
}

.dashboard__longevity-nav-all-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.45rem;
  border: 0;
  border-radius: 4px;
  background: none;
  color: #2d4a66;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
}

.dashboard__longevity-nav-all-toggle::after {
  content: "▾";
  font-size: 0.75rem;
  transition: transform 0.15s ease;
}

.dashboard__longevity-nav-all-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.dashboard__longevity-nav-all-toggle:hover,
.dashboard__longevity-nav-all-toggle:focus-visible {
  background: #eef3f8;
  color: #1a1a1a;
}

.dashboard__longevity-nav-all-toggle:focus-visible {
  outline: 2px solid #5a8ab8;
  outline-offset: 2px;
}

.dashboard__longevity-nav-all-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.25rem;
  margin: 0.35rem 0 0;
  padding: 0.45rem;
  list-style: none;
  border: 1px solid #e4e4e0;
  border-radius: 5px;
  background: #fafaf8;
  max-height: min(50vh, 22rem);
  max-height: min(50dvh, 22rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.dashboard__longevity-nav-all-list[hidden] {
  display: none;
}

.dashboard__longevity-nav-all-item {
  margin: 0;
  display: flex;
}

.dashboard__longevity-nav-all-link {
  display: flex;
  align-items: center;
  flex: 1;
  width: 100%;
  min-height: 100%;
  padding: 0.35rem 0.45rem;
  border: 0;
  border-radius: 4px;
  background: none;
  color: #444;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.dashboard__longevity-nav-all-link:hover {
  background: #eef3f8;
  color: #1a1a1a;
}

.dashboard__longevity-nav-all-link:focus-visible {
  outline: 2px solid #5a8ab8;
  outline-offset: 1px;
}

.dashboard__longevity-nav-all-link--active,
.dashboard__longevity-nav-all-link[aria-current="true"] {
  background: #e8e8e6;
  color: #333;
  font-weight: 600;
}

.dashboard__longevity-nav-all-link[data-longevity-topic-color] {
  border-left: 4px solid var(--longevity-topic-color);
  padding-left: calc(0.45rem - 1px);
  background: color-mix(in srgb, var(--longevity-topic-color) 8%, transparent);
}

.dashboard__longevity-nav-all-link[data-longevity-topic-color]:not(.dashboard__longevity-nav-all-link--active):not([aria-current="true"]) {
  color: #444;
}

.dashboard__longevity-nav-all-link--active[data-longevity-topic-color],
.dashboard__longevity-nav-all-link[aria-current="true"][data-longevity-topic-color] {
  background: color-mix(in srgb, var(--longevity-topic-color) 18%, #e8e8e6);
  color: var(--longevity-topic-color);
}

.dashboard__longevity-hint {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  color: #5c5c5c;
}

.dashboard__longevity-analysis-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.75rem;
}

.dashboard__analysis-btn,
.dashboard__longevity-analysis-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid #3d6b9e;
  border-radius: 5px;
  background: #2a4a6e;
  color: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.3;
  cursor: pointer;
}

.dashboard__analysis-btn:hover,
.dashboard__analysis-btn:focus-visible,
.dashboard__longevity-analysis-btn:hover,
.dashboard__longevity-analysis-btn:focus-visible {
  background: #1f3a58;
  border-color: #1f3a58;
}

.dashboard__analysis-btn:focus-visible,
.dashboard__longevity-analysis-btn:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
}

.dashboard__micro-day-card-head {
  display: flex;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #e8e8e4;
}

.dashboard__micro-day-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  min-width: 0;
  flex: 1 1 auto;
}

.dashboard__micro-day-card-head .dashboard__label {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  line-height: 1.2;
}

.dashboard__micro-day-card-head .dashboard__date {
  line-height: 1.2;
}

.dashboard__micro-day-analysis {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
  margin-left: auto;
  padding: 0.12rem 0.3rem;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #9a9a96;
  font: inherit;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.dashboard__micro-day-analysis:hover,
.dashboard__micro-day-analysis:focus-visible {
  color: #5c5c5c;
  background: #f4f4f2;
}

.dashboard__micro-day-analysis:focus-visible {
  outline: 2px solid #c8c8c4;
  outline-offset: 1px;
}

.dashboard__card--today .dashboard__micro-day-analysis {
  color: #7a92ad;
}

.dashboard__card--today .dashboard__micro-day-analysis:hover,
.dashboard__card--today .dashboard__micro-day-analysis:focus-visible {
  color: #3d6b9e;
  background: #eef3f8;
}

.analysis-picker-modal__panel {
  max-width: 24rem;
  max-height: min(85vh, 28rem);
}

.analysis-picker__options {
  gap: 0.55rem;
}

.analysis-picker__btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid #d4d4d0;
  border-radius: 6px;
  background: #fafaf8;
  color: #1a1a1a;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.analysis-picker__btn:hover,
.analysis-picker__btn:focus-visible {
  border-color: #3d6b9e;
  background: #f0f4f8;
}

.analysis-picker__btn:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
}

.analysis-picker__btn-title {
  font-size: 0.88rem;
  font-weight: 650;
  color: #1f3a58;
}

.analysis-picker__btn-meta {
  font-size: 0.72rem;
  color: #5c5c5c;
  line-height: 1.35;
}

.analysis-picker__day-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.15rem;
  padding-top: 0.55rem;
  border-top: 1px solid #ecece8;
}

.analysis-picker__day-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #5c5c5c;
}

.analysis-picker__day-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
}

.analysis-picker__day-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-height: 2.75rem;
  padding: 0.4rem 0.25rem;
  border: 1px solid #d4d4d0;
  border-radius: 6px;
  background: #fafaf8;
  color: #1a1a1a;
  font: inherit;
  cursor: pointer;
}

.analysis-picker__day-btn:hover,
.analysis-picker__day-btn:focus-visible {
  border-color: #3d6b9e;
  background: #f0f4f8;
}

.analysis-picker__day-btn:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
}

.analysis-picker__day-btn--today {
  border-color: #3d6b9e;
  background: #f5f8fc;
}

.analysis-picker__day-btn--today .analysis-picker__day-btn-name {
  color: #3d6b9e;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.15em;
}

.analysis-picker__day-btn-name {
  font-size: 0.82rem;
  font-weight: 650;
  color: #1f3a58;
  line-height: 1.2;
}

.analysis-picker__day-btn-date {
  font-size: 0.68rem;
  color: #5c5c5c;
  line-height: 1.2;
}

.longevity-analysis-report__band-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0.35rem 0 0.55rem;
}

.longevity-analysis-report__band-group {
  border: 1px solid #e8e8e4;
  border-radius: 5px;
  background: #fafaf8;
}

.longevity-analysis-report__band-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.longevity-analysis-report__band-summary::-webkit-details-marker {
  display: none;
}

.longevity-analysis-report__band-summary-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
  min-width: 0;
}

.longevity-analysis-report__band-label {
  font-size: 0.8rem;
  font-weight: 700;
}

.longevity-analysis-report__band-count {
  font-size: 0.72rem;
  color: #6a6a66;
}

.longevity-analysis-report__band-chevron {
  flex: 0 0 auto;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid #8a8a86;
  border-bottom: 1.5px solid #8a8a86;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.longevity-analysis-report__band-group[open] .longevity-analysis-report__band-chevron {
  transform: rotate(45deg);
}

.longevity-analysis-report__band-group .longevity-analysis-report__nutrient-list {
  margin: 0;
  padding: 0.15rem 0.55rem 0.45rem;
  border-top: 1px solid #efefec;
}

.longevity-analysis-report__nutrient-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0.35rem 0 0.55rem;
}

.longevity-analysis-report__nutrient-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.2rem 0.1rem;
  border-bottom: 1px solid #f0f0ec;
  font-size: 0.78rem;
  line-height: 1.35;
}

.longevity-analysis-report__nutrient-row:last-child {
  border-bottom: none;
}

.longevity-analysis-report__nutrient-main {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  flex: 1 1 auto;
}

.longevity-analysis-report__nutrient-name {
  min-width: 0;
  color: #333;
}

.longevity-analysis-report__nutrient-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  flex: 0 0 auto;
}

.longevity-analysis-report__info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #b8b8b2;
  cursor: pointer;
}

.longevity-analysis-report__info-btn:hover,
.longevity-analysis-report__info-btn:focus-visible {
  color: #7a7a74;
  background: #f2f2ef;
}

.longevity-analysis-report__info-btn:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.longevity-analysis-report__info-icon {
  display: block;
}

.longevity-analysis-report__nutrient-pct {
  flex: 0 0 auto;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.longevity-analysis-modal__panel {
  max-height: min(92vh, 56rem);
}

.longevity-analysis-modal__body {
  overflow: auto;
  max-height: min(68vh, 42rem);
}

.longevity-analysis-report__meta {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #444;
}

.longevity-analysis-report__note {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #666;
}

.longevity-analysis-report__filters-wrap {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 1rem;
}

.longevity-analysis-report__filters-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.longevity-analysis-report__emoji-toggle {
  padding: 0.28rem 0.55rem;
  border: 1px solid #cfd5dd;
  border-radius: 5px;
  background: #fff;
  color: #333;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
}

.longevity-analysis-report__emoji-toggle:hover,
.longevity-analysis-report__emoji-toggle:focus-visible {
  border-color: #9aa6b5;
  background: #f8fafc;
}

.longevity-analysis-report__emoji-toggle:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.longevity-analysis-report__emoji-toggle[aria-pressed="true"] {
  border-color: #3d6b9e;
  background: #eef4fb;
  color: #1f4e79;
}

.longevity-analysis-report__emoji-hint {
  font-size: 0.68rem;
  line-height: 1.3;
  color: #6a7380;
}

.longevity-analysis-report__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.55rem 0.6rem;
  border: 1px solid #e4e8ee;
  border-radius: 6px;
  background: #f4f6f8;
}

.longevity-analysis-report__filters--limit {
  border-color: #ecd9c4;
  background: #fff8f0;
}

.longevity-analysis-report__filters-label {
  margin-right: 0.15rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #6a7380;
}

.longevity-analysis-report__filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.5rem;
  border: 1px solid #cfd5dd;
  border-radius: 5px;
  background: #fff;
  color: #333;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.longevity-analysis-report__filter-emoji {
  display: none;
  font-size: 0.95rem;
  line-height: 1;
}

.longevity-analysis-report__filters-wrap--emojis .longevity-analysis-report__filter-emoji {
  display: inline;
}

.longevity-analysis-report__filter-btn:hover,
.longevity-analysis-report__filter-btn:focus-visible {
  border-color: #9aa6b5;
  background: #f8fafc;
}

.longevity-analysis-report__filter-btn:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.longevity-analysis-report__filter-btn--active {
  box-shadow: inset 0 0 0 1px currentColor;
}

.longevity-analysis-report__filter-btn--red {
  color: #b42318;
  border-color: #e8b4af;
}

.longevity-analysis-report__filter-btn--red.longevity-analysis-report__filter-btn--active {
  background: #fdeceb;
  border-color: #b42318;
}

.longevity-analysis-report__filter-btn--yellow {
  color: #9a6700;
  border-color: #e6c97a;
}

.longevity-analysis-report__filter-btn--yellow.longevity-analysis-report__filter-btn--active {
  background: #fff6d9;
  border-color: #9a6700;
}

.longevity-analysis-report__filter-btn--green {
  color: #1a7a36;
  border-color: #a8d4b4;
}

.longevity-analysis-report__filter-btn--green.longevity-analysis-report__filter-btn--active {
  background: #e8f6ec;
  border-color: #1a7a36;
}

.longevity-analysis-report__filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
  font-size: 0.68rem;
  font-weight: 700;
  color: inherit;
}

.longevity-analysis-report__avg {
  font-weight: 750;
}

.longevity-analysis-report__avg--red {
  color: #b42318;
}

.longevity-analysis-report__avg--yellow {
  color: #9a6700;
}

.longevity-analysis-report__avg--green {
  color: #1a7a36;
}

.longevity-analysis-report__section {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e4e8ee;
  border-radius: 6px;
  background: #fafbfc;
  break-inside: avoid;
  page-break-inside: avoid;
}

.longevity-analysis-report__section--goto {
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
}

.longevity-analysis-report__section--goto:hover,
.longevity-analysis-report__section--goto:focus-visible {
  border-color: #3d6b9e;
  background: #f3f7fb;
  box-shadow: 0 0 0 1px rgba(61, 107, 158, 0.18);
  outline: none;
}

.longevity-analysis-report__section-title {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1a2a38;
}

.longevity-analysis-report__goto-hint {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  font-weight: 650;
  color: #3d6b9e;
}

.longevity-analysis-return {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 95;
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid #2a4a6e;
  border-radius: 8px;
  background: #2a4a6e;
  box-shadow: 0 8px 24px rgba(26, 42, 56, 0.28);
}

.longevity-analysis-return[hidden] {
  display: none !important;
}

.longevity-analysis-return__open {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.65rem 0.8rem;
  border: none;
  border-radius: 7px 0 0 7px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
}

.longevity-analysis-return__open:hover,
.longevity-analysis-return__open:focus-visible {
  background: rgba(255, 255, 255, 0.1);
}

.longevity-analysis-return__open:focus-visible {
  outline: 2px solid #9ec0e6;
  outline-offset: -2px;
}

.longevity-analysis-return__open-icon {
  font-size: 1rem;
  line-height: 1;
}

.longevity-analysis-return__dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  margin: 0;
  padding: 0;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0 7px 7px 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.longevity-analysis-return__dismiss:hover,
.longevity-analysis-return__dismiss:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

.longevity-analysis-return__dismiss:focus-visible {
  outline: 2px solid #9ec0e6;
  outline-offset: -2px;
}

@media (max-width: 720px) {
  .longevity-analysis-return {
    right: 0.75rem;
    bottom: 4.75rem;
  }
}

.longevity-analysis-report__metric-group {
  margin: 0 0 0.55rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #d7e4f2;
  border-left: 3px solid #3d6b9e;
  border-radius: 5px;
  background: #f4f8fc;
}

.longevity-analysis-report__metric-group:last-of-type {
  margin-bottom: 0;
}

.longevity-analysis-report__metric-group--limit {
  border-color: #ecd9c4;
  border-left-color: #c45c00;
  background: #fff8f0;
}

.longevity-analysis-report__metric-heading {
  margin: 0 0 0.1rem;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  color: #2a4a6e;
}

.longevity-analysis-report__metric-group--limit .longevity-analysis-report__metric-heading {
  color: #8a5a2b;
}

.longevity-analysis-report__metric-sub {
  margin: 0 0 0.45rem;
  font-size: 0.68rem;
  line-height: 1.35;
  color: #6a7380;
}

.longevity-analysis-report__hero {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 0.75rem;
  margin: 0 0 0.45rem;
  padding: 0.35rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.72);
}

.longevity-analysis-report__hero-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.55rem;
  min-width: 0;
}

.longevity-analysis-report__hero-pct {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.longevity-analysis-report__hero-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #5c6670;
}

.longevity-analysis-report__hero-unit {
  font-size: 0.68rem;
  color: #6a7380;
}

.longevity-analysis-report__details {
  display: grid;
  gap: 0.28rem;
}

.longevity-analysis-report__detail-row {
  display: grid;
  grid-template-columns: 3.6rem minmax(0, 1fr) auto;
  gap: 0.35rem 0.55rem;
  align-items: baseline;
  padding: 0.2rem 0.15rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.78rem;
  line-height: 1.3;
}

.longevity-analysis-report__detail-row:first-child {
  border-top: none;
  padding-top: 0;
}

.longevity-analysis-report__detail-kind {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #6a7380;
}

.longevity-analysis-report__detail-name {
  min-width: 0;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.longevity-analysis-report__detail-pct {
  font-weight: 700;
  color: #1a2a38;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.longevity-analysis-report__detail-row--mode .longevity-analysis-report__detail-name {
  white-space: normal;
}

.longevity-analysis-report__single {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.45rem;
  margin: 0;
  padding: 0.35rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.84rem;
  line-height: 1.35;
  color: #222;
}

.longevity-analysis-report__single-name {
  font-weight: 600;
  min-width: 0;
}

.longevity-analysis-report__single-pct {
  font-size: 1.05rem;
  font-weight: 800;
}

.longevity-analysis-report__single-unit {
  font-size: 0.72rem;
  color: #6a7380;
}

.longevity-analysis-report__empty {
  margin: 0;
  font-size: 0.8rem;
  color: #777;
}

@media (max-width: 560px) {
  .longevity-analysis-report__detail-row {
    grid-template-columns: 3.4rem minmax(0, 1fr);
  }

  .longevity-analysis-report__detail-pct {
    grid-column: 2;
    justify-self: start;
  }
}

.dashboard__longevity-intro {
  margin: 0 0 0.65rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #444;
  background: #f4f7f2;
  border-left: 3px solid #7a9e6a;
  border-radius: 0 4px 4px 0;
}

.dashboard__longevity-intro-text {
  margin: 0;
}

.dashboard__longevity-disclaimer {
  margin: 0 0 0.65rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #6b3a12;
  background: #fff4e8;
  border-left: 3px solid #e67e22;
  border-radius: 0 4px 4px 0;
}

.dashboard__longevity-disclaimer-text {
  margin: 0;
}

.dashboard__panel-disclaimer-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}

.dashboard__panel-disclaimer-btn:hover .dashboard__longevity-disclaimer-text {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dashboard__longevity-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0 0 0.75rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.66rem;
  color: #5c5c5c;
  background: #f8f8f6;
  border: 1px solid #e8e8e4;
  border-radius: 4px;
}

.dashboard__longevity-legend-item--aim::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.3rem;
  border-radius: 2px;
  background: #1a7a36;
  vertical-align: middle;
}

.dashboard__longevity-legend-item--limit::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.3rem;
  border-radius: 2px;
  background: #b42318;
  vertical-align: middle;
}

.dashboard__longevity-legend-item--micro::before {
  content: "—";
  margin-right: 0.25rem;
  color: #8a8a8a;
}

.dashboard__longevity-section {
  margin-bottom: 0.85rem;
  padding: 0.55rem 0.6rem 0.65rem;
  border: 1px solid #e4e4e0;
  border-radius: 6px;
  background: #fdfdfc;
  scroll-margin-top: calc(var(--longevity-nav-height, 5.5rem) + 0.65rem);
}

.app-sheet .dashboard__longevity-section {
  scroll-margin-top: 0.65rem;
}

.dashboard__longevity-section:last-child {
  margin-bottom: 0;
}

.dashboard__longevity-section-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #333;
}

.dashboard__longevity-section-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.58rem;
  font-weight: 400;
  color: #b5b5b5;
  text-decoration: none;
  cursor: pointer;
  opacity: 0.85;
}

.dashboard__longevity-section-link:hover,
.dashboard__longevity-section-link:focus-visible {
  color: #888;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 1;
}

.dashboard__longevity-section-link:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
  border-radius: 2px;
}

.dashboard__longevity-note--gi {
  margin-top: 0.75rem;
}

.dashboard__longevity-note--sub {
  margin-top: 0.55rem;
  margin-bottom: 0.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: #6a6a6a;
}

.dashboard__longevity-note {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  color: #5c5c5c;
}

.dashboard__longevity-processed-note {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #444;
  background: #f6f8fa;
  border-left: 3px solid #9eb4cc;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

.dashboard__longevity-processed-note:hover {
  background: #eef2f6;
}

.dashboard__longevity-processed-note[data-tip-collapsed="1"] {
  display: none;
}

.dashboard__longevity-processed-note-text {
  margin: 0;
}

.dashboard__longevity-processed-note-list {
  margin: 0.55rem 0 0;
  padding-left: 1.15rem;
}

.dashboard__longevity-processed-note-list li {
  margin: 0 0 0.4rem;
}

.dashboard__longevity-processed-note-list li:last-child {
  margin-bottom: 0;
}

.dashboard__longevity-processed-note a {
  color: #2a5f9e;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dashboard__longevity-processed-note a:hover {
  color: #1a4078;
}

.dashboard__longevity-processed-note--section {
  margin-top: 0.35rem;
  margin-bottom: 0.5rem;
}

.dashboard__longevity-tip-link {
  display: inline;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: #2a5f9e;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: none;
  cursor: pointer;
}

.dashboard__longevity-tip-link:hover {
  color: #1a4078;
}

.phosphorus-binder-modal__body {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #333;
}

.phosphorus-binder-modal__lead {
  margin: 0 0 1rem;
}

.phosphorus-binder-modal__section {
  margin-bottom: 0.85rem;
}

.phosphorus-binder-modal__heading {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #444;
}

.phosphorus-binder-modal__list {
  margin: 0;
  padding-left: 1.15rem;
}

.phosphorus-binder-modal__list li {
  margin-bottom: 0.45rem;
}

.phosphorus-binder-modal__list li:last-child {
  margin-bottom: 0;
}

.phosphorus-binder-modal__note {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: #5c5c5c;
}

.phosphorus-binder-modal__details {
  margin-bottom: 0.55rem;
  border: 1px solid #d8dde3;
  border-radius: 6px;
  background: #fafbfc;
}

.phosphorus-binder-modal__details:last-child {
  margin-bottom: 0;
}

.phosphorus-binder-modal__summary {
  padding: 0.55rem 0.75rem;
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  list-style: none;
}

.phosphorus-binder-modal__summary::-webkit-details-marker {
  display: none;
}

.phosphorus-binder-modal__summary::before {
  content: "▸ ";
  color: #5c5c5c;
}

.phosphorus-binder-modal__details[open] .phosphorus-binder-modal__summary::before {
  content: "▾ ";
}

.phosphorus-binder-modal__details-body {
  padding: 0 0.75rem 0.65rem;
  border-top: 1px solid #e8ebef;
}

.dashboard__longevity-subgroup {
  margin: 0.5rem 0 0.2rem;
  padding: 0.28rem 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 3px;
}

.dashboard__longevity-subgroup--limit {
  color: #8b3a2f;
  background: #fdf5f3;
}

.dashboard__longevity-subgroup--aim {
  color: #2d5c3a;
  background: #f3f9f4;
}

.dashboard__longevity-subgroup--micro {
  color: #4a5568;
  background: #f5f7fa;
}

.dashboard__longevity-table {
  margin-top: 0.25rem;
}

.dashboard__longevity-thead,
.dashboard__longevity-row {
  display: grid;
  grid-template-columns: minmax(7rem, 1.4fr) minmax(4.5rem, 0.9fr) minmax(3rem, 0.55fr) minmax(4rem, 0.75fr);
  gap: 0.35rem 0.5rem;
  align-items: center;
}

.dashboard__longevity-thead {
  padding: 0.2rem 0.4rem 0.35rem;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a8a8a;
  border-bottom: 1px solid #e8e8e4;
}

.dashboard__longevity-thead span:nth-child(n + 2) {
  text-align: right;
}

.dashboard__longevity-thead span:last-child {
  text-align: left;
}

.dashboard__longevity-tbody {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dashboard__longevity-row {
  padding: 0.3rem 0.4rem;
  border-radius: 4px;
  font-size: 0.76rem;
  background: #fff;
  border: 1px solid #ecece8;
}

.dashboard__longevity-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.35rem 1rem;
}

.dashboard__longevity-row--computed {
  background: #f5f7fa;
  border-color: #d8e0ea;
}

.dashboard__longevity-row--from-micro {
  border-style: dashed;
  background: #fafbfd;
}

.dashboard__longevity-row--limiting {
  border-left: 3px solid #e8c4be;
}

.dashboard__longevity-row:not(.dashboard__longevity-row--limiting):not(
    .dashboard__longevity-row--computed
  ) {
  border-left: 3px solid #c8e6d0;
}

.dashboard__longevity-row--computed {
  border-left: 3px solid #c8d4e6;
  background: #f8fafc;
}

.dashboard__longevity-row--jump {
  border-left: 3px solid #b8c8dc;
  background: #f8fafc;
}

button.dashboard__longevity-name.dashboard__longevity-nav-jump-btn {
  color: #3d6ea8;
}

button.dashboard__longevity-name.dashboard__longevity-nav-jump-btn:hover,
button.dashboard__longevity-name.dashboard__longevity-nav-jump-btn:focus-visible {
  color: #2a5588;
  text-decoration: underline;
}

.dashboard__longevity-pct--jump {
  color: #3d6ea8;
  font-weight: 600;
}

.dashboard__longevity-name {
  font-weight: 600;
  color: #333;
  min-width: 0;
}

button.dashboard__longevity-name {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: #333;
  text-align: left;
  cursor: pointer;
}

button.dashboard__longevity-name:hover {
  color: #333;
}

.dashboard__longevity-name--form,
button.dashboard__longevity-name--form {
  color: #6a6a6a;
  font-weight: 500;
}

.dashboard__longevity-name--form .dashboard__nutrient-form,
button.dashboard__longevity-name--form .dashboard__nutrient-form {
  color: #8a8a8a;
  font-weight: 400;
}

button.dashboard__longevity-name:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
  border-radius: 2px;
}

.dashboard__longevity-row--clickable:hover {
  background: #f3f3f0;
}

.dashboard__longevity-name-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.dashboard__longevity-name-wrap .dashboard__longevity-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dashboard__longevity-name-wrap .dashboard__micro-sources-btn,
.dashboard__longevity-name-wrap .dashboard__micro-daily-intake-btn,
.dashboard__longevity-name-wrap .dashboard__micro-acute-btn {
  flex-shrink: 0;
  align-self: center;
}

.dashboard__longevity-amt {
  color: #5c5c5c;
  font-size: 0.7rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: normal;
  overflow-wrap: anywhere;
}

.dashboard__longevity-pct-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  min-width: 0;
  line-height: 1.3;
  gap: 0.08rem;
}

.dashboard__longevity-target-kind-wrap {
  display: block;
  line-height: 1.2;
}

.dashboard__longevity-target-kind {
  font-size: 0.54rem;
  line-height: 1.2;
  color: #8a8a86;
  white-space: nowrap;
  font-weight: 400;
}

.dashboard__longevity-pct {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.74rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.dashboard__longevity-pct--amount {
  color: #7a7a7a;
  font-weight: 500;
}

.dashboard__longevity-bar-wrap {
  position: relative;
  height: 0.45rem;
}

.dashboard__longevity-bar {
  height: 0.45rem;
  background: #ecece8;
  border-radius: 3px;
  overflow: hidden;
}

.dashboard__longevity-bar--empty {
  opacity: 0.35;
}

.dashboard__longevity-bar-fill {
  height: 100%;
  border-radius: 3px;
  min-width: 2px;
  transition: width 0.15s ease;
}

.dashboard__longevity-bar-notch {
  position: absolute;
  right: 0;
  top: 50%;
  z-index: 1;
  width: 3px;
  height: 0.72rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 1px;
  background: #5a5a56;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
  opacity: 0.72;
  transform: translate(50%, -50%);
  cursor: default;
}

.dashboard__longevity-bar-notch:hover,
.dashboard__longevity-bar-notch:focus-visible {
  opacity: 1;
  background: #3a3a38;
}

.dashboard__longevity-bar-notch-popover {
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  z-index: 2;
  padding: 0.28rem 0.45rem;
  font-size: 0.68rem;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  color: #444;
  white-space: nowrap;
  background: #fff;
  border: 1px solid #d8dce2;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%);
  transition: opacity 0.12s ease, visibility 0.12s ease;
  pointer-events: none;
}

.dashboard__longevity-bar-notch:hover .dashboard__longevity-bar-notch-popover,
.dashboard__longevity-bar-notch:focus-visible .dashboard__longevity-bar-notch-popover {
  opacity: 1;
  visibility: visible;
}

.dashboard__gi-section {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding-top: 1rem;
  border-top: 1px solid #e4e4e0;
  clear: both;
}

.dashboard__gi-chart {
  display: block;
  width: 100%;
}

.dashboard__gi-chart-title {
  display: block;
  margin: 0 0 0.85rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: #6a6a6a;
  text-align:center;
}

.dashboard__gi-bars {
  display: flex;
  gap: 0.75rem 1rem;
  width: 100%;
  align-items: center;
  margin-bottom: 1rem;
  flex-flow: row nowrap;
  justify-content: center;
}

.dashboard__gi-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.dashboard__gi-bar-slot {
  width: 100%;
  max-width: 4.5rem;
  height: 3.75rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.dashboard__gi-bucket-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: #7a9ec8;
  min-height: 2px;
}

.dashboard__gi-bucket-bar--low {
  background: #4a8f5a;
}

.dashboard__gi-bucket-bar--med {
  background: #c9a227;
}

.dashboard__gi-bucket-bar--high {
  background: #b45309;
}

.dashboard__gi-bucket-label {
  width: 100%;
  text-align: center;
  font-size: 0.68rem;
  line-height: 1.35;
  color: #5c5c5c;
}

.dashboard__gi-bucket-tier {
  font-weight: 600;
  color: #444;
}

.dashboard__gi-bucket-sub {
  margin-top: 0.1rem;
  font-size: 0.62rem;
  color: #888;
}

.dashboard__gi-bucket-meta {
  margin-top: 0.2rem;
  font-variant-numeric: tabular-nums;
  color: #5c5c5c;
}

.dashboard__longevity-pct .dashboard__longevity-tip-link {
  font-size: inherit;
  font-variant-numeric: tabular-nums;
}

.dashboard__longevity-pct .dashboard__longevity-pct-link {
  font-weight: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dashboard__longevity-pct .dashboard__longevity-pct-link:hover,
.dashboard__longevity-pct .dashboard__longevity-pct-link:focus-visible {
  color: #1a4078;
}

.dashboard__title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

.dashboard__hint {
  margin: 0;
  color: #5c5c5c;
  font-size: 0.8rem;
}

.dashboard__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.6rem;
}

.week-summary {
  margin-top: 0.45rem;
}

.week-summary__toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.4rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid #9eb4cc;
  border-radius: 6px;
  background: #e8eef4;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #2a4a6e;
  cursor: pointer;
  text-align: left;
}

.week-summary__toggle:hover,
.week-summary__toggle:focus-visible {
  background: #dde6f0;
}

.week-summary__toggle:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.week-summary__toggle-label {
  letter-spacing: 0.03em;
}

.week-summary__toggle-preview {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #1a1a1a;
  font-size: 0.9rem;
}

.week-summary__toggle-chevron {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}

.week-summary__toggle-chevron::before {
  content: "▸";
  font-size: 0.75rem;
  color: #5c5c5c;
  transition: transform 0.15s ease;
}

.week-summary--open .week-summary__toggle-chevron::before {
  transform: rotate(90deg);
}

.week-summary__body[hidden] {
  display: none;
}

.week-summary__cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.week-summary__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  flex: 1 1 8.5rem;
  min-width: 8rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid #c5d3e0;
  border-radius: 6px;
  background: #fff;
}

.week-summary__label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #2a4a6e;
}

.week-summary__icon {
  display: block;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.week-summary__calories {
  font-size: 0.98rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #1a1a1a;
  line-height: 1.25;
}

.week-summary__tdee-denom {
  font-size: 0.72em;
  font-weight: 500;
  color: #5c5c5c;
}

.week-summary__calories--muted {
  font-size: 0.8rem;
  font-weight: 500;
  color: #5c5c5c;
}

.week-summary__projection {
  font-size: 0.72rem;
  font-weight: 500;
  color: #5c5c5c;
  font-variant-numeric: tabular-nums;
}

.week-summary__card--deficit .week-summary__calories,
.week-summary__card--deficit .week-summary__projection {
  color: #1f6b45;
}

.week-summary__card--surplus .week-summary__calories,
.week-summary__card--surplus .week-summary__projection {
  color: #9a4a12;
}

.week-summary__explain-link {
  margin-top: 0.05rem;
  letter-spacing: normal;
  text-transform: lowercase;
}

.week-summary__macros-label {
  font-weight: 700;
  color: #2a4a6e;
}

.week-summary__macro-need {
  font-size: 0.8rem;
  color: #444;
  line-height: 1.35;
}

.dashboard__card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.dashboard__card-head-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.dashboard__card-head .dashboard__label {
  margin-bottom: 0;
}

.dashboard__date {
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: #8a8a86;
  line-height: 1.2;
}

.dashboard__card--today .dashboard__date {
  color: #3d6b9e;
}

.dashboard__card-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.dashboard__card-toggle,
.dashboard__card-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 1px solid #d8d8d4;
  border-radius: 4px;
  background: #fafaf8;
  color: #5c5c5c;
  cursor: pointer;
}

.dashboard__card-toggle:hover,
.dashboard__card-rank:hover {
  border-color: #9eb4cc;
  color: #2a4a6e;
  background: #e8eef4;
}

.dashboard__card-toggle-icon,
.dashboard__card-rank-icon {
  display: block;
}

.dashboard__card-toggle-icon--flipped {
  transform: scaleX(-1);
}

.macro-rank-modal__scope-wrap {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.4rem;
}

.macro-rank-modal__scope {
  flex: 0 0 auto;
}

.macro-rank-modal__scope-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #b8b8b2;
  cursor: pointer;
}

.macro-rank-modal__scope-info:hover,
.macro-rank-modal__scope-info:focus-visible,
.macro-rank-modal__scope-info[aria-expanded="true"] {
  color: #7a7a74;
  background: #f2f2ef;
}

.macro-rank-modal__scope-info:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.macro-rank-modal__scope-info-icon {
  display: block;
}

.macro-rank-modal__scope-tip {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 70;
  width: min(16.5rem, calc(100vw - 3rem));
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  background: #1a1a1a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.macro-rank-modal__scope-tip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 0.35rem;
  border: 5px solid transparent;
  border-bottom-color: #1a1a1a;
}

.macro-rank-modal__scope-info:hover .macro-rank-modal__scope-tip,
.macro-rank-modal__scope-info:focus-visible .macro-rank-modal__scope-tip,
.macro-rank-modal__scope-info[aria-expanded="true"] .macro-rank-modal__scope-tip {
  opacity: 1;
  visibility: visible;
}

.macro-rank-modal__tabs {
  display: flex;
  gap: 0;
  margin: 0 1rem;
  border-bottom: 1px solid #e0e0dc;
}

.macro-rank-modal__tab {
  appearance: none;
  margin: 0;
  padding: 0.55rem 0.9rem;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: #6a6a66;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.macro-rank-modal__tab:hover {
  color: #2a4a6e;
}

.macro-rank-modal__tab:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
}

.macro-rank-modal__tab--active,
.macro-rank-modal__tab[aria-selected="true"] {
  color: #2a4a6e;
  border-bottom-color: #3d6b9e;
}

.macro-rank-modal__tab--calories {
  position: relative;
  margin-left: auto;
  padding-left: 1.15rem;
}

.macro-rank-modal__tab--calories::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  bottom: 0.55rem;
  width: 1px;
  background: #e0e0dc;
}

.dashboard__card {
  min-width: 0;
  overflow: visible;
  padding: 0.55rem 0.6rem;
  border: 1px solid #c8c8c4;
  border-radius: 6px;
  background: #fff;
  font-size: 0.78rem;
  line-height: 1.35;
  transition: box-shadow 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.dashboard__card--today {
  border-color: #3d6b9e;
  background: #f5f8fc;
}

.dashboard__card--today .dashboard__label {
  color: #3d6b9e;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.dashboard__card--ignored {
  border-color: #c4b496;
  background: #f6f1e8;
}

.dashboard__card--ignored .dashboard__label {
  color: #6b5a3d;
}

.dashboard__card--focus {
  position: relative;
  z-index: 1;
  border-color: #3d6b9e;
  background: #eef4fa;
  box-shadow: 0 0 0 2px rgba(61, 107, 158, 0.4);
}

.dashboard__card--today.dashboard__card--focus {
  background: #e8eef6;
}

.dashboard__card--ignored.dashboard__card--focus {
  border-color: #8a7a5c;
  background: #f3ebe0;
  box-shadow: 0 0 0 2px rgba(107, 90, 61, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .dashboard__card {
    transition: none;
  }
}

.dashboard__ignored-badge {
  display: block;
  margin: 0;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8a7a5c;
  line-height: 1.2;
}

.dashboard__card:not(.dashboard__card--ignored) .dashboard__ignored-badge {
  visibility: hidden;
}

.dashboard__ignored-days-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  padding: 0.14rem 0.42rem;
  border: 1px solid #c4b496;
  border-radius: 999px;
  background: #f6f1e8;
  color: #6b5a3d;
  font: inherit;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.2;
  cursor: pointer;
}

.dashboard__ignored-days-badge[hidden] {
  display: none;
}

.dashboard__ignored-days-badge:hover,
.dashboard__ignored-days-badge:focus-visible,
.dashboard__ignored-days-badge[aria-expanded="true"] {
  border-color: #b39a72;
  background: #efe6d4;
  color: #5a4a32;
}

.dashboard__ignored-days-badge:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
}

.week-summary__label .dashboard__ignored-days-badge {
  text-transform: uppercase;
}

.dashboard__ignored-days-popover {
  position: fixed;
  z-index: 120;
  min-width: 12rem;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.6rem 0.7rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #444;
  background: #fff;
  border: 1px solid #d8dce2;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  pointer-events: auto;
}

.dashboard__ignored-days-popover[hidden] {
  display: none;
}

.dashboard__ignored-days-popover-text {
  margin: 0;
}

.dashboard__ignored-days-popover-copy {
  margin: 0;
}

.dashboard__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #444;
}

.dashboard__row {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.15rem;
  min-width: 0;
}

.dashboard__row--total {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid #e0e0dc;
  font-weight: 600;
}

.dashboard__day {
  display: flex;
  flex-direction: column;
  min-width: 0;
  container-type: inline-size;
  container-name: dash-day;
}

.dashboard__macro-need {
  margin-top: 0.35rem;
  min-width: 0;
  padding: 0.35rem 0.5rem 0.4rem;
  border: 1px solid #c8c8c4;
  border-radius: 6px;
  background: #f7f7f5;
  font-size: 0.7rem;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  cursor: pointer;
}

.dashboard__macro-need:hover {
  border-color: #b0b0aa;
  background: #f2f2ef;
}

.dashboard__macro-need--today {
  border-color: #3d6b9e;
  background: #f5f8fc;
}

.dashboard__macro-need--today:hover {
  border-color: #335f8f;
  background: #eef4fa;
}

.dashboard__macro-need--consumed {
  border-style: dashed;
}

.dashboard__macro-need-label {
  align-self: flex-start;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #444;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.62rem;
  cursor: help;
  text-decoration: underline dotted rgba(100, 100, 96, 0.55);
  text-underline-offset: 0.14em;
}

.dashboard__macro-need-label:hover,
.dashboard__macro-need-label:focus-visible {
  color: #2a2a28;
}

.dashboard__macro-need-label:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
  border-radius: 2px;
}

.dashboard__macro-need--today .dashboard__macro-need-label {
  color: #3d6b9e;
}

.dashboard__macro-need--today .dashboard__macro-need-label:hover,
.dashboard__macro-need--today .dashboard__macro-need-label:focus-visible {
  color: #2a5080;
}

.dashboard__macro-need-list {
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
  border-radius: 3px;
}

.dashboard__macro-need-list:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
}

.dashboard__macro-need-popover {
  position: fixed;
  z-index: 120;
  min-width: 12rem;
  max-width: min(20rem, calc(100vw - 2rem));
  padding: 0.6rem 0.7rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #444;
  background: #fff;
  border: 1px solid #d8dce2;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  pointer-events: auto;
}

.dashboard__macro-need-popover[hidden] {
  display: none;
}

.dashboard__macro-need-popover-copy {
  margin: 0;
}

.dashboard__macro-need-popover-copy + .dashboard__macro-need-popover-copy {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid #ecece8;
}

.dashboard__macro-need-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.dashboard__macro-need-key {
  color: #5c5c5c;
  font-weight: 600;
}

.dashboard__macro-need-amt {
  color: #444;
  text-align: right;
  white-space: nowrap;
}

.dashboard__macro-need-item--met .dashboard__macro-need-key,
.dashboard__macro-need-item--met .dashboard__macro-need-amt {
  color: #1a7a36;
  font-weight: 600;
}

.week-summary__macro-need-vals {
  display: inline;
}

.week-summary__macro-need-vals .dashboard__macro-need-item {
  display: inline-flex;
  gap: 0.2rem;
  justify-content: flex-start;
}

.week-summary__macro-need-sep {
  color: #888;
}

.dashboard__macro {
  flex-shrink: 0;
  color: #5c5c5c;
}

.dashboard__macro-short {
  display: none;
}

.dashboard__days-carousel-nav {
  display: none;
}

.dashboard__val {
  min-width: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 7 equal columns are ~11–12.5rem at the 1480px page cap — shorten labels there */
@container dash-day (max-width: 13.5rem) {
  .dashboard__macro-long {
    display: none;
  }

  .dashboard__macro-short {
    display: inline;
  }

  .dashboard__card {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }

  .dashboard__macro-need {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }
}

@container dash-day (max-width: 11.25rem) {
  .dashboard__val,
  .dashboard__macro-need-amt {
    white-space: normal;
  }
}

.week__entry-tools {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.8rem 0.65rem;
  border: 1px solid #c8c8c4;
  border-radius: 8px;
  background: #fff;
  position: relative;
  z-index: 10;
}

.week__days-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  margin-bottom: 0;
  position: relative;
  z-index: 10;
}

.week__days-hint {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.8rem;
  color: #5c5c5c;
}

.week__days-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.5rem;
}

.week__food-notes {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.week__food-notes:not([hidden]) {
  gap: 0.35rem;
}

.week__food-notes:not([hidden])::before {
  content: "";
  align-self: stretch;
  width: 1px;
  background: #c8c8c4;
  flex-shrink: 0;
}

.week__food-notes[hidden] {
  display: none;
}

.week__food-notes-lead {
  color: #8a8a8a;
}

.week__food-notes-labels {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
}

.week__food-notes-sep {
  color: #8a8a8a;
  white-space: pre;
}

.week__food-notes-label {
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: inherit;
  color: #8a8a8a;
  text-decoration: underline;
  text-decoration-color: rgba(138, 138, 138, 0.45);
  text-underline-offset: 2px;
  background: none;
  border: none;
  cursor: pointer;
}

.week__food-notes-label:hover,
.week__food-notes-label:focus-visible,
.week__food-notes-label[aria-expanded="true"] {
  color: #5c5c5c;
  text-decoration-color: rgba(92, 92, 92, 0.55);
}

.week__food-notes-popover {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 30;
  min-width: 14rem;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #444;
  background: #fff;
  border: 1px solid #d8dce2;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.week__food-notes-popover[hidden] {
  display: none;
}

.week__food-notes-entry-text {
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.week__food-notes-entry-text p {
  margin: 0 0 0.65rem;
}

.week__food-notes-entry-text p:last-child {
  margin-bottom: 0;
}

.week__food-notes-read-more {
  display: inline-block;
  padding: 0;
  margin: 0.35rem 0 0;
  font: inherit;
  font-weight: 600;
  color: #2a5f9e;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: none;
  cursor: pointer;
}

.week__food-notes-read-more:hover {
  color: #1a4078;
}

.week__food-notes-read-more[hidden] {
  display: none;
}

.week__visibility-controls {
  color: #8a8a8a;
  vertical-align: top;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.week__highlight-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: 1px solid rgba(226, 178, 54, 0.6);
  border-radius: 5px;
  background: #fff6d8;
  color: #7a5a0a;
  cursor: pointer;
}

.week__highlight-toggle:hover {
  border-color: #d9a91e;
  background: #ffefb5;
}

.week__highlight-toggle:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
}

.week__highlight-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.week__highlight-toggle--off {
  border-color: #d0d0ca;
  background: transparent;
  color: #9a9a96;
}

.week__highlight-toggle-icon {
  display: block;
  width: 0.82rem;
  height: 0.82rem;
  fill: currentColor;
}

.week__highlight-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  font-size: 80%;
  margin: 0;
  padding-top: 0.55rem;
  border-top: 1px solid #e6e6e2;
}

.week__unmatched-lines {
  display: block;
  width: 100%;
  max-width: 22rem;
  margin-top: 0.35rem;
  margin-bottom: 0.65rem;
  line-height: 1.45;
  font-size: 80%;
}

.week__unmatched-lines[hidden] {
  display: none;
}

.week__unmatched-toggle {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  padding: 0.1rem 0;
  margin: 0;
  font: inherit;
  font-size: inherit;
  font-weight: 600;
  color: #b85c5c;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(184, 92, 92, 0.35);
  text-underline-offset: 2px;
}

.week__unmatched-toggle:hover,
.week__unmatched-toggle:focus-visible {
  color: #a84848;
  text-decoration-color: rgba(168, 72, 72, 0.55);
  outline: none;
}

.week__unmatched-toggle[aria-expanded="true"] {
  text-decoration: none;
}

.week__unmatched-count {
  font-weight: 700;
}

.week__unmatched-carousel {
  margin-top: 0.4rem;
  padding: 0.45rem 0.5rem 0.5rem;
  border: 1px solid rgba(184, 92, 92, 0.28);
  border-radius: 6px;
  background: rgba(196, 106, 106, 0.06);
}

.week__unmatched-carousel-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.4rem;
}

.week__unmatched-carousel-adj {
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 1px solid rgba(184, 92, 92, 0.35);
  border-radius: 4px;
  background: #fff;
  color: #a84848;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.week__unmatched-carousel-adj:hover:not(:disabled) {
  background: rgba(196, 106, 106, 0.12);
  border-color: rgba(168, 72, 72, 0.45);
}

.week__unmatched-carousel-adj:focus-visible {
  outline: 2px solid rgba(168, 72, 72, 0.45);
  outline-offset: 1px;
}

.week__unmatched-carousel-adj:disabled {
  opacity: 0.4;
  cursor: default;
}

.week__unmatched-carousel-indicator {
  text-align: center;
  font-weight: 600;
  color: #a84848;
}

.week__unmatched-carousel-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  padding: 0.4rem 0.45rem;
  margin: 0;
  font: inherit;
  font-size: inherit;
  line-height: 1.35;
  text-align: left;
  color: #c46a6a;
  background: #fff;
  border: 1px solid rgba(184, 92, 92, 0.2);
  border-radius: 4px;
  cursor: pointer;
}

.week__unmatched-carousel-card:hover,
.week__unmatched-carousel-card:focus-visible {
  color: #a84848;
  border-color: rgba(168, 72, 72, 0.4);
  outline: none;
}

.week__unmatched-carousel-loc {
  font-weight: 700;
  color: #a84848;
}

.week__unmatched-carousel-text {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #8a5050;
}

.week__unmatched-carousel-hint {
  font-size: 0.85em;
  color: #b07a7a;
}

.toolbar-bulk-btn,
.week__meals-bulk {
  padding: 0.1rem 0.25rem;
  font: inherit;
  font-size: 0.65rem;
  font-weight: 400;
  line-height: 1.2;
  cursor: pointer;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: #9a9a96;
}

.toolbar-bulk-btn:hover,
.week__meals-bulk:hover {
  color: #5c5c5c;
  background: rgba(0, 0, 0, 0.04);
}

.week__clear-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.2rem;
  padding: 0.1rem 0.25rem;
  font: inherit;
  font-size: 0.65rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: #9a9a96;
}

.day__clear,
.day__copy-toggle,
.day__favorite,
.day__ai,
.day__ignore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-sizing: border-box;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.15rem;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.1;
  cursor: pointer;
  border: 1px solid #d4d4d0;
  border-radius: 4px;
  background: #fff;
  color: #5c5c5c;
  position: relative;
  z-index: 1;
}

.day__action-icon {
  display: block;
  flex: 0 0 auto;
}

.day__action-label {
  display: inline-block;
  max-width: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  transition: max-width 0.16s ease, opacity 0.12s ease, margin 0.16s ease;
}

.day__clear:hover:not(:disabled),
.day__clear:focus:not(:disabled),
.day__clear:focus-visible:not(:disabled),
.day__copy-toggle:hover:not(:disabled),
.day__copy-toggle:focus:not(:disabled),
.day__copy-toggle:focus-visible:not(:disabled),
.day__copy-toggle[aria-expanded="true"],
.day__copy:focus-within .day__copy-toggle,
.day__favorite:hover:not(:disabled),
.day__favorite:focus:not(:disabled),
.day__favorite:focus-visible:not(:disabled),
.day__ai:hover:not(:disabled),
.day__ai:focus:not(:disabled),
.day__ai:focus-visible:not(:disabled),
.day__ignore:hover:not(:disabled),
.day__ignore:focus:not(:disabled),
.day__ignore:focus-visible:not(:disabled),
.day__ignore[aria-pressed="true"] {
  padding: 0.15rem 0.4rem 0.15rem 0.28rem;
  z-index: 3;
}

.day__clear:hover:not(:disabled) .day__action-label,
.day__clear:focus:not(:disabled) .day__action-label,
.day__clear:focus-visible:not(:disabled) .day__action-label,
.day__copy-toggle:hover:not(:disabled) .day__action-label,
.day__copy-toggle:focus:not(:disabled) .day__action-label,
.day__copy-toggle:focus-visible:not(:disabled) .day__action-label,
.day__copy-toggle[aria-expanded="true"] .day__action-label,
.day__copy:focus-within .day__copy-toggle .day__action-label,
.day__favorite:hover:not(:disabled) .day__action-label,
.day__favorite:focus:not(:disabled) .day__action-label,
.day__favorite:focus-visible:not(:disabled) .day__action-label,
.day__ai:hover:not(:disabled) .day__action-label,
.day__ai:focus:not(:disabled) .day__action-label,
.day__ai:focus-visible:not(:disabled) .day__action-label,
.day__ignore:hover:not(:disabled) .day__action-label,
.day__ignore:focus:not(:disabled) .day__action-label,
.day__ignore:focus-visible:not(:disabled) .day__action-label,
.day__ignore[aria-pressed="true"] .day__action-label {
  max-width: 5.5rem;
  margin-left: 0.28rem;
  opacity: 1;
}

.day__ai:hover:not(:disabled) .day__action-label,
.day__ai:focus:not(:disabled) .day__action-label,
.day__ai:focus-visible:not(:disabled) .day__action-label {
  max-width: 6.75rem;
}

.day__ai:hover:not(:disabled),
.day__ai:focus:not(:disabled),
.day__ai:focus-visible:not(:disabled),
.day__ignore:hover:not(:disabled),
.day__ignore:focus:not(:disabled),
.day__ignore:focus-visible:not(:disabled),
.day__ignore[aria-pressed="true"] {
  padding: 0.15rem 0.28rem 0.15rem 0.4rem;
}

.day__ai:hover:not(:disabled) .day__action-label,
.day__ai:focus:not(:disabled) .day__action-label,
.day__ai:focus-visible:not(:disabled) .day__action-label,
.day__ignore:hover:not(:disabled) .day__action-label,
.day__ignore:focus:not(:disabled) .day__action-label,
.day__ignore:focus-visible:not(:disabled) .day__action-label,
.day__ignore[aria-pressed="true"] .day__action-label {
  margin-left: 0;
  margin-right: 0.28rem;
}

@media (pointer: coarse) {
  .day__action-label {
    max-width: 5.5rem;
    margin-left: 0.28rem;
    opacity: 1;
  }

  .day__ai .day__action-label {
    max-width: 6.75rem;
  }

  .day__ai:hover:not(:disabled) .day__action-label,
  .day__ai:focus:not(:disabled) .day__action-label,
  .day__ai:focus-visible:not(:disabled) .day__action-label,
  .day__ignore[aria-pressed="true"] .day__action-label,
  .day__ignore:hover:not(:disabled) .day__action-label,
  .day__ignore:focus:not(:disabled) .day__action-label,
  .day__ignore:focus-visible:not(:disabled) .day__action-label {
    margin-left: 0;
    margin-right: 0.28rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .day__action-label {
    transition: none;
  }
}

.week__clear-all:hover:not(:disabled) {
  color: #7a4a4a;
  background: rgba(0, 0, 0, 0.04);
}

.day__clear:hover:not(:disabled) {
  color: #7a4a4a;
  border-color: #d0b0b0;
  background: #faf4f4;
}

.day__favorite:hover:not(:disabled),
.day__favorite[aria-pressed="true"] {
  color: #1f5c53;
  border-color: #7aafa6;
  background: #eef7f5;
}

.day__copy-toggle:hover:not(:disabled),
.day__copy-toggle[aria-expanded="true"] {
  color: #3d6b9e;
  border-color: #9bb6d4;
  background: #eef4fa;
}

.day__ai:hover:not(:disabled),
.day__ai:focus:not(:disabled),
.day__ai:focus-visible:not(:disabled),
.day__line-select[aria-pressed="true"] {
  color: #2a4a6e;
  border-color: #9bb6d4;
  background: #eef4fa;
}

.day__ignore:hover:not(:disabled),
.day__ignore[aria-pressed="true"] {
  color: #6b5a3d;
  border-color: #c4b496;
  background: #f6f1e8;
}

.week__clear-all:disabled,
.day__clear:disabled,
.day__copy-toggle:disabled,
.day__favorite:disabled,
.day__ai:disabled,
.day__ignore:disabled {
  opacity: 0.4;
  cursor: default;
}

.day__copy {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.day__copy-menu {
  position: absolute;
  top: calc(100% + 0.15rem);
  /* Open rightward so Mon (and carousel days at the scrollport start) are not
     clipped by .week__grid { overflow-x: auto }. */
  left: 0;
  right: auto;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 13.5rem;
  padding: 0.25rem;
  border: 1px solid #c8c8c4;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

/* Last column: open leftward so the menu stays inside the grid. */
.week__grid > .day:last-child .day__copy-menu {
  left: auto;
  right: 0;
}

.day__copy-menu[hidden] {
  display: none;
}

.day__copy-menu button {
  display: block;
  width: 100%;
  padding: 0.35rem 0.45rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #333;
  font: inherit;
  font-size: 0.68rem;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.day__copy-menu button:hover:not(:disabled) {
  background: #f0f4f8;
  color: #3d6b9e;
}

.day__copy-menu button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Soft cue matching .day--today / current-week label (blue + underline). */
.day__copy-menu button.day__copy-menu-item--today {
  color: #5a7fa8;
  text-decoration: underline;
  text-decoration-color: #7a9cc0;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.day__copy-menu button.day__copy-menu-item--today:hover:not(:disabled) {
  color: #3d6b9e;
  text-decoration-color: #3d6b9e;
}

.day__copy-menu button.day__copy-menu-item--today:disabled {
  text-decoration-color: #a8b8c8;
}

.week__days {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  border: 1px solid #b8b7b0;
  border-radius: 8px;
  background: #e4e3dd;
  overflow: visible;
}

.week__days-carousel-nav {
  display: none;
}

.week__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.55rem;
  min-height: 8rem;
  overflow-x: auto;
  padding: 0.55rem;
}

.week__grid.week__grid--columns-animating {
  transition: grid-template-columns 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.week__grid.week__grid--day-focus-instant {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .week__grid.week__grid--columns-animating {
    transition: none;
  }
}

.day--focus-wide {
  z-index: 1;
}

.day {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  min-width: 0;
  border: 1px solid #c8c8c4;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(26, 26, 26, 0.04);
}

.day__head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.4rem;
  min-height: 0;
  overflow: visible;
  padding: 0.5rem 0.5rem 0.45rem;
  border-bottom: 1px solid #e2e2de;
  background: #f6f5f1;
  border-radius: 7px 7px 0 0;
}

.day__head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
  min-width: 0;
}

.day__head-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
}

.day__head-tools {
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.25rem;
  flex: 0 0 auto;
  align-self: flex-start;
}

.day__head-tools .day__ai,
.day__head-tools .day__ignore {
  flex: 0 0 auto;
  flex-direction: row-reverse;
}

body.day-entry-advanced
  .day__head-tools
  .day__ai.week__advanced-only {
  display: none;
}

body.day-entry-advanced
  .day:focus-within
  .day__head-tools
  .day__ai.week__advanced-only,
body.day-entry-advanced
  .day.day--focus-wide
  .day__head-tools
  .day__ai.week__advanced-only {
  display: inline-flex;
}

.day__head-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem;
  flex-shrink: 0;
  min-height: 0;
}

.day__label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #2a2a28;
  line-height: 1.15;
}

.day__date {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #6e6e6a;
  line-height: 1.2;
}

.day--today {
  border-color: #7a9ab8;
  box-shadow: 0 0 0 1px rgba(61, 107, 158, 0.18);
}

.day--today .day__head {
  background: #e8eef6;
  border-bottom-color: #c5d4e6;
}

.day--today .day__label {
  color: #3d6b9e;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.day--today .day__date {
  color: #3d6b9e;
}

.day--today .day__editor {
  border-color: transparent;
  background: #f5f8fc;
}

.day--favorite-day {
  border-color: #7aafa6;
  box-shadow: 0 0 0 1px rgba(42, 122, 110, 0.16);
}

.day--favorite-day .day__head {
  background: #e8f4f1;
  border-bottom-color: #c5ddd8;
}

.day--favorite-day .day__label {
  color: #1f5c53;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.day--favorite-day .day__date {
  color: #1f5c53;
}

.day--favorite-day .day__editor {
  border-color: transparent;
  background: #eef7f5;
}

.day--today.day--favorite-day {
  border-color: #7aafa6;
  box-shadow: 0 0 0 1px rgba(42, 122, 110, 0.16);
}

.day--today.day--favorite-day .day__head {
  background: linear-gradient(180deg, #e8eef6 0%, #e8f4f1 100%);
  border-bottom-color: #c5d4e6;
}

.day--today.day--favorite-day .day__label {
  color: #1f5c53;
}

.day--today.day--favorite-day .day__date {
  color: #1f5c53;
}

.day--today.day--favorite-day .day__editor {
  border-color: transparent;
  background: linear-gradient(180deg, #f5f8fc 0%, #eef7f5 100%);
}

.day--search-result,
.day--today.day--search-result,
.day--favorite-day.day--search-result {
  border-color: #c49a43;
  box-shadow: 0 0 0 2px rgba(196, 154, 67, 0.28);
}

.day--search-result .day__head,
.day--today.day--search-result .day__head,
.day--favorite-day.day--search-result .day__head {
  background: #fff3d6;
  border-bottom-color: #e2c982;
}

.day--search-result .day__label,
.day--search-result .day__date,
.day--today.day--search-result .day__label,
.day--today.day--search-result .day__date,
.day--favorite-day.day--search-result .day__label,
.day--favorite-day.day--search-result .day__date {
  color: #805f18;
}

.day--search-result .day__label {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.day--search-result .day__editor,
.day--today.day--search-result .day__editor,
.day--favorite-day.day--search-result .day__editor {
  border-color: transparent;
  background: #fffaf0;
}

.day__editor {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  min-width: 100%;
  height: var(--day-editor-height, calc(45vh - 2.5rem));
  min-height: 6rem;
  max-height: 80vh;
  resize: both;
  border: none;
  border-radius: 0 0 7px 7px;
  background: #fff;
  overflow: hidden;
}

body.day-entry-guided .day__editor {
  display: none;
}

body.day-entry-guided .week__advanced-only {
  display: none;
}

.week__entry-mode-toggle {
  width: auto;
  height: auto;
  min-width: 4.75rem;
  min-height: 1.5rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-color: #c8c8c4;
  background: #fff;
  color: #5c5c5c;
}

.week__entry-mode-toggle:hover {
  border-color: #9bb6d4;
  background: #eef4fa;
  color: #3d6b9e;
}

.week__entry-mode-toggle[aria-pressed="true"] {
  color: #2a4a6e;
  background: #e8eef4;
  border-color: #3d6b9e;
}

.week__quiz-mode-toggle {
  color: #315d8b;
  border-color: #9eb4cc;
  background: #f5f8fc;
}

.week__quiz-mode-toggle:hover {
  color: #244a70;
  border-color: #7295b8;
  background: #e8eef4;
}

.week-quiz-modal__panel {
  max-width: 48rem;
  max-height: min(92vh, 52rem);
}

.modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #6a6a66;
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.modal__close:hover {
  border-color: #d6d6d2;
  background: #f4f4f1;
  color: #252525;
}

.modal__close:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
}

.week-quiz-modal__body {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.week-quiz-modal__purpose {
  margin: 0;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #cbd8e5;
  background: #eef4fa;
  color: #294764;
  font-size: 0.84rem;
  line-height: 1.5;
}

.week-quiz-modal__section {
  min-width: 0;
  padding: 0.85rem 1rem 1rem;
}

.week-quiz-modal__selection {
  background: #fff;
}

.week-quiz-modal__groups {
  display: grid;
  gap: 0.65rem;
}

.week-quiz-modal__group {
  overflow: hidden;
  border: 1px solid #d8d8d4;
  border-radius: 6px;
  background: #fff;
}

.week-quiz-modal__group-summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.35rem;
  padding: 0.45rem 0.65rem;
  background: #f7f7f4;
  color: #343434;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.week-quiz-modal__group-summary::-webkit-details-marker {
  display: none;
}

.week-quiz-modal__group-summary::before {
  content: "›";
  display: inline-block;
  color: #65798b;
  font-size: 1rem;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 140ms ease-out;
}

.week-quiz-modal__group-title {
  min-width: 0;
}

.week-quiz-modal__group-hint {
  margin-left: auto;
  color: #657565;
  font-size: 0.67rem;
  font-weight: 600;
}

.week-quiz-modal__group[open] > .week-quiz-modal__group-summary::before {
  transform: rotate(90deg);
}

.week-quiz-modal__group-summary:hover {
  background: #f0f3f5;
}

.week-quiz-modal__group-summary:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: -2px;
}

.week-quiz-modal__group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  min-height: 1.2rem;
  padding: 0.05rem 0.32rem;
  border: 1px solid #c8d3de;
  border-radius: 999px;
  background: #fff;
  color: #526577;
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
}

.week-quiz-modal__group-body {
  padding: 0.6rem;
  border-top: 1px solid #e7e7e3;
}

.week-quiz-modal__group-note {
  margin: 0;
  color: #6b6b67;
  font-size: 0.7rem;
  line-height: 1.4;
}

.week-quiz-modal__group-body > .week-quiz-modal__group-note {
  margin-bottom: 0.5rem;
}

.week-quiz-modal__group-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.week-quiz-modal__output {
  border-top: 1px solid #e1e1dd;
  background: #fafaf8;
}

.week-quiz-modal__section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.week-quiz-modal__section-title {
  margin: 0;
  color: #292929;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.week-quiz-modal__section-note {
  margin: 0.2rem 0 0;
  color: #676763;
  font-size: 0.74rem;
  line-height: 1.4;
}

.week-quiz-modal__selection-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.45rem;
}

.week-quiz-modal__text-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: #315d8b;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: rgba(49, 93, 139, 0.35);
  text-underline-offset: 0.14em;
  cursor: pointer;
}

.week-quiz-modal__text-btn:hover:not(:disabled) {
  color: #244a70;
  text-decoration-color: currentColor;
}

.week-quiz-modal__text-btn:disabled {
  color: #a0a09b;
  text-decoration: none;
  cursor: default;
}

.week-quiz-modal__food-list {
  max-height: min(18rem, 36vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #ddddda;
  border-radius: 5px;
  scrollbar-width: thin;
}

.week-quiz-modal__food-list[hidden] {
  display: none;
}

.week-quiz-modal__food-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.42rem 0.7rem;
  align-items: start;
  min-height: 4.35rem;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid #ebebe7;
  background: #fff;
  cursor: pointer;
}

.week-quiz-modal__food-row:last-child {
  border-bottom: 0;
}

.week-quiz-modal__food-row:hover {
  background: #f7f9fb;
}

.week-quiz-modal__food-row:has(.week-quiz-modal__checkbox:checked) {
  background: #f1f6fb;
}

.week-quiz-modal__checkbox {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: #3d6b9e;
  margin-top: 0.12rem;
}

.week-quiz-modal__checkbox:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
}

.week-quiz-modal__food-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.15rem;
}

.week-quiz-modal__food-label {
  grid-column: 2;
  display: grid;
  min-width: 0;
  gap: 0.42rem;
  cursor: pointer;
}

.week-quiz-modal__food-row--favorite .week-quiz-modal__food-label {
  cursor: default;
}

.week-quiz-modal__food-name {
  color: #252525;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.week-quiz-modal__food-meta {
  overflow: hidden;
  color: #74746f;
  font-size: 0.69rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-quiz-modal__food-stats {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  gap: 0.25rem;
  color: #4f5d69;
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.week-quiz-modal__food-stats span {
  padding: 0.18rem 0.28rem;
  border: 1px solid #d7dfe7;
  border-radius: 3px;
  background: #fff;
}

.week-quiz-modal__favorite-btn,
.week-quiz-modal__remove-btn {
  grid-column: 3;
  align-self: start;
  font: inherit;
  cursor: pointer;
}

.week-quiz-modal__favorite-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border: 1px solid #d0d0cc;
  border-radius: 4px;
  background: #fff;
  color: #777771;
  font-size: 1rem;
}

.week-quiz-modal__favorite-btn:hover,
.week-quiz-modal__favorite-btn--active {
  border-color: #b99132;
  background: #fff8df;
  color: #8a6814;
}

.week-quiz-modal__favorite-btn:focus-visible,
.week-quiz-modal__remove-btn:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
}

.week-quiz-modal__remove-btn {
  padding: 0.25rem 0.42rem;
  border: 0;
  background: transparent;
  color: #8a3d35;
  font-size: 0.7rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.week-quiz-modal__remove-btn:hover {
  color: #672a25;
}

.week-quiz-modal__included-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-top: 0.12rem;
  border-radius: 50%;
  background: #3d6b9e;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
}

.week-quiz-modal__empty {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px dashed #c8c8c4;
  border-radius: 5px;
  background: #fafaf8;
  color: #5c5c5c;
  font-size: 0.82rem;
  line-height: 1.45;
}

.week-quiz-modal__empty[hidden] {
  display: none;
}

.week-quiz-modal__csv {
  display: block;
  width: 100%;
  height: 10rem;
  min-height: 8rem;
  max-height: 18rem;
  resize: vertical;
  padding: 0.65rem;
  border: 1px solid #c8c8c4;
  border-radius: 5px;
  background: #fff;
  color: #343434;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  line-height: 1.45;
  white-space: pre;
}

.week-quiz-modal__csv[hidden] {
  display: none;
}

.week-quiz-modal__csv:focus {
  outline: 2px solid #3d6b9e;
  outline-offset: 0;
  border-color: #3d6b9e;
}

.week-quiz-modal__copy-status {
  min-height: 1.15rem;
  margin: 0.45rem 0 0;
  color: #315d58;
  font-size: 0.72rem;
  line-height: 1.35;
}

.week-quiz-modal__copy-status:empty {
  display: none;
}

.week-quiz-modal__footer {
  align-items: center;
}

.week-quiz-modal__footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

@media (max-width: 760px) {
  .week-quiz-modal__panel {
    max-height: 94vh;
  }

  .week-quiz-modal__food-stats {
    grid-template-columns: repeat(2, auto);
  }

  .week-quiz-modal__csv {
    min-height: 10rem;
  }

  .week-quiz-modal__footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .week-quiz-modal__footer-actions {
    width: 100%;
  }

  .week-quiz-modal__footer-actions .modal__secondary,
  .week-quiz-modal__footer-actions .modal__done {
    flex: 1 1 50%;
  }
}

@media (max-width: 440px) {
  .week-quiz-modal__group-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .week-quiz-modal__group-hint {
    display: none;
  }

}

.day__guided {
  display: none;
  flex-direction: column;
  flex: 0 0 auto;
  width: 100%;
  min-width: 100%;
  height: var(--day-editor-height, calc(45vh - 2.5rem));
  min-height: 6rem;
  max-height: 80vh;
  resize: both;
  border: none;
  border-radius: 0 0 7px 7px;
  background: #fff;
  overflow: hidden;
}

body.day-entry-guided .day__guided {
  display: flex;
}

.day--today .day__guided {
  border-color: transparent;
  background: #f7fafc;
}

.day--favorite-day .day__guided {
  border-color: transparent;
  background: #f4faf8;
}

.day--today.day--favorite-day .day__guided {
  border-color: transparent;
  background: linear-gradient(180deg, #f7fafc 0%, #f4faf8 100%);
}

.day--search-result .day__guided,
.day--today.day--search-result .day__guided,
.day--favorite-day.day--search-result .day__guided {
  border-color: transparent;
  background: #fffbf2;
}

.day--ignored {
  border-color: #c4b496;
  box-shadow: 0 0 0 1px rgba(107, 90, 61, 0.12);
}

.day--ignored .day__head {
  background: #f6f1e8;
  border-bottom-color: #e2d8c4;
}

.day--ignored .day__label {
  color: #6b5a3d;
}

.day--ignored .day__date {
  color: #8a7a5c;
}

.day--ignored .day__editor,
.day--ignored .day__guided {
  opacity: 0.72;
}

.day__guided-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.day__food-list {
  list-style: none;
  margin: 0;
  padding: 0.2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.day__food-item {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid #ececea;
  min-width: 0;
  position: relative;
}

.day__food-item--food:hover,
.day__food-item--food:focus-within,
.day__food-item--food.day__food-item--active {
  background: #f7f7f4;
}

.day__food-popover {
  position: fixed;
  z-index: 120;
  min-width: 14.5rem;
  max-width: min(22rem, calc(100vw - 1.5rem));
  max-height: min(24rem, calc(100vh - 2rem));
  overflow: auto;
  padding: 0.65rem 0.75rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #333;
  background: #fff;
  border: 1px solid #d8dce2;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.day__food-popover[hidden] {
  display: none;
}

.day__finish-rearrange-popover {
  position: fixed;
  z-index: 130;
  margin: 0;
  padding: 0.45rem 0.75rem;
  border: 1px solid #3d6b9e;
  border-radius: 8px;
  background: #fff;
  color: #3d6b9e;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.2;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  white-space: nowrap;
}

.day__finish-rearrange-popover:hover,
.day__finish-rearrange-popover:focus-visible {
  background: #eef4fa;
}

.day__finish-rearrange-popover:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
}

.day__finish-rearrange-popover[hidden] {
  display: none;
}

.day__food-popover-title {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 650;
}

.day__food-popover-macros {
  display: grid;
  gap: 0.12rem 0;
  margin: 0 0 0.55rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #ecece8;
}

.day__food-popover-macros > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
}

.day__food-popover-macros dt {
  margin: 0;
  color: #6a6a66;
}

.day__food-popover-macros dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}

.day__food-popover-nutrients-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin: 0 0 0.3rem;
}

.day__food-popover-nutrients-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #7a7a7a;
}

.day__food-popover-nutrients-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.day__food-popover-nutrients-page {
  min-width: 2.4rem;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  color: #6a6a66;
  text-align: center;
}

.day__food-popover-adj {
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border: 1px solid #d0d0cc;
  border-radius: 4px;
  background: #fff;
  color: #3d4a5c;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.day__food-popover-adj:hover:not(:disabled) {
  background: #eef3f8;
  border-color: #b8c8d8;
}

.day__food-popover-adj:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.day__food-popover-adj:disabled {
  opacity: 0.4;
  cursor: default;
}

.day__food-popover-nutrients {
  list-style: none;
  margin: 0;
  padding: 0;
}

.day__food-popover-nutrient {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.2rem 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.18rem 0.2rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

button.day__food-popover-nutrient:hover,
button.day__food-popover-nutrient:focus-visible {
  background: #f3f3f0;
}

button.day__food-popover-nutrient:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
}

.day__food-popover-nutrient-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #444;
}

.day__food-popover-nutrient-amt {
  font-variant-numeric: tabular-nums;
  color: #333;
  white-space: nowrap;
}

.day__food-popover-nutrient-pct {
  min-width: 3.2rem;
  font-variant-numeric: tabular-nums;
  color: #6a6a66;
  text-align: right;
  white-space: nowrap;
}

.day__food-popover-empty {
  margin: 0;
  color: #7a7a7a;
}

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

.day__food-item--comment {
  background: #f0efeb;
  border-bottom-color: #ddd9d2;
  border-radius: 0;
  padding: 0.5rem 0.55rem 0.4rem;
  margin-top: 0.35rem;
}

.day__food-item--comment:first-child {
  margin-top: 0;
}

.day__food-item--divider {
  background: transparent;
  border-bottom: none;
  min-height: 0;
  padding: 0.55rem 0.55rem 0.45rem;
  margin: 0.15rem 0 0.05rem;
}

.day__food-item--unmatched {
  background: #fbf6f0;
  border-bottom-color: #e8d9c4;
}

.day__food-item-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #1a1a1a;
  text-align: left;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
}

.day__food-item--comment .day__food-item-name {
  color: #2a2a28;
  font-size: 0.72rem;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
  -webkit-line-clamp: 3;
}

.day__food-item-divider {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  align-self: stretch;
  padding: 0;
}

.day__food-item-divider-line {
  display: block;
  width: 100%;
  height: 0;
  margin: 0;
  border: none;
  border-top: 2px solid #b8b8b2;
}

.day__guided--rearrange .day__food-item--comment,
.day__guided--rearrange .day__food-item--divider {
  background: #f0efeb;
  border: none;
  border-bottom: 1px solid #ddd9d2;
  border-radius: 0;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.day__guided--rearrange .day__food-item-divider-line {
  border-top-color: #3d6b9e;
}

.day__food-item--unmatched .day__food-item-name {
  color: #5c4a2e;
}

.day__food-item-unmatched-hint {
  display: inline;
  font-size: 0.68em;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #9a7a4a;
  opacity: 0.9;
}

.day__food-item-servings {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex: 0 0 auto;
  margin-top: 0.05rem;
}

.day__food-item-servings-input {
  width: 2.6rem;
  height: 1.6rem;
  padding: 0;
  border: 1px solid #c8c8c4;
  border-radius: 4px;
  background: #fff;
  color: #1a1a1a;
  font: inherit;
  font-size: 0.55rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.add-food-modal__servings-input {
  width: 2.6rem;
  height: 1.4rem;
  padding: 0 0.2rem;
  border: 1px solid #c8c8c4;
  border-radius: 4px;
  background: #fff;
  color: #1a1a1a;
  font: inherit;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

input[type="number"]::-webkit-inner-spin-button {
  height: 30px;
}

/* Always show servings count; edit chrome on hover/focus/active */
.day__food-item-servings-input {
  border-color: transparent;
  background: #f3f3f0;
  border-radius: 4px;
  pointer-events: none;
  cursor: default;
  font-weight: 600;
  color: #444;
}

.day__food-item-servings-input--visible,
.day__food-item .day__food-item-servings-input {
  opacity: 1;
}

.day__food-item-edit,
.day__food-item-remove {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0;
  height: 1.35rem;
  padding: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #8a8a86;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.day__food-item:hover .day__food-item-servings-input,
.day__food-item:focus-within .day__food-item-servings-input,
.day__food-item--active .day__food-item-servings-input {
  border-color: #c8c8c4;
  background: #fff;
  pointer-events: auto;
  cursor: text;
}

.day__food-item:hover .day__food-item-edit,
.day__food-item:focus-within .day__food-item-edit,
.day__food-item--active .day__food-item-edit,
.day__food-item:hover .day__food-item-remove,
.day__food-item:focus-within .day__food-item-remove,
.day__food-item--active .day__food-item-remove {
  width: 1.35rem;
  opacity: 1;
  pointer-events: auto;
}

.day__food-item-edit:hover {
  background: rgba(61, 107, 158, 0.1);
  color: #3d6b9e;
}

.day__food-item-edit-icon {
  display: block;
  width: 0.85rem;
  height: 0.85rem;
}

.day__food-item-remove:hover {
  background: rgba(122, 74, 74, 0.08);
  color: #7a4a4a;
}

.day__food-item-remove--holding {
  width: 1.35rem;
  opacity: 1;
  pointer-events: auto;
  background: rgba(122, 74, 74, 0.16);
  color: #7a4a4a;
}

.day__food-item-remove--on,
.day__food-item-remove[aria-pressed="true"] {
  width: 1.35rem;
  opacity: 1;
  pointer-events: auto;
  background: #7a4a4a;
  color: #fff;
}

.day__food-item-remove--on:hover,
.day__food-item-remove[aria-pressed="true"]:hover,
.day__food-item-remove--on:focus-visible,
.day__food-item-remove[aria-pressed="true"]:focus-visible {
  background: #633c3c;
  color: #fff;
}

.day__guided--remove-select .day__food-item-edit,
.day__guided--remove-select .day__food-item-remove {
  width: 1.35rem;
  opacity: 1;
  pointer-events: auto;
}

.day__guided--remove-select .day__food-item--remove-selected,
.day__guided--remove-select .day__food-item--food.day__food-item--remove-selected,
.day__guided--remove-select .day__food-item--comment.day__food-item--remove-selected,
.day__guided--remove-select .day__food-item--divider.day__food-item--remove-selected,
.day__guided--remove-select .day__food-item--unmatched.day__food-item--remove-selected {
  background: #f8eeee;
  box-shadow: inset 3px 0 0 #7a4a4a;
}

.add-food-modal__servings-input {
  width: 3.1rem;
  border-color: #c8c8c4;
  background: #fff;
  pointer-events: auto;
  cursor: text;
}

.day__guided-empty {
  margin: 0;
  padding: 1.5rem 0.85rem;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #8a8a86;
}

.day__guided-empty[hidden] {
  display: none;
}

.day__guided-footer {
  flex: 0 0 auto;
  padding: 0.45rem 0.5rem 0.5rem;
  border-top: 1px solid #ddd9d2;
  background: #f3f2ee;
}

.day__guided-footer-main[hidden] {
  display: none;
}

.day__add-food {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.05rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #3d6b9e;
  border-radius: 5px;
  background: #eef4fa;
  color: #2a4a6e;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.day__add-food:hover:not(:disabled) {
  background: #dde8f4;
  border-color: #2a4a6e;
  border-style: solid;
}

.day__add-food:disabled {
  background: #e6e6e2;
  border-color: #c8c8c4;
  border-style: solid;
  color: #8a8a86;
  cursor: not-allowed;
  opacity: 0.72;
}

.day__duplicate-food {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.05rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #3d6b9e;
  border-radius: 5px;
  background: #eef4fa;
  color: #2a4a6e;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.day__duplicate-food:hover {
  background: #dde8f4;
  border-color: #2a4a6e;
}

.day__add-food[hidden],
.day__duplicate-food[hidden] {
  display: none;
}

.day__guided-footer-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.day__guided-others {
  position: relative;
  margin-top: 0;
  min-width: 0;
}

.day__add-others {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 1.75rem;
  padding: 0.25rem 0.35rem;
  border: 1px solid #c8c8c4;
  border-radius: 5px;
  background: #fff;
  color: #5c5c5c;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.day__add-others:hover,
.day__add-others[aria-expanded="true"] {
  background: #f3f3f0;
  border-color: #b0b0aa;
  color: #333;
}

.day__guided-rearrange {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 1.75rem;
  margin-top: 0;
  padding: 0.25rem 0.35rem;
  border: 1px solid #c8c8c4;
  border-radius: 5px;
  background: #fff;
  color: #5c5c5c;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.day__guided-rearrange:hover,
.day__guided-rearrange--on,
.day__guided-rearrange[aria-pressed="true"] {
  background: #eef4fa;
  border-color: #3d6b9e;
  color: #3d6b9e;
}

.day__guided-footer-remove-select {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.day__guided-footer-remove-select[hidden] {
  display: none;
}

.day__guided-remove-confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.05rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid #7a4a4a;
  border-radius: 5px;
  background: #7a4a4a;
  color: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.day__guided-remove-confirm:hover:not(:disabled) {
  background: #633c3c;
  border-color: #633c3c;
  color: #fff;
}

.day__guided-remove-confirm:focus-visible {
  outline: 2px solid #7a4a4a;
  outline-offset: 2px;
}

.day__guided-remove-confirm:disabled {
  background: #c4b0b0;
  border-color: #c4b0b0;
  color: #f7f1f1;
  cursor: not-allowed;
  box-shadow: none;
}

.day__guided-remove-cancel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 1.85rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid #c8c8c4;
  border-radius: 5px;
  background: #fff;
  color: #5c5c5c;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.day__guided-remove-cancel:hover {
  background: #f3f3f0;
  border-color: #b0b0aa;
  color: #333;
}

.day__food-item-drag {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #8a8a86;
  cursor: grab;
  touch-action: none;
}

.day__guided--rearrange .day__food-item-drag {
  display: inline-flex;
}

.day__food-item-drag:hover {
  background: #eef4fa;
  border-color: #c8d6e6;
  color: #3d6b9e;
}

.day__food-item-drag:active {
  cursor: grabbing;
}

.day__food-item-drag[aria-pressed="true"] {
  background: #3d6b9e;
  border-color: #3d6b9e;
  color: #fff;
}

.day__food-item-drag[aria-pressed="true"]:hover,
.day__food-item-drag[aria-pressed="true"]:focus-visible {
  background: #335c88;
  border-color: #335c88;
  color: #fff;
}

.day__food-item-drag-icon {
  display: block;
  width: 0.85rem;
  height: 0.85rem;
  fill: currentColor;
}

.day__guided--rearrange .day__food-item--selected,
.day__guided--rearrange .day__food-item--food.day__food-item--selected,
.day__guided--rearrange .day__food-item--comment.day__food-item--selected,
.day__guided--rearrange .day__food-item--divider.day__food-item--selected,
.day__guided--rearrange .day__food-item--unmatched.day__food-item--selected {
  background: #e4eef8;
  box-shadow: inset 3px 0 0 #3d6b9e;
}

.day__food-item--dragging {
  opacity: 0.45;
}

.day__food-item--drag-ghost {
  z-index: 0;
  background: #fff;
  border: 1px solid #c8d6e6;
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  opacity: 1;
}

.day__food-item-drag-count {
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #3d6b9e;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

.day__food-item--drop-before,
.day__food-item--drop-after {
  position: relative;
}

.day__food-item--drop-before::before,
.day__food-item--drop-after::after,
.day__food-list--drop-end::after {
  content: "";
  position: absolute;
  left: 0.25rem;
  right: 0.25rem;
  height: 3px;
  border-radius: 2px;
  background: #3d6b9e;
  box-shadow: 0 0 0 2px rgba(61, 107, 158, 0.2);
  pointer-events: none;
  z-index: 2;
}

.day__food-item--drop-before::before {
  top: -2px;
}

.day__food-item--drop-after::after {
  bottom: -2px;
}

.day__food-list--drop-end::after {
  bottom: 0.15rem;
}

.day__guided--drop-target {
  box-shadow: inset 0 0 0 2px rgba(61, 107, 158, 0.35);
}

.day__guided--drop-target .day__food-list {
  min-height: 2.25rem;
}

.day__guided--rearrange .day__food-item {
  cursor: default;
}

.day__guided-others-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.2rem);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.25rem;
  border: 1px solid #c8c8c4;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.day__guided-others-menu[hidden] {
  display: none;
}

.day__guided-others-menu button {
  display: block;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #333;
  font: inherit;
  font-size: 0.72rem;
  text-align: left;
  cursor: pointer;
}

.day__guided-others-menu button:hover {
  background: #eef4fa;
  color: #3d6b9e;
}

.add-food-submit-split {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}

.add-food-submit-split > .add-food-submit-split__action.modal__done {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  padding-right: 0.85rem;
}

.add-food-submit-split > .add-food-submit-split__chevron.modal__done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  min-width: 1.75rem;
  padding: 0.5rem 0;
  margin-left: -1px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left-color: rgba(255, 255, 255, 0.32);
}

.add-food-submit-split > .add-food-submit-split__chevron.modal__done:hover,
.add-food-submit-split > .add-food-submit-split__chevron.modal__done:focus-visible {
  border-left-color: rgba(255, 255, 255, 0.45);
}

.add-food-submit-split__chevron-mark {
  display: block;
  width: 0.72rem;
  height: 0.72rem;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.add-food-submit-split__chevron[aria-expanded="true"] .add-food-submit-split__chevron-mark {
  transform: rotate(180deg);
}

.add-food-submit-split .modal__done:disabled {
  opacity: 0.55;
  cursor: default;
}

.add-food-submit-split--locked > .add-food-submit-split__action.modal__done {
  border-radius: 4px;
  padding-right: 1rem;
}

.add-food-submit-split--locked .add-food-submit-split__chevron,
.add-food-submit-split--locked .add-food-submit-split__menu {
  display: none;
}

.add-food-submit-split__menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.3rem);
  z-index: 2;
  min-width: 10.5rem;
  padding: 0.25rem;
  border: 1px solid #c8c8c4;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(26, 26, 26, 0.12);
}

.add-food-submit-split__menu[hidden] {
  display: none;
}

.add-food-submit-split__menu button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #1a1a1a;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.add-food-submit-split__menu button:hover,
.add-food-submit-split__menu button:focus-visible {
  background: #e8eef4;
}

.add-food-submit-split__menu button[aria-checked="true"] {
  color: #2a4a6e;
}

.add-food-submit-split__menu button[aria-checked="true"]::after {
  content: " ✓";
  font-weight: 700;
}

#add-food-meal-picker-modal {
  z-index: 110;
}

.add-food-meal-picker__body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.add-food-meal-picker__list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: min(40vh, 16rem);
  overflow-y: auto;
}

.add-food-meal-picker__meal {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid #d8d8d4;
  border-radius: 6px;
  background: #fafaf8;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.add-food-meal-picker__meal:hover,
.add-food-meal-picker__meal:focus-visible {
  border-color: #9eb4cc;
  background: #eef4fa;
}

.add-food-meal-picker__meal-name {
  font-weight: 600;
}

.add-food-meal-picker__meal-meta {
  font-size: 0.78rem;
  color: #5c5c5c;
}

.add-food-meal-picker__empty {
  margin: 0;
  font-size: 0.85rem;
  color: #5c5c5c;
}

.add-food-meal-picker__open-all {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2a5a8a;
  text-decoration: underline;
  text-decoration-color: rgba(42, 90, 138, 0.35);
  text-underline-offset: 0.12em;
  cursor: pointer;
}

.add-food-meal-picker__open-all:hover {
  color: #1a4570;
  text-decoration-color: currentColor;
}

.add-food-modal__body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
}

#add-food-modal {
  overflow: auto;
}

.add-food-modal__stage {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  max-width: 100%;
}

#add-food-modal .modal__panel {
  flex: 0 1 36rem;
  width: 36rem;
  max-width: 100%;
  height: min(90vh, 42rem);
}

#add-food-modal .add-food-modal__body {
  overflow: hidden;
}

#add-food-modal .import-json-wrap,
#add-food-modal .add-food-modal__pagination,
#add-food-modal .add-food-modal__empty,
#add-food-modal .add-food-modal__selected,
#add-food-modal .import-modal__error {
  flex: 0 0 auto;
}

.add-food-modal__search {
  position: relative;
}

.add-food-modal__search-input {
  padding-right: 2rem;
}

.add-food-modal__search-clear {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #888;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.add-food-modal__search-clear[hidden] {
  display: none;
}

.add-food-modal__search-clear:hover,
.add-food-modal__search-clear:focus-visible {
  background: #fce8e8;
  color: #b42318;
}

.add-food-modal__search-clear:focus-visible {
  outline: 2px solid #4a7fd4;
  outline-offset: 1px;
}

.add-food-modal__results {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #ececea;
  border-radius: 6px;
  background: #fff;
  scrollbar-width: thin;
}

.add-food-modal__results:empty {
  display: block;
}

.add-food-modal__pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.add-food-modal__pagination[hidden] {
  display: none;
}

.add-food-modal__page-btn {
  flex: 0 0 auto;
  min-height: 1.85rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid #c8c8c4;
  border-radius: 5px;
  background: #fff;
  color: #3d6b9e;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.add-food-modal__page-btn:hover:not(:disabled) {
  background: #eef4fa;
  border-color: #3d6b9e;
}

.add-food-modal__page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.add-food-modal__page-status {
  flex: 1 1 auto;
  text-align: center;
  font-size: 0.72rem;
  color: #5c5c5c;
}

.add-food-modal__result {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: none;
  border-bottom: 1px solid #ececea;
  border-radius: 0;
  background: transparent;
  color: #1a1a1a;
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
}

.add-food-modal__result:last-child {
  border-bottom: none;
}

.add-food-modal__result:hover,
.add-food-modal__result--selected {
  background: #eef4fa;
  color: #2f5680;
}

.add-food-modal__empty {
  margin: 0;
  padding: 0.75rem 0.25rem;
  font-size: 0.8rem;
  color: #5c5c5c;
  line-height: 1.4;
}

.add-food-modal__selected {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #c8d6e6;
  border-radius: 6px;
  background: #f5f8fb;
}

.add-food-modal__selected[hidden] {
  display: none;
}

.add-food-modal__selected-label {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5c5c5c;
}

.add-food-modal__selected-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: 12rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.add-food-modal__selected-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.45rem 0 0.55rem;
  border-bottom: 1px solid #dce6f0;
}

.add-food-modal__selected-item:first-child {
  padding-top: 0.1rem;
}

.add-food-modal__selected-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.add-food-modal__selected-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.add-food-modal__selected-drag {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #73869a;
  font: 700 1rem/1 sans-serif;
  letter-spacing: -0.18rem;
  cursor: grab;
}

.add-food-modal__selected-drag:hover,
.add-food-modal__selected-drag:focus-visible {
  background: #e4edf6;
  color: #2f5680;
}

.add-food-modal__selected-drag:active {
  cursor: grabbing;
}

.add-food-modal__selected-item:only-child .add-food-modal__selected-drag,
.add-food-modal__selected-item:only-child .add-food-modal__selected-order {
  display: none;
}

.add-food-modal__selected-order {
  display: inline-flex;
  gap: 0.15rem;
  margin-left: auto;
}

.add-food-modal__selected-order button {
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border: 1px solid #c8d6e6;
  border-radius: 4px;
  background: #fff;
  color: #426789;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.add-food-modal__selected-order button:hover:not(:disabled) {
  background: #e4edf6;
}

.add-food-modal__selected-order button:disabled {
  opacity: 0.35;
  cursor: default;
}

.add-food-modal__selected-item--dragging {
  opacity: 0.5;
}

.add-food-modal__selected-item--drop-before {
  box-shadow: inset 0 2px 0 #4779aa;
}

.add-food-modal__selected-item--drop-after {
  box-shadow: inset 0 -2px 0 #4779aa;
}

.add-food-modal__selected-name {
  flex: 1 1 auto;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.add-food-modal__selected-remove {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  margin: -0.1rem -0.15rem 0 0;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #8a8a86;
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.add-food-modal__selected-remove:hover {
  background: rgba(122, 74, 74, 0.08);
  color: #7a4a4a;
}

.add-food-modal__servings {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.add-food-modal__servings-controls {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.add-food-modal__servings-steps {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  height: 1.4rem;
}

.add-food-modal__servings-step {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #c5d4e6;
  border-radius: 6px;
  background: #fff;
}

.add-food-modal__servings-step-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  padding: 0 0.28rem;
  border-left: 1px solid #dce6f0;
  border-right: 1px solid #dce6f0;
  background: #f5f8fb;
  color: #3d6b9e;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1;
}

.add-food-modal__servings-nudge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  /* min-height: 1.55rem; */
  padding: 0;
  border: none;
  border-radius: 0;
  background: #fff;
  color: #3d6b9e;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.add-food-modal__servings-nudge:hover:not(:disabled) {
  background: #eef4fa;
}

.add-food-modal__servings-nudge:disabled {
  opacity: 0.35;
  cursor: default;
}

.add-food-modal__footer-start {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.add-food-modal__calc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2a5a8a;
  text-decoration: underline;
  text-decoration-color: rgba(42, 90, 138, 0.35);
  text-underline-offset: 0.12em;
  cursor: pointer;
}

.add-food-modal__calc-toggle[hidden] {
  display: none;
}

.add-food-modal__calc-toggle:hover,
.add-food-modal__calc-toggle:focus-visible {
  color: #1a4570;
  text-decoration-color: currentColor;
}

.add-food-modal__calc-toggle:focus-visible {
  outline: 2px solid #4a7fd4;
  outline-offset: 2px;
  border-radius: 2px;
}

.add-food-modal__calc-toggle[aria-expanded="true"] {
  color: #1a4570;
  text-decoration-color: currentColor;
}

.add-food-modal__calc-toggle-icon {
  display: block;
  flex-shrink: 0;
  fill: currentColor;
}

.add-food-calc {
  flex: 0 0 auto;
  width: 0;
  margin-left: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: width 0.22s ease, margin-left 0.22s ease, opacity 0.18s ease;
}

.add-food-modal--calc-open .add-food-calc {
  width: 16rem;
  margin-left: 0.85rem;
  opacity: 1;
  pointer-events: auto;
}

.add-food-calc__window {
  box-sizing: border-box;
  width: 16rem;
  padding: 0 0.55rem 0.55rem;
  border-radius: 12px;
  background: #1c1c1e;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  color: #f5f5f7;
  user-select: none;
}

.add-food-calc__titlebar {
  display: flex;
  align-items: center;
  height: 1.7rem;
  padding: 0.15rem 0.05rem 0;
}

.add-food-calc__close {
  position: relative;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.add-food-calc__close::after {
  content: "×";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(80, 20, 16, 0.82);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
}

.add-food-calc__close:hover::after,
.add-food-calc__close:focus-visible::after {
  opacity: 1;
}

.add-food-calc__close:focus-visible {
  outline: 2px solid #7ab0ff;
  outline-offset: 2px;
}

.add-food-calc__display-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: 4.15rem;
  padding: 0.15rem 0.45rem 0.55rem;
}

.add-food-calc__display {
  display: block;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #f5f5f7;
  font-family: system-ui, -apple-system, "SF Pro Display", "Segoe UI", sans-serif;
  font-size: 2.55rem;
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
  user-select: text;
  cursor: text;
}

.add-food-calc__display--long {
  font-size: 2.05rem;
}

.add-food-calc__display--xl {
  font-size: 1.55rem;
}

.add-food-calc__pad {
  display: grid;
  grid-template-columns: repeat(4, 3.35rem);
  grid-template-rows: repeat(5, 3.35rem);
  gap: 0.42rem;
  justify-content: center;
}

.add-food-calc__key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #636366;
  color: #f5f5f7;
  font-family: inherit;
  font-size: 1.28rem;
  font-weight: 400;
  line-height: 1;
  touch-action: manipulation;
  cursor: pointer;
}

.add-food-calc__key:hover {
  background: #747478;
}

.add-food-calc__key:active {
  background: #8e8e93;
}

.add-food-calc__key:focus-visible {
  outline: 2px solid #7ab0ff;
  outline-offset: 2px;
}

.add-food-calc__key--fn {
  background: #5a5a5e;
  font-size: 1.05rem;
}

.add-food-calc__key--fn:hover {
  background: #6c6c70;
}

.add-food-calc__key--fn:active {
  background: #84848a;
}

.add-food-calc__key--op {
  background: #ff9f0a;
  font-size: 1.45rem;
  font-weight: 500;
}

.add-food-calc__key--op:hover {
  background: #ffb340;
}

.add-food-calc__key--op:active {
  background: #ffc36b;
}

.add-food-calc__key--op.is-active {
  background: #f5f5f7;
  color: #ff9f0a;
}

.add-food-calc__key--zero {
  grid-column: span 2;
  width: 100%;
  border-radius: 1.7rem;
  justify-content: flex-start;
  padding-left: 1.18rem;
}

@media (max-width: 54rem) {
  #add-food-modal.add-food-modal--calc-open .add-food-modal__stage {
    flex-direction: column;
    align-items: center;
    max-height: 100%;
    overflow: auto;
  }

  #add-food-modal.add-food-modal--calc-open .modal__panel {
    flex: 0 1 auto;
    width: min(36rem, 100%);
    height: min(calc(90vh - 19rem), 42rem);
  }

  .add-food-modal--calc-open .add-food-calc {
    width: 16rem;
    margin-left: 0;
    margin-top: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .add-food-calc {
    transition: none;
  }
}

.day__editor:focus-within {
  outline: 2px solid #3d6b9e;
  outline-offset: 1px;
  border-color: #3d6b9e;
}

.day__backdrop {
  position: absolute;
  inset: 0;
  padding: 0.65rem 0.75rem;
  overflow: hidden;
  pointer-events: none;
  font: inherit;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  color: #1a1a1a;
}

body.day-word-wrap-off .day__backdrop {
  white-space: pre;
  word-wrap: normal;
  overflow-wrap: normal;
}

.day__editor--viewing .day__backdrop {
  z-index: 1;
  pointer-events: auto;
  cursor: text;
}

.day--line-select .day__input,
.day--line-select .day__editor--viewing .day__backdrop {
  cursor: pointer;
}

.day__editor--editing .day__backdrop,
.day__editor--plain .day__backdrop {
  /* opacity (not visibility) so caret rect measurement still works while editing */
  opacity: 0;
  pointer-events: none;
}

.day__editor--viewing .day__input {
  opacity: 0;
  caret-color: transparent;
}

.day__backdrop mark.hl:not(.hl--multiplier):nth-of-type(odd) {
  background: #ffd966;
  color: #5c3d00;
  border-radius: 2px;
  padding: 0;
  margin: 0;
  line-height: inherit;
}

.day__backdrop mark.hl:not(.hl--multiplier):nth-of-type(even) {
  background: #fff0b3;
  color: #5c3d00;
  border-radius: 2px;
  padding: 0;
  margin: 0;
  line-height: inherit;
}

.day__backdrop .hl--multiplier {
  background: #d8d8d4;
  color: #444;
  border-radius: 2px;
  padding: 0;
  margin: 0;
  line-height: inherit;
}

.day__backdrop .day__line-comment {
  color: #8a8a86;
  font-style: italic;
}

.day__backdrop-placeholder {
  color: #9a9a96;
}

.day__input {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0.65rem 0.75rem;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #1a1a1a;
  caret-color: #1a1a1a;
  font: inherit;
  line-height: 1.5;
  resize: none;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  -webkit-appearance: none;
  appearance: none;
}

body.day-word-wrap-off .day__input {
  white-space: pre;
  word-wrap: normal;
  overflow-wrap: normal;
  overflow-x: auto;
}

.day__input::placeholder {
  color: #9a9a96;
}

.day__input::selection {
  background: rgba(61, 107, 158, 0.35);
}

.day__suggest {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  height: auto;
  bottom: auto;
  padding: 0 0.75rem 0.65rem;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid #c8c8c4;
  pointer-events: auto;
}

.day__suggest--above {
  border-top: none;
  border-bottom: 1px solid #c8c8c4;
  padding: 0.65rem 0.75rem 0;
}

.day__suggest--above .day__suggest-list {
  flex: 1 1 auto;
}

.day__suggest--tip .day__suggest-list {
  flex: 0 0 auto;
  overflow-y: visible;
}

.day__suggest-header {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  padding-top: 0.35rem;
  padding-bottom: 0.25rem;
}

.day__suggest-list {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.day__suggest[hidden] {
  display: none;
}

.day__suggest-dismiss {
  margin: 0;
  padding: 0.2rem 0.55rem;
  border: 1px solid #c8c8c4;
  border-radius: 999px;
  background: #f5f5f3;
  box-shadow: 0 1px 4px rgba(26, 26, 26, 0.08);
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.35;
  color: #666;
  cursor: pointer;
}

.day__suggest-dismiss:hover {
  background: #ececea;
  border-color: #b0b0aa;
  color: #444;
}

.day__suggest-item {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.35rem 0;
  width: 100%;
  max-width: 100%;
  border: none;
  border-bottom: 1px solid #ececea;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.35;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  color: #444;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

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

.day__suggest-item-viewport {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.day__suggest-item-label {
  display: block;
  box-sizing: border-box;
  white-space: nowrap;
}

.day__suggest-item:not(.day__suggest-item--scrollable):not(.day__suggest-item--fitted)
  .day__suggest-item-label {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.day__suggest-item--fitted:not(.day__suggest-item--scrollable) {
  width: max-content;
  max-width: 100%;
}

.day__suggest-item--scrollable {
  width: 100%;
  padding-inline: 0.15rem 0.35rem;
}

.day__suggest-item--scrollable .day__suggest-item-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.day__suggest-item--scrollable .day__suggest-item-viewport::-webkit-scrollbar {
  display: none;
}

.day__suggest-item-chevron {
  display: none;
  flex: 0 0 1.1rem;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  color: #3d6b9e;
  cursor: pointer;
  user-select: none;
}

.day__suggest-item--scrollable .day__suggest-item-chevron {
  display: flex;
}

.day__suggest-item-chevron:hover {
  background: rgba(61, 107, 158, 0.12);
}

.day__suggest-item-chevron--disabled {
  opacity: 0.35;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .day__suggest-item--scrollable .day__suggest-item-viewport {
    scroll-behavior: auto;
  }
}

.day__suggest-item:hover {
  background: #eef4fa;
}

.day__suggest-item--tip {
  color: #666;
  font-style: italic;
  cursor: pointer;
}

.day__suggest-item--tip .day__suggest-match {
  font-style: normal;
  font-weight: 600;
  color: #2f5680;
}

.day__suggest-item--tip:hover {
  background: #eef4fa;
}

.day__suggest-match {
  font-weight: 600;
  color: #2f5680;
}

.day__suggest-rest {
  color: #555;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.keywords {
  margin-top: 1.5rem;
}

.keywords[hidden] {
  display: none;
}

.keywords--sheet {
  margin: 0;
  min-height: 0;
}

.app-sheet__panel.keywords-sheet__panel {
  padding: 0;
}

.app-sheet__panel.keywords-sheet__panel .app-sheet__body {
  padding: 0.75rem 1rem 1rem;
}

.keywords-sheet__panel .keywords__header {
  margin-bottom: 0.55rem;
}

.app-sheet__panel.meals-sheet__panel {
  padding: 0;
}

.app-sheet__panel.meals-sheet__panel .app-sheet__body {
  padding: 0.75rem 1rem 1rem;
}

.meals--sheet {
  margin: 0;
  min-height: 0;
}

.meals--sheet .keywords__hint {
  margin-bottom: 0.85rem;
}

.meals__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.85rem;
}

.meals__filter-controls {
  flex: 1 1 12rem;
  max-width: 24rem;
}

.meals__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.meals__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: start;
  padding: 0.65rem 0.75rem;
  border: 1px solid #d8d8d4;
  border-radius: 6px;
  background: #fafaf8;
}

.meals__row-main {
  min-width: 0;
}

.meals__open {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.meals__open:hover .meals__row-name,
.meals__open:focus-visible .meals__row-name {
  color: #2f5680;
}

.meals__row-name {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
}

.meals__row-meta {
  font-size: 0.75rem;
  color: #6a6a66;
  line-height: 1.3;
}

.meals__row-foods {
  margin-top: 0.1rem;
  font-size: 0.78rem;
  color: #4a4a46;
  line-height: 1.35;
}

.meals__row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: flex-end;
}

.meals__text-btn {
  min-height: 1.85rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid #c8c8c4;
  border-radius: 5px;
  background: #fff;
  color: #3d6b9e;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.meals__text-btn:hover {
  background: #eef4fa;
}

.meals__text-btn--danger {
  color: #7a4a4a;
}

.meals__text-btn--danger:hover {
  background: #faf2f2;
  border-color: #d0a8a8;
}

.meals__detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin-bottom: 0.55rem;
}

.meals__back {
  min-height: 1.85rem;
  padding: 0.2rem 0.15rem;
  border: 0;
  background: transparent;
  color: #3d6b9e;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.meals__back:hover {
  text-decoration: underline;
}

.meals__detail-name {
  margin: 0;
  flex: 1 1 10rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.meals__detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.meals__detail-hint {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  color: #5c5c5c;
}

.meals__foods {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.meals__food {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.4rem;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border: 1px solid #d8d8d4;
  border-radius: 6px;
  background: #fff;
}

.meals__food-order {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
}

.meals__food-order button {
  min-width: 1.6rem;
  min-height: 1.35rem;
  padding: 0;
  border: 1px solid #c8c8c4;
  border-radius: 4px;
  background: #f8f8f6;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.meals__food-order button:disabled {
  opacity: 0.4;
  cursor: default;
}

.meals__food-name {
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
}

.meals__food-name--missing {
  color: #7a4a4a;
}

.meals__food-servings {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.meals__food-servings label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #5c5c5c;
}

.meals__food-servings input {
  width: 4.25rem;
  min-height: 1.75rem;
  padding: 0.15rem 0.35rem;
  border: 1px solid #c8c8c4;
  border-radius: 4px;
  font: inherit;
  font-size: 0.85rem;
}

.meals__food-remove {
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0;
  border: 1px solid #c8c8c4;
  border-radius: 4px;
  background: #f8f8f6;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.meals__food-remove:hover {
  background: #faf2f2;
  border-color: #d0a8a8;
  color: #7a4a4a;
}

.meals__detail-empty {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: #5c5c5c;
}

.meals__detail-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.add-food-modal__result-kind,
.day__suggest-kind {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1f5c53;
  background: #eef7f5;
  border-radius: 999px;
  vertical-align: 0.08em;
}

.add-food-modal__result--meal .add-food-modal__result-kind {
  flex: 0 0 auto;
}

.add-food-modal__result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.day__suggest-item--meal .day__suggest-kind {
  flex: 0 0 auto;
}

.demographic {
  margin-top: 1rem;
}

.demographic__details {
  border: 1px solid #c8c8c4;
  border-radius: 6px;
  background: #fff;
}

.demographic__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  list-style: none;
}

.demographic__summary::-webkit-details-marker {
  display: none;
}

.demographic__summary::before {
  content: "▸";
  margin-right: 0.35rem;
  font-size: 0.75rem;
  color: #5c5c5c;
  transition: transform 0.15s ease;
}

.demographic__details[open] .demographic__summary::before {
  transform: rotate(90deg);
}

.demographic__badge {
  font-size: 1.15rem;
  line-height: 1;
  color: #3d6b9e;
}

.demographic__body {
  padding: 0 0.75rem 0.75rem;
  border-top: 1px solid #e8e8e4;
}

.demographic__hint {
  margin: 0.6rem 0 0.65rem;
  font-size: 0.8rem;
  color: #5c5c5c;
}

.demographic__note {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #444;
  background: #f6f8fa;
  border-left: 3px solid #9eb4cc;
  border-radius: 0 4px 4px 0;
}

.demographic__note-lead {
  margin: 0 0 0.45rem;
}

.demographic__note-list {
  margin: 0;
  padding-left: 1.15rem;
}

.demographic__note-list li {
  margin-bottom: 0.35rem;
}

.demographic__note-list li:last-child {
  margin-bottom: 0;
}

.demographic__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.demographic__option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.875rem;
  border: 1px solid #c8c8c4;
  border-radius: 6px;
  background: #fafaf8;
  color: #1a1a1a;
  cursor: pointer;
}

.demographic__option:hover {
  border-color: #9eb4cc;
  background: #e8eef4;
}

.demographic__option--selected {
  border-color: #3d6b9e;
  background: #e8eef4;
  box-shadow: 0 0 0 1px #3d6b9e;
}

.demographic__option-icon {
  font-size: 1.1rem;
  line-height: 1;
  color: #3d6b9e;
}

.settings-modal__body {
  padding: 0 1rem 1rem;
  max-height: min(70vh, 32rem);
  overflow-y: auto;
}

.settings-modal__section + .settings-modal__section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e8e8e4;
}

.settings-modal__heading {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.settings-modal__hint {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: #5c5c5c;
}

.settings-modal__tdee-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}

.settings-modal__macro-split-row {
  margin-top: 0.85rem;
}

.settings-modal__macro-split-row .settings-modal__field {
  flex: 1 1 10rem;
  min-width: 9rem;
  max-width: 16rem;
}

.settings-modal__macro-split-row .settings-modal__select {
  min-width: 0;
}

.settings-modal__macro-split-row .settings-modal__select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #f5f5f2;
}

.settings-modal__macro-split-preview {
  margin: 0.5rem 0 0;
  display: grid;
  gap: 0.55rem;
}

.settings-modal__macro-split-preview-line {
  margin: 0;
  font-size: 0.8rem;
  color: #2a4a6e;
  font-weight: 600;
}

.settings-modal__protein-evidence {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.settings-modal__protein-evidence-tile {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.6rem;
  background: #f6f8fa;
  border: 1px solid #e2e8ef;
  border-radius: 8px;
  min-width: 0;
}

.settings-modal__protein-evidence-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5a6f86;
}

.settings-modal__protein-evidence-rate {
  font-size: 0.72rem;
  color: #6a6a66;
  line-height: 1.3;
}

.settings-modal__protein-evidence-val {
  margin-top: 0.15rem;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #1a1a1a;
  letter-spacing: -0.02em;
}

.settings-modal__protein-evidence-val--tip {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.35;
  font-variant-numeric: normal;
}

.settings-modal__max-hr-trigger {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: none;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline dotted rgba(106, 106, 102, 0.55);
  text-underline-offset: 0.14em;
}

.settings-modal__max-hr-trigger:hover,
.settings-modal__max-hr-trigger:focus-visible,
.settings-modal__max-hr-trigger[aria-expanded="true"] {
  color: #555;
  text-decoration-color: rgba(85, 85, 85, 0.75);
}

.settings-modal__max-hr-trigger:focus-visible {
  outline: 2px solid #9eb4cc;
  outline-offset: 2px;
}

.settings-modal__max-hr-popover {
  position: fixed;
  z-index: 130;
  min-width: 14rem;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.65rem 0.75rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #444;
  background: #fff;
  border: 1px solid #d8dce2;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.settings-modal__max-hr-popover[hidden] {
  display: none;
}

.settings-modal__max-hr-popover-copy {
  margin: 0;
}

.settings-modal__max-hr-popover-copy + .settings-modal__max-hr-popover-copy {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #ecece8;
}

.settings-modal__protein-evidence-error {
  margin: 0.15rem 0 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: #2a4a6e;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  cursor: pointer;
  text-align: left;
}

.settings-modal__protein-evidence-error:hover,
.settings-modal__protein-evidence-error:focus-visible {
  color: #1a3350;
}

@media (max-width: 560px) {
  .settings-modal__protein-evidence {
    grid-template-columns: 1fr;
  }
}

.settings-modal__field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 8rem;
}

.settings-modal__field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #444;
}

.settings-modal__input,
.settings-modal__select {
  width: 100%;
  min-width: 8rem;
  padding: 0.4rem 0.5rem;
  font: inherit;
  font-size: 0.875rem;
  border: 1px solid #c8c8c4;
  border-radius: 6px;
  background: #fff;
}

.settings-modal__input:focus,
.settings-modal__select:focus {
  outline: none;
  border-color: #3d6b9e;
  box-shadow: 0 0 0 2px rgba(61, 107, 158, 0.15);
}

.settings-modal__calc-link {
  padding: 0.4rem 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: #3d6b9e;
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.settings-modal__calc-link:hover {
  color: #2a4a6e;
}

.tdee-calc__body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0 1rem 1rem;
  max-height: min(70vh, 36rem);
  overflow-y: auto;
}

.tdee-calc__fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.tdee-calc__legend {
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #444;
}

.tdee-calc__unit-group {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
}

.tdee-calc__unit-toggle {
  display: inline-flex;
  border: 1px solid #c8c8c4;
  border-radius: 6px;
  overflow: hidden;
}

.tdee-calc__unit-btn {
  padding: 0.4rem 0.65rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  border: 0;
  background: #fafaf8;
  color: #5c5c5c;
  cursor: pointer;
}

.tdee-calc__unit-btn + .tdee-calc__unit-btn {
  border-left: 1px solid #c8c8c4;
}

.tdee-calc__unit-btn--active {
  background: #e8eef4;
  color: #2a4a6e;
}

.tdee-calc__ft-in {
  display: flex;
  gap: 0.65rem;
}

.tdee-calc__activity-block {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tdee-calc__mode-toggle {
  display: inline-flex;
  align-self: flex-start;
  border: 1px solid #c8c8c4;
  border-radius: 6px;
  overflow: hidden;
}

.tdee-calc__sets-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.tdee-calc__hint {
  margin: 0;
  font-size: 0.72rem;
  color: #6a6a6a;
  line-height: 1.35;
}

.tdee-calc__intensity-helpers {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.4rem;
}

.tdee-calc__helper-link {
  padding: 0;
  font: inherit;
  font-size: inherit;
  font-weight: 600;
  color: #3d6b9e;
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tdee-calc__helper-link:hover {
  color: #2a4a6e;
}

.tdee-calc__helper-sep {
  color: #9aa3ad;
}

.tdee-hr-zones__steps {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #333;
}

.tdee-hr-zones__steps li {
  margin-bottom: 0.35rem;
}

.tdee-hr-zones__steps li:last-child {
  margin-bottom: 0;
}

.tdee-hr-zones__inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 0 0.75rem;
}

.tdee-hr-zones__status {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #444;
  min-height: 1.45em;
}

.tdee-hr-zones__note {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: #666;
}

.tdee-hr-zones__table tbody tr.tdee-hr-zones__row--match td {
  background: #e8f1fb;
}

.tdee-hr-zones__table tbody tr.tdee-hr-zones__row--match {
  outline: 2px solid #3d6b9e;
  outline-offset: -2px;
}

@media (max-width: 640px) {
  .tdee-hr-zones__inputs {
    grid-template-columns: 1fr;
  }
}

.tdee-calc__check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  cursor: pointer;
}

.tdee-calc__check input {
  margin: 0;
}

.tdee-calc__cardio-details {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tdee-calc__cardio-details--disabled {
  opacity: 0.42;
  filter: grayscale(0.35);
  pointer-events: none;
  user-select: none;
}

.tdee-calc__cardio-rows {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tdee-calc__cardio-row {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid #c5d3e0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.55);
}

.tdee-calc__cardio-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.tdee-calc__cardio-row-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #2a4a6e;
}

.tdee-calc__cardio-remove {
  margin: 0;
  padding: 0.15rem 0.45rem;
  border: 1px solid #c5a8a0;
  border-radius: 4px;
  background: #f7ece9;
  color: #8a3b2a;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.tdee-calc__cardio-remove:hover {
  background: #f0ddd7;
}

.tdee-calc__cardio-add {
  align-self: flex-start;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border: 1px dashed #9eb4cc;
  border-radius: 4px;
  background: transparent;
  color: #2a4a6e;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.tdee-calc__cardio-add:hover {
  background: rgba(255, 255, 255, 0.55);
  border-style: solid;
}

.tdee-calc__footer-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.tdee-calc__activity-factor {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #5c5c5c;
}

.tdee-calc__result {
  margin-top: 0.25rem;
  padding: 0.75rem;
  text-align: center;
  border: 1px solid #9eb4cc;
  border-radius: 6px;
  background: #e8eef4;
}

.tdee-calc__result-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #2a4a6e;
}

.tdee-calc__result-value {
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #1a1a1a;
}

.keywords__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.keywords__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.keywords__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.keywords__hint {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  color: #5c5c5c;
  font-size: 0.8rem;
}

.keywords__toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.5rem;
  flex: 0 0 auto;
  margin-left: auto;
}

.keywords__filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.keywords__filter-label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #444;
}

.keywords__filter-controls {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 1 1 12rem;
  min-width: 0;
  max-width: 24rem;
}

.keywords__filter-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 1.85rem 0.35rem 0.55rem;
  border: 1px solid #c8c8c4;
  border-radius: 4px;
  background: #fff;
  color: inherit;
}

/* Hide native search clear; custom #keywords-search-clear is used instead. */
.keywords__filter-input::-webkit-search-decoration,
.keywords__filter-input::-webkit-search-cancel-button,
.keywords__filter-input::-webkit-search-results-button,
.keywords__filter-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.keywords__filter-input:focus-visible {
  outline: 2px solid #4a7fd4;
  outline-offset: 1px;
}

.keywords__filter-clear {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #888;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.keywords__filter-clear[hidden] {
  display: none;
}

.keywords__filter-clear:hover,
.keywords__filter-clear:focus-visible {
  background: #fce8e8;
  color: #b42318;
}

.keywords__filter-clear:focus-visible {
  outline: 2px solid #4a7fd4;
  outline-offset: 1px;
}

.keywords__category-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.keywords__category-open {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border: 1px solid #c8c8c4;
  border-radius: 5px;
  background: #f4f4f2;
  color: #333;
  cursor: pointer;
}

.keywords__category-open:hover,
.keywords__category-open:focus-visible {
  background: #ebebe8;
  border-color: #b0b0aa;
}

.keywords__category-open:focus-visible {
  outline: 2px solid #4a7fd4;
  outline-offset: 1px;
}

.keywords__category-open--active {
  background: #e8f0fc;
  border-color: #8eb0e0;
  color: #1f4f9c;
}

.keywords__category-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 14rem;
  padding: 0.2rem 0.25rem 0.2rem 0.55rem;
  border: 1px solid #8eb0e0;
  border-radius: 999px;
  background: #e8f0fc;
  color: #1f4f9c;
  font-size: 0.75rem;
  font-weight: 600;
}

.keywords__category-chip[hidden] {
  display: none;
}

.keywords__category-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.keywords__category-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #1f4f9c;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.keywords__category-clear:hover,
.keywords__category-clear:focus-visible {
  background: #d4e4f8;
}

.keywords__category-clear:focus-visible {
  outline: 2px solid #4a7fd4;
  outline-offset: 1px;
}

.keywords-category-modal__body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.keywords-category-modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.keywords-category-modal__item {
  margin: 0;
}

.keywords-category-modal__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.keywords-category-modal__link:hover {
  background: #f4f4f2;
}

.keywords-category-modal__link:focus-visible {
  outline: 2px solid #4a7fd4;
  outline-offset: 1px;
}

.keywords-category-modal__link--active,
.keywords-category-modal__link[aria-selected="true"] {
  background: #e8f0fc;
  border-color: #8eb0e0;
  color: #1f4f9c;
  font-weight: 600;
}

.keywords-category-modal__count {
  flex-shrink: 0;
  min-width: 1.5rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #ebebe8;
  color: #555;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

.keywords-category-modal__link--active .keywords-category-modal__count,
.keywords-category-modal__link[aria-selected="true"] .keywords-category-modal__count {
  background: #cfe0f7;
  color: #1f4f9c;
}

.keywords-category-modal__uncategorized {
  border-top: 1px solid #ddd;
  padding-top: 0.75rem;
}

.keywords-category-modal__uncategorized-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.keywords-category-modal__uncategorized-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fafaf8;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.keywords-category-modal__uncategorized-count:hover {
  background: #f4f4f2;
}

.keywords-category-modal__uncategorized-count:focus-visible {
  outline: 2px solid #4a7fd4;
  outline-offset: 1px;
}

.keywords-category-modal__uncategorized-count[aria-expanded="true"] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}

.keywords-category-modal__uncategorized-label {
  font-weight: 600;
}

.keywords-category-modal__filter-btn {
  flex-shrink: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
  border: 1px solid #c8c8c4;
  border-radius: 5px;
  background: #f4f4f2;
  color: #333;
  cursor: pointer;
}

.keywords-category-modal__filter-btn:hover,
.keywords-category-modal__filter-btn:focus-visible {
  background: #ebebe8;
}

.keywords-category-modal__filter-btn:focus-visible {
  outline: 2px solid #4a7fd4;
  outline-offset: 1px;
}

.keywords-category-modal__filter-btn--active {
  background: #e8f0fc;
  border-color: #8eb0e0;
  color: #1f4f9c;
}

.keywords-category-modal__food-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0.65rem 0.55rem;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 5px 5px;
  background: #fff;
  max-height: 12rem;
  overflow: auto;
}

.keywords-category-modal__food-list[hidden] {
  display: none;
}

.keywords-category-modal__food-item {
  margin: 0;
  padding: 0.3rem 0;
  font-size: 0.82rem;
  color: #444;
  border-bottom: 1px solid #f0f0ec;
}

.keywords-category-modal__food-item:last-child {
  border-bottom: none;
}

.keywords-category-modal__food-empty {
  margin: 0;
  padding: 0.45rem 0;
  font-size: 0.82rem;
  color: #777;
}

.keywords__filter-empty {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: #5c5c5c;
}

.keywords__filter-empty[hidden] {
  display: none;
}

.keywords__panel {
  border: 1px solid #c8c8c4;
  border-radius: 6px;
  background: #fff;
  padding: 0.75rem;
}

.keywords__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.keywords__table th {
  position: sticky;
  top: 0;
  z-index: 5;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5c5c5c;
  padding: 0.55rem 0.35rem 0.5rem;
  background: #fff;
  box-shadow: inset 0 -1px 0 #e8e8e4;
}

.keywords__th-order {
  width: 1%;
  white-space: nowrap;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.keywords__reorder-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0.2rem 0.35rem;
  font: inherit;
  font-size: inherit;
  font-weight: 600;
  color: inherit;
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  line-height: 1.2;
}

.keywords__reorder-toggle:hover {
  background: #eeeee8;
  border-color: #dcdcd8;
}

.keywords__reorder-toggle:focus-visible {
  outline: none;
  border-color: #888880;
  box-shadow: 0 0 0 2px rgba(120, 120, 110, 0.15);
}

.keywords__reorder-toggle-icon {
  font-size: 0.65rem;
  opacity: 0.5;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.keywords__table--reorder-open .keywords__reorder-toggle-icon {
  transform: rotate(90deg);
  opacity: 0.75;
}

.keywords__order {
  width: 1%;
  white-space: nowrap;
  padding: 0.45rem 0.35rem;
}

.keywords__th-macro {
  width: 6.5rem;
}

.keywords__macro-toggle {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.2rem 0.35rem;
  font: inherit;
  font-size: inherit;
  font-weight: 600;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  line-height: 1.2;
}

.keywords__macro-toggle:hover {
  background: #eeeee8;
  border-color: #dcdcd8;
}

.keywords__macro-toggle:focus-visible {
  outline: none;
  border-color: #888880;
  box-shadow: 0 0 0 2px rgba(120, 120, 110, 0.15);
}

.keywords__macro-toggle[aria-pressed="true"] {
  background: #eef3f8;
  border-color: #b8c8d8;
  color: #2d4a66;
}

.keywords__th-total--cal {
  width: 6.5rem;
}

.keywords__cal {
  display: inline-block;
  min-width: 3rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid #e8e8e4;
  border-radius: 4px;
  background: #f8f8f6;
  color: #5c5c5c;
  font-variant-numeric: tabular-nums;
}

.keywords__macro--total .keywords__cal {
  font-weight: 600;
  color: #2d4a66;
  background: #eef3f8;
  border-color: #c8d4e0;
}

.keywords__th-micros {
  width: 7.5rem;
}

.keywords__th-longevity {
  width: 7.5rem;
}

.keywords__longevity-cell {
  white-space: nowrap;
  overflow: visible;
}

.keywords__longevity-cell .keywords__longevity {
  max-width: 6.5rem;
}

.keywords__longevity {
  position: relative;
  display: inline-block;
  max-width: 6.5rem;
  padding: 0.35rem 0.45rem;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  border: 1px dashed #b8b8b4;
  background: #fafaf8;
  color: #5c5c5c;
}

.keywords__longevity-text {
  display: inline-block;
  white-space: nowrap;
}

.keywords__longevity--filled {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  text-align: left;
  border-style: solid;
  border-color: #7a6a9e;
  background: #f0eef6;
  color: #3d2d5a;
  font-weight: 500;
}

.keywords__longevity--filled .keywords__longevity-text {
  min-width: min-content;
}

.keywords__longevity:hover {
  background: #f0f0ec;
  border-color: #989894;
  color: #1a1a1a;
}

.keywords__longevity--filled:hover {
  background: #e6e2ef;
  border-color: #5a4a80;
}

.keywords__longevity[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  z-index: 60;
  padding: 0.4rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  color: #fff;
  background: #1a1a1a;
  border-radius: 4px;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.keywords__longevity[data-tooltip]:hover::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  z-index: 61;
  border: 5px solid transparent;
  border-top-color: #1a1a1a;
  transform: translateX(-50%);
  pointer-events: none;
}

.keywords__th-actions {
  width: 8.5rem;
}

.keywords__micros-cell {
  white-space: nowrap;
  overflow: visible;
}

.keywords__micros {
  position: relative;
  display: inline-block;
  max-width: 6.5rem;
  padding: 0.35rem 0.45rem;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  border: 1px dashed #b8b8b4;
  background: #fafaf8;
  color: #5c5c5c;
  vertical-align: middle;
}

.keywords__micros-text {
  display: inline-block;
  white-space: nowrap;
}

.keywords__micros--filled {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  text-align: left;
  border-style: solid;
  border-color: #6a9e6a;
  background: #eef6ee;
  color: #2d5a2d;
  font-weight: 500;
}

.keywords__micros--filled .keywords__micros-text {
  min-width: min-content;
}

.keywords__micros:hover {
  background: #f0f0ec;
  border-color: #989894;
  color: #1a1a1a;
}

.keywords__micros--filled:hover {
  background: #e2efe2;
  border-color: #4a804a;
}

.keywords__micros[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  z-index: 60;
  padding: 0.4rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  color: #fff;
  background: #1a1a1a;
  border-radius: 4px;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.keywords__micros[data-tooltip]:hover::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  z-index: 61;
  border: 5px solid transparent;
  border-top-color: #1a1a1a;
  transform: translateX(-50%);
  pointer-events: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#longevity-analysis-modal {
  z-index: 100;
}

#micro-def-modal,
#micro-sources-modal,
#longevity-sources-modal,
#tdee-hr-zones-modal,
#tdee-rpe-modal {
  z-index: 110;
}

#micro-def-modal.modal--stacked {
  z-index: 120;
}

#micro-def-modal.modal--stacked .modal__backdrop {
  background: rgba(26, 26, 26, 0.85);
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) {
  padding: 0.5rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .modal__panel {
  max-width: 54rem;
  max-height: min(90vh, 63rem);
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .modal__header {
  padding: 1.5rem 1.5rem 0.75rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .modal__title {
  font-size: 1.575rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .modal__subtitle {
  font-size: 1.3125rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .micro-def__targets {
  padding: 0.675rem 1.5rem 0.825rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .micro-def__targets-inner {
  font-size: 1.17rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .micro-def__targets-kind {
  font-size: 0.84rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .modal__tool-btn {
  padding: 0.525rem 0.975rem;
  font-size: 1.17rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .modal__tool-btn-icon {
  width: 21px;
  height: 21px;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .micro-def__body {
  padding: 1.125rem 1.5rem 1.5rem;
  font-size: 1.3125rem;
  line-height: 1.5;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .micro-def__heading {
  font-size: 1.08rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen)
  .micro-def__heading--warning,
#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen)
  .micro-def__heading--condition {
  font-size: 1.2rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen)
  .micro-def__section--warning
  .micro-def__p,
#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen)
  .micro-def__section--condition
  .micro-def__p {
  font-size: 1.32rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .micro-def__sources-summary {
  padding: 0.525rem 0;
  font-size: 1.2rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .micro-def__sources-body {
  max-height: min(33vh, 13.5rem);
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .micro-def__sources-heading {
  font-size: 1.2rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .micro-def__sources-subheading {
  font-size: 1.125rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .micro-def__sources-list li {
  font-size: 1.2rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .micro-def__source-btn {
  font-size: 1.2rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .micro-def__sex-label {
  font-size: 1.2rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .micro-def__sex-icon {
  font-size: 1.5rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .modal__footer {
  padding: 1.125rem 1.5rem 1.5rem;
}

#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .modal__done,
#micro-def-modal.modal--stacked-food-sources:not(.modal--fullscreen) .modal__secondary {
  padding: 0.75rem 1.5rem;
  font-size: 1.3125rem;
}

#micro-sources-modal.modal--stacked,
#longevity-sources-modal.modal--stacked {
  z-index: 120;
}

#micro-sources-modal.modal--stacked .modal__backdrop,
#longevity-sources-modal.modal--stacked .modal__backdrop {
  background: rgba(26, 26, 26, 0.55);
}

#food-sources-modal.modal--under-def .modal__backdrop {
  background: rgba(26, 26, 26, 0.72);
}

.modal__header-tools {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
}

.modal__tool-btn--icon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.modal__tool-btn-icon {
  flex-shrink: 0;
  display: block;
  fill: currentColor;
}

.modal[hidden] {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.45);
}

.modal__panel {
  position: relative;
  width: 100%;
  max-width: 28rem;
  max-height: min(90vh, 32rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #c8c8c4;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.modal__panel--wide {
  max-width: 36rem;
  max-height: min(90vh, 42rem);
}

.modal__header {
  padding: 1rem 1rem 0.5rem;
  border-bottom: 1px solid #ecece8;
}

.modal__header--with-tools {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.modal__header-text {
  flex: 1 1 auto;
  min-width: 0;
}

.modal__tool-btn {
  flex-shrink: 0;
  padding: 0.35rem 0.65rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: #2a4a6e;
  background: #fff;
  border: 1px solid #9eb4cc;
  border-radius: 4px;
  cursor: pointer;
}

.modal__tool-btn:hover {
  background: #e8eef4;
}

.modal__tool-btn[aria-pressed="true"] {
  background: #e8eef4;
  border-color: #3d6b9e;
}

#micro-def-modal.modal--fullscreen {
  padding: 0;
}

#micro-def-modal.modal--fullscreen .modal__backdrop {
  background: #fff;
}

#micro-def-modal.modal--fullscreen .modal__panel {
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

#micro-def-modal.modal--fullscreen .modal__title {
  font-size: 1.35rem;
}

#micro-def-modal.modal--fullscreen .modal__subtitle {
  font-size: 1rem;
}

#micro-def-modal.modal--fullscreen .micro-def__targets {
  padding: 0.55rem 1.25rem 0.65rem;
}

#micro-def-modal.modal--fullscreen .micro-def__targets-inner {
  font-size: 0.9rem;
}

#micro-def-modal.modal--fullscreen .micro-def__body {
  font-size: 1.125rem;
  line-height: 1.6;
}

#micro-def-modal.modal--fullscreen .micro-def__heading {
  font-size: 0.9rem;
}

#micro-def-modal.modal--fullscreen .micro-def__sources-summary {
  font-size: 1rem;
  padding: 0.45rem 0;
}

#micro-def-modal.modal--fullscreen .micro-def__sources-body {
  max-height: min(28vh, 12rem);
  padding: 0 0 0.25rem;
}

#micro-def-modal.modal--fullscreen .micro-def__sources-heading {
  font-size: 1rem;
}

#micro-def-modal.modal--fullscreen .micro-def__sources-subheading {
  font-size: 0.95rem;
}

#micro-def-modal.modal--fullscreen .micro-def__sources-list li {
  font-size: 1rem;
}

#micro-def-modal.modal--fullscreen .micro-def__source-btn {
  font-size: 1rem;
}

#micro-def-modal.modal--fullscreen .micro-def__sex-label {
  font-size: 1rem;
}

#micro-def-modal.modal--fullscreen .micro-def__sex-icon {
  font-size: 1.2rem;
}

#micro-sources-modal.modal--fullscreen,
#longevity-sources-modal.modal--fullscreen,
#food-sources-modal.modal--fullscreen {
  padding: 0;
}

#micro-sources-modal.modal--fullscreen .modal__backdrop,
#longevity-sources-modal.modal--fullscreen .modal__backdrop,
#food-sources-modal.modal--fullscreen .modal__backdrop {
  background: #fff;
}

#micro-sources-modal.modal--fullscreen .modal__panel,
#longevity-sources-modal.modal--fullscreen .modal__panel,
#food-sources-modal.modal--fullscreen .modal__panel {
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

#micro-sources-modal.modal--fullscreen .modal__title,
#longevity-sources-modal.modal--fullscreen .modal__title,
#food-sources-modal.modal--fullscreen .modal__title {
  font-size: 1.35rem;
}

#micro-sources-modal.modal--fullscreen .modal__subtitle,
#longevity-sources-modal.modal--fullscreen .modal__subtitle,
#food-sources-modal.modal--fullscreen .modal__subtitle {
  font-size: 1rem;
}

#micro-sources-modal.modal--fullscreen .micro-sources-modal__body,
#longevity-sources-modal.modal--fullscreen .micro-sources-modal__body,
#food-sources-modal.modal--fullscreen .food-sources-modal__body {
  max-height: none;
  font-size: 1rem;
  line-height: 1.55;
}

#micro-sources-modal.modal--fullscreen .micro-sources-modal__item,
#longevity-sources-modal.modal--fullscreen .micro-sources-modal__item {
  font-size: 0.95rem;
}

.modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

button.modal__title-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  cursor: pointer;
}

button.modal__title-link:hover {
  color: #1a4d7a;
}

button.modal__title-link:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
  border-radius: 2px;
}

.modal__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: #5c5c5c;
}

.micro-form {
  padding: 0.75rem 1rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 0.75rem;
}

.micro-form__separator {
  grid-column: 1 / -1;
  margin-top: 0.8rem;
  padding: 0.4rem 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6a6a66;
  border-top: 1px solid #e0e0dc;
}

.micro-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.micro-form__label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #5c5c5c;
}

button.micro-form__label-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: #2a5a8a;
  text-decoration: underline;
  text-decoration-color: rgba(42, 90, 138, 0.35);
  text-underline-offset: 0.12em;
}

button.micro-form__label-link:hover {
  color: #1a4570;
  text-decoration-color: currentColor;
}

button.micro-form__label-link:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
  border-radius: 2px;
}

.micro-form__unit {
  margin-left: 0.15rem;
  font-weight: 500;
  color: #8a8a86;
}

.micro-form__input {
  padding: 0.4rem 0.5rem;
  border: 1px solid #d8d8d4;
  border-radius: 4px;
  font: inherit;
  font-size: 0.875rem;
}

.micro-form__input:focus {
  outline: 2px solid #3d6b9e;
  outline-offset: 0;
  border-color: #3d6b9e;
}

.longevity-form {
  padding: 0.5rem 1rem 0.75rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(70vh, 32rem);
}

.longevity-form__group {
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

.longevity-form__legend {
  margin: 0 0 0.5rem;
  padding: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #333;
}

.longevity-form__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 0.75rem;
}

.longevity-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.longevity-form__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #333;
}

button.longevity-form__label-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: #2a5a8a;
  text-decoration: underline;
  text-decoration-color: rgba(42, 90, 138, 0.35);
  text-underline-offset: 0.12em;
}

button.longevity-form__label-link:hover {
  color: #1a4570;
  text-decoration-color: currentColor;
}

button.longevity-form__label-link:focus-visible {
  outline: 2px solid #3d6b9e;
  outline-offset: 2px;
  border-radius: 2px;
}

.longevity-form__unit {
  font-size: 0.72rem;
  color: #5c5c5c;
}

.longevity-form__input {
  width: 100%;
  padding: 0.35rem 0.45rem;
  font: inherit;
  font-size: 0.85rem;
  border: 1px solid #c8c8c4;
  border-radius: 4px;
}

.longevity-form__input:focus {
  outline: 2px solid #3d6b9e;
  outline-offset: 0;
  border-color: #3d6b9e;
}

.modal__footer {
  flex-shrink: 0;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid #ecece8;
  display: flex;
  justify-content: flex-end;
  background: #fff;
}

#micro-def-modal-footer {
  align-items: flex-start;
  gap: 0.5rem 0.75rem;
}

#micro-def-modal-footer:has(.micro-def__sources-dock:not([hidden])) {
  background: #e8eef4;
  border-top-color: #c5d4e2;
}

#micro-def-modal-footer .modal__done,
#micro-def-modal-footer .modal__secondary {
  flex: 0 0 auto;
  align-self: flex-start;
  white-space: nowrap;
}

.modal__footer--split {
  justify-content: space-between;
  gap: 0.5rem;
}

.import-modal__body {
  padding: 0.75rem 1rem 0.5rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#add-food-modal .import-modal__body {
  overflow: hidden;
}

.import-modal__hint {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: #5c5c5c;
}

.import-modal__hint code {
  font-size: 0.85em;
  background: #f0f0ec;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.import-modal__tools {
  margin: 0 0 0.5rem;
}

.import-modal__ai-link {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: #5c5c5c;
  text-decoration: none;
  cursor: pointer;
}

.import-modal__ai-link:hover {
  color: #333;
  text-decoration: underline;
  text-decoration-color: rgba(92, 92, 92, 0.4);
}

.import-all-mode {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e0e0dc;
  border-radius: 6px;
  background: #fafaf8;
}

.import-all-mode__legend {
  padding: 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5c5c5c;
}

.import-all-mode__option {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-top: 0.45rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #333;
  cursor: pointer;
}

.import-all-mode__option:first-of-type {
  margin-top: 0.35rem;
}

.import-all-mode__text {
  flex: 1;
}

.import-ai-panel {
  padding: 0.65rem 0.75rem;
  border: 1px solid #e8e8e4;
  border-radius: 6px;
  background: #fafaf8;
}

.import-ai-panel__label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #5c5c5c;
}

.import-ai-panel__portion {
  display: block;
  width: 100%;
  margin-bottom: 0.55rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid #c8d4e0;
  border-radius: 4px;
  font: inherit;
  font-size: 0.9rem;
}

.import-ai-panel__portion:focus {
  outline: 2px solid #3d6b9e;
  outline-offset: 0;
  border-color: #3d6b9e;
}

.import-ai-panel__preview-label {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #5c5c5c;
}

.import-ai-panel__actions + .import-ai-panel__preview-label {
  margin-top: 0.55rem;
}

.import-ai-panel__preview--tall {
  max-height: 14rem;
}

.micro-gaps-modal__mode {
  margin-bottom: 0.75rem;
}

.micro-gaps-modal__select {
  margin-bottom: 0.55rem;
}

.micro-gaps-modal__additional-label {
  margin-top: 0.15rem;
}

.micro-gaps-modal__additional {
  min-height: 3rem;
  resize: vertical;
  margin-bottom: 0.55rem;
}

.micro-gaps-modal__foods {
  margin: 0 0 0.55rem;
  border: 1px solid #e0e0dc;
  border-radius: 6px;
  background: #fafaf8;
}

.micro-gaps-modal__foods-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  list-style: none;
}

.micro-gaps-modal__foods-summary::-webkit-details-marker {
  display: none;
}

.micro-gaps-modal__foods-summary::before {
  content: "▸ ";
  color: #5c5c5c;
}

.micro-gaps-modal__foods[open] .micro-gaps-modal__foods-summary::before {
  content: "▾ ";
}

.micro-gaps-modal__foods-count {
  font-weight: 500;
  color: #6a6a66;
}

.micro-gaps-modal__foods-body {
  padding: 0 0.65rem 0.55rem;
  border-top: 1px solid #e8e8e4;
}

.micro-gaps-modal__foods-empty {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: #6a6a66;
}

.micro-gaps-modal__foods-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: 11rem;
  overflow: auto;
  margin-top: 0.4rem;
}

.micro-gaps-modal__food-option {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0;
  padding: 0.22rem 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #333;
  cursor: pointer;
}

.micro-gaps-modal__food-option input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.micro-gaps-modal__panel {
  margin-top: 0.35rem;
}

.import-ai-panel__preview {
  margin: 0 0 0.55rem;
  padding: 0.55rem 0.65rem;
  max-height: 9rem;
  overflow: auto;
  border: 1px solid #d8d8d4;
  border-radius: 4px;
  background: #fafaf8;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.7rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  color: #333;
}

.import-ai-panel__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.import-ai-panel__copy {
  padding: 0.35rem 0.65rem;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid #d8d8d4;
  background: #fff;
  color: #5c5c5c;
}

.import-ai-panel__copy:hover {
  background: #f3f3f0;
  color: #333;
}

.import-ai-panel__open-label {
  font-size: 0.78rem;
  color: #5c5c5c;
}

.import-ai-panel__service {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #5c5c5c;
  text-decoration: none;
}

.import-ai-panel__service-icon {
  flex: 0 0 auto;
  display: block;
  width: 0.9em;
  height: 0.9em;
  fill: currentColor;
  opacity: 0.86;
  vertical-align: middle;
  margin-right: 2px;
}

.import-ai-panel__service-icon--chatgpt {
  color: #16a37f;
}

.import-ai-panel__service-icon--claude {
  color: #cc785c;
}

.import-ai-panel__service:hover {
  color: #333;
  text-decoration: underline;
  text-decoration-color: rgba(92, 92, 92, 0.4);
}

.import-json-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 0;
}

.import-json-wrap__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.import-json-wrap__label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #5c5c5c;
}

.import-json-wrap__file-btn {
  padding: 0.28rem 0.6rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid #c8c8c4;
  background: #f8f8f6;
  color: inherit;
  white-space: nowrap;
}

.import-json-wrap__file-btn:hover {
  background: #eeeee8;
  border-color: #a8a8a4;
}

.import-json-wrap--ai .import-modal__json {
  min-height: 8rem;
  max-height: 10rem;
}

.import-modal__json {
  width: 100%;
  min-height: 9rem;
  max-height: 14rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #d8d8d4;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  resize: vertical;
  color: inherit;
  flex-shrink: 0;
}

.import-modal__json:focus {
  outline: 2px solid #3d6b9e;
  outline-offset: 0;
  border-color: #3d6b9e;
}

.import-modal__error {
  margin: 0;
  flex-shrink: 0;
  font-size: 0.8rem;
  color: #8b3030;
}

.modal__secondary {
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid #c8c8c4;
  background: #f8f8f6;
  color: inherit;
}

.modal__secondary:hover {
  background: #eeeee8;
  border-color: #a8a8a4;
}

.modal__done {
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid #3d6b9e;
  background: #3d6b9e;
  color: #fff;
}

.modal__done:hover {
  background: #325a85;
  border-color: #325a85;
}

@media (max-width: 400px) {
  .micro-form {
    grid-template-columns: 1fr;
  }

  .longevity-form__grid {
    grid-template-columns: 1fr;
  }
}

.keywords__row td {
  padding: 0.4rem 0.35rem;
  vertical-align: middle;
  border-bottom: 1px solid #f0f0ec;
}

.keywords__row:last-child td {
  border-bottom: none;
}

.keywords__order-cell {
  display: flex;
  align-items: center;
  gap: 0;
}

.keywords__table--reorder-open .keywords__order-cell {
  gap: 0.6rem;
}

.keywords__table--reorder-open .keywords__order {
  padding: 0.5rem 0.65rem 0.5rem 0.45rem;
}

.keywords__num {
  flex-shrink: 0;
  min-width: 1.9rem;
  height: 1.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #4a4a46;
  background: #eeeee8;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.keywords__order-controls {
  display: none;
  align-items: center;
  gap: 0.4rem;
}

.keywords__table--reorder-open .keywords__order-controls {
  display: flex;
}

.keywords__order-steppers {
  display: inline-flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #d4d4d0;
  background: #fff;
}

.keywords__order-steppers .keywords__move {
  width: 1.85rem;
  height: 1.85rem;
  border: none;
  border-radius: 0;
  background: #fafaf8;
  border-right: 1px solid #e4e4e0;
}

.keywords__order-steppers .keywords__move:last-child {
  border-right: none;
}

.keywords__order-steppers .keywords__move:hover:not(:disabled) {
  background: #f0f0ec;
  border-color: #e4e4e0;
}

.keywords__order-steppers .keywords__move:disabled {
  background: #f6f6f4;
}

.keywords__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}

.keywords__pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid #e4e4e0;
}

.keywords__pagination[hidden] {
  display: none;
}

.keywords__pagination-size {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #5c5c5c;
}

.keywords__page-size-label {
  margin: 0;
}

.keywords__page-size {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid #c8c8c4;
  border-radius: 4px;
  background: #fff;
  color: inherit;
}

.keywords__page-size:focus-visible {
  outline: 2px solid #4a7fd4;
  outline-offset: 1px;
}

.keywords__page-size-suffix {
  white-space: nowrap;
}

.keywords__pagination-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.keywords__pagination-nav[hidden] {
  display: none;
}

.keywords__page-status {
  margin: 0 0.35rem;
  font-size: 0.75rem;
  color: #5c5c5c;
  white-space: nowrap;
}

.keywords__page-btn {
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid #c8c8c4;
  background: #f8f8f6;
  color: inherit;
  padding: 0.25rem 0.55rem;
}

.keywords__page-btn:hover:not(:disabled) {
  background: #efefec;
  border-color: #b8b8b4;
}

.keywords__page-btn:focus-visible {
  outline: 2px solid #4a7fd4;
  outline-offset: 1px;
}

.keywords__page-btn:disabled {
  cursor: default;
  opacity: 0.45;
  background: #f6f6f4;
}

.keywords__bulk {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.keywords__panel:not(:has(#keywords-list .keywords__row:nth-child(20))) .keywords__bulk {
  display: none;
}

.keywords__move,
.keywords__delete,
.keywords__add {
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid #c8c8c4;
  background: #f8f8f6;
  color: inherit;
}

.keywords__move {
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  line-height: 1;
}

.keywords__move--position {
  width: auto;
  height: 1.85rem;
  padding: 0 0.55rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 6px;
  background: #fff;
  color: #5c5c58;
}

.keywords__move--position:hover:not(:disabled) {
  background: #f4f4f0;
  color: #1a1a1a;
}

.keyword-position-select {
  width: 100%;
  font: inherit;
  font-size: 0.9375rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #c8c8c4;
  border-radius: 4px;
  background: #fff;
  color: inherit;
}

.keyword-position-select:focus {
  outline: none;
  border-color: #888880;
  box-shadow: 0 0 0 2px rgba(120, 120, 110, 0.15);
}

.keywords__move:hover:not(:disabled),
.keywords__delete:hover,
.keywords__add:hover {
  background: #eeeee8;
  border-color: #a8a8a4;
}

.keywords__move:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.keywords__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.keywords__import {
  padding: 0.35rem 0.5rem;
  color: #2a4a6e;
  border-color: #a8c4e0;
  background: #f4f8fc;
}

.keywords__import:hover {
  background: #e8f0f8;
  border-color: #7aa8cc;
}

.keywords__delete {
  padding: 0.35rem 0.5rem;
  color: #8b3030;
  border-color: #d4a8a8;
  background: #fdf6f6;
}

.keywords__input {
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: 1px solid #d8d8d4;
  border-radius: 4px;
  font: inherit;
  font-size: inherit;
  color: inherit;
  background: #fff;
}

.keywords__input--name {
  min-width: 8rem;
}

.keywords__input--num {
  max-width: 6rem;
}

.keywords__input:focus {
  outline: 2px solid #3d6b9e;
  outline-offset: 0;
  border-color: #3d6b9e;
}

.keywords__empty {
  margin: 0.5rem 0 0;
  color: #5c5c5c;
  font-size: 0.875rem;
  line-height: 1.5;
}

.keywords__empty-link {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: #2f5680;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  cursor: pointer;
}

.keywords__empty-link:hover {
  color: #1f3d5c;
}

.starter-guide {
  position: fixed;
  z-index: 120;
  width: min(17.5rem, calc(100vw - 1.5rem));
  pointer-events: auto;
}

.starter-guide[hidden] {
  display: none;
}

.starter-guide__panel {
  position: relative;
  z-index: 1;
  padding: 0.75rem 0.85rem;
  border: 1px solid #3d6b9e;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(26, 26, 26, 0.14);
}

.starter-guide__text {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #333;
}

.starter-guide__dismiss {
  margin: 0;
  padding: 0.28rem 0.65rem;
  border: 1px solid #c8c8c4;
  border-radius: 999px;
  background: #f5f5f3;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: #444;
  cursor: pointer;
}

.starter-guide__dismiss:hover {
  background: #ececea;
  border-color: #b0b0aa;
}

.starter-guide__arrow {
  position: absolute;
  z-index: 0;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 1px solid #3d6b9e;
}

.starter-guide[data-placement="top"] .starter-guide__arrow {
  top: -7px;
  left: 50%;
  margin-left: -6px;
  transform: rotate(45deg);
  border-right: none;
  border-bottom: none;
}

.starter-guide[data-placement="bottom"] .starter-guide__arrow {
  bottom: -7px;
  left: 50%;
  margin-left: -6px;
  transform: rotate(45deg);
  border-left: none;
  border-top: none;
}

.keywords__add {
  margin-top: 0.75rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
}

@media (max-width: 720px) {
  .dashboard__longevity-nav-track {
    flex-direction: column;
    gap: 0.35rem;
  }

  .dashboard__longevity-nav-adj--next {
    text-align: left;
    align-items: flex-start;
  }

  .dashboard__longevity-nav-all-list {
    grid-template-columns: 1fr;
    max-height: min(40vh, 16rem);
    max-height: min(40dvh, 16rem);
  }

  .keywords__panel {
    overflow-x: auto;
  }

  .keywords__table {
    min-width: 52rem;
  }
}

@media (max-width: 900px) {
  .dashboard__micro-intro {
    flex-direction: column;
    gap: 0.55rem;
  }

  .dashboard__micro-sticky {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title close"
      "actions actions"
      "filters filters"
      "options options";
    align-items: stretch;
  }

  .dashboard__micro-sticky > .dashboard__panel-close {
    align-self: center;
  }

  .dashboard__micro-sticky .dashboard__micro-intro-actions {
    gap: 0.45rem 0.75rem;
  }

  .dashboard__micro-sticky-filters,
  .dashboard__longevity-sticky-filters {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.45rem;
  }

  .dashboard__sticky-filters-carousel-nav {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.35rem;
    align-items: center;
    width: 100%;
  }

  .dashboard__sticky-filters-carousel-adj {
    box-sizing: border-box;
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border: 1px solid #c8c8c4;
    border-radius: 6px;
    background: #fff;
    color: #444;
    font: inherit;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
  }

  .dashboard__sticky-filters-carousel-adj:hover:not(:disabled) {
    background: #f3f3f0;
    border-color: #b0b0ac;
  }

  .dashboard__sticky-filters-carousel-adj:focus-visible {
    outline: 2px solid #3d6b9e;
    outline-offset: 1px;
  }

  .dashboard__sticky-filters-carousel-adj:disabled {
    opacity: 0.4;
    cursor: default;
  }

  .dashboard__sticky-filters-carousel-current {
    min-width: 0;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7a7a7a;
  }

  body.app-nav-shortcuts-visible .dashboard__sticky-filters-track {
    overflow-y: visible;
    padding-top: 0.5rem;
    margin-top: -0.5rem;
  }

  .dashboard__sticky-filters-track {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .dashboard__sticky-filters-track::-webkit-scrollbar {
    display: none;
  }

  .dashboard__micro-sticky-filters .dashboard__sticky-filter-group,
  .dashboard__longevity-sticky-filters .dashboard__sticky-filter-group {
    box-sizing: border-box;
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.35rem 0.45rem;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .dashboard__micro-sticky-filters .dashboard__sticky-filter-group-label,
  .dashboard__longevity-sticky-filters .dashboard__sticky-filter-group-label {
    /* Label shown in carousel nav; keep in DOM for a11y but hide visually */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .dashboard__micro-sticky-filters .dashboard__nutrient-filter-panel--inline,
  .dashboard__longevity-sticky-filters .dashboard__nutrient-filter-panel--inline {
    flex: 1 1 100%;
    width: auto;
    max-width: none;
  }

  .dashboard__micro-sticky-filters .dashboard__micro-condition-wrap {
    flex: 1 1 100%;
    min-width: 0;
  }

  .dashboard__micro-sticky-filters .dashboard__micro-condition-controls {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    overflow: visible;
  }

  .dashboard__micro-sticky-filters .dashboard__micro-sticky-filter-icons,
  .dashboard__longevity-sticky-filters .dashboard__micro-sticky-filter-icons {
    flex-wrap: wrap;
    max-width: 100%;
    overflow: visible;
  }

  .dashboard__micro-sticky .dashboard__sticky-options {
    width: 100%;
    min-width: 0;
    padding-top: 0.4rem;
    border-top: 1px solid #e8e8e4;
    align-items: flex-start;
  }

  .dashboard__micro-sticky .dashboard__sticky-options-disclosures {
    justify-content: flex-start;
    width: 100%;
  }

  .dashboard__micro-sticky .dashboard__sticky-options-panel {
    align-items: flex-start;
  }

  .dashboard__micro-sticky .dashboard__sticky-options-note {
    text-align: left;
  }

  .dashboard__micro-sticky .dashboard__sticky-options-checks {
    align-items: flex-start;
  }

  .dashboard__micro-sticky .dashboard__sticky-options-toggles {
    justify-content: flex-start;
  }

  .dashboard__micro-sticky .dashboard__sticky-options-panel--filter {
    align-items: stretch;
  }

  .dashboard__micro-sticky .dashboard__nutrient-filter-chips {
    justify-content: flex-start;
  }

  .dashboard__longevity-nav {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title close"
      "track track"
      "all all"
      "filters filters"
      "options options";
    align-items: stretch;
  }

  .dashboard__longevity-nav > .dashboard__panel-close {
    align-self: center;
  }

  .dashboard__longevity-nav .dashboard__sticky-options {
    width: 100%;
    min-width: 0;
    padding-top: 0.4rem;
    border-top: 1px solid #e4e8ee;
    align-items: flex-start;
  }

  .dashboard__longevity-nav .dashboard__sticky-options-disclosures {
    justify-content: flex-start;
    width: 100%;
  }

  .dashboard__longevity-nav .dashboard__sticky-options-panel {
    align-items: flex-start;
  }

  .dashboard__longevity-nav .dashboard__sticky-options-note {
    text-align: left;
  }

  .dashboard__longevity-nav .dashboard__sticky-options-checks {
    align-items: flex-start;
  }

  .dashboard__longevity-nav .dashboard__sticky-options-toggles {
    justify-content: flex-start;
  }

  .dashboard__longevity-nav .dashboard__nutrient-filter-chips {
    justify-content: flex-start;
  }
}

@media (max-width: 1100px) {
  .dashboard__grid,
  .dashboard__micro-daily-grid,
  .dashboard__macros-condensed-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .week__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dashboard__grid,
  .dashboard__micro-daily-grid,
  .dashboard__macros-condensed-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .week__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .dashboard__nutrient-filter-presets {
    grid-template-columns: 1fr;
  }

  .dashboard__longevity-thead,
  .dashboard__longevity-row {
    grid-template-columns: minmax(0, 1.5fr) minmax(2.4rem, 0.7fr) minmax(2.6rem, 0.65fr);
    gap: 0.15rem 0.25rem;
    font-size: 0.7rem;
    padding: 0.22rem 0.28rem;
  }

  .dashboard__longevity-thead {
    font-size: 0.58rem;
    padding: 0.15rem 0.28rem 0.25rem;
  }

  /* Free width for long labels + source icons; % DV stays visible */
  .dashboard__longevity-thead span:last-child,
  .dashboard__longevity-bar-wrap,
  .dashboard__longevity-row > .dashboard__longevity-bar {
    display: none;
  }

  .dashboard__longevity-name-wrap {
    gap: 0.15rem;
  }

  .dashboard__longevity-name-wrap .dashboard__micro-sources-btn,
  .dashboard__longevity-name-wrap .dashboard__micro-daily-intake-btn,
  .dashboard__longevity-name-wrap .dashboard__micro-acute-btn {
    width: 1.2rem;
    height: 1.2rem;
  }

  .dashboard__longevity-amt {
    font-size: 0.64rem;
  }

  .dashboard__longevity-pct {
    font-size: 0.68rem;
  }

  .dashboard__longevity-target-kind {
    font-size: 0.5rem;
  }

  .week__settings-icon {
    display: none;
  }

  .week__settings-abbr {
    display: inline-block;
  }

  .week__auth-email {
    max-width: min(9.5rem, 40vw);
  }

  .dashboard__days-carousel-nav {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.45rem;
  }

  .dashboard__days-carousel-adj {
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border: 1px solid #c8c8c4;
    border-radius: 6px;
    background: #fff;
    color: #444;
    font: inherit;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
  }

  .dashboard__days-carousel-adj:hover:not(:disabled) {
    background: #f3f3f0;
    border-color: #b0b0ac;
  }

  .dashboard__days-carousel-adj:focus-visible {
    outline: 2px solid #3d6b9e;
    outline-offset: 1px;
  }

  .dashboard__days-carousel-adj:disabled {
    opacity: 0.4;
    cursor: default;
  }

  .dashboard__days-carousel-current {
    min-width: 0;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #444;
  }

  .dashboard__macros-condensed-grid {
    display: flex;
    gap: 0.55rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .dashboard__macros-condensed-day {
    flex: 0 0 auto;
    min-width: 3.2rem;
  }

  .dashboard__grid {
    display: flex;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .dashboard__grid::-webkit-scrollbar {
    display: none;
  }

  .dashboard__grid > .dashboard__day {
    flex: 0 0 100%;
    box-sizing: border-box;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .dashboard__micro-daily-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard__card {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 0.5rem;
    row-gap: 0.35rem;
    align-items: start;
    padding: 0.5rem 0.65rem;
  }

  .dashboard__card-head {
    grid-column: 1 / -1;
    margin-bottom: 0;
    min-width: 0;
  }

  .dashboard__row {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.05rem;
    margin-bottom: 0;
    min-width: 0;
  }

  .dashboard__row--total {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    align-self: stretch;
    margin-top: 0.05rem;
    margin-left: 0;
    padding: 0.3rem 0.45rem;
    border-top: none;
    border-radius: 4px;
    background: #ecece8;
    text-align: left;
  }

  .dashboard__card--today .dashboard__row--total {
    background: #dce6f0;
  }

  .dashboard__row--total .dashboard__macro {
    color: #2a2a2a;
  }

  .dashboard__row--total .dashboard__val {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1a1a1a;
  }

  .dashboard__macro {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .dashboard__val {
    font-size: 0.68rem;
    white-space: normal;
  }

  .week__days-carousel-nav {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.45rem 0.55rem;
    border-bottom: 1px solid #ddd9d2;
    background: #f3f2ee;
  }

  .week__days-carousel-adj {
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border: 1px solid #c8c8c4;
    border-radius: 6px;
    background: #fff;
    color: #444;
    font: inherit;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
  }

  .week__days-carousel-adj:hover:not(:disabled) {
    background: #f3f3f0;
    border-color: #b0b0ac;
  }

  .week__days-carousel-adj:focus-visible {
    outline: 2px solid #3d6b9e;
    outline-offset: 1px;
  }

  .week__days-carousel-adj:disabled {
    opacity: 0.4;
    cursor: default;
  }

  .week__days-carousel-current {
    min-width: 0;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #444;
  }

  .week__grid {
    display: flex;
    gap: 0.55rem;
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    padding: 0.55rem;
  }

  .week__grid::-webkit-scrollbar {
    display: none;
  }

  .week__grid .day {
    flex: 0 0 calc(100% - 0.05rem);
    box-sizing: border-box;
    width: calc(100% - 0.05rem);
    min-width: calc(100% - 0.05rem);
    max-width: calc(100% - 0.05rem);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .day__editor,
  .day__guided {
    flex: none;
    width: auto;
    min-width: 0;
    min-height: 6rem;
    max-height: none;
    resize: vertical;
  }

  .day__input {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  .week {
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }

  /* Stack title/hint above auth+settings so long emails cannot crush the lead copy */
  .week__header {
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.55rem 0.75rem;
  }

  .week__header-text {
    flex: 1 1 100%;
  }

  .week__header-actions {
    flex: 1 1 100%;
    justify-content: flex-end;
  }

  .week__auth {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
  }

  .week__auth-email {
    max-width: min(12rem, 46vw);
  }

  .app-sheet__panel {
    top: var(--app-sheet-top, 0px);
    bottom: var(--app-sheet-bottom, calc(3.15rem + env(safe-area-inset-bottom, 0px)));
    height: auto;
    border-radius: 12px 12px 0 0;
  }

  body.exclusive-overlay-open .app-nav {
    top: auto;
    bottom: 0;
    padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    background: #fff;
  }

  .app-nav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 45;
    margin: 0;
    padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    border-bottom: none;
    border-top: 1px solid #c8c8c4;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -4px 16px rgba(26, 26, 26, 0.08);
  }

  .app-nav__inner {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 0.1rem;
    justify-content: center;
  }

  .app-nav__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 3.4rem;
    min-height: 2.75rem;
    padding: 0.3rem 0.55rem;
    font-size: 0.62rem;
    line-height: 1.15;
    text-align: center;
    border-radius: 6px;
  }

  .app-nav__label--full {
    display: none;
  }

  .app-nav__label--short {
    display: inline;
  }

  .app-nav__divider {
    align-self: center;
    height: 1.6rem;
    margin: 0 0.1rem;
  }

  .dashboard__micro-sticky,
  .dashboard__longevity-nav {
    top: 0;
  }

  #dashboard-grid,
  #food-entry,
  #week-summary,
  #week-summary-panel,
  #food-definitions-panel,
  #meals-panel,
  #dashboard-macros-condensed,
  #dashboard-micro-panel,
  #dashboard-longevity-panel {
    scroll-margin-top: 0.75rem;
    scroll-margin-bottom: 5rem;
  }
}

@media print {
  body {
    background: #fff;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .week {
    max-width: none;
    padding: 0;
  }

  .app-sheet__backdrop,
  .app-nav,
  .dashboard__print,
  .dashboard__days-carousel-nav,
  .dashboard__macros-condensed,
  .week__days-actions,
  .week__days-carousel-nav,
  .week__nav,
  .week__entry-tools,
  .week__days-favorite-week,
  .favorites-sidebar,
  .day__clear,
  .day__copy,
  .day__favorite,
  .day__ai,
  .day__ignore,
  .day__guided-footer,
  .day__food-item-servings,
  .day__food-item-edit,
  .day__food-item-remove,
  .day__finish-rearrange-popover,
  .week__entry-mode-toggle,
  .week__unmatched-lines,
  .keywords,
  .demographic,
  .modal,
  #food-definitions-panel,
  #meals-panel,
  .dashboard__micro-intro-actions,
  .dashboard__micro-hint-actions,
  .dashboard__micro-hint-ai,
  .dashboard__micro-sources-btn,
  .dashboard__micro-daily-intake-btn,
  .dashboard__micro-acute-btn,
  .longevity-analysis-report__info-btn,
  .longevity-analysis-report__nutrient-actions,
  .dashboard__micro-sticky,
  .dashboard__sticky-options,
  .dashboard__card-actions,
  .dashboard__card-toggle,
  .dashboard__card-rank,
  .dashboard__longevity-nav,
  .dashboard__longevity-section-link,
  .dashboard__longevity-analysis-actions {
    display: none !important;
  }

  body.print-longevity-analysis .week,
  body.print-longevity-analysis .app-nav,
  body.print-longevity-analysis .favorites-sidebar,
  body.print-longevity-analysis .starter-guide,
  body.print-longevity-analysis .modal:not(#longevity-analysis-modal) {
    display: none !important;
  }

  body.print-longevity-analysis #longevity-analysis-modal {
    display: block !important;
    position: static;
    inset: auto;
    z-index: auto;
    padding: 0;
    background: none;
  }

  body.print-longevity-analysis #longevity-analysis-modal .modal__backdrop,
  body.print-longevity-analysis #longevity-analysis-modal .modal__footer,
  body.print-longevity-analysis .longevity-analysis-report__filters-wrap,
  body.print-longevity-analysis .longevity-analysis-report__filters,
  body.print-longevity-analysis .longevity-analysis-report__goto-hint,
  .longevity-analysis-return {
    display: none !important;
  }

  body.print-longevity-analysis .longevity-analysis-report__section[hidden] {
    display: none !important;
  }

  body.print-longevity-analysis #longevity-analysis-modal .modal__panel {
    max-width: none;
    max-height: none;
    width: auto;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  body.print-longevity-analysis #longevity-analysis-modal .longevity-analysis-modal__body {
    max-height: none;
    overflow: visible;
  }

  body.print-longevity-analysis .longevity-analysis-report__section {
    background: #fff;
  }

  .dashboard__hint,
  .week__hint,
  .week__days-hint {
    display: none;
  }

  .week__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    height: auto;
    min-height: 0;
    overflow: visible;
    scroll-snap-type: none;
  }

  .week__grid .day {
    flex: none;
    width: auto;
    min-width: 0;
  }

  .dashboard__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    overflow: visible;
    scroll-snap-type: none;
  }

  .dashboard__grid > .dashboard__day {
    flex: none;
    width: auto;
    min-width: 0;
    max-width: none;
  }

  .day {
    min-height: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .day__editor {
    border: none;
    background: transparent;
    overflow: visible;
    outline: none;
    resize: none;
  }

  .day__guided {
    border: none;
    background: transparent;
    overflow: visible;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .day__editor:focus-within {
    outline: none;
    border-color: transparent;
  }

  .day__input {
    display: none !important;
  }

  .day__backdrop {
    position: static;
    inset: auto;
    overflow: visible;
    height: auto;
    max-height: none;
    padding: 0;
    pointer-events: auto;
  }

  .day__backdrop mark.hl {
    background: transparent;
    color: inherit;
    border-radius: 0;
  }

  .day__backdrop .hl--multiplier {
    background: transparent;
    color: inherit;
  }

  .dashboard__micro-name,
  .dashboard__micro-day-name,
  .dashboard__longevity-name {
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: default;
    text-align: inherit;
  }
}

body.print-preview {
  background: #fff;
}

body.print-preview .week {
  max-width: none;
}

body.print-preview .app-nav,
body.print-preview .dashboard__print,
body.print-preview .dashboard__days-carousel-nav,
body.print-preview .dashboard__macros-condensed,
body.print-preview .week__days-actions,
body.print-preview .week__days-carousel-nav,
body.print-preview .week__nav,
body.print-preview .week__entry-tools,
body.print-preview .week__days-favorite-week,
body.print-preview .favorites-sidebar,
body.print-preview .day__clear,
body.print-preview .day__copy,
body.print-preview .day__favorite,
body.print-preview .day__ai,
body.print-preview .day__ignore,
body.print-preview .day__guided-footer,
body.print-preview .day__food-item-servings,
body.print-preview .day__food-item-edit,
body.print-preview .day__food-item-remove,
body.print-preview .day__finish-rearrange-popover,
body.print-preview .week__entry-mode-toggle,
body.print-preview .week__unmatched-lines,
body.print-preview .day__suggest,
body.print-preview .day__food-popover,
body.print-preview .week__food-notes,
body.print-preview .starter-guide,
body.print-preview .keywords,
body.print-preview .demographic,
body.print-preview .modal,
body.print-preview #food-definitions-panel,
body.print-preview #meals-panel,
body.print-preview .dashboard__micro-intro-actions,
body.print-preview .dashboard__micro-hint-actions,
body.print-preview .dashboard__micro-hint-ai,
body.print-preview .dashboard__micro-sources-btn,
body.print-preview .dashboard__micro-daily-intake-btn,
body.print-preview .dashboard__micro-acute-btn,
body.print-preview .longevity-analysis-report__info-btn,
body.print-preview .longevity-analysis-report__nutrient-actions,
body.print-preview .dashboard__micro-sticky,
body.print-preview .dashboard__sticky-options,
body.print-preview .dashboard__card-actions,
body.print-preview .dashboard__card-toggle,
body.print-preview .dashboard__card-rank,
body.print-preview .dashboard__longevity-section-link {
  display: none !important;
}

body.print-preview .dashboard__hint,
body.print-preview .week__hint,
body.print-preview .week__days-hint {
  display: none;
}

body.print-preview .week__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  height: auto;
  min-height: 0;
  overflow: visible;
  scroll-snap-type: none;
}

body.print-preview .week__grid .day {
  flex: none;
  width: auto;
  min-width: 0;
}

body.print-preview .dashboard__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  overflow: visible;
  scroll-snap-type: none;
}

body.print-preview .dashboard__grid > .dashboard__day {
  flex: none;
  width: auto;
  min-width: 0;
  max-width: none;
}

body.print-preview .day {
  min-height: 0;
}

body.print-preview .day__editor {
  border: none;
  background: transparent;
  overflow: visible;
  outline: none;
  resize: none;
}

body.print-preview .day__guided {
  border: none;
  background: transparent;
  overflow: visible;
  height: auto;
  min-height: 0;
  max-height: none;
}

body.print-preview .day__editor:focus-within {
  outline: none;
  border-color: transparent;
}

body.print-preview .day__input {
  display: none !important;
}

body.print-preview .day__backdrop {
  position: static;
  inset: auto;
  overflow: visible;
  height: auto;
  max-height: none;
  padding: 0;
  pointer-events: auto;
}
