:root {
  --color-bg: #0d0f12;
  --color-surface: #16191d;
  --color-surface-2: #1c2027;
  --color-border: #3d434c;
  --color-text: #e6e8eb;
  --text-muted: #9aa3ad;
  --color-accent: #39d353;
  --color-on-accent: #0d0f12;
  --color-success: #3fb950;
  --color-warning: #e3b341;
  --color-danger: #f85149;
  --color-over-slight: #f2a541;
  --color-over-notable: #f2801f;
  --color-over-high: var(--color-danger);
  --radius: 12px;
  --spacing: 1rem;
  color-scheme: dark;
  interpolate-size: allow-keywords;
}

* {
  box-sizing: border-box;
}

a {
  color: var(--color-accent);
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
  accent-color: var(--color-accent);
}

.status-success {
  color: var(--color-success);
}

.status-warning {
  color: var(--color-warning);
}

.status-danger {
  color: var(--color-danger);
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  padding: var(--spacing);
}

.app-main--with-nav {
  padding-bottom: 5rem;
}
.app-main[data-controller~=day-swipe] {
  touch-action: pan-y;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  margin-bottom: var(--spacing);
  border-bottom: 1px solid var(--color-border);
}
.app-header__title {
  margin: 0;
  font-size: 1.15rem;
  flex: 1;
  text-align: center;
}
.app-header__back, .app-header__profile, .app-header__spacer {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  flex-shrink: 0;
}
.app-header__back svg {
  width: 20px;
  height: 20px;
}
.app-header__profile svg {
  width: 22px;
  height: 22px;
}
.app-header__action {
  flex-shrink: 0;
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}

.app-header--day .app-header__title {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.app-header--day .app-header__title .text-muted {
  font-size: 0.8rem;
}

.app-header__back--disabled {
  opacity: 0.3;
  pointer-events: none;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  box-sizing: border-box;
  display: flex;
  background: var(--color-surface);
  border-top: 2px solid var(--color-accent);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
  padding: 0.5rem 0 max(0.5rem, env(safe-area-inset-bottom));
}
.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin: 0 0.35rem;
  padding: 0.3rem 0;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.bottom-nav__item svg {
  width: 22px;
  height: 22px;
}
.bottom-nav__item.is-active {
  color: var(--color-accent);
  font-weight: 600;
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
}

.btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
}
.btn[hidden] {
  display: none;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.btn-secondary {
  background: color-mix(in srgb, var(--color-accent) 10%, var(--color-surface-2));
  color: var(--color-text);
  border-color: var(--color-accent);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--color-danger);
  border-color: var(--color-danger);
}

.btn-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: var(--spacing);
}
.btn-stack form {
  margin: 0;
}

.link-button {
  background: none;
  border: none;
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.badge-success {
  color: var(--color-success);
  border-color: var(--color-success);
}

.badge-warning {
  color: var(--color-warning);
  border-color: var(--color-warning);
}

.badge-neutral {
  color: var(--text-muted);
}

.badge-danger {
  color: var(--color-danger);
  border-color: var(--color-danger);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 0.9rem;
  appearance: none;
  text-decoration: none;
  cursor: pointer;
}
.chip:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.chip.is-active {
  background: color-mix(in srgb, var(--color-accent) 12%, var(--color-surface));
  border-color: var(--color-accent);
  color: var(--color-accent);
  font-weight: 600;
}
.chip--block {
  display: flex;
  width: 100%;
  text-align: left;
}

.portion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.portion-chips--duration .chip {
  padding-left: calc(0.85rem - 1px);
  padding-right: calc(0.85rem - 1px);
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1;
  padding: 0.25rem 0.5rem;
}
.icon-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.icon-btn svg {
  display: block;
  width: 18px;
  height: 18px;
}
.icon-btn--danger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  flex-shrink: 0;
  border: 1px solid var(--color-danger);
  border-radius: var(--radius);
  color: var(--color-danger);
  padding: 0;
}
.icon-btn--danger svg {
  width: 16px;
  height: 16px;
}
.icon-btn--edit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-accent);
  padding: 0;
}
.icon-btn--edit svg {
  width: 16px;
  height: 16px;
}
.icon-btn--primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  flex-shrink: 0;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  background: var(--color-accent);
  color: var(--color-on-accent);
  padding: 0;
}
.icon-btn--primary svg {
  width: 16px;
  height: 16px;
}

.icon-toggle-group {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.icon-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}
.icon-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.icon-toggle svg {
  width: 1rem;
  height: 1rem;
}
.icon-toggle.is-active {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 12%, var(--color-surface));
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--color-border);
  overflow: hidden;
  margin: 0.5rem 0;
}
.progress-bar--thin {
  height: 5px;
  margin: 0.35rem 0 0;
}
.progress-bar__fill {
  height: 100%;
  background: var(--color-success);
  border-radius: inherit;
}
.progress-bar__fill--danger {
  background: var(--color-danger);
}

.form-field {
  margin-bottom: var(--spacing);
}
.form-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}
.form-field input, .form-field select {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
}
.form-field--error input, .form-field--error select {
  border-color: var(--color-danger);
}
.form-field__error {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}
.form-field .help-text {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.choice-expanded {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.choice-expanded__option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0;
}
.choice-expanded__option input {
  width: 1.35rem;
  height: 1.35rem;
}
.choice-expanded__option label {
  display: inline;
  margin-bottom: 0;
  font-size: 1.05rem;
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: var(--spacing) 0;
}
.stepper__button {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 1.25rem;
  cursor: pointer;
}
.stepper__button--jump {
  width: auto;
  height: 2.25rem;
  padding: 0 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.stepper__value {
  width: 6rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: none;
  background: transparent;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 2.75rem;
  height: 1.6rem;
  flex-shrink: 0;
}
.switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.switch input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.switch__track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--color-border);
  transition: background 0.15s ease;
  pointer-events: none;
}
.switch__track::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.6rem - 4px);
  height: calc(1.6rem - 4px);
  border-radius: 999px;
  background: var(--color-surface);
  transition: transform 0.15s ease;
}

.switch input:checked + .switch__track {
  background: var(--color-accent);
}
.switch input:checked + .switch__track::before {
  transform: translateX(1.15rem);
  background: var(--color-on-accent);
}

.menu-list {
  margin-bottom: var(--spacing);
  padding: 0 1rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--color-border);
  background: none;
  color: var(--color-text);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.menu-row[type=button] {
  border-width: 0 0 1px;
  border-style: solid;
  border-color: var(--color-border);
}
.menu-row:last-child {
  border-bottom: none;
}
.menu-row__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
  color: var(--color-accent);
}
.menu-row__icon svg {
  width: 16px;
  height: 16px;
}
.menu-row__label {
  flex: 1;
}
.menu-row span:last-child {
  color: var(--text-muted);
}

.search-bar {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.search-bar__field {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}
.search-bar__barcode-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--text-muted);
}
.search-bar__barcode-button svg {
  width: 1.2rem;
  height: 1.2rem;
}

.search-group-heading {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: var(--spacing) 0 0.25rem;
}
.search-group-heading:first-child {
  margin-top: 0.5rem;
}

.search-recent {
  margin-top: var(--spacing);
}
.search-recent .search-group-heading {
  margin: 0 0 0.5rem;
}

.search-result-row {
  display: block;
  width: 100%;
  padding: 0.6rem 0;
  border: none;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  color: inherit;
  text-decoration: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.search-result-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}
.search-result-row--create {
  border-bottom: none;
  color: var(--color-accent);
  font-weight: 600;
  text-align: center;
  padding: 0.85rem 0;
}

.budget-card {
  padding: 1rem;
  margin-bottom: var(--spacing);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.budget-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.budget-card__kcal {
  font-size: 2.25rem;
  font-weight: 700;
  margin-right: 0.35rem;
}
.budget-card__note {
  margin-top: 0.25rem;
}
.budget-card__overview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: var(--spacing);
}
.budget-card__overview-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.85rem;
}
.budget-card__overview-value {
  font-size: 1.15rem;
  font-weight: 700;
}
.budget-card__sport {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1rem;
}
.budget-card__sport-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--text-muted);
}
.budget-card--incomplete {
  text-align: center;
}
.budget-card--incomplete .btn {
  margin-top: 0.5rem;
}

.kcal-ring {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}
.kcal-ring svg {
  width: 100%;
  height: 100%;
}
.kcal-ring__track {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 12;
}
.kcal-ring__fill {
  fill: none;
  stroke: var(--color-success);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: calc(326.73 * (1 - var(--percent, 0) / 100));
  transition: stroke-dashoffset 0.3s ease;
}
.kcal-ring__fill--danger {
  stroke: var(--color-danger);
}
.kcal-ring__center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.8rem;
  text-align: center;
}
.kcal-ring__value {
  font-size: 1.5rem;
  font-weight: 700;
}

.preview-card {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: var(--spacing);
  text-align: center;
  margin-bottom: var(--spacing);
}
.preview-card__kcal {
  font-size: 1.75rem;
  font-weight: 700;
  margin-right: 0.25rem;
}

.meal-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing);
  margin-bottom: var(--spacing);
}

.dish-create {
  padding: 1rem;
  margin-bottom: var(--spacing);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.dish-create__heading {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}
.dish-create__actions {
  margin-top: 0.75rem;
}
.dish-create__buttons {
  display: flex;
  gap: 0.5rem;
}
.dish-create__buttons .btn {
  flex: 1;
}
.dish-create__cancel.btn {
  flex: 0 0 33%;
}
.dish-create__count {
  margin-top: 0.5rem;
}

.meal-slot {
  padding: 0.9rem 1rem 0.5rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  scroll-margin-top: 0.75rem;
}
.meal-slot__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
  font-weight: 700;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0.35rem;
  gap: 0.6rem;
}
.meal-slot__head-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.meal-slot__head-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
}
.meal-slot__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--color-accent) 16%, transparent);
  color: var(--color-accent);
}
.meal-slot__icon svg {
  width: 17px;
  height: 17px;
}
.meal-slot__add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-accent);
  flex-shrink: 0;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.meal-slot__add svg {
  width: 0.9rem;
  height: 0.9rem;
}
.meal-slot__empty {
  padding: 0.5rem 0;
}

.meal-entry-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--color-border);
}
.meal-entry-row:last-child {
  border-bottom: none;
}
.meal-entry-row__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  padding: 0.2rem 0;
  color: var(--color-text);
  text-decoration: none;
}
.meal-entry-row__select {
  display: none;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.meal-entry-row__main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}
.meal-entry-row__main span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meal-entry-row__delete {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}
.meal-entry-row__delete svg {
  width: 1rem;
  height: 1rem;
}
.meal-entry-row__delete:hover, .meal-entry-row__delete:focus-visible {
  color: var(--color-danger);
}

.dish-select--selecting .meal-entry-row__select {
  display: block;
}
.dish-select--selecting .meal-entry-row--selected .meal-entry-row__select {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.sport-section {
  margin-top: var(--spacing);
  padding: 0.9rem 1rem 0.5rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.sport-section__hint {
  padding-top: 0.4rem;
  font-size: 0.85rem;
}

.sport-row__icon {
  flex-shrink: 0;
  display: flex;
  color: var(--text-muted);
}
.sport-row__icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.activity-group, .meal-template-group {
  margin-top: 0.75rem;
  padding: 0 0.9rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}
.activity-group::details-content, .meal-template-group::details-content {
  height: 0;
  overflow: hidden;
  transition: height 0.22s ease, content-visibility 0.22s allow-discrete;
}
.activity-group[open]::details-content, .meal-template-group[open]::details-content {
  height: auto;
}
@starting-style {
  .activity-group[open]::details-content, .meal-template-group[open]::details-content {
    height: 0;
  }
}
.activity-group:first-of-type, .meal-template-group:first-of-type {
  margin-top: var(--spacing);
}
.activity-group__heading, .meal-template-group__heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.activity-group__heading::-webkit-details-marker, .activity-group__heading::marker, .meal-template-group__heading::-webkit-details-marker, .meal-template-group__heading::marker {
  display: none;
  content: "";
}
.activity-group__icon, .meal-template-group__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.activity-group__icon svg, .meal-template-group__icon svg {
  width: 16px;
  height: 16px;
}
.activity-group__label, .meal-template-group__label {
  flex: 1;
}
.activity-group__count, .meal-template-group__count {
  color: var(--text-muted);
  font-weight: 400;
}
.activity-group__chevron, .meal-template-group__chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}
.activity-group[open], .meal-template-group[open] {
  border-color: var(--color-accent);
}
.activity-group[open] .activity-group__heading, .activity-group[open] .meal-template-group__heading, .meal-template-group[open] .activity-group__heading, .meal-template-group[open] .meal-template-group__heading {
  color: var(--color-accent);
}
.activity-group[open] .activity-group__heading .activity-group__icon,
.activity-group[open] .activity-group__heading .activity-group__chevron,
.activity-group[open] .activity-group__heading .meal-template-group__icon,
.activity-group[open] .activity-group__heading .meal-template-group__chevron, .activity-group[open] .meal-template-group__heading .activity-group__icon,
.activity-group[open] .meal-template-group__heading .activity-group__chevron,
.activity-group[open] .meal-template-group__heading .meal-template-group__icon,
.activity-group[open] .meal-template-group__heading .meal-template-group__chevron, .meal-template-group[open] .activity-group__heading .activity-group__icon,
.meal-template-group[open] .activity-group__heading .activity-group__chevron,
.meal-template-group[open] .activity-group__heading .meal-template-group__icon,
.meal-template-group[open] .activity-group__heading .meal-template-group__chevron, .meal-template-group[open] .meal-template-group__heading .activity-group__icon,
.meal-template-group[open] .meal-template-group__heading .activity-group__chevron,
.meal-template-group[open] .meal-template-group__heading .meal-template-group__icon,
.meal-template-group[open] .meal-template-group__heading .meal-template-group__chevron {
  color: var(--color-accent);
}
.activity-group[open] .activity-group__heading .activity-group__icon,
.activity-group[open] .activity-group__heading .meal-template-group__icon, .activity-group[open] .meal-template-group__heading .activity-group__icon,
.activity-group[open] .meal-template-group__heading .meal-template-group__icon, .meal-template-group[open] .activity-group__heading .activity-group__icon,
.meal-template-group[open] .activity-group__heading .meal-template-group__icon, .meal-template-group[open] .meal-template-group__heading .activity-group__icon,
.meal-template-group[open] .meal-template-group__heading .meal-template-group__icon {
  background: color-mix(in srgb, var(--color-accent) 28%, transparent);
}
.activity-group[open] .activity-group__chevron, .activity-group[open] .meal-template-group__chevron, .meal-template-group[open] .activity-group__chevron, .meal-template-group[open] .meal-template-group__chevron {
  transform: rotate(180deg);
}

.meal-template-group--placeholder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem;
  border-style: dashed;
  color: var(--text-muted);
}

.activity-row-list {
  padding-bottom: 0.5rem;
}

.activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}
.activity-row:last-child {
  border-bottom: none;
}
.activity-row:has(input:checked) {
  color: var(--color-accent);
  font-weight: 600;
}

.quick-access {
  margin-bottom: var(--spacing);
  padding: 1rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.quick-access__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.quick-access__heading {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}
.quick-access__chips {
  margin-bottom: 0.75rem;
}
.quick-access__chips form {
  display: contents;
}
.quick-access__search-bar {
  display: flex;
  gap: 0.5rem;
  margin-top: var(--spacing);
  margin-bottom: var(--spacing);
}
.quick-access__search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  text-decoration: none;
}
.quick-access__search-row svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  color: var(--text-muted);
}
.quick-access__barcode-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--text-muted);
}
.quick-access__barcode-button svg {
  width: 1.2rem;
  height: 1.2rem;
}
.quick-access__barcode-button--active {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.builder-search-row__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
}
.builder-search-row__input:focus {
  outline: none;
}
.builder-search-row__input::placeholder {
  color: var(--text-muted);
}

.log-form__context {
  color: var(--color-accent);
  font-size: 0.85rem;
  margin-bottom: 0;
}
.log-form__source {
  margin-top: 0.15rem;
  text-align: center;
}
.log-form__label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  margin-top: var(--spacing);
}
.log-form__label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.log-form__label-row .log-form__label {
  margin-bottom: 0;
}
.log-form__portion-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: -0.5rem;
  margin-bottom: var(--spacing);
}
.log-form__delete {
  margin-top: 0.75rem;
}

.slot-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: var(--spacing);
}
.slot-buttons__item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  text-align: center;
  cursor: pointer;
}
.slot-buttons__item:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.slot-buttons__item:has(input:checked) {
  border-color: var(--color-accent);
  color: var(--color-accent);
  font-weight: 600;
}

.weight-chart {
  width: 100%;
  height: 140px;
  margin-top: var(--spacing);
}

.chart-line {
  fill: none;
}
.chart-line--daily {
  stroke: var(--text-muted);
  stroke-width: 1.5;
}
.chart-line--avg {
  stroke: var(--color-accent);
  stroke-width: 2.5;
}

.chart-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.chart-legend__swatch {
  display: inline-block;
  width: 0.85rem;
  height: 2px;
  margin-right: 0.3rem;
  vertical-align: middle;
}
.chart-legend__swatch--daily {
  background: var(--text-muted);
}
.chart-legend__swatch--avg {
  background: var(--color-accent);
}

.metrics-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.75rem;
  margin-top: var(--spacing);
  margin-bottom: 0.5rem;
}

.metric-tile {
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-align: center;
}
.metric-tile__label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.metric-tile__value {
  font-size: 1.3rem;
  font-weight: 700;
}
.metric-tile .badge {
  display: inline-block;
  margin-top: 0.35rem;
}

.macro-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: var(--spacing);
  font-size: 0.85rem;
}
.macro-grid__row {
  display: flex;
  flex-direction: column;
}
.macro-grid__value {
  white-space: nowrap;
  font-size: 0.8rem;
}

.period-toggle {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  margin-top: var(--spacing);
}
.period-toggle__item {
  flex: 1;
  text-align: center;
  padding: 0.6rem 0;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
}
.period-toggle__item.is-active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.bar-chart {
  display: flex;
  gap: 0.5rem;
  margin-top: var(--spacing);
}
.bar-chart__scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 140px;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: right;
  flex-shrink: 0;
}
.bar-chart__plot {
  flex: 1;
  min-width: 0;
}
.bar-chart__bars {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 140px;
  gap: 2px;
  border-left: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding-left: 0.35rem;
}
.bar-chart__target-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px dashed var(--text-muted);
  pointer-events: none;
}
.bar-chart__axis {
  display: flex;
  gap: 2px;
  padding-left: 0.35rem;
  margin-top: 0.3rem;
}
.bar-chart__axis-label {
  flex: 1;
  min-width: 2px;
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-muted);
}
.bar-chart__bar {
  flex: 1;
  min-width: 2px;
  background: var(--color-accent);
  border-radius: 2px 2px 0 0;
}
.bar-chart__bar--under {
  background: var(--color-warning);
}
.bar-chart__bar--on-target {
  background: var(--color-success);
}
.bar-chart__bar--over {
  background: var(--color-danger);
}
.bar-chart__bar--over-slight {
  background: var(--color-over-slight);
}
.bar-chart__bar--over-notable {
  background: var(--color-over-notable);
}
.bar-chart__bar--over-high {
  background: var(--color-over-high);
}
.bar-chart__bar--stacked {
  display: flex;
  flex-direction: column-reverse;
  background: none;
  border-radius: 0;
  overflow: hidden;
}
.bar-chart__segment {
  width: 100%;
}
.bar-chart__segment--carbs {
  background: var(--color-accent);
}
.bar-chart__segment--protein {
  background: var(--color-warning);
}
.bar-chart__segment--fat {
  background: var(--color-danger);
}

.balance-row {
  margin-bottom: 0.6rem;
}
.balance-row__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.balance-sport {
  margin-top: 0.5rem;
  margin-bottom: var(--spacing);
}

.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}
.week-nav__label {
  font-weight: 600;
}
.week-nav__range {
  text-align: center;
  margin-top: 0;
  margin-bottom: var(--spacing);
}

.template-pill-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.template-pill-list form {
  display: contents;
}

.template-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border);
}
.template-card:last-child {
  border-bottom: none;
}
.template-card__name {
  font-size: 0.95rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.template-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.template-card__kcal {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}
.template-card__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.template-card__delete-form {
  display: flex;
  flex: 0 0 auto;
}

.recipe-ingredient-list {
  margin-bottom: 0.5rem;
}

.recipe-builder__search {
  margin-bottom: 1.25rem;
}

.recipe-ingredient-row {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--color-border);
}
.recipe-ingredient-row__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.recipe-ingredient-row__amount {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
}
.recipe-ingredient-row__amount input[type=number] {
  width: 3.75rem;
  padding: 0.35rem 0.4rem;
  text-align: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
}
.recipe-ingredient-row__step {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 1rem;
  cursor: pointer;
}

.scan-frame {
  position: relative;
  height: 210px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  margin-bottom: 0.5rem;
}
.scan-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scan-frame__target {
  position: absolute;
  inset: 15% 10%;
  border: 2px solid #fff;
  border-radius: 8px;
  pointer-events: none;
}

.scan-frame__hint {
  text-align: center;
  margin-bottom: var(--spacing);
}

.scan-torch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--spacing);
}
.scan-torch-row[hidden] {
  display: none;
}

.scan-manual .form-field {
  margin-bottom: 0.5rem;
}

.nutrient-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--spacing);
}

.food-form__hint {
  background: color-mix(in srgb, var(--color-warning) 10%, var(--color-surface));
  border: 1px solid var(--color-warning);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: var(--spacing);
}
.food-form__portion {
  margin-bottom: var(--spacing);
}
.food-form__portion summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.food-form__footnote {
  text-align: center;
  margin-top: 0.5rem;
}

.undo-banner {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem var(--spacing);
  margin: 0 calc(var(--spacing) * -1) var(--spacing);
  background: var(--color-accent);
  color: var(--color-on-accent);
  box-shadow: 0 1px 0 var(--color-border);
  font-size: 0.9rem;
  font-weight: 600;
}
.undo-banner--danger {
  background: var(--color-bg);
  color: var(--color-danger);
  font-weight: 400;
}
.undo-banner__close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  margin-left: 0.25rem;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  opacity: 0.7;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.undo-banner__close:hover, .undo-banner__close:focus-visible {
  opacity: 1;
}

.import-summary {
  padding: var(--spacing) 0;
  border-bottom: 1px solid var(--color-border);
}
.import-summary__list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}
.import-summary__skipped {
  margin-top: 0.75rem;
}
.import-summary__skipped summary {
  cursor: pointer;
  color: var(--color-accent);
}
.import-summary__skipped ul {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.1rem;
}

.import-form {
  margin-top: var(--spacing);
}
.import-form input[type=file] {
  width: 100%;
  color: var(--color-text);
}

.value-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: var(--spacing);
}

.value-tile {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 1rem;
  color: var(--color-text);
  text-decoration: none;
}
.value-tile:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.value-tile--wide {
  grid-column: 1/-1;
  flex-direction: row;
  align-items: center;
}
.value-tile__icon {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--color-accent);
  flex-shrink: 0;
}
.value-tile__label {
  font-weight: 600;
}

.metric-summary-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--spacing);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.metric-summary-list strong {
  color: var(--color-text);
}
.metric-summary-list .badge {
  margin-left: 0.4rem;
}

.metric-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
}
.metric-history-row:last-child {
  border-bottom: none;
}
.metric-history-row--link {
  color: var(--text-muted);
}
.metric-history-row__value--under {
  color: var(--color-warning);
}
.metric-history-row__value--over {
  color: var(--color-danger);
}
.metric-history-row__value--over-slight {
  color: var(--color-over-slight);
}
.metric-history-row__value--over-notable {
  color: var(--color-over-notable);
}
.metric-history-row__value--over-high {
  color: var(--color-over-high);
}
.metric-history-row--head {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.macro-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  display: inline-block;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.macro-dot--carbs {
  background: var(--color-accent);
}
.macro-dot--protein {
  background: var(--color-warning);
}
.macro-dot--fat {
  background: var(--color-danger);
}

.weighin-reminder {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing);
}
.weighin-reminder[hidden] {
  display: none;
}
.weighin-reminder__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--color-bg) 80%, transparent);
}
.weighin-reminder__card {
  position: relative;
  width: 100%;
  max-width: 22rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--color-accent);
  color: var(--color-on-accent);
}
.weighin-reminder__card .text-muted {
  color: inherit;
  opacity: 0.75;
}
.weighin-reminder__card .btn-primary {
  background: var(--color-on-accent);
  color: var(--color-accent);
}
.weighin-reminder__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  background: none;
  color: var(--color-on-accent);
  opacity: 0.7;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.weighin-reminder__close:hover, .weighin-reminder__close:focus-visible {
  opacity: 1;
}
.weighin-reminder__title {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 1.5rem 0.25rem 0;
}

.app-splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  color: var(--color-accent);
  opacity: 1;
  transition: opacity 0.3s ease;
}
.app-splash[hidden] {
  display: none;
}
.app-splash--hide {
  opacity: 0;
}
.app-splash__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.app-splash__logo {
  width: min(50vw, 12rem);
  height: min(50vw, 12rem);
}
.app-splash__version {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: transparent;
}
.tour-overlay[hidden] {
  display: none;
}

.tour-highlight {
  position: relative;
  z-index: 39;
  border-radius: var(--radius);
  box-shadow: 0 0 0 3px var(--color-accent), 0 0 24px 4px color-mix(in srgb, var(--color-accent) 60%, transparent);
}

.tour-bubble {
  position: fixed;
  z-index: 41;
  width: min(88vw, 22rem);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  background: var(--color-accent);
  color: var(--color-on-accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 1.25rem;
  box-shadow: 0 8px 24px color-mix(in srgb, black 40%, transparent);
}
.tour-bubble::before {
  content: "";
  position: absolute;
  left: var(--tour-arrow-left, 50%);
  width: 1rem;
  height: 1rem;
  background: var(--color-accent);
  transform: translateX(-50%) rotate(45deg);
}
.tour-bubble--arrow-top::before {
  top: -0.4rem;
}
.tour-bubble--arrow-bottom::before {
  bottom: -0.4rem;
}
.tour-bubble__counter {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0.75;
  margin-bottom: 0.35rem;
}
.tour-bubble__text {
  margin: 0 0 1rem;
  font-weight: 600;
  line-height: 1.4;
}
.tour-bubble__button {
  margin: 0;
  border: 1px solid var(--color-on-accent);
}

.invitation-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}
.invitation-row span:first-child {
  flex: 1;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

:root[data-theme=light] {
  --color-bg: #ffffff;
  --color-surface: #f5f6f8;
  --color-surface-2: #eceef1;
  --color-border: #c3c9d1;
  --color-text: #1a1d21;
  --text-muted: #5b636d;
  --color-accent: #1f9d3a;
  --color-on-accent: #ffffff;
  --color-success: #2e8f45;
  --color-warning: #a6790f;
  --color-danger: #d1373a;
  --color-over-slight: #b5730c;
  --color-over-notable: #c1590f;
  --color-over-high: var(--color-danger);
  color-scheme: light;
}

/*# sourceMappingURL=app-7d1043473d.output.css.map */
