/* Meals. One family (Archivo, variable width + weight): extra-condensed black for
   titles and dinner names, normal width for reading. The one loud element is the
   Nutrition Facts panel on Today; everything else stays quiet. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

/* Colour comes from the food and always means something: herb green is the
   site; each meal slot has its own colour (yolk breakfast, avocado lunch,
   berry snack, blue shake, tomato dinner); grocery aisles and advice cards use
   the same set. The Nutrition Facts panel stays black on white on purpose. */
:root {
  --page: #f3f6ee;
  --paper: #ffffff;
  --ink: #000000;
  --ink-2: #44493f;
  --ink-3: #62685c;
  --line: #d3d9cb;
  --tape: #ffd23f;
  --tape-ink: #000000;
  --alert: #b3261e;
  --good: #1f6b45;
  --dot: #8b9184;

  --herb: #1f6b45;
  --herb-ink: #ffffff;
  --herb-soft: #e1efe4;
  --yolk: #e8a600;
  --yolk-soft: #fdf1cf;
  --avocado: #5a9a2c;
  --avocado-soft: #e8f3da;
  --berry: #b4245d;
  --berry-soft: #f8e1ea;
  --sky: #2c6fb7;
  --sky-soft: #e2edf8;
  --tomato: #d9432b;
  --tomato-soft: #fce4de;

  --gutter: 16px;
  --tabs-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0b120d;
    --paper: #151d17;
    --ink: #ffffff;
    --ink-2: #c3cabe;
    --ink-3: #9aa294;
    --line: #2d382f;
    --alert: #ff8a80;
    --good: #6bd38a;
    --dot: #7c8577;

    --herb: #2f8a5b;
    --herb-ink: #ffffff;
    --herb-soft: #183324;
    --yolk: #f5b81c;
    --yolk-soft: #3a2f0e;
    --avocado: #7cc04a;
    --avocado-soft: #20301a;
    --berry: #e0578f;
    --berry-soft: #3a1626;
    --sky: #5a9ee6;
    --sky-soft: #142a40;
    --tomato: #f0644c;
    --tomato-soft: #3d1a14;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--tape); color: var(--tape-ink); padding: .5rem 1rem; z-index: 50; }
.skip:focus { left: var(--gutter); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ type */

h1, h2, h3 { margin: 0; font-weight: 800; }

.display, h1 {
  font-stretch: 62%;
  font-weight: 900;
  line-height: .9;
  letter-spacing: -0.005em;
}

h1 { font-size: clamp(3rem, 15vw, 5.25rem); margin: 1.25rem 0 .5rem; overflow-wrap: anywhere; }
h1.smaller { font-size: clamp(2.5rem, 11vw, 4rem); }

h2 {
  font-stretch: 75%;
  font-size: 1.625rem;
  line-height: 1.05;
  margin: 2.25rem 0 .5rem;
}

h3 { font-stretch: 87.5%; font-size: 1.1875rem; line-height: 1.2; margin: 1.5rem 0 .35rem; }

p { margin: .5rem 0; max-width: 38em; }

.lede { font-size: 1.125rem; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ frame */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  height: calc(52px + env(safe-area-inset-top));
  background: var(--herb);
  color: var(--herb-ink);
}
.top :focus-visible { outline-color: var(--herb-ink); }

.brand {
  font-stretch: 62%;
  font-weight: 900;
  font-size: 1.75rem;
  line-height: 1;
  text-decoration: none;
}

.top-week { font-size: .875rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: var(--tape); color: var(--tape-ink); }
.top-auth { margin-left: auto; font-size: .9375rem; font-weight: 700; }

.net {
  position: sticky;
  top: calc(52px + env(safe-area-inset-top));
  z-index: 19;
  margin: 0;
  padding: .45rem var(--gutter);
  background: var(--sky-soft);
  border-bottom: 1px solid var(--sky);
  font-size: .9375rem;
  font-weight: 650;
}
@media (min-width: 960px) { .net { grid-column: 1 / -1; } }

main {
  display: block;
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 var(--gutter) calc(var(--tabs-h) + 3rem + env(safe-area-inset-bottom));
}
main:focus { outline: none; }

.loading { margin-top: 3rem; color: var(--ink-2); }

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--paper);
  border-top: 3px solid var(--herb);
}

.tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 750;
  font-stretch: 87.5%;
  font-size: .9375rem;
  min-width: 0;
}

.tabs a span { padding: .25rem .4rem; border-radius: 2px; }
.tabs a[aria-current="page"] span { background: var(--tape); color: var(--tape-ink); }

.rail { display: none; }

@media (min-width: 960px) {
  body {
    display: grid;
    grid-template-columns: 15rem 1fr;
    grid-template-rows: auto 1fr;
  }
  .top { grid-column: 1 / -1; }
  .tabs { display: none; }
  .rail {
    display: block;
    position: sticky;
    top: 54px;
    align-self: start;
    padding: 1.25rem var(--gutter);
  }
  .rail a {
    display: block;
    padding: .4rem .6rem;
    margin: 0 -.6rem;
    text-decoration: none;
    font-weight: 650;
    border-radius: 2px;
  }
  .rail a[aria-current="page"] { background: var(--tape); color: var(--tape-ink); font-weight: 800; }
  .rail hr { border: 0; border-top: 1px solid var(--line); margin: .75rem 0; }
  main { margin: 0; padding-bottom: 4rem; padding-left: 2rem; max-width: 46rem; }
}

/* ------------------------------------------------------------ controls */

button, input, select, textarea { font: inherit; color: inherit; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 44px;
  padding: .55rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.btn.solid { background: var(--herb); border-color: var(--herb); color: var(--herb-ink); }
.btn.tape { background: var(--tape); color: var(--tape-ink); border-color: var(--tape-ink); }
.btn.quiet { border-color: transparent; background: transparent; text-decoration: underline; padding-inline: .25rem; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { min-height: 36px; padding: .3rem .7rem; font-size: .9375rem; }
.btns { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1rem 0; }

.seg { display: inline-flex; border: 2px solid var(--herb); border-radius: 999px; overflow: hidden; background: var(--paper); }
.seg button {
  min-height: 40px;
  padding: .4rem .9rem;
  border: 0;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}
.seg button + button { border-left: 2px solid var(--herb); }
.seg button[aria-pressed="true"] { background: var(--herb); color: var(--herb-ink); }
.controls { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.25rem; }
.controls.tight .seg button { min-height: 38px; padding: .35rem .75rem; font-size: .9375rem; }

label { display: block; font-weight: 650; font-size: .9375rem; margin: .9rem 0 .3rem; }
label.inline { display: flex; align-items: center; gap: .6rem; font-weight: 600; margin: .6rem 0; }
.help { display: block; font-weight: 400; color: var(--ink-2); font-size: .875rem; }

input[type="text"], input[type="number"], input[type="date"], input[type="password"], input:not([type]), textarea, select {
  width: 100%;
  min-height: 44px;
  padding: .55rem .7rem;
  border: 1.5px solid var(--ink-3);
  border-radius: 6px;
  background: var(--paper);
}
textarea { min-height: 5.5rem; resize: vertical; line-height: 1.45; }
select { padding-right: 2rem; }

input[type="checkbox"].check {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  display: grid;
  place-content: center;
  cursor: pointer;
}
input[type="checkbox"].check::after {
  content: "";
  width: .55rem;
  height: .95rem;
  margin-top: -.2rem;
  border: solid var(--tape-ink);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) scale(0);
}
input[type="checkbox"].check:checked { background: var(--tape); border-color: var(--tape-ink); }
.meal input[type="checkbox"].check { border-color: var(--slot, var(--ink)); }
.meal input[type="checkbox"].check:checked { background: var(--slot, var(--tape)); border-color: var(--slot, var(--tape-ink)); }
.meal input[type="checkbox"].check:checked::after { border-color: var(--slot-check, #fff); }
.slot-breakfast { --slot-check: #000; } /* white on yolk is too faint */
input[type="checkbox"].check:checked::after { transform: rotate(45deg) scale(1); }

.err { color: var(--alert); font-weight: 650; }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabs-h) + 12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  max-width: calc(100% - 2 * var(--gutter));
  padding: .6rem 1rem;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.toast.on { opacity: 1; }
@media (min-width: 960px) { .toast { bottom: 24px; } }

.tape {
  background: var(--tape);
  color: var(--tape-ink);
  padding: .8rem 1rem;
  border-radius: 2px;
  margin: 1rem 0;
}
.tape p { margin: .25rem 0; }
.tape a { color: var(--tape-ink); }

/* ------------------------------------------------------------ today */

.date-line { font-weight: 650; color: var(--ink-2); margin: 0; }

.tonight { margin: .75rem 0 0; font-size: 1.125rem; }
.tonight a { font-weight: 800; }

.day-nav { display: flex; justify-content: space-between; gap: 1rem; margin: 1.5rem 0 0; font-weight: 650; }

/* The Nutrition Facts panel: the page's one loud element. */
.facts {
  max-width: 26rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: .4rem .75rem .6rem;
  margin: 1.25rem 0;
}
.facts-title { font-stretch: 62%; font-weight: 900; font-size: 2.6rem; line-height: 1; margin: 0; }
.facts-sub { display: flex; justify-content: space-between; font-weight: 650; font-size: .9375rem; margin: .15rem 0 0; }
.facts .rule { background: var(--ink); height: 1px; }
.facts .rule.xl { height: 12px; margin: .3rem 0 .15rem; }
.facts .rule.m { height: 5px; margin: .2rem 0 .1rem; }
.facts-row {
  display: grid;
  grid-template-columns: 1fr auto 4.25rem;
  align-items: baseline;
  gap: .5rem;
  padding: .22rem 0;
  border-top: 1px solid var(--ink);
  font-variant-numeric: tabular-nums;
}
.facts-row.first { border-top: 0; }
.facts-row b { font-weight: 850; }
.facts-row .pct { text-align: right; font-weight: 850; }
.facts-row .of { text-align: right; }
.facts-head { display: flex; justify-content: flex-end; font-size: .8125rem; font-weight: 800; padding-top: .1rem; }
.facts-big { font-weight: 900; font-stretch: 75%; font-size: 1.9rem; line-height: 1.1; }
.facts-foot { font-size: .8125rem; margin: .45rem 0 0; color: var(--ink-2); }
.meter { height: 6px; background: var(--line); margin: .15rem 0 .35rem; }
.meter i { display: block; height: 100%; background: var(--herb); width: 0; transition: width .35s ease-out; }

/* Each meal slot carries its colour as a stripe and a tag. */
.slot-breakfast { --slot: var(--yolk); --slot-soft: var(--yolk-soft); }
.slot-lunch { --slot: var(--avocado); --slot-soft: var(--avocado-soft); }
.slot-snack { --slot: var(--berry); --slot-soft: var(--berry-soft); }
.slot-shake { --slot: var(--sky); --slot-soft: var(--sky-soft); }
.slot-dinner { --slot: var(--tomato); --slot-soft: var(--tomato-soft); }
.slot-other { --slot: var(--herb); --slot-soft: var(--herb-soft); }

.meals { list-style: none; margin: 0; padding: 0; }
.meal {
  display: grid;
  grid-template-columns: 2.25rem 1fr auto;
  gap: .25rem .75rem;
  padding: .9rem .9rem .9rem .8rem;
  margin: .6rem 0;
  background: var(--paper);
  border-left: 6px solid var(--slot, var(--line));
  border-radius: 4px 10px 10px 4px;
}
.meal .check { margin-top: .2rem; }
.meal-slot {
  justify-self: start;
  display: inline-block;
  font-size: .8125rem;
  font-weight: 750;
  margin: 0 0 .2rem;
  padding: .05rem .5rem;
  border-radius: 999px;
  background: var(--slot-soft, var(--herb-soft));
  color: var(--ink);
}
.meal-title { font-size: 1.1875rem; font-weight: 800; line-height: 1.25; margin: 0; }
.meal-food { color: var(--ink-2); margin: .2rem 0 0; font-size: .9375rem; }
.meal-note { font-size: .875rem; margin: .3rem 0 0; }
.meal-nums { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meal-nums b { display: block; font-size: 1.125rem; }
.meal-nums span { color: var(--ink-2); font-size: .9375rem; }
.meal-pick { grid-column: 2 / -1; margin-top: .4rem; }
.meal-pick select { width: auto; max-width: 100%; min-height: 40px; font-size: .9375rem; }
.meal.eaten .meal-title { text-decoration: line-through; text-decoration-thickness: 2px; }
.meal.eaten { background: var(--slot-soft, var(--paper)); }
.meal.adjust { --slot: var(--ink-3); --slot-soft: var(--line); }
.meal-thumb { width: 3.5rem; height: 3.5rem; object-fit: cover; border-radius: 8px; float: right; margin: 0 0 .25rem .6rem; }

.summary { display: flex; flex-wrap: wrap; gap: .35rem .9rem; align-items: baseline; margin: .25rem 0 0; font-variant-numeric: tabular-nums; }
.summary b { font-size: 1.25rem; font-weight: 850; }

.tips { display: grid; gap: .5rem; margin: 1rem 0; }
.tip { border-radius: 10px; padding: .7rem .9rem; background: var(--yolk-soft); border-left: 6px solid var(--yolk); }
.tip.prep { background: var(--avocado-soft); border-left-color: var(--avocado); }
.tip h3 { margin: 0 0 .15rem; font-size: 1.0625rem; }
.tip p { margin: .1rem 0; }

.extras { list-style: none; margin: .25rem 0; padding: 0; }
.extras li { display: grid; grid-template-columns: 1fr auto auto; gap: .5rem; align-items: center; padding: .45rem 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.extra-form { display: grid; grid-template-columns: 1fr 6rem 6rem; gap: .5rem; align-items: end; }
.extra-form label { margin: 0 0 .25rem; }
.extra-form .btns { grid-column: 1 / -1; margin: .25rem 0 0; }
@media (max-width: 420px) { .extra-form { grid-template-columns: 1fr 1fr; } .extra-form > div:first-child { grid-column: 1 / -1; } }

.today-grid { display: block; }
@media (min-width: 960px) {
  main.wide { max-width: 66rem; }
  .today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 24rem; gap: 2rem; align-items: start; }
  .today-side { position: sticky; top: 70px; }
  .today-side .facts { margin-top: 0; }
}

.quick-weigh { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; }
.quick-weigh label { margin: 0; flex: 1 1 9rem; }

/* ------------------------------------------------------------ lists and tables */

.tbl-wrap { position: relative; overflow-x: auto; margin: .75rem 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9688rem; }
.tbl th { text-align: left; font-weight: 800; font-size: .875rem; padding: .45rem .5rem .45rem 0; border-bottom: 2px solid var(--ink); vertical-align: bottom; }
.tbl td { padding: .55rem .5rem .55rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.is-today { background: var(--tape); color: var(--tape-ink); font-weight: 750; }
.tbl td.is-today a { color: var(--tape-ink); }
.tbl td:first-child, .tbl th:first-child { padding-left: .25rem; }

.board { list-style: none; margin: 1rem 0; padding: 0; }
.board li { border-top: 2px solid var(--tomato); }
.board li:last-child { border-bottom: 2px solid var(--tomato); }
.board a { display: grid; grid-template-columns: 1fr auto; gap: .9rem; align-items: center; padding: .8rem 0 .9rem; text-decoration: none; }
.board .thumb { width: 6.5rem; height: 5rem; object-fit: cover; border-radius: 10px; background: var(--tomato-soft); }
.board .name { display: block; font-stretch: 62%; font-weight: 900; font-size: 2.1rem; line-height: .95; }
.board a:hover .name { color: var(--tomato); }
.board .carb { display: block; color: var(--ink-2); margin-top: .3rem; }
.board .whens { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.board .when { font-size: .8125rem; font-weight: 700; padding: .05rem .5rem; border-radius: 999px; background: var(--tomato-soft); }
.board .mins { display: block; font-size: .875rem; color: var(--ink-2); margin-top: .2rem; }

.hero-photo { margin: .75rem 0 .25rem; }
.hero-photo img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 14px; background: var(--tomato-soft); }
.hero-photo figcaption { font-size: .8125rem; color: var(--ink-3); margin-top: .3rem; }
.recipe-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin: .75rem 0; padding: 0; list-style: none; }
.recipe-meta li { padding: .25rem .7rem; border-radius: 999px; background: var(--tomato-soft); font-weight: 700; font-size: .9375rem; }
.ingredients { list-style: none; padding: 0; margin: .5rem 0; }
.ingredients li { padding: .45rem 0 .45rem 1.4rem; border-top: 1px solid var(--line); position: relative; }
.ingredients li::before { content: ""; position: absolute; left: .2rem; top: .95rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--avocado); }
.source { font-size: .9375rem; color: var(--ink-2); }

ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 1rem 0; }
ol.steps li { counter-increment: step; display: grid; grid-template-columns: 2.75rem 1fr; gap: .5rem; padding: .7rem 0; border-top: 1px solid var(--line); font-size: 1.125rem; }
ol.steps li::before { content: counter(step); font-stretch: 62%; font-weight: 900; font-size: 2.25rem; line-height: .9; color: var(--tomato); }

.facts-mini { border: 2px solid var(--ink); background: var(--paper); padding: .6rem .8rem; margin: 1rem 0; }
.facts-mini dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; margin: 0; }
.facts-mini dt { font-weight: 800; }
.facts-mini dd { margin: 0; }

.checklist { list-style: none; margin: .5rem 0; padding: 0; }
.checklist li { border-top: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 1px solid var(--line); }
.checklist label { display: flex; align-items: center; gap: .85rem; min-height: 52px; margin: 0; padding: .45rem 0; font-weight: 500; font-size: 1.0625rem; cursor: pointer; }
.checklist input:checked + span { text-decoration: line-through; color: var(--ink-3); }

/* Grocery aisles: a colour chip before each heading. */
h2.aisle { display: flex; align-items: center; gap: .55rem; }
h2.aisle::before { content: ""; flex: none; width: .9rem; height: .9rem; border-radius: 4px; background: var(--aisle, var(--herb)); }
.aisle-protein { --aisle: var(--tomato); }
.aisle-carbs { --aisle: var(--yolk); }
.aisle-veggies { --aisle: var(--avocado); }
.aisle-sauces { --aisle: var(--berry); }
.aisle-extras { --aisle: var(--sky); }
.checklist input[type="checkbox"].check:checked { background: var(--herb); border-color: var(--herb); }
.checklist input[type="checkbox"].check:checked::after { border-color: #fff; }

.plain { padding-left: 1.2rem; }
.plain li { margin: .35rem 0; }

.links { list-style: none; padding: 0; margin: 1rem 0; }
.links li { border-top: 1px solid var(--line); }
.links li:last-child { border-bottom: 1px solid var(--line); }
.links a { display: flex; flex-direction: column; padding: .85rem 0; text-decoration: none; }
.links a b { font-size: 1.1875rem; font-weight: 800; }
.links a span { color: var(--ink-2); font-size: .9375rem; }

.week-grid td.cell-day { font-weight: 700; white-space: nowrap; }

/* ------------------------------------------------------------ progress */

.advice { border-left: 6px solid var(--sky); background: var(--sky-soft); padding: .8rem 1rem; margin: 1rem 0; border-radius: 4px 10px 10px 4px; }
.advice.cut, .advice.eat-to-plan { border-left-color: var(--tomato); background: var(--tomato-soft); }
.advice.add { border-left-color: var(--yolk); background: var(--yolk-soft); }
.advice.on-track { border-left-color: var(--herb); background: var(--herb-soft); }
.stat-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
.stat { flex: 1 1 8rem; background: var(--paper); border-radius: 10px; padding: .6rem .8rem; border-top: 4px solid var(--herb); }
.stat b { display: block; font-size: 1.5rem; font-weight: 850; font-stretch: 87.5%; }
.stat span { font-size: .875rem; color: var(--ink-2); }
.tbl td.off { color: var(--ink-3); }
.advice h3 { margin: 0 0 .25rem; }
.advice p { margin: .25rem 0; }

.chart-wrap { position: relative; margin: .5rem 0 1rem; }
.chart-wrap > svg { display: block; width: 100%; overflow: visible; touch-action: pan-y; }
.chart-wrap > svg:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .875rem; color: var(--ink-2); margin: .5rem 0 .25rem; }
.legend span { display: inline-flex; align-items: center; gap: .45rem; }
.legend svg { flex: none; }
.chart-tip {
  position: absolute;
  top: 0;
  pointer-events: none;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: .35rem .55rem;
  font-size: .875rem;
  line-height: 1.35;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chart-tip b { font-size: 1rem; }
.chart-tip .k { display: inline-block; width: 14px; vertical-align: middle; margin-right: .35rem; }

.c-grid { stroke: var(--line); stroke-width: 1; }
.c-tick { fill: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.c-avg { stroke: var(--herb); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.c-dot { fill: var(--dot); stroke: var(--page); stroke-width: 2; }
.c-end { fill: var(--ink); font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; }
.c-cross { stroke: var(--ink-3); stroke-width: 1; }
.c-focus { fill: var(--dot); stroke: var(--ink); stroke-width: 2; }
.c-hit { fill: transparent; }

.log-actions { white-space: nowrap; }
.nowrap { white-space: nowrap; }
.log-actions .btn { margin-left: .25rem; }

/* ------------------------------------------------------------ editor */

.section-list a { display: grid; grid-template-columns: 1fr auto; gap: 0 1rem; }
.section-list a span { grid-column: 1 / -1; }

.row-card { border: 1px solid var(--ink-3); border-radius: 8px; background: var(--paper); padding: .25rem .9rem .9rem; margin: .9rem 0; }
.photo-field { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.photo-field img { width: 7rem; height: 5rem; object-fit: cover; border-radius: 8px; background: var(--line); }
.weekday-picks { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.row-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; justify-content: space-between; padding-top: .6rem; }
.row-head b { font-weight: 800; margin-right: auto; overflow-wrap: anywhere; }
.row-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; }
.row-fields .wide { grid-column: 1 / -1; }
@media (max-width: 420px) { .row-fields { grid-template-columns: 1fr; } }

.sched-day { display: grid; grid-template-columns: 6.5rem 1fr; gap: .5rem; align-items: start; padding: .6rem 0; border-top: 1px solid var(--line); }
.sched-day > b { padding-top: .55rem; }
.sched-day .sched-fields { display: grid; gap: .4rem; }
@media (min-width: 560px) { .sched-day .sched-fields { grid-template-columns: 9rem 1fr 1fr; } }

.save-bar {
  position: sticky;
  bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  background: var(--page);
  border-top: 2px solid var(--ink);
  padding: .6rem 0;
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  z-index: 5;
}
@media (min-width: 960px) { .save-bar { bottom: 0; } }

.signin { max-width: 24rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .top, .tabs, .rail, .btns, .controls, .toast, .no-print, .save-bar { display: none !important; }
  body { background: #fff; color: #000; display: block; }
  main { padding: 0; max-width: none; }
  .checklist label { min-height: 0; padding: .15rem 0; }
  input[type="checkbox"].check { width: 1rem; height: 1rem; }
  h1 { font-size: 2.5rem; }
}
