:root {
  --nt-accent: #1f6b32;
  --nt-accent-strong: #4fb56b;
  --nt-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nt-root-size: 16px;

  --nt-rule: var(--bs-border-color-translucent);
  --nt-control-size: 3rem;
  --nt-control-font: 1.05rem;
  --nt-control-icon: 1.45rem;
  --nt-hairline: 0.0625rem;
  --nt-card-edge: 0.1875rem;
  --nt-focus-ring: 0.125rem;
  --nt-z-fixed: 1030;
  --nt-z-boot: 2000;

  --bs-primary: var(--nt-accent);
  --bs-link-color: var(--nt-accent);
  --bs-link-hover-color: var(--nt-accent-strong);
}

html {
  font-size: var(--nt-root-size);
}

body {
  font-family: var(--nt-font);
  min-height: 100vh;
}

.btn-primary {
  --bs-btn-bg: var(--nt-accent);
  --bs-btn-border-color: var(--nt-accent);
  --bs-btn-hover-bg: var(--nt-accent-strong);
  --bs-btn-hover-border-color: var(--nt-accent-strong);
  --bs-btn-active-bg: var(--nt-accent-strong);
  --bs-btn-active-border-color: var(--nt-accent-strong);
}

.btn-outline-primary {
  --bs-btn-color: var(--nt-accent);
  --bs-btn-border-color: var(--nt-accent);
  --bs-btn-hover-bg: var(--nt-accent);
  --bs-btn-hover-border-color: var(--nt-accent);
}

.font-mono,
.nutrient-table td,
.export-box {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.min-w-0 {
  min-width: 0;
}

#boot-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bs-body-bg);
  z-index: var(--nt-z-boot);
}

.app-navbar {
  background: var(--bs-body-bg);
  border-bottom: var(--nt-hairline) solid var(--nt-rule);
  z-index: var(--nt-z-fixed);
}

.app-navbar > .container-xl {
  display: flex;
  align-items: center;
  min-height: var(--nt-control-size);
}

.btn-ghost {
  --bs-btn-color: var(--bs-body-color);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: transparent;
  --bs-btn-hover-bg: var(--bs-secondary-bg);
  --bs-btn-hover-border-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  line-height: 1.5;
  min-height: var(--nt-control-size);
  font-size: var(--nt-control-font);
}

.btn-ghost .bi {
  vertical-align: 0;
  font-size: var(--nt-control-icon);
}

.app-navbar .btn-ghost,
.meal-card .dropdown > .btn-ghost,
.modal-header .dropdown > .btn-ghost,
.btn-ghost[aria-label] {
  min-width: var(--nt-control-size);
}

.btn-ghost.btn-sm {
  --bs-btn-font-size: var(--nt-control-font);
  --bs-btn-padding-y: 0.25rem;
  --bs-btn-padding-x: 0.5rem;
}

.bi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: -0.125em;
}

.bi::before {
  display: block;
  line-height: 1;
}

[data-nt-icon-nudge="on"] .bi::before {
  transform: translateY(0.17em);
}

.meal-card {
  border-left: var(--nt-card-edge) solid var(--nt-rule);
}

.meal-card.is-focused {
  border-left-color: var(--nt-accent);
  outline: var(--nt-focus-ring) solid var(--nt-accent);
  outline-offset: calc(-1 * var(--nt-focus-ring));
}

.meal-card:focus {
  outline: none;
}

.portion-list .list-group-item {
  background: transparent;
}

.meal-thumb {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border: var(--nt-hairline) solid var(--nt-rule);
  border-radius: var(--bs-border-radius);
  overflow: hidden;
}

.meal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nutrient-table th[scope="row"] {
  font-family: var(--nt-font);
  font-variant-numeric: normal;
}

.nutrient-band {
  white-space: nowrap;
}

.product-suggest {
  max-height: 14rem;
  overflow-y: auto;
  margin-bottom: 0.5rem;
}

.product-suggest .list-group-item {
  min-height: var(--nt-control-size);
  text-align: left;
}

.scroll-menu {
  max-height: var(--popper-available-height, 60vh);
  overflow-y: auto;
  max-width: calc(100vw - 1rem);
  min-width: 14rem;
}

.dropdown-menu {
  --bs-dropdown-font-size: var(--nt-control-font);
  --bs-dropdown-item-padding-y: 0.65rem;
  --bs-dropdown-item-padding-x: 1rem;
}

.dropdown-item {
  white-space: normal;
  display: flex;
  align-items: center;
  min-height: var(--nt-control-size);
}

.dropdown-item .bi {
  font-size: var(--nt-control-icon);
}

.scanner-frame {
  position: relative;
  background: #000;
  border-radius: var(--bs-border-radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.scanner-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-reticle {
  position: absolute;
  inset: 30% 10%;
  border: 0.125rem solid rgba(255, 255, 255, 0.8);
  border-radius: 0.25rem;
  pointer-events: none;
}

.calendar td,
.calendar th {
  width: calc(100% / 7);
  padding: 0.1rem;
  text-align: center;
}

.cal-day {
  position: relative;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--bs-body-color);
  padding: 0.35rem 0;
  border-radius: var(--bs-border-radius);
  white-space: nowrap;
}

.cal-day:hover {
  background: var(--bs-secondary-bg);
}

.cal-day.active {
  background: var(--nt-accent);
  color: #fff;
}

.cal-today {
  outline: var(--nt-hairline) solid var(--nt-accent);
}

.cal-dot {
  position: absolute;
  bottom: 0.15rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

.cal-dot--some {
  width: 0.35rem;
  height: 0.35rem;
}

.cal-dot--many {
  width: 0.45rem;
  height: 0.45rem;
  opacity: 0.9;
}

.accent-swatch {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--swatch);
  border: var(--nt-hairline) solid var(--nt-rule);
}

.btn-check:checked + .accent-swatch {
  outline: var(--nt-focus-ring) solid var(--bs-body-color);
  outline-offset: var(--nt-focus-ring);
}

#compact-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: var(--nt-z-fixed);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--nt-accent);
  color: #fff;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.25);
  transition: opacity 0.2s ease;
}

#compact-fab.is-scrolling {
  opacity: 0.35;
}

[data-nt-fab="off"] #compact-fab {
  display: none;
}

@media (min-width: 576px) {
  [data-nt-fab="mobile"] #compact-fab {
    display: none;
  }
}

[data-nt-animations="off"] * {
  transition: none !important;
  animation: none !important;
}

[data-nt-animations="off"] .fade {
  transition: none !important;
}

[data-nt-compact="on"] .meal-card .portion-list,
[data-nt-compact="on"] .meal-card [data-role="photos"] {
  display: none;
}

[data-nt-compact="on"] .meal-card {
  margin-bottom: 0.25rem !important;
}

@media (max-width: 575.98px) {
  .modal-dialog {
    margin: 0;
    min-height: 100%;
  }

  .modal-content {
    min-height: 100vh;
    border-radius: 0;
    border: none;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

.modal-body {
  overflow-wrap: anywhere;
}

.table-responsive {
  overflow-x: auto;
}
