:root {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #193b35;
  background: #f5f6f0;
  font-synthesis: none;
  --green: #17483f;
  --muted: #63736c;
  --line: #dce3d9;
  --lime: #d4ee98;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button,
.button {
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  background: var(--green);
  color: white;
  padding: 14px 18px;
  min-height: 48px;
  font-weight: 650;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.secondary,
.button.secondary {
  background: #e7ecdf;
  color: var(--green);
}
button.quiet {
  background: transparent;
  color: var(--green);
  padding: 8px 10px;
}
button.danger {
  color: #9a2d32;
  background: #fbe8e8;
}
.topbar {
  height: 76px;
  max-width: 920px;
  margin: auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--green);
  text-decoration: none;
}
.brand-dot {
  color: #9cbd66;
  font-size: 13px;
  vertical-align: top;
  margin-left: 3px;
}
#connection {
  font-size: 12px;
  color: var(--muted);
}
main {
  max-width: 780px;
  margin: auto;
  padding: 14px 24px 128px;
}
h1 {
  font-size: clamp(28px, 6vw, 38px);
  line-height: 1.12;
  letter-spacing: -1.2px;
  margin: 8px 0 10px;
}
h2 {
  font-size: 19px;
  letter-spacing: -0.4px;
  margin: 0 0 14px;
}
h3 {
  font-size: 16px;
  margin: 0;
}
p {
  line-height: 1.5;
}
.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 750;
  color: var(--muted);
}
.muted {
  color: var(--muted);
  font-size: 14px;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  margin: 16px 0;
}
.hero {
  background: var(--green);
  color: white;
  border: 0;
}
.hero .muted {
  color: #c3d6cb;
}
.kcal {
  font-size: 52px;
  font-weight: 750;
  letter-spacing: -3px;
  line-height: 1.15;
}
.kcal small {
  font-size: 14px;
  font-weight: 450;
  letter-spacing: 0;
  color: #c3d6cb;
}
.macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
}
.macro {
  border-left: 2px solid #a4bf87;
  padding-left: 10px;
  font-size: 12px;
  color: #c3d6cb;
}
.macro strong {
  display: block;
  font-size: 19px;
  color: white;
  margin-top: 4px;
}
.meter {
  height: 7px;
  width: 100%;
  background: #456a5b;
  border-radius: 20px;
  margin-top: 18px;
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  background: var(--lime);
  border-radius: 20px;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.row + .row {
  margin-top: 12px;
}
.food-row {
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  gap: 12px;
  display: flex;
  align-items: center;
}
.food-row:last-child {
  border-bottom: 0;
}
.food-info {
  flex: 1;
  min-width: 0;
}
.food-info strong {
  display: block;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.food-info small {
  color: var(--muted);
  font-size: 12px;
}
.food-row button.quiet {
  min-width: 42px;
}
.empty {
  padding: 24px 4px;
  text-align: center;
  color: var(--muted);
}
.stack {
  display: grid;
  gap: 12px;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.chips button {
  font-size: 13px;
  padding: 9px 13px;
  min-height: 38px;
}
.full {
  width: 100%;
}
label {
  font-size: 13px;
  font-weight: 600;
  display: grid;
  gap: 7px;
  margin: 12px 0;
}
input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cbd6cb;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  color: #193b35;
}
input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid #a5c968;
  outline-offset: 3px;
}
input.grams {
  font-size: 50px;
  font-weight: 700;
  text-align: center;
  min-height: 100px;
}
.searchbar {
  display: flex;
  gap: 8px;
}
.searchbar input {
  min-width: 0;
}
.small {
  font-size: 12px;
}
.entry-actions {
  display: flex;
  gap: 2px;
}
nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 12px max(12px, env(safe-area-inset-bottom));
  background: #fdfefaf5;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  gap: 4px;
  backdrop-filter: blur(12px);
}
nav[hidden] {
  display: none;
}
nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
  padding: 8px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  gap: 3px;
}
nav a span {
  font-size: 20px;
}
nav a.active {
  background: #e7eedb;
  color: var(--green);
}
.add-fab {
  position: fixed;
  bottom: 96px;
  right: max(24px, calc((100vw - 760px) / 2));
  box-shadow: 0 5px 20px #17483f30;
  border-radius: 20px;
  background: var(--lime);
  color: var(--green);
  font-size: 17px;
  padding: 17px 24px;
}
.notice {
  border-left: 3px solid #a5c968;
  background: #edf3e1;
  padding: 14px;
  border-radius: 8px;
  font-size: 14px;
}
.error {
  border-color: #bb4545;
  background: #fff0ed;
  color: #822a2a;
}
#notice:not(:empty) {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  width: max-content;
  background: #193b35;
  color: white;
  padding: 13px 20px;
  border-radius: 14px;
  z-index: 10;
  box-shadow: 0 4px 20px #0002;
}
.token {
  font-family: monospace;
  overflow-wrap: anywhere;
  background: #edf3e1;
  padding: 16px;
  border-radius: 12px;
  user-select: all;
}
video {
  width: 100%;
  border-radius: 16px;
  max-height: 320px;
  background: #17362d;
}
.spark {
  width: 100%;
  height: 160px;
}
.spark polyline {
  fill: none;
  stroke: #6c9539;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}
.spark text {
  font-size: 11px;
  fill: #63736c;
}
.date {
  max-width: 160px;
}
.login {
  text-align: center;
  margin-top: 8vh;
}
.login .leaf {
  font-size: 56px;
}
details {
  margin: 18px 0;
}
summary {
  cursor: pointer;
  font-weight: 650;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check input {
  width: 22px;
  min-height: 22px;
  margin: 0;
}
.badge {
  background: #eaf1dd;
  border-radius: 8px;
  font-size: 11px;
  padding: 4px 7px;
}
@media (min-width: 650px) {
  main {
    padding-top: 30px;
  }
  .topbar {
    height: 84px;
  }
  .two-col {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 20px;
    align-items: start;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button:active {
    transform: scale(0.98);
  }
}
