:root {
  --bg: #000000;
  --card: #111110;
  --ink: #f5f3ea;
  --soft: rgba(245, 243, 234, 0.54);
  --line: rgba(245, 243, 234, 0.12);
  --accent: #ffd43b;
  --over: #ff7a59;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 16px;
}

.nf {
  width: min(332px, 100%);
  padding: 12px 15px 6px;
  border-radius: 28px;
  background: linear-gradient(180deg, #1a1a17 0%, var(--card) 50%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 30px 60px -30px color-mix(in srgb, var(--accent) 30%, transparent);
}
.nf__head { display: flex; align-items: center; justify-content: space-between; height: 32px; }
.nf__title { font-size: 15px; font-weight: 680; font-stretch: 108%; letter-spacing: -0.008em; }
.nf__qty { display: flex; align-items: center; height: 32px; padding: 0 3px; border-radius: 16px; background: rgba(245, 243, 234, 0.08); }
.nf__qty button { display: grid; place-items: center; width: 30px; height: 26px; border: 0; border-radius: 13px; background: none; color: var(--ink); cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: background-color 0.2s ease, opacity 0.2s ease; }
.nf__qty button:disabled { opacity: 0.3; cursor: default; }
.nf__qty svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.900; stroke-linecap: round; }
.nf__qty button:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.nf__n { display: block; min-width: 76px; height: 18px; overflow: hidden; text-align: center; font-size: 12px; line-height: 18px; font-weight: 660; }
.nf__n span { display: block; white-space: nowrap; }

/* the calories: the heaviest thing on the label, and heavier with every portion */
.nf__read { display: flex; align-items: flex-end; gap: 8px; margin-top: 2px; padding-bottom: clamp(5px, 1.800vh, 9px); border-bottom: 5px solid var(--ink); }
.nf__kcal { height: clamp(44px, 13vh, 56px); font-size: clamp(42px, 12.500vh, 54px); line-height: clamp(44px, 13vh, 56px); font-weight: 400; letter-spacing: -0.04em; font-variation-settings: "wght" var(--w, 700), "wdth" 92; }
.nf__unit { padding-bottom: 5px; font-size: 12px; line-height: 15px; font-weight: 620; }
.nf__unit span { color: var(--soft); font-weight: 540; }

/* where the calories come from: carbohydrate, protein and fat, each as wide as its share */
.nf__bar { display: flex; gap: 3px; height: 8px; margin-top: clamp(7px, 2.200vh, 11px); }
.nf__bar i { display: block; height: 100%; min-width: 0; border-radius: 4px; background: var(--ink); opacity: 0.3; transform-origin: 50% 50%; transition: opacity 0.25s ease, background-color 0.25s ease; }
.nf__bar i.is-pick { background: var(--accent); opacity: 1; }

.nf__rows { margin-top: clamp(3px, 1.200vh, 7px); }
.nut {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 42px;
  align-items: center;
  column-gap: 8px;
  width: 100%;
  height: clamp(27px, 7.800vh, 33px);
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.nut:last-child { border-bottom: 0; }
.nut__name { font-size: 12.5px; font-weight: 660; white-space: nowrap; }
.nut__g { font-size: 12.5px; font-weight: 540; color: var(--soft); white-space: nowrap; }
.nut__pc { font-size: 12.5px; font-weight: 700; text-align: right; white-space: nowrap; transition: color 0.3s ease; }
/* the share of the day: a thin line under the row, warmer when it passes the whole day */
.nut__day { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; border-radius: 1px; background: var(--accent); transition: background-color 0.3s ease; }
.nut.is-over .nut__day { background: var(--over); }
.nut.is-over .nut__pc { color: var(--over); }
.nut:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 8px; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #f5f3ea;
  stroke: #000000;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (hover: hover) {
  .nf__qty button:not(:disabled):hover { background: rgba(245, 243, 234, 0.1); }
}
/* larger in a roomy window, so the preview is not a small card in a big page */
@media (min-width: 700px) and (min-height: 500px) { .nf { zoom: 1.4; } .ghost { width: 28px; height: 28px; } }
@media (min-width: 1100px) and (min-height: 760px) { .nf { zoom: 2; } .ghost { width: 34px; height: 34px; } }
